wscat -c wss://{ACCOUNT}.askwisdom.ai/graphql \
-H "Authorization: Bearer your_api_key" \
-s graphql-ws \
--execute '{
"type": "start",
"payload": {
"query": "subscription SubscribeConversation($auth: SubscriptionAuthInput!, $conversationId: String!) { subscribeConversation(auth: $auth, conversationId: $conversationId) { assistantMessageSent { id body { ops { insert { text } } } sender createdAt } assistantResponseDiff { bodyDiff { ops { insert { text } } } sender inProgress } assistantResponseCancelled } }",
"variables": {
"auth": {
"token": "your_jwt_token_here"
},
"conversationId": "conv_123456789"
}
}
}'
{
"data": {
"subscribeConversation": [
{
"assistantMessageSent": {
"id": "msg_987654321",
"body": {
"ops": [
{
"insert": {
"text": "Here's the analysis you requested:"
}
}
]
},
"sender": "ASSISTANT",
"createdAt": "2024-01-15T10:30:00Z"
},
"assistantResponseDiff": null,
"assistantResponseCancelled": null
}
]
}
}
Subscribe to real-time conversation updates as messages are sent and received
wscat -c wss://{ACCOUNT}.askwisdom.ai/graphql \
-H "Authorization: Bearer your_api_key" \
-s graphql-ws \
--execute '{
"type": "start",
"payload": {
"query": "subscription SubscribeConversation($auth: SubscriptionAuthInput!, $conversationId: String!) { subscribeConversation(auth: $auth, conversationId: $conversationId) { assistantMessageSent { id body { ops { insert { text } } } sender createdAt } assistantResponseDiff { bodyDiff { ops { insert { text } } } sender inProgress } assistantResponseCancelled } }",
"variables": {
"auth": {
"token": "your_jwt_token_here"
},
"conversationId": "conv_123456789"
}
}
}'
{
"data": {
"subscribeConversation": [
{
"assistantMessageSent": {
"id": "msg_987654321",
"body": {
"ops": [
{
"insert": {
"text": "Here's the analysis you requested:"
}
}
]
},
"sender": "ASSISTANT",
"createdAt": "2024-01-15T10:30:00Z"
},
"assistantResponseDiff": null,
"assistantResponseCancelled": null
}
]
}
}
subscribeConversation
subscription allows you to listen for real-time updates to a conversation, including new messages and response streams, via a WebSocket-based subscription model.
subscribeConversation(
auth: SubscriptionAuthInput!
conversationId: String!
): [ConversationUpdateOneOf!]!
ConversationUpdateOneOf
objects representing conversation updates. See ConversationUpdateOneOf for the schema.
subscription SubscribeConversation(
$auth: SubscriptionAuthInput!
$conversationId: String!
) {
subscribeConversation(
auth: $auth
conversationId: $conversationId
) {
assistantMessageSent {
id
body {
ops {
insert {
text
visualization {
id
title
type
}
}
}
}
sender
createdAt
}
assistantResponseDiff {
bodyDiff {
ops {
insert {
text
}
visualization {
id
title
type
}
}
}
sender
inProgress
}
assistantResponseCancelled
}
}
wscat -c wss://{ACCOUNT}.askwisdom.ai/graphql \
-H "Authorization: Bearer your_api_key" \
-s graphql-ws \
--execute '{
"type": "start",
"payload": {
"query": "subscription SubscribeConversation($auth: SubscriptionAuthInput!, $conversationId: String!) { subscribeConversation(auth: $auth, conversationId: $conversationId) { assistantMessageSent { id body { ops { insert { text } } } sender createdAt } assistantResponseDiff { bodyDiff { ops { insert { text } } } sender inProgress } assistantResponseCancelled } }",
"variables": {
"auth": {
"token": "your_jwt_token_here"
},
"conversationId": "conv_123456789"
}
}
}'
{
"data": {
"subscribeConversation": [
{
"assistantMessageSent": {
"id": "msg_987654321",
"body": {
"ops": [
{
"insert": {
"text": "Here's the analysis you requested:"
}
}
]
},
"sender": "ASSISTANT",
"createdAt": "2024-01-15T10:30:00Z"
},
"assistantResponseDiff": null,
"assistantResponseCancelled": null
}
]
}
}