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 |
| #2 | |
| #3 | from pydantic import BaseModel, ConfigDict, Field, model_validator |
| #4 | |
| #5 | |
| #6 | class LangchainConfig(BaseModel): |
| #7 | try: |
| #8 | from langchain_community.vectorstores import VectorStore |
| #9 | except ImportError: |
| #10 | raise ImportError( |
| #11 | "The 'langchain_community' library is required. Please install it using 'pip install langchain_community'." |
| #12 | ) |
| #13 | VectorStore: ClassVar[type] = VectorStore |
| #14 | |
| #15 | client: VectorStore = Field(description="Existing VectorStore instance") |
| #16 | collection_name: str = Field("mem0", description="Name of the collection to use") |
| #17 | |
| #18 | @model_validator(mode="before") |
| #19 | @classmethod |
| #20 | def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]: |
| #21 | allowed_fields = set(cls.model_fields.keys()) |
| #22 | input_fields = set(values.keys()) |
| #23 | extra_fields = input_fields - allowed_fields |
| #24 | if extra_fields: |
| #25 | raise ValueError( |
| #26 | f"Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)}" |
| #27 | ) |
| #28 | return values |
| #29 | |
| #30 | model_config = ConfigDict(arbitrary_types_allowed=True) |
| #31 |