Ai platforms
This event will be published when conversations have been received from the LLM provider.
Payload
object- id stringRequired
Identifies the event.
- time string
Timestamp of when the occurrence happened. Must adhere to RFC 3339.
- type stringRequired
Unique identifier for the event type.
- source stringRequired
Identifies the context in which an event happened.
- specversion stringRequired
The version of the CloudEvents specification which the event uses.
- datacontenttype string
Content type of the data value. Must adhere to RFC 2046 format.
- host string
Unique identifier for the host related to the event.
- reason string
Reason associated with the occurrence, when applicable.
- userid string
Unique identifier for the user related to the event.
- ownerid string
Unique identifier for the owner related to the event.
- spaceid string
Unique identifier for the space related to the event.
- authtype string
Representing the type of principal that triggered the occurrence.
- clientid string
Unique identifier for the client related to the event.
- tenantid stringRequired
Unique identifier for the tenant related to the event.
- sessionid string
Unique identifier for the session related to the event.
- authclaims string
A JSON string representing the impersonating entity (the JWT "act" claim), if any.
- tracestate string
A comma-delimited list of key-value pairs.
- traceparent string
Contains a version, trace ID, span ID, and trace options.
- toplevelresourceid string
If the event originated from a sub resource the toplevelresourceid MUST contain the id of the top level resource associated with the sub resource. If the event originated from a top level resource it MUST NOT be defined.
- data object
Conversations finished event specific data.
data properties
- id stringRequired
A unique identifier for the completion.
- cost object
Estimated token cost in USD. When per-token pricing is configured for the model, the object contains input, output, and total cost values. When pricing is not configured for the model, this property is omitted entirely. Prompt-cache token pricing is not included.
cost properties
- inputCost string
Cost of prompt/input tokens in USD.
- totalCost string
Sum of inputCost and outputCost.
- outputCost string
Cost of completion/output tokens in USD.
-
- _meta object
Internal metadata associated with the request.
_meta properties
- act object
Details of the impersonating entity.
act properties
- iss string
Issuer of the impersonating entity's identity.
- sub string
Subject of the impersonating entity.
- subType string
Type of the impersonating entity's subject.
-
- aud array of strings
Audience(s) the JWT was issued for.
- iss string
Issuer of the principal's identity.
- sid string
ID of the session associated with this JWT, if any.
- sub string
Subject of the principal's identity.
- level string
Access level of the principal.
- userId string
Internal ID of the user making the request. Present when subType is "user".
- subType string
Type of the principal's subject.
- clientId string
ID of the client making the request.
- tenantId string
Internal ID of the tenant to restrict access to.
- licenseId string
License ID associated with the principal.
- parentLicenseId string
Parent license ID associated with the principal.
-
- jobId string
Optional RFS job ID forwarded from the X-Qlik-RFS-JobID request header to correlate triggered and finished events.
- model string
The model used for conversation.
- usage object
Token usage for a conversations response, including optional prompt-cache token counts.
usage properties
- totalTokens integerRequired
Addition of the completion and prompt tokens.
- promptTokens integerRequired
Tokens explicitly provided as input to the model.
- completionTokens integerRequired
Tokens generated by the model in response to the input.
- cacheReadInputTokens integer
Tokens read from the prompt cache.
- cacheWriteInputTokens integer
Tokens written to the prompt cache.
-
- callId string
The call ID associated with this request.
- object stringRequired
The object type. Always set to conversation.
- choices array of objectsRequired
A list of conversation choices.
choices properties
- index integerRequired
Position of a specific token within the generated output. Each token in the model's response has an associated index, starting from 0.
- message object
Individual communication within a conversation. This field (along with toolCalls/functionCall and any other generated content) is redacted and is never present on the published event; it is documented here only for historical/reference purposes.
message properties
- role stringRequired
The role of the message sender, either "user" or "assistant".
Can be one of: "user""assistant"
-
- finishReason stringRequired
Reason why a model's response generation process ended.
-
- traceId string
The trace ID associated with this request.
- createdAt integerRequired
Unix timestamp of when the response was generated.
- systemFingerprint string|null
This fingerprint represents the backend configuration that the model runs with.
- performanceMetrics object
Only present on streaming requests.
performanceMetrics properties
- ttft string|nullRequired
Time to first token (TTFT) in seconds. Null when timing data is unavailable.
- endTime stringRequired
Finishing time of the task.
- startTime stringRequired
Starting time of the task.
- totalTime string|nullRequired
Total time of the task in seconds. Null when timing data is unavailable.
- inferenceSpeed string|nullRequired
Tokens per second generated by the model in response to the input. Null when timing data is unavailable.
-
-
com.qlik.core.ai-platform.conversations-job.finished
Example payload of the "Conversations finished" event
{ "id": "A234-1234-1234", "time": "2023-01-01T12:00:00Z", "type": "com.qlik.core.ai-platform.conversations-job.finished", "source": "com.qlik/ai-platform", "specversion": "1.0", "datacontenttype": "application/json", "host": "ai-platform-llm-gateway-844db7d4c7-4glrb", "reason": "string", "userid": "00000000-0000-0000-0000-000000000000", "ownerid": "00000000-0000-0000-0000-000000000000", "spaceid": "00000000-0000-0000-0000-000000000000", "authtype": "user", "clientid": "00000000-0000-0000-0000-000000000000", "tenantid": "00000000-0000-0000-0000-000000000000", "sessionid": "00000000-0000-0000-0000-000000000000", "authclaims": "{\"sub\":\"1234567890\",\"subType\":\"user\",\"iss\":\"qlik.api.internal\"}", "tracestate": "congo=t61rcWkgMzE", "traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01", "toplevelresourceid": "id123", "data": { "id": "converse-393592ed-ca78-4740-aa87-0ca97480706f", "cost": { "inputCost": "0.000300", "totalCost": "0.003300", "outputCost": "0.003000" }, "model": "anthropic.claude-3-sonnet-20240229-v1:0", "usage": { "totalTokens": 238, "promptTokens": 16, "completionTokens": 222 }, "object": "conversation", "createdAt": 1728909071, "systemFingerprint": null, "performanceMetrics": { "ttft": "0.57", "endTime": "2024-07-10T15:48:30.416262", "startTime": "2024-07-10T15:48:21.598495", "totalTime": "8.82", "inferenceSpeed": "34.5" } }}