Arc API
The Arc API defines the interfaces and data models that are used to interact with Arc Agents.
The Arc GraphQL Spring Boot Starter is the first implementation of this API. See Arc Graphql.
Agent Request
The following defines the data model for sending a request to an Arc Agent.
Field Name | Description | Required |
---|---|---|
agentName | The Name of the Agent that should retrieve the request. If omitted the application should route the request to a default Agent. | false |
request/conversationContext | The conversation context contains fields that are related to the conversation model. | |
request/conversationContext/conversationId | The unique identifier of the conversation. | true |
request/systemContext | The system context contains information related to the system, such as, tenant id. | |
request/userContext | The user context contains data related to the user. | |
request/userContext/userId | The unique identifier of the user. | true |
request/userContext/profile | A key/value set of fields providing information about the user. This can be used to tailor the response generated by the Agent. | false |
request/messages | A list of messages that are part of the conversation. | true |
request/messages/role | The message role, i.e. user, assistant | true |
request/messages/format | The message format, i.e. text, json. | true |
request/messages/content | The content of the message. | true |
Agent Response
The following defines the data model response.
Field Name | Description | Required |
---|---|---|
responseTime | The time the response took in seconds. | false |
messages/content | The content of the response. The response will only contain new messages. | true |
GraphQL Example
Here is an example of a Agent Request being sent over a GraphQL subscription:
subscription {
agent(
agentName: "assistant-agent"
request: {
conversationContext: {
conversationId: "1"
}
systemContext: [],
userContext: {
userId: "1234",
profile: [{
key: "name",
value: "Pat"
}]
},
messages: [
{
role: "user",
content: "Hi",
format: "text",
}
]
}
) {
messages {
content
}
}
}