Skip to main content

enterprise_ai.llm.facade

Source: sdks/python/src/enterprise_ai/llm/facade.py. Back to the Python SDK reference index.

note

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).

NameTypeDefaultRequiredDescription
modelstryesOnly cards whose model pattern matches this model id (case insensitive glob).
inputstr | list[str]yesText or list of texts to embed.
**paramsAnynoExtra 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).

NameTypeDefaultRequiredDescription
modelstryesOnly cards whose model pattern matches this model id (case insensitive glob).
messageslist[dict[str, Any]]yesChat messages {role, content} sent to the model.
effortstr | NoneNonenoReasoning effort (none, low, medium, high, max), checked against the model before the call.
**paramsAnynoExtra 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).

NameTypeDefaultRequiredDescription
modelstryesOnly cards whose model pattern matches this model id (case insensitive glob).
messageslist[dict[str, Any]]yesChat messages {role, content} sent to the model.
effortstr | NoneNonenoReasoning effort (none, low, medium, high, max), checked against the model before the call.
**paramsAnynoExtra 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).

NameTypeDefaultRequiredDescription
promptstryesQuestion about the image. Default Describe this image.
media_idstr | NoneNonenoStored image media.
content_base64str | NoneNonenoInline image, base64 encoded (scanned before use).
mime_typestr | NoneNonenoMedia type of the inline image, for example image/jpeg.
modelstr | NoneNonenoModel to use. Default: the configured adapter.
**extraAnynoExtra 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).