enterprise_ai.llm.facade
Source: sdks/python/src/enterprise_ai/llm/facade.py. Back to the Python SDK reference index.
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Class LlmClient
One entry point over /v1/gateway/chat/completions, /v1/gateway/embeddings and /v1/multimodal/vision; every call keeps the gateway checks (effort precheck, policy, DLP, quotas).
Resource
LlmClient.embed
embed(model: str, input: str | list[str], **params: Any) -> Any
Compute embeddings. OpenAI compatible embeddings through the same controls as chat (kill switches, allow lists, classification, DLP on each input, cost guardrails, policy decision, audit). The model must declare the embeddings capability and, when dimensions is given, support it (422 capability_not_supported, 422 embedding_dimensions_invalid). Requires a tenant principal with the scope models:invoke.
Route: /v1/gateway/embeddings (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
model | str | yes | Only cards whose model pattern matches this model id (case insensitive glob). | |
input | str | list[str] | yes | Text or list of texts to embed. | |
**params | Any | no | Extra fields merged into the request. |
Returns: Any. Decoded JSON answer of the operation "Compute embeddings".
Raises: the typed errors of the transport (Errors).
LlmClient.generate
generate(model: str, messages: list[dict[str, Any]], effort: str | None = None, **params: Any) -> Any
Call a chat model. OpenAI compatible chat completion through every control of the gateway; with stream: true the answer is Server-Sent Events, with the cost guardrails checked during the stream. Requires a tenant principal (403 platform_only) whose credential carries the scope models:invoke.
Route: /v1/gateway/chat/completions (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
model | str | yes | Only cards whose model pattern matches this model id (case insensitive glob). | |
messages | list[dict[str, Any]] | yes | Chat messages {role, content} sent to the model. | |
effort | str | None | None | no | Reasoning effort (none, low, medium, high, max), checked against the model before the call. |
**params | Any | no | Extra fields merged into the request. |
Returns: Any. Decoded JSON answer of the operation "Call a chat model".
Raises: the typed errors of the transport (Errors).
LlmClient.stream
stream(model: str, messages: list[dict[str, Any]], effort: str | None = None, **params: Any) -> Any
Call a chat model. OpenAI compatible chat completion through every control of the gateway; with stream: true the answer is Server-Sent Events, with the cost guardrails checked during the stream. Requires a tenant principal (403 platform_only) whose credential carries the scope models:invoke.
Route: /v1/gateway/chat/completions (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
model | str | yes | Only cards whose model pattern matches this model id (case insensitive glob). | |
messages | list[dict[str, Any]] | yes | Chat messages {role, content} sent to the model. | |
effort | str | None | None | no | Reasoning effort (none, low, medium, high, max), checked against the model before the call. |
**params | Any | no | Extra fields merged into the request. |
Returns: Any. Decoded JSON answer of the operation "Call a chat model".
Raises: the typed errors of the transport (Errors).
LlmClient.vision
vision(prompt: str, media_id: str | None = None, content_base64: str | None = None, mime_type: str | None = None, model: str | None = None, **extra: Any) -> Any
Understand an image. Starts a vision understanding job on an image media or inline image with a prompt (201, the job). The answer goes through the DLP with dlp_mode. detail answers 422 parameter_unsupported when the configured provider cannot honour it; a non image input answers 422 unsupported_media. Needs tenant_admin, developer or agent.
Route: /v1/multimodal/vision (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
prompt | str | yes | Question about the image. Default Describe this image. | |
media_id | str | None | None | no | Stored image media. |
content_base64 | str | None | None | no | Inline image, base64 encoded (scanned before use). |
mime_type | str | None | None | no | Media type of the inline image, for example image/jpeg. |
model | str | None | None | no | Model to use. Default: the configured adapter. |
**extra | Any | no | Extra fields merged into the request body. |
Returns: Any. Decoded JSON answer of the operation "Understand an image".
Raises: the typed errors of the transport (Errors).