sessions
chat

Chat

Initiates a chat session.

Routes to different implementations based on feature flags:

  • If auto_run_tools_chat feature flag is enabled, uses the new auto-tools implementation
  • Otherwise, uses the legacy implementation

Parameters: developer (Developer): The developer associated with the chat session. session_id (UUID): The unique identifier of the chat session. chat_input (ChatInput): The chat input data. background_tasks (BackgroundTasks): The background tasks to run. x_custom_api_key (Optional[str]): The custom API key. mock_response (Optional[str]): Mock response for testing. connection_pool: Connection pool for testing purposes.

Returns: ChatResponse or StreamingResponse: The chat response or streaming response.

post/sessions/{session_id}/chat

Path parameters

session_idstring uuid required

Query parameters

{"stackTrail":"paths:/sessions/{session_id}/chat:post:parameters:1:schema","oasType":"schema","type":"unknown","title":"Connection Pool"}

Headers

X-Custom-Api-Keystring nullable

Request body

rememberboolean
recallboolean
saveboolean
modelstring nullable
streamboolean
stopstring[]
seedinteger nullable
max_tokensinteger nullable
logit_biasobject nullable
agentstring uuid nullable
repetition_penaltynumber nullable
length_penaltynumber nullable
min_pnumber nullable
frequency_penaltynumber nullable
presence_penaltynumber nullable
temperaturenumber nullable
top_pnumber nullable
metadataobject nullable
auto_run_toolsboolean
recall_toolsboolean

Response

Successful Response

OR

Changes

Changed in 15 of the 44 revisions of this API.9321

    • removed the request property messages/items/continue

      request-property-removed

    • removed the optional property anyOf[subschema #1: ChunkChatResponse]/choices/items/delta/continue from the response with the 201 status

      response-optional-property-removed

    • added the new optional request property auto_run_tools

      new-optional-request-property

    • added the new optional request property recall_tools

      new-optional-request-property

    • removed ApiCallDef from the tools/anyOf[subschema #1]/items/api_call request property anyOf list

      request-property-any-of-removed

    • added ApiCallDef-Input to the tools/anyOf[subschema #1]/items/api_call request property anyOf list

      request-property-any-of-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 55cf66f6460711See the full diff
    • removed Content from the messages/items/content/anyOf[subschema #3]/items/ request property anyOf list

      request-property-any-of-removed

    • added agents_api__autogen__Chat__Content to the messages/items/content/anyOf[subschema #3]/items/ request property anyOf list

      request-property-any-of-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new optional request property metadata

      new-optional-request-property

    • added the new optional request property tools/anyOf[subschema #1]/items/api_call/anyOf[subschema #1: ApiCallDef]/secrets

      new-optional-request-property

    • added the new optional request property tools/anyOf[subschema #1]/items/api_call/anyOf[subschema #1: ApiCallDef]/include_response_content

      new-optional-request-property

    • added MailgunIntegrationDef to the tools/anyOf[subschema #1]/items/integration request property anyOf list

      request-property-any-of-added

    • added CompletionUsage to the anyOf[subschema #1: ChunkChatResponse]/usage response property anyOf list for the response status 201

      response-property-any-of-added

    • added CompletionUsage to the anyOf[subschema #2: MessageChatResponse]/usage response property anyOf list for the response status 201

      response-property-any-of-added

    • removed CompetionUsage from the anyOf[subschema #1: ChunkChatResponse]/usage response property anyOf list for the response status 201

      response-property-any-of-removed

    • removed CompetionUsage from the anyOf[subschema #2: MessageChatResponse]/usage response property anyOf list for the response status 201

      response-property-any-of-removed

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • request property tools/anyOf[subschema #1]/items/integration/anyOf[subschema #21: AlgoliaIntegrationDef]/arguments/anyOf[subschema #1: AlgoliaSearchArguments]/attributes_to_retrieve list-of-types was narrowed by removing types object from media type application/json

      request-property-list-of-types-narrowed

    • the tools/anyOf[subschema #1]/items/integration/anyOf[subschema #21: AlgoliaIntegrationDef]/arguments/anyOf[subschema #1: AlgoliaSearchArguments]/attributes_to_retrieve/anyOf[subschema #1]/ request property type/format changed from object/ to array/

      request-property-type-changed

    • added AlgoliaIntegrationDef to the tools/anyOf[subschema #1]/items/integration request property anyOf list

      request-property-any-of-added

  • 88911baf2b4b111See the full diff
    • added the new required request property tools/anyOf[subschema #1]/items/integration/anyOf[subschema #2: BraveIntegrationDef]/setup/anyOf[subschema #1: BraveSearchSetup]/brave_api_key

      new-required-request-property

    • removed the request property tools/anyOf[subschema #1]/items/integration/anyOf[subschema #2: BraveIntegrationDef]/setup/anyOf[subschema #1: BraveSearchSetup]/api_key

      request-property-removed

    • added UnstructuredIntegrationDef to the tools/anyOf[subschema #1]/items/integration request property anyOf list

      request-property-any-of-added