Saltar al contenido principal

Referencia GraphQL: ai-inference

Generada a partir del esquema que sirve este servicio, así que no puede quedarse atrás. El mismo esquema se publica como archivo para herramientas y agentes.

Endpointhttps://<your-host>/api/ai-inference/graphql
Plano de autenticaciónservice — Called by another DeviceChain service, not by an application. Documented for completeness; there is no supported way for a tenant client to call it.
Autorizaciónservice token
Archivo del esquema/schema/ai-inference.graphql
Descritos12 de 12 elementos
NotaCalled by event-processing under its own service token when compiling a natural-language rule description. Not reachable with a tenant access token.
nota

La referencia que sigue se genera a partir del esquema y está solo en inglés.

Queries​

aiInferenceInfo

aiInferenceInfo​

Identifies the service answering. Requires no specific authority.

Returns ServiceInfo!

Mutations​

inferRuleCandidate

inferRuleCandidate​

Drafts a detection rule: sends the prompt to the model the calling tenant has been assigned for rule drafting, or else its tier's default model, and returns the output unvalidated. The tenant comes from the caller's token. The call fails if the tenant's tier offers no usable model or the provider has no API key (the error is only "inference is unavailable", whatever the cause), if the tenant has not opted in to external AI routing (a distinct error), if the tenant is over its inference rate limit (a distinct, retryable error), or if the prompt is blank or too large. The function cannot be chosen by the caller. Requires ai:infer.

Returns InferenceResult!

ArgumentTypeDescription
requestInferenceRequest!The prompt to send.

Objects​

InferenceResult · ServiceInfo

InferenceResult​

object

The model's answer to an inference request.

FieldTypeDescription
candidateString!The model's text output, returned as produced. It is a proposal only: nothing has validated it.
modelString!Identifier of the model that answered, as reported by the provider.
providerString!Token of the registered provider that served the call.

ServiceInfo​

object

Identity of the service answering the request.

FieldTypeDescription
areaString!The functional area this service serves; for this service, the AI inference area.

Input types​

InferenceRequest

InferenceRequest​

input

A prompt to send to the model. The output-token limit, the endpoint and the call timeout are fixed by the server and cannot be set by the caller.

Input fieldTypeDescription
promptString!The user prompt. Required, and must not be blank. The prompt and system prompt together may not exceed 128 KiB unless the operator configured a different limit.
systemStringOptional system prompt (instructions or persona) sent ahead of the prompt.