Send a message to the Davis CoPilot recommender in Dynatrace and receive a streaming or non-streaming reply with conversation state and context.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/davis/copilot/v1/skills/conversations:message |
Allows clients to send messages to the Davis CoPilot recommender and receive responses. The endpoint can handle both, streaming and non-streaming requests.
The mode is is configured via the HTTP Header Accept:
Accept: application/jsonAccept: application/x-ndjsonThe payload is a JSON dictionary with the following top level keys. Please review the examples for the correct payload formatting.
Parameters:
text: Message to the AI service. The response is a reply to this input.
state (Optional): Information containing a conversation between user and ai to be continued. If not
supplied, a new conversation is started. A state object is obtained from the response of a previous call to
the conversations:message endpoint. So the client is responsible for storing and providing the state.
context (Optional): Additional information to provide context to the requests.
Please note, this endpoint is in preview and is subject to the Dynatrace preview conditions, as linked in the overview.
To execute this request, you need a platform token or OAuth access token with davis-copilot:conversations:execute scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| body | Conversation | - | body | Required |
ConversationRequest object| Element | Type | Description | Required |
|---|---|---|---|
| text | string | - | Required |
| context | Conversation | Specify the information sources which will be used to process the request. Empty or null will default to the standard Davis CoPilot documentation search. | Optional |
| annotations | object | Specify the annotation information which will be used to add extra context to the request, e.g. | Optional |
| state | State | - | Optional |
ConversationContext object| Element | Type | Description | Required |
|---|---|---|---|
| type | string | -The element can hold these values
| Required |
| value | string | - | Required |
AnnotationItem objectState object| Element | Type | Description | Required |
|---|---|---|---|
| version | string | - | Optional |
| conversationId | string | - | Optional |
| skillName | string | - | Optional |
| history | object[] | - | Optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"text": "How can I instrument my java service?"}
| Code | Type | Description |
|---|---|---|
| 200 | Conversation | Answer from recommender skill. The response is a streaming response consisting of the following possible tokens: Start, Progress, Tokens, Notification, Content, End, Error. Please select the individual types to view the specific response format. A usual token stream follows the sequence: Start, Progress, Tokens, ... End. |
| 4XX | Client | - |
| 5XX | Internal | Service unavailable |
ConversationResponse object| Element | Type | Description |
|---|---|---|
| text | string | - |
| messageToken | string | - |
| status | Status | -The element can hold these values
|
| state | State | - |
| metadata | Metadata | - |
Status objectState object| Element | Type | Description |
|---|---|---|
| version | string | - |
| conversationId | string | - |
| skillName | string | - |
| history | object[] | - |
MetadataWithSource object| Element | Type | Description |
|---|---|---|
| notifications | Notification[] | - |
| sources | Source | - |
Notification object| Element | Type | Description |
|---|---|---|
| severity | string | - |
| notificationType | string | - |
| message | string | - |
SourceDocument object| Element | Type | Description |
|---|---|---|
| title | string | - |
| url | string | - |
| type | string | - |
StartEvent objectThe StartEvent is the first event sent by the server to the client.
It contains a messageToken that is used to identify the conversation.
| Element | Type | Description |
|---|---|---|
| event | Event | -The element can hold these values
|
| data | object | - |
ProgressEvent objectThe ProgressEvent is sent by the server to the client to indicate progress.
It contains at the type of progress and a message to be displayed to the user.
| Element | Type | Description |
|---|---|---|
| event | Event | -The element can hold these values
|
| data | object | - |
TokensEvent objectThe TokensEvent contains the tokens streamed from the server to the client during the conversation.
It may contain multiple tokens.
| Element | Type | Description |
|---|---|---|
| event | Event | -The element can hold these values
|
| data | object | - |
NotificationEvent objectThe NotificationEvent is sent by the server in case something do not fully go as planned.
It contains the severity of the notification (e.g. Warning), the type of issue, and a message.
| Element | Type | Description |
|---|---|---|
| event | Event | -The element can hold these values
|
| data | Notification | - |
ContentEvent object| Element | Type | Description |
|---|---|---|
| event | Event | -The element can hold these values
|
| data | object | - |
EndEvent objectThe EndEvent is sent by the server to indicate the end of the conversation.
It is comparable to the non-streaming response, containing the full answer comprised of all tokens,
the sources of the answer, and the state of the conversation that can be used for continuation.
| Element | Type | Description |
|---|---|---|
| event | Event | -The element can hold these values
|
| data | object | - |
ErrorEvent objectThe ErrorEvent is sent by the server to indicate an error and that the conversation cannot be continued.
This means the stream is closed and the client should not expect any further events.
It contains the code of the error representing the equivalent HTTP code and human readable message.
| Element | Type | Description |
|---|---|---|
| event | Event | -The element can hold these values
|
| data | Error | - |
EventType objectErrorMessage object| Element | Type | Description |
|---|---|---|
| code | integer | - |
| message | string | - |
ClientErrorResponse object| Element | Type | Description |
|---|---|---|
| error | Client | - |
ClientErrorResponseObject object| Element | Type | Description |
|---|---|---|
| code | integer | - |
| message | string | - |
{"text": "To instrument your Java service with Dynatrace, you can follow these steps...","messageToken": "1e9eaca7-2a32-4263-806f-787fa2e1350c","status": "SUCCESSFUL","state": {"version": "0.3","conversationId": "68b5d405-03d1-41b0-8ba3-a815fc72f06c","skillName": "recommender","history": [{"role": "User","text": "How can I instrument my java service?","supplementary": "The user is new to Dynatrace product"},{"role": "AI","text": "To instrument your Java service with Dynatrace, you can follow these steps...","supplementary": null},{"role": "AI","text": "To instrument your Java service with Dynatrace, you can follow these steps..."}]},"metadata": {"notifications": [{"severity": "WARNING","notificationType": "POSSIBLY_UNEXPECTED_DQL_BEHAVIOUR","message": "Your prompt seems to refer to segments or management zones. Please select the segment using the segment selector."}],"sources": [{"title": "Remote configuration management of OneAgents and ActiveGates","url": "https://www.dynatrace.com/support/help/setup-and-configuration/bulk-configuration","type": "Documentation"}]}}
{"error": {"code": 400,"message": "Bad Request"}}