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 | class BaiduDBConfig(BaseModel): |
| #7 | endpoint: str = Field("http://localhost:8287", description="Endpoint URL for Baidu VectorDB") |
| #8 | account: str = Field("root", description="Account for Baidu VectorDB") |
| #9 | api_key: str = Field(None, description="API Key for Baidu VectorDB") |
| #10 | database_name: str = Field("mem0", description="Name of the database") |
| #11 | table_name: str = Field("mem0", description="Name of the table") |
| #12 | embedding_model_dims: int = Field(1536, description="Dimensions of the embedding model") |
| #13 | metric_type: str = Field("L2", description="Metric type for similarity search") |
| #14 | |
| #15 | @model_validator(mode="before") |
| #16 | @classmethod |
| #17 | def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]: |
| #18 | allowed_fields = set(cls.model_fields.keys()) |
| #19 | input_fields = set(values.keys()) |
| #20 | extra_fields = input_fields - allowed_fields |
| #21 | if extra_fields: |
| #22 | raise ValueError( |
| #23 | f"Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)}" |
| #24 | ) |
| #25 | return values |
| #26 | |
| #27 | model_config = ConfigDict(arbitrary_types_allowed=True) |
| #28 |