Skip to main content

models.go (package eai)

Source: sdks/go/models.go. Back to the Go 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.

Model Money​

Money is a decimal string amount with an ISO 4217 currency.

Fields:

NameTypeRequiredDescription
Amount (amount)stringyesExact decimal amount serialized as a string, for example 12.50.
Currency (currency)stringyesISO 4217 currency code, for example EUR.

Model UsagePricing​

UsagePricing is the price applicable at call time.

Fields:

NameTypeRequiredDescription
PriceCardID (price_card_id)*stringnoPrice card used, omitted when nil.
PricingVersion (pricing_version)stringyesVersion of the pricing used.
Currency (currency)stringyesISO 4217 currency code, for example EUR.
EffectiveAt (effective_at)time.TimeyesTime from which the price applies.
ReasoningBilling (reasoning_billing)stringnoHow reasoning tokens are billed: included_in_output (default), separate, not_billed or not_exposed.
AllocationPolicyID (allocation_policy_id)*stringnoCost allocation policy applied, omitted when nil.

Model UsageCost​

UsageCost holds estimated, measured and billed costs (each may be null).

Fields:

NameTypeRequiredDescription
Estimated (estimated)*MoneynoMoney is a decimal string amount with an ISO 4217 currency.
Measured (measured)*MoneynoMoney is a decimal string amount with an ISO 4217 currency.
Billed (billed)*MoneynoMoney is a decimal string amount with an ISO 4217 currency.

Model UsageEvent​

UsageEvent is the Usage Event v1 contract (contracts/v1/usage-event.schema.json).

Fields:

NameTypeRequiredDescription
SchemaVersion (schema_version)stringyesContract version 1.<minor>; minor bumps stay backward compatible.
EventID (event_id)stringyesIdentifier of the event, used to deduplicate it (event_id).
OccurredAt (occurred_at)time.TimeyesTime the usage happened.
TenantID (tenant_id)stringyesTenant of the agent. Default default.
ProjectID (project_id)*stringnoIdentifier of the project, the workspace of a tenant that owns agents, knowledge bases, quotas and secrets.
Environment (environment)*stringnoEnvironment of the consumption, omitted when nil.
AgentID (agent_id)*stringnoAgent that consumed, nil when none.
SessionID (session_id)*stringnoSession of the consumption, nil when none.
RunID (run_id)*stringnoRun that consumed, omitted when nil.
TaskID (task_id)*stringnoTask of the consumption, nil when none.
RequestID (request_id)*stringnoPlatform request identifier, omitted when nil.
ProviderRequestID (provider_request_id)*stringnoRequest identifier given by the provider, omitted when nil.
TraceID (trace_id)*stringnoW3C trace id, 32 lowercase hexadecimal characters, to correlate the event with a trace.
UsageType (usage_type)stringyesKind of consumption, for example llm, reasoning, embeddings, tool or gpu_local.
Provider (provider)stringyesProvider that served the call, never empty.
ModelID (model_id)stringyesModel of the call, matched against the model patterns of the price cards.
DeploymentID (deployment_id)*stringnoModel deployment running on the GPU during the sample.
Region (region)stringyesProcessing region, for example eu-west-1 or on-prem-paris.
Units (units)map[string]float64yesConsumed units by name, for example input_tokens, output_tokens, images; at least one.
Pricing (pricing)UsagePricingyesUsagePricing is the price applicable at call time.
Cost (cost)UsageCostyesUsageCost holds estimated, measured and billed costs (each may be null).
Status (status)stringnoCost status: estimated, measured or reconciled.
Source (source)stringyesComponent that emitted the event: gateway, litellm, adapter, runtime, tool_gateway, connector_hub, sandbox, gpu_exporter or import.
Labels (labels)map[string]stringnoLabels of the host as a map of strings, replacing the current ones, for example {"zone": "a"}.

Model AuditEvent​

AuditEvent is the Audit Event v1 contract (contracts/v1/audit-event.schema.json).

Fields:

NameTypeRequiredDescription
SchemaVersion (schema_version)stringyesContract version 1.<minor>; minor bumps stay backward compatible.
EventID (event_id)stringyesIdentifier of the audit event (event_id).
Sequence (sequence)int64yesOrdered steps of the failover, as free objects.
OccurredAt (occurred_at)time.TimeyesTime the audited action happened.
TenantID (tenant_id)stringyesTenant of the agent. Default default.
Actor (actor)json.RawMessageyesRaw JSON of the actor: kind (user, service, agent, system) and id.
Action (action)stringyesAudited action as domain.verb, for example model.invoke or agent.suspend.
Resource (resource)json.RawMessageyesRaw JSON of the resource acted on: type, id and optional name.
Decision (decision)json.RawMessagenoapprove or reject.
Outcome (outcome)stringyesResult of the action: success, failure or error.
Evidence (evidence)json.RawMessagenoEvidence of the measures (logs, timestamps, screenshots references...).
Classification (classification)stringnoData classification: public, internal, confidential, restricted or secret.
PrevHash (prev_hash)stringyesSHA-256 hash (64 hex characters) of the previous event of the chain.
Hash (hash)stringyesDigest of the source content, for example sha256:....

Model ExecutionContract​

ExecutionContract is the Execution Contract v1 of a run (contracts/v1/execution-contract.schema.json).

Fields:

NameTypeRequiredDescription
SchemaVersion (schema_version)stringyesContract version 1.<minor>; minor bumps stay backward compatible.
RunID (run_id)stringyesIdentifier of the run (run_id).
TenantID (tenant_id)stringyesTenant of the agent. Default default.
ProjectID (project_id)*stringnoIdentifier of the project, the workspace of a tenant that owns agents, knowledge bases, quotas and secrets.
SessionID (session_id)*stringnoSession of the run, nil when absent.
ParentRunID (parent_run_id)*stringnoRun that started this one as a sub-agent, nil for a root run.
Depth (depth)*intnoDepth of the run in the sub-agent tree, 0 or more; nil when absent.
Agent (agent)json.RawMessageyesRaw JSON of the agent: name and semantic version.
Task (task)json.RawMessagenoRaw JSON of the task: task_id, objective and input.
State (state)stringyesState of the run: pending, running, waiting_approval, waiting_input, suspended, succeeded, failed, cancelled or timed_out.
Steps (steps)[]json.RawMessageyesRaw JSON of the steps, each with step_id, kind and state.
Budgets (budgets)json.RawMessageyesRaw JSON of the budgets: limits and what was consumed.
Errors (errors)[]json.RawMessagenoRaw JSON of the errors met by the run.
RetryPolicy (retry_policy)json.RawMessagenoRetry policy: max_attempts (1 or more, default 3) and backoff_seconds (0 or more, default 2).
Resume (resume)json.RawMessagenoRaw JSON of the resume settings: checkpoint_id and strategy.
Trace (trace)json.RawMessagenoRaw JSON of the trace context: trace_id, span_id, parent_span_id.
CreatedAt (created_at)*time.TimenoCreation time of the run, nil when absent.
UpdatedAt (updated_at)*time.TimenoLast update time of the run, nil when absent.

Model PolicyDecision​

PolicyDecision is the decision part of the Policy Contract v1.

Fields:

NameTypeRequiredDescription
Allow (allow)boolyestrue when the policy allows the request.
DecisionID (decision_id)stringyesIdentifier of the decision, to find it in the audit trail.
PolicyID (policy_id)stringnoPolicy the candidate replaces; null to add it to the active set.
PolicyVersion (policy_version)stringnoVersion of the policy that decided.
Engine (engine)stringnoAuto (default), HPA or KEDA.
Reasons (reasons)[]stringyesReasons given for the decision.
Obligations (obligations)[]json.RawMessagenoObligations added to the decision when this allow rule applies.
EvaluatedAt (evaluated_at)*time.TimenoEvaluation time, nil when absent.

Model PolicyContract​

PolicyContract is the Policy Contract v1 (request plus optional decision).

Fields:

NameTypeRequiredDescription
SchemaVersion (schema_version)stringyesContract version 1.<minor>; minor bumps stay backward compatible.
Request (request)json.RawMessageyesRaw JSON of the request: subject, resource, action and context.
Decision (decision)*PolicyDecisionnoapprove or reject.

Model Metadata​

Metadata is the manifest metadata (common.schema.json#/$defs/metadata).

Fields:

NameTypeRequiredDescription
Name (name)stringyesStable DNS-like name of the asset.
Tenant (tenant)stringnoTenant slug.
Project (project)stringnoIdentifier of the project the results are restricted to.
Environment (environment)stringnoTarget environment: dev, test, staging or prod.
Version (version)stringyesSemantic version of the asset.
Owner (owner)stringyesAccountable owner, team id or e-mail.
Description (description)stringnoFree description, up to 4000 characters.
Labels (labels)map[string]stringnoLabels of the host as a map of strings, replacing the current ones, for example {"zone": "a"}.
Annotations (annotations)map[string]stringnoAnnotations of the alert; summary and description feed the incident.

Model Manifest​

Manifest is any v1 manifest (Agent, Model, Tool, Skill, Plugin, Connector, Channel).

Fields:

NameTypeRequiredDescription
APIVersion (apiVersion)stringyesAPI version of the manifest, enterprise-ai.io/v1 (the APIVersion constant).
Kind (kind)stringyesKind of the manifest (Agent, Model, Tool...); ContractForKind gives its contract.
Metadata (metadata)MetadatayesFree key-value pairs stored with the object and returned as they are; the platform never interprets them.
Spec (spec)json.RawMessageyesSpecification: sites (value per site) and health_check with its url, both required.

Type alias ModelManifest​

ModelManifest is a Model Manifest v1.

Definition: = Manifest.

Type alias ToolManifest​

ToolManifest is a Tool Manifest v1.

Definition: = Manifest.

Model ChatMessage​

ChatMessage is an OpenAI compatible message.

Fields:

NameTypeRequiredDescription
Role (role)stringyesRole of the author, for example system, user or assistant.
Content (content)anyyesContent of the message: a string or OpenAI compatible content parts.
Name (name)stringnoOptional name of the author of the message.

Model EaiExtension​

EaiExtension is the eai body field of gateway calls.

Fields:

NameTypeRequiredDescription
Effort (effort)EffortnoEffort is the normalized reasoning effort (common.schema.json#/$defs/effort), translated per model by the Capability Resolver.
AgentID (agent_id)stringnoAgent making the call (agent_id).
SessionID (session_id)stringnoSession the call belongs to (session_id).
RunID (run_id)stringnoRun the call belongs to (run_id).
TaskID (task_id)stringnoTask the call belongs to (task_id).
DataClassification (data_classification)stringnoClassification of the data sent (data_classification), for example confidential.
Purpose (purpose)stringnoUse of the target. Default backup.
RegionAllow (region_allow)[]stringnoProcessing regions the call may use (region_allow).
FallbackPolicy (fallback_policy)stringnoFallback policy the gateway applies when the model is unavailable (fallback_policy).

Model ChatRequest​

ChatRequest is the body of POST /v1/gateway/chat/completions.

Fields:

NameTypeRequiredDescription
Model (model)stringyesModel alias of the gateway that answers the request.
Messages (messages)[]ChatMessageyesConversation sent to the model, in order.
Temperature (temperature)*float64noSampling temperature, omitted when nil.
MaxTokens (max_tokens)*intnoMaximum output tokens; when set, it is the output assumed for the worst case.
Tools (tools)[]map[string]anynoTools its external agents may invoke (names or patterns such as crm.*).
Stream (stream)boolnoStream the answer as Server-Sent Events; ChatCompletions forces it to false, ChatCompletionsStream to true.
Eai (eai)*EaiExtensionnoEaiExtension is the eai body field of gateway calls.

Model ChatResponse​

ChatResponse is a chat completion with the gateway headers.

Fields:

NameTypeRequiredDescription
Rawjson.RawMessageyesRaw JSON body of the answer.
ModelstringyesModel that produced the answer.
ContentstringyesText of choices[0].message.content.
FinishReasonstringyesfinish_reason of the first choice.
Usagemap[string]anyyesUsage counters added to the budget consumption, for example input_tokens, output_tokens.
DecisionIDstringyesPolicy decision identifier, from the X-EAI-Decision-Id response header.
CostEstimatedstringyesValue of the X-EAI-Cost-Estimated response header.
CostMeasuredstringyesValue of the X-EAI-Cost-Measured response header.

Model ChatChunk​

ChatChunk is one streamed chunk.

Fields:

NameTypeRequiredDescription
Rawjson.RawMessageyesRaw JSON data of the Server-Sent Event.
DeltastringyesText of choices[0].delta.content in this chunk.
FinishReasonstringyesfinish_reason of the first choice, empty until the last chunk.
Usagemap[string]anyyesUsage counters added to the budget consumption, for example input_tokens, output_tokens.