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, Optional |
| #2 | |
| #3 | from pydantic import BaseModel, Field, model_validator |
| #4 | |
| #5 | |
| #6 | class MongoDBConfig(BaseModel): |
| #7 | """Configuration for MongoDB vector database.""" |
| #8 | |
| #9 | db_name: str = Field("mem0_db", description="Name of the MongoDB database") |
| #10 | collection_name: str = Field("mem0", description="Name of the MongoDB collection") |
| #11 | embedding_model_dims: Optional[int] = Field(1536, description="Dimensions of the embedding vectors") |
| #12 | mongo_uri: str = Field("mongodb://localhost:27017", description="MongoDB URI. Default is mongodb://localhost:27017") |
| #13 | |
| #14 | @model_validator(mode="before") |
| #15 | @classmethod |
| #16 | def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]: |
| #17 | allowed_fields = set(cls.model_fields.keys()) |
| #18 | input_fields = set(values.keys()) |
| #19 | extra_fields = input_fields - allowed_fields |
| #20 | if extra_fields: |
| #21 | raise ValueError( |
| #22 | f"Extra fields not allowed: {', '.join(extra_fields)}. " |
| #23 | f"Please provide only the following fields: {', '.join(allowed_fields)}." |
| #24 | ) |
| #25 | return values |
| #26 |