public

Handle New Chat Message

This endpoint is both used for all the following purposes:

  • Sending a new message in the session
  • Regenerating a message in the session (just send the same one again)
  • Editing a message (similar to regenerating but sending a different message)
  • Kicking off a seeded chat session (set use_existing_user_message)

Assumes that previous messages have been set as the latest to minimize overhead.

Args: chat_message_req (CreateChatMessageRequest): Details about the new chat message. request (Request): The current HTTP request context. user (User | None): The current user, obtained via dependency injection. _ (None): Rate limit check is run if user/group/global rate limits are enabled.

Returns: StreamingResponse: Streams the response to the new chat message.

post/chat/send-message

Request body

chunks_aboveinteger nullable
chunks_belowinteger nullable
full_docboolean
chat_session_idstring uuid required
parent_message_idinteger nullable required
messagestring required
search_doc_idsinteger[] nullable required
query_overridestring nullable
regenerateboolean nullable
temperature_overridenumber nullable
alternate_assistant_idinteger nullable
use_existing_user_messageboolean
existing_assistant_message_idinteger nullable
structured_response_formatobject nullable
skip_gen_ai_answer_generationboolean
allowed_tool_idsinteger[] nullable
forced_tool_idsinteger[] nullable
deep_researchboolean

Response

Successful Response

{"stackTrail":"paths:/chat/send-message:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}

Changes