root.models¶
Classes¶
Models (sub) API |
Module Contents¶
- class root.models.Models(client: Awaitable[root.generated.openapi_aclient.ApiClient] | root.generated.openapi_client.ApiClient)¶
Models (sub) API
Note
The construction of the API instance should be handled by accesing an attribute of a
root.client.RootSignals
instance.- Parameters:
client (Union[Awaitable[root.generated.openapi_aclient.ApiClient], root.generated.openapi_client.ApiClient])
- async acreate(*, name: str, model: str | None = None, default_key: str | None = None, max_output_token_count: int | None = None, max_token_count: int | None = None, url: str | None = None, _request_timeout: int | None = None) str ¶
Asynchronously create a new model and return its ID.
- Parameters:
name (str) – The unique identifier for the model instance (e.g. “google/gemma-2-9b”).
model (Optional[str]) – The base model name to be used. Defaults to name.
default_key (Optional[str]) – The default API key required for the model, if applicable.
max_output_token_count (Optional[int]) – The maximum number of tokens to output.
max_token_count (Optional[int]) – The maximum number of tokens to process.
url (Optional[str]) – Optional URL pointing to the model’s endpoint.
_request_timeout (Optional[int])
- Return type:
str
- async adelete(model_id: str, *, _request_timeout: int | None = None) None ¶
Asynchronously delete the model.
- Parameters:
model – The model to be deleted.
model_id (str)
_request_timeout (Optional[int])
- Return type:
None
- async alist(*, capable_of: List[str] | None = None, limit: int = 100) AsyncIterator[root.generated.openapi_aclient.models.model.Model] ¶
Asynchronously iterate through the models.
Note
The call will list only publicly available global models and those models available to the organzation(s) of the user.
- Parameters:
limit (int) – Number of entries to iterate through at most.
capable_of (Optional[List[str]]) – List of capabilities to filter the models by.
- Return type:
AsyncIterator[root.generated.openapi_aclient.models.model.Model]
- create(*, name: str, model: str | None = None, default_key: str | None = None, max_output_token_count: int | None = None, max_token_count: int | None = None, url: str | None = None, _request_timeout: int | None = None) str ¶
Create a new model and return its ID.
- Parameters:
name (str) – The unique identifier for the model instance (e.g. “google/gemma-2-9b”).
model (Optional[str]) – The base model name to be used. Defaults to name.
default_key (Optional[str]) – The default API key required for the model, if applicable.
max_output_token_count (Optional[int]) – The maximum number of tokens to output.
max_token_count (Optional[int]) – The maximum number of tokens to process.
url (Optional[str]) – Optional URL pointing to the model’s endpoint.
_request_timeout (Optional[int])
- Return type:
str
- delete(model_id: str, *, _request_timeout: int | None = None) None ¶
Delete the model.
- Parameters:
model – The model to be deleted.
model_id (str)
_request_timeout (Optional[int])
- Return type:
None
- list(*, capable_of: List[str] | None = None, limit: int = 100) Iterator[root.generated.openapi_client.models.model.Model] ¶
Iterate through the models.
Note
The call will list only publicly available global models and those models available to the organzation(s) of the user.
- Parameters:
limit (int) – Number of entries to iterate through at most.
capable_of (Optional[List[str]]) – List of capabilities to filter the models by.
- Return type:
- client¶