repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | from typing import Any, Dict |
| #2 | |
| #3 | from pydantic import BaseModel, ConfigDict, Field, model_validator |
| #4 | |
| #5 | |
| #6 | # TODO: Upgrade to latest pydantic version |
| #7 | class RedisDBConfig(BaseModel): |
| #8 | redis_url: str = Field(..., description="Redis URL") |
| #9 | collection_name: str = Field("mem0", description="Collection name") |
| #10 | embedding_model_dims: int = Field(1536, description="Embedding model dimensions") |
| #11 | |
| #12 | @model_validator(mode="before") |
| #13 | @classmethod |
| #14 | def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]: |
| #15 | allowed_fields = set(cls.model_fields.keys()) |
| #16 | input_fields = set(values.keys()) |
| #17 | extra_fields = input_fields - allowed_fields |
| #18 | if extra_fields: |
| #19 | raise ValueError( |
| #20 | f"Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)}" |
| #21 | ) |
| #22 | return values |
| #23 | |
| #24 | model_config = ConfigDict(arbitrary_types_allowed=True) |
| #25 |