gen_ai_hub.proxy.langchain.init_models
index
/home/jenkins/agent/workspace/ation_generative-ai-hub-sdk_main/gen_ai_hub/proxy/langchain/init_models.py

 
Classes
       
builtins.object
Catalog
RegisterDeployment
RetrievalResult
enum.Enum(builtins.object)
ModelType

 
class Catalog(builtins.object)
     Methods defined here:
__init__(self)
Initialize self.  See help(type(self)) for accurate signature.
all_embedding_models(self, proxy_client: 'Optional[Union[str, BaseProxyClient]]' = None) -> 'Dict[str, Embeddings]'
all_llms(self, proxy_client: 'Optional[Union[str, BaseProxyClient]]' = None) -> 'Dict[str, BaseLanguageModel]'
register(self, proxy_client, base_class, *model_names, f_select_deployment: 'Optional[Callable]' = None)
retrieve(self, proxy_client: 'Optional[BaseProxyClient]' = None, args: 'List[str]' = None, kwargs: 'Dict[str, str]' = None, model_type: 'Union[str, ModelType]' = None) -> 'RetrievalResult'

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class ModelType(enum.Enum)
    ModelType(value, names=None, *, module=None, qualname=None, type=None, start=1)
 
An enumeration.
 
 
Method resolution order:
ModelType
enum.Enum
builtins.object

Data and other attributes defined here:
EMBEDDINGS = <ModelType.EMBEDDINGS: 2>
LLM = <ModelType.LLM: 1>

Data descriptors inherited from enum.Enum:
name
The name of the Enum member.
value
The value of the Enum member.

Readonly properties inherited from enum.EnumMeta:
__members__
Returns a mapping of member name->value.
 
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.

 
class RegisterDeployment(builtins.object)
    RegisterDeployment(model: 'Union[BaseLanguageModel, Embeddings]', init_func: 'Callable', f_select_deployment: 'Optional[Callable[[BaseProxyClient, Dict[str, str]], BaseDeployment]]' = None) -&gt; None
 
RegisterDeployment(model: 'Union[BaseLanguageModel, Embeddings]', init_func: 'Callable', f_select_deployment: 'Optional[Callable[[BaseProxyClient, Dict[str, str]], BaseDeployment]]' = None)
 
  Methods defined here:
__eq__(self, other)
Return self==value.
__init__(self, model: 'Union[BaseLanguageModel, Embeddings]', init_func: 'Callable', f_select_deployment: 'Optional[Callable[[BaseProxyClient, Dict[str, str]], BaseDeployment]]' = None) -> None
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
__annotations__ = {'f_select_deployment': 'Optional[Callable[[BaseProxyClient, Dict[str, str]], BaseDeployment]]', 'init_func': 'Callable', 'model': 'Union[BaseLanguageModel, Embeddings]'}
__dataclass_fields__ = {'f_select_deployment': Field(name='f_select_deployment',type='Optional[...appingproxy({}),kw_only=False,_field_type=_FIELD), 'init_func': Field(name='init_func',type='Callable',default=<...appingproxy({}),kw_only=False,_field_type=_FIELD), 'model': Field(name='model',type='Union[BaseLanguageModel...appingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)
__hash__ = None
__match_args__ = ('model', 'init_func', 'f_select_deployment')
f_select_deployment = None

 
class RetrievalResult(builtins.object)
    RetrievalResult(proxy_client: 'BaseProxyClient', deployment: 'BaseDeployment', registry_entry: 'RegisterDeployment') -&gt; None
 
RetrievalResult(proxy_client: 'BaseProxyClient', deployment: 'BaseDeployment', registry_entry: 'RegisterDeployment')
 
  Methods defined here:
__eq__(self, other)
Return self==value.
__init__(self, proxy_client: 'BaseProxyClient', deployment: 'BaseDeployment', registry_entry: 'RegisterDeployment') -> None
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
__annotations__ = {'deployment': 'BaseDeployment', 'proxy_client': 'BaseProxyClient', 'registry_entry': 'RegisterDeployment'}
__dataclass_fields__ = {'deployment': Field(name='deployment',type='BaseDeployment',de...appingproxy({}),kw_only=False,_field_type=_FIELD), 'proxy_client': Field(name='proxy_client',type='BaseProxyClient'...appingproxy({}),kw_only=False,_field_type=_FIELD), 'registry_entry': Field(name='registry_entry',type='RegisterDeploy...appingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)
__hash__ = None
__match_args__ = ('proxy_client', 'deployment', 'registry_entry')

 
Functions
       
default_f_select_deployment(proxy_client: 'BaseProxyClient', **model_identification_kwargs: 'Dict[str, str]') -> 'BaseDeployment'
get_model_class(*args, model_type: 'Union[str, ModelType]' = None, proxy_client: 'Optional[BaseProxyClient]' = None, **kwargs) -> 'Union[BaseLanguageModel, Embeddings]'
Retrieves the model class for the specified model.
 
:param model_type: The type of the model to retrieve (optional)
:type model_type: Union[str, ModelType]
:param proxy_client: The proxy client to use for the model (optional)
:type proxy_client: BaseProxyClient
:return: The model class
:rtype: Union[BaseLanguageModel, Embeddings]
init_embedding_model(*args, proxy_client: 'Optional[BaseProxyClient]' = None, **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
: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, **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
:return: The initialized language model
:rtype: BaseLanguageModel

 
Data
        Any = typing.Any
Callable = typing.Callable
Dict = typing.Dict
List = typing.List
Optional = typing.Optional
Union = typing.Union
annotations = _Feature((3, 7, 0, 'beta', 1), (3, 11, 0, 'alpha', 0), 16777216)
catalog = <gen_ai_hub.proxy.langchain.init_models.Catalog object>
proxy_clients = <gen_ai_hub.proxy.core.proxy_clients.ProxyClients object>