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 Optional |
| #2 | |
| #3 | from embedchain.config.vector_db.base import BaseVectorDbConfig |
| #4 | from embedchain.helpers.json_serializable import register_deserializable |
| #5 | |
| #6 | |
| #7 | @register_deserializable |
| #8 | class OpenSearchDBConfig(BaseVectorDbConfig): |
| #9 | def __init__( |
| #10 | self, |
| #11 | opensearch_url: str, |
| #12 | http_auth: tuple[str, str], |
| #13 | vector_dimension: int = 1536, |
| #14 | collection_name: Optional[str] = None, |
| #15 | dir: Optional[str] = None, |
| #16 | batch_size: Optional[int] = 100, |
| #17 | **extra_params: dict[str, any], |
| #18 | ): |
| #19 | """ |
| #20 | Initializes a configuration class instance for an OpenSearch client. |
| #21 | |
| #22 | :param collection_name: Default name for the collection, defaults to None |
| #23 | :type collection_name: Optional[str], optional |
| #24 | :param opensearch_url: URL of the OpenSearch domain |
| #25 | :type opensearch_url: str, Eg, "http://localhost:9200" |
| #26 | :param http_auth: Tuple of username and password |
| #27 | :type http_auth: tuple[str, str], Eg, ("username", "password") |
| #28 | :param vector_dimension: Dimension of the vector, defaults to 1536 (openai embedding model) |
| #29 | :type vector_dimension: int, optional |
| #30 | :param dir: Path to the database directory, where the database is stored, defaults to None |
| #31 | :type dir: Optional[str], optional |
| #32 | :param batch_size: Number of items to insert in one batch, defaults to 100 |
| #33 | :type batch_size: Optional[int], optional |
| #34 | """ |
| #35 | self.opensearch_url = opensearch_url |
| #36 | self.http_auth = http_auth |
| #37 | self.vector_dimension = vector_dimension |
| #38 | self.extra_params = extra_params |
| #39 | self.batch_size = batch_size |
| #40 | |
| #41 | super().__init__(collection_name=collection_name, dir=dir) |
| #42 |