Ai platforms
This event will be published when conversations have been received from the LLM provider.
Payload
object- idstringRequired
Identifies the event.
- timestring
Timestamp of when the occurrence happened. Must adhere to RFC 3339.
- typestringRequired
Unique identifier for the event type.
- sourcestringRequired
Identifies the context in which an event happened.
- specversionstringRequired
The version of the CloudEvents specification which the event uses.
- datacontenttypestring
Content type of the data value. Must adhere to RFC 2046 format.
- hoststring
Unique identifier for the host related to the event.
- reasonstring
Reason associated with the occurrence, when applicable.
- useridstring
Unique identifier for the user related to the event.
- owneridstring
Unique identifier for the owner related to the event.
- spaceidstring
Unique identifier for the space related to the event.
- authtypestring
Representing the type of principal that triggered the occurrence.
- clientidstring
Unique identifier for the client related to the event.
- tenantidstringRequired
Unique identifier for the tenant related to the event.
- sessionidstring
Unique identifier for the session related to the event.
- authclaimsstring
A JSON string representing the impersonating entity (the JWT "act" claim), if any.
- tracestatestring
A comma-delimited list of key-value pairs.
- traceparentstring
Contains a version, trace ID, span ID, and trace options.
- toplevelresourceidstring
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.
- dataobject
Conversations finished event specific data.
data properties
- idstringRequired
A unique identifier for the completion.
- costobject
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
- inputCoststring
Cost of prompt/input tokens in USD.
- totalCoststring
Sum of inputCost and outputCost.
- outputCoststring
Cost of completion/output tokens in USD.
-
- _metaobject
Internal metadata associated with the request.
_meta properties
- actobject
Details of the impersonating entity.
act properties
- issstring
Issuer of the impersonating entity's identity.
- substring
Subject of the impersonating entity.
- subTypestring
Type of the impersonating entity's subject.
-
- audarray of strings
Audience(s) the JWT was issued for.
- issstring
Issuer of the principal's identity.
- sidstring
ID of the session associated with this JWT, if any.
- substring
Subject of the principal's identity.
- levelstring
Access level of the principal.
- userIdstring
Internal ID of the user making the request. Present when subType is "user".
- subTypestring
Type of the principal's subject.
- clientIdstring
ID of the client making the request.
- tenantIdstring
Internal ID of the tenant to restrict access to.
- licenseIdstring
License ID associated with the principal.
- parentLicenseIdstring
Parent license ID associated with the principal.
-
- jobIdstring
Optional RFS job ID forwarded from the X-Qlik-RFS-JobID request header to correlate triggered and finished events.
- modelstring
The model used for conversation.
- usageobject
Token usage for a conversations response, including optional prompt-cache token counts.
usage properties
- totalTokensintegerRequired
Addition of the completion and prompt tokens.
- promptTokensintegerRequired
Tokens explicitly provided as input to the model.
- completionTokensintegerRequired
Tokens generated by the model in response to the input.
- cacheReadInputTokensinteger
Tokens read from the prompt cache.
- cacheWriteInputTokensinteger
Tokens written to the prompt cache.
-
- callIdstring
The call ID associated with this request.
- objectstringRequired
The object type. Always set to conversation.
- choicesarray of objectsRequired
A list of conversation choices.
choices properties
- indexintegerRequired
Position of a specific token within the generated output. Each token in the model's response has an associated index, starting from 0.
- messageobject
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
- rolestringRequired
The role of the message sender, either "user" or "assistant".
Can be one of: "user""assistant"
-
- finishReasonstringRequired
Reason why a model's response generation process ended.
-
- traceIdstring
The trace ID associated with this request.
- createdAtintegerRequired
Unix timestamp of when the response was generated.
- systemFingerprintstring|null
This fingerprint represents the backend configuration that the model runs with.
- performanceMetricsobject
Only present on streaming requests.
performanceMetrics properties
- ttftstring|nullRequired
Time to first token (TTFT) in seconds. Null when timing data is unavailable.
- endTimestringRequired
Finishing time of the task.
- startTimestringRequired
Starting time of the task.
- totalTimestring|nullRequired
Total time of the task in seconds. Null when timing data is unavailable.
- inferenceSpeedstring|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" } }}