Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .mock/asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ channels:
contexts, flush them, or close them independently. A `close_socket` message can be used to terminate
the entire connection gracefully.

For more information on how to use this API for conversational agents see the [conversational agents guide](/docs/best-practices/conversational-agents).
For more information on best practices for how to use this API, please see the [multi context websocket guide](/docs/cookbooks/multi-context-web-socket).

bindings:
ws:
Expand Down Expand Up @@ -624,18 +624,18 @@ components:
items:
$ref: '#/components/schemas/PronunciationDictionaryLocator'
description: Optional list of pronunciation dictionary locators. Can only be provided in the first message for a given context_id.
context_id:
contextId:
type: string
nullable: true
description: An identifier for the text-to-speech context. Allows managing multiple independent audio generation streams over a single WebSocket connection. If omitted, a default context is used.
close_context:
type: boolean
default: false
description: If true, closes the specified `context_id`. No further audio will be generated for this context. The `text` field is ignored.
description: If true, closes the specified `contextId`. No further audio will be generated for this context. The `text` field is ignored.
close_socket:
type: boolean
default: false
description: If true, flushes all contexts and closes the entire WebSocket connection. The `text` and `context_id` fields are ignored.
description: If true, flushes all contexts and closes the entire WebSocket connection. The `text` and `contextId` fields are ignored.

WebsocketTTSServerMessageMulti:
type: object
Expand Down Expand Up @@ -762,9 +762,9 @@ components:
alignment:
$ref: '#/components/schemas/Alignment'
nullable: true
context_id:
contextId:
type: string
description: The context_id for which this audio is.
description: The contextId for which this audio is.

FinalOutputMulti:
type: object
Expand Down
136 changes: 110 additions & 26 deletions .mock/definition/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,26 +212,6 @@ types:
source:
openapi: openapi.json
AgentConfig:
properties:
first_message:
type: optional<string>
docs: >-
If non-empty, the first message the agent will say. If empty, the
agent waits for the user to start the discussion.
default: ''
language:
type: optional<string>
docs: Language of the agent - used for ASR and TTS
default: en
dynamic_variables:
type: optional<DynamicVariablesConfig>
docs: Configuration for dynamic variables
prompt:
type: optional<PromptAgent>
docs: The prompt for the agent
source:
openapi: openapi.json
AgentConfigDbModel:
properties:
first_message:
type: optional<string>
Expand Down Expand Up @@ -1253,8 +1233,19 @@ types:
properties: {}
source:
openapi: openapi.json
ChapterContentBlockInputModelSubType:
enum:
- p
- h1
- h2
- h3
inline: true
source:
openapi: openapi.json
ChapterContentBlockInputModel:
properties:
sub_type:
type: optional<ChapterContentBlockInputModelSubType>
block_id:
type: optional<string>
nodes:
Expand Down Expand Up @@ -2135,7 +2126,7 @@ types:
agent and an AI user.
properties:
simulated_user_config:
type: AgentConfigDbModel
type: AgentConfig
tool_mock_config:
type: optional<map<string, ToolMockConfig>>
partial_conversation_history:
Expand Down Expand Up @@ -2182,6 +2173,9 @@ types:
expiration_time_unix_secs:
type: optional<integer>
docs: The expiration time of the token in unix seconds
conversation_id:
type: optional<string>
docs: The ID of the conversation
purpose:
type: optional<ConversationTokenPurpose>
docs: The purpose of the token
Expand Down Expand Up @@ -3017,6 +3011,11 @@ types:
type: WidgetConfigResponseModel
source:
openapi: openapi.json
GetAgentKnowledgebaseSizeResponseModel:
properties:
number_of_pages: double
source:
openapi: openapi.json
GetAgentLinkResponseModel:
properties:
agent_id:
Expand Down Expand Up @@ -3651,6 +3650,19 @@ types:
type: optional<map<string, LlmInputOutputTokensUsage>>
source:
openapi: openapi.json
LlmUsageCalculatorLlmResponseModel:
properties:
llm:
type: Llm
price_per_minute: double
source:
openapi: openapi.json
LlmUsageCalculatorResponseModel:
properties:
llm_prices:
type: list<LlmUsageCalculatorLlmResponseModel>
source:
openapi: openapi.json
LanguageAddedResponse:
properties:
version: integer
Expand Down Expand Up @@ -4067,6 +4079,66 @@ types:
docs: Whether the user is on the watchlist.
source:
openapi: openapi.json
NativeMcpToolConfigInput:
docs: A Native MCP tool is a tool that is used to call a Native MCP server
properties:
id:
type: optional<string>
default: ''
name:
type: string
validation:
pattern: ^[a-zA-Z0-9_-]{1,64}$
minLength: 0
description:
type: string
validation:
minLength: 0
response_timeout_secs:
type: optional<integer>
docs: The maximum time in seconds to wait for the tool call to complete.
default: 20
parameters:
type: optional<ObjectJsonSchemaPropertyInput>
docs: Schema for any parameters the LLM needs to provide to the MCP tool.
mcp_tool_name:
type: string
docs: The name of the MCP tool to call
mcp_server_id:
type: string
docs: The id of the MCP server to call
source:
openapi: openapi.json
NativeMcpToolConfigOutput:
docs: A Native MCP tool is a tool that is used to call a Native MCP server
properties:
id:
type: optional<string>
default: ''
name:
type: string
validation:
pattern: ^[a-zA-Z0-9_-]{1,64}$
minLength: 0
description:
type: string
validation:
minLength: 0
response_timeout_secs:
type: optional<integer>
docs: The maximum time in seconds to wait for the tool call to complete.
default: 20
parameters:
type: optional<ObjectJsonSchemaPropertyOutput>
docs: Schema for any parameters the LLM needs to provide to the MCP tool.
mcp_tool_name:
type: string
docs: The name of the MCP tool to call
mcp_server_id:
type: string
docs: The id of the MCP server to call
source:
openapi: openapi.json
ObjectJsonSchemaPropertyInputPropertiesValue:
discriminated: false
union:
Expand Down Expand Up @@ -4673,6 +4745,8 @@ types:
type: ClientToolConfigInput
mcp:
type: McpToolConfigInput
native_mcp:
type: NativeMcpToolConfigInput
system:
type: SystemToolConfigInput
webhook:
Expand Down Expand Up @@ -4707,6 +4781,9 @@ types:
mcp_server_ids:
type: optional<list<string>>
docs: A list of MCP server ids to be used by the agent
native_mcp_server_ids:
type: optional<list<string>>
docs: A list of Native MCP server ids to be used by the agent
knowledge_base:
type: optional<list<KnowledgeBaseLocator>>
docs: A list of knowledge bases to be used by the agent
Expand All @@ -4730,6 +4807,8 @@ types:
type: ClientToolConfigOutput
mcp:
type: McpToolConfigOutput
native_mcp:
type: NativeMcpToolConfigOutput
system:
type: SystemToolConfigOutput
webhook:
Expand All @@ -4745,6 +4824,8 @@ types:
type: ClientToolConfigInput
mcp:
type: McpToolConfigInput
native_mcp:
type: NativeMcpToolConfigInput
system:
type: SystemToolConfigInput
webhook:
Expand Down Expand Up @@ -4779,6 +4860,9 @@ types:
mcp_server_ids:
type: optional<list<string>>
docs: A list of MCP server ids to be used by the agent
native_mcp_server_ids:
type: optional<list<string>>
docs: A list of Native MCP server ids to be used by the agent
knowledge_base:
type: optional<list<KnowledgeBaseLocator>>
docs: A list of knowledge bases to be used by the agent
Expand Down Expand Up @@ -7506,7 +7590,7 @@ types:
docs: >-
Optional list of pronunciation dictionary locators. Can only be
provided in the first message for a given context_id.
context_id:
contextId:
type: optional<string>
docs: >-
An identifier for the text-to-speech context. Allows managing multiple
Expand All @@ -7515,14 +7599,14 @@ types:
close_context:
type: optional<boolean>
docs: >-
If true, closes the specified `context_id`. No further audio will be
If true, closes the specified `contextId`. No further audio will be
generated for this context. The `text` field is ignored.
default: false
close_socket:
type: optional<boolean>
docs: >-
If true, flushes all contexts and closes the entire WebSocket
connection. The `text` and `context_id` fields are ignored.
connection. The `text` and `contextId` fields are ignored.
default: false
source:
openapi: asyncapi.yml
Expand Down Expand Up @@ -7651,9 +7735,9 @@ types:
docs: Base64 encoded audio chunk.
normalizedAlignment: optional<NormalizedAlignment>
alignment: optional<Alignment>
context_id:
contextId:
type: optional<string>
docs: The context_id for which this audio is.
docs: The contextId for which this audio is.
source:
openapi: asyncapi.yml
FinalOutputMulti:
Expand Down
32 changes: 32 additions & 0 deletions .mock/definition/conversationalAi/agents/knowledgeBase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
imports:
root: ../../__package__.yml
service:
auth: false
base-path: ''
endpoints:
size:
path: /v1/convai/agent/{agent_id}/knowledge-base/size
method: GET
auth: false
docs: Returns the number of pages in the agent's knowledge base.
source:
openapi: openapi.json
path-parameters:
agent_id: string
display-name: Returns The Size Of The Agent'S Knowledge Base
response:
docs: Successful Response
type: root.GetAgentKnowledgebaseSizeResponseModel
status-code: 200
errors:
- root.UnprocessableEntityError
examples:
- path-parameters:
agent_id: agent_id
response:
body:
number_of_pages: 1.1
audiences:
- convai
source:
openapi: openapi.json
3 changes: 2 additions & 1 deletion .mock/definition/conversationalAi/agents/link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ service:
body:
agent_id: J3Pbu5gP6NNKBscdCdwB
token:
agent_id: J3Pbu5gP6NNKBscdCdwB
agent_id: agent_J3Pbu5gP6NNKBscdCdwB
conversation_token: '1234567890'
expiration_time_unix_secs: 1716153600
conversation_id: conv_J3Pbu5gP6NNKBscdCdwB
purpose: signed_url
audiences:
- convai
Expand Down
51 changes: 51 additions & 0 deletions .mock/definition/conversationalAi/agents/llmUsage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
imports:
root: ../../__package__.yml
service:
auth: false
base-path: ''
endpoints:
calculate:
path: /v1/convai/agent/{agent_id}/llm-usage/calculate
method: POST
auth: false
docs: Calculates expected number of LLM tokens needed for the specified agent.
source:
openapi: openapi.json
path-parameters:
agent_id: string
display-name: Calculate Expected Llm Usage For An Agent
request:
name: LlmUsageCalculatorRequestModel
body:
properties:
prompt_length:
type: optional<integer>
docs: Length of the prompt in characters.
number_of_pages:
type: optional<integer>
docs: >-
Pages of content in pdf documents OR urls in agent's Knowledge
Base.
rag_enabled:
type: optional<boolean>
docs: Whether RAG is enabled.
content-type: application/json
response:
docs: Successful Response
type: root.LlmUsageCalculatorResponseModel
status-code: 200
errors:
- root.UnprocessableEntityError
examples:
- path-parameters:
agent_id: agent_id
request: {}
response:
body:
llm_prices:
- llm: gpt-4o-mini
price_per_minute: 1.1
audiences:
- convai
source:
openapi: openapi.json
Loading