| | |
- default_f_select_deployment(proxy_client: 'BaseProxyClient', **model_identification_kwargs: 'Dict[str, str]') -> 'BaseDeployment'
- Default function to select a deployment based on model identification kwargs.
:param proxy_client: The proxy client to use for selecting the deployment
:type proxy_client: BaseProxyClient
:return: The selected deployment
:rtype: BaseDeployment
- handle_model_args_kwargs(proxy_client, args: 'List[Any]', kwargs: 'Dict[str, Any]')
- Handles model identification arguments and keyword arguments.
:param proxy_client: the proxy client to use for model identification
:type proxy_client: _type_
:param args: list of positional arguments
:type args: List[Any]
:param kwargs: dictionary of keyword arguments
:type kwargs: Dict[str, Any]
:raises ValueError: if no model identification argument is provided
:return: A tuple containing the model name, model identification kwargs, and remaining kwargs
:rtype: Tuple[str, Dict[str, str], Dict[str, Any]]
- init_embedding_model(*args, proxy_client: 'Optional[BaseProxyClient]' = None, init_func: 'Optional[Callable]' = None, model_id: 'Optional[str]' = '', **kwargs) -> 'Embeddings'
- Initializes an embedding model using the specified parameters.
:param proxy_client: The proxy client to use for the model (optional)
:type proxy_client: BaseProxyClient
:param init_func: Function to call for initializing the model, optional
:type init_func: Callable
:param model_id: id of the Amazon Bedrock model, needed in case a custom Amazon Bedrock model is being
initiated (optional)
:type model_id: str
:return: The initialized embedding model
:rtype: Embeddings
- init_llm(*args, proxy_client: 'Optional[BaseProxyClient]' = None, temperature: 'float' = 0.0, max_tokens: 'int' = 256, top_k: 'Optional[int]' = None, top_p: 'float' = 1.0, init_func: 'Optional[Callable]' = None, model_id: 'Optional[str]' = '', **kwargs) -> 'BaseLanguageModel'
- Initializes a language model using the specified parameters.
:param proxy_client: The proxy client to use for the model (optional)
:type proxy_client: ProxyClient
:param temperature: The temperature parameter for model generation (default: 0.0)
:type temperature: float
:param max_tokens: The maximum number of tokens to generate (default: 256)
:type max_tokens: int
:param top_k: The top-k parameter for model generation (optional)
:type top_k: int
:param top_p: The top-p parameter for model generation (default: 1.0)
:type top_p: float
:param init_func: Function to call for initializing the model, optional
:type init_func: Callable
:param model_id: id of the Amazon Bedrock model, needed in case a custom Amazon Bedrock model is being
initiated (optional)
:type model_id: str
:return: The initialized language model
:rtype: BaseLanguageModel
|