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, Union |
| #2 | |
| #3 | import httpx |
| #4 | |
| #5 | from embedchain.helpers.json_serializable import register_deserializable |
| #6 | |
| #7 | |
| #8 | @register_deserializable |
| #9 | class BaseEmbedderConfig: |
| #10 | def __init__( |
| #11 | self, |
| #12 | model: Optional[str] = None, |
| #13 | deployment_name: Optional[str] = None, |
| #14 | vector_dimension: Optional[int] = None, |
| #15 | endpoint: Optional[str] = None, |
| #16 | api_key: Optional[str] = None, |
| #17 | api_base: Optional[str] = None, |
| #18 | model_kwargs: Optional[Dict[str, Any]] = None, |
| #19 | http_client_proxies: Optional[Union[Dict, str]] = None, |
| #20 | http_async_client_proxies: Optional[Union[Dict, str]] = None, |
| #21 | ): |
| #22 | """ |
| #23 | Initialize a new instance of an embedder config class. |
| #24 | |
| #25 | :param model: model name of the llm embedding model (not applicable to all providers), defaults to None |
| #26 | :type model: Optional[str], optional |
| #27 | :param deployment_name: deployment name for llm embedding model, defaults to None |
| #28 | :type deployment_name: Optional[str], optional |
| #29 | :param vector_dimension: vector dimension of the embedding model, defaults to None |
| #30 | :type vector_dimension: Optional[int], optional |
| #31 | :param endpoint: endpoint for the embedding model, defaults to None |
| #32 | :type endpoint: Optional[str], optional |
| #33 | :param api_key: hugginface api key, defaults to None |
| #34 | :type api_key: Optional[str], optional |
| #35 | :param api_base: huggingface api base, defaults to None |
| #36 | :type api_base: Optional[str], optional |
| #37 | :param model_kwargs: key-value arguments for the embedding model, defaults a dict inside init. |
| #38 | :type model_kwargs: Optional[Dict[str, Any]], defaults a dict inside init. |
| #39 | :param http_client_proxies: The proxy server settings used to create self.http_client, defaults to None |
| #40 | :type http_client_proxies: Optional[Dict | str], optional |
| #41 | :param http_async_client_proxies: The proxy server settings for async calls used to create |
| #42 | self.http_async_client, defaults to None |
| #43 | :type http_async_client_proxies: Optional[Dict | str], optional |
| #44 | """ |
| #45 | self.model = model |
| #46 | self.deployment_name = deployment_name |
| #47 | self.vector_dimension = vector_dimension |
| #48 | self.endpoint = endpoint |
| #49 | self.api_key = api_key |
| #50 | self.api_base = api_base |
| #51 | self.model_kwargs = model_kwargs or {} |
| #52 | self.http_client = httpx.Client(proxies=http_client_proxies) if http_client_proxies else None |
| #53 | self.http_async_client = ( |
| #54 | httpx.AsyncClient(proxies=http_async_client_proxies) if http_async_client_proxies else None |
| #55 | ) |
| #56 |