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, ClassVar, Dict, Optional |
| #2 | |
| #3 | from pydantic import BaseModel, ConfigDict, Field, model_validator |
| #4 | |
| #5 | |
| #6 | class WeaviateConfig(BaseModel): |
| #7 | from weaviate import WeaviateClient |
| #8 | |
| #9 | WeaviateClient: ClassVar[type] = WeaviateClient |
| #10 | |
| #11 | collection_name: str = Field("mem0", description="Name of the collection") |
| #12 | embedding_model_dims: int = Field(1536, description="Dimensions of the embedding model") |
| #13 | cluster_url: Optional[str] = Field(None, description="URL for Weaviate server") |
| #14 | auth_client_secret: Optional[str] = Field(None, description="API key for Weaviate authentication") |
| #15 | additional_headers: Optional[Dict[str, str]] = Field(None, description="Additional headers for requests") |
| #16 | |
| #17 | @model_validator(mode="before") |
| #18 | @classmethod |
| #19 | def check_connection_params(cls, values: Dict[str, Any]) -> Dict[str, Any]: |
| #20 | cluster_url = values.get("cluster_url") |
| #21 | |
| #22 | if not cluster_url: |
| #23 | raise ValueError("'cluster_url' must be provided.") |
| #24 | |
| #25 | return values |
| #26 | |
| #27 | @model_validator(mode="before") |
| #28 | @classmethod |
| #29 | def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]: |
| #30 | allowed_fields = set(cls.model_fields.keys()) |
| #31 | input_fields = set(values.keys()) |
| #32 | extra_fields = input_fields - allowed_fields |
| #33 | |
| #34 | if extra_fields: |
| #35 | raise ValueError( |
| #36 | f"Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)}" |
| #37 | ) |
| #38 | |
| #39 | return values |
| #40 | |
| #41 | model_config = ConfigDict(arbitrary_types_allowed=True) |
| #42 |