v3

latestOpenAPI 3.1.02026-08-06274467602.9 KB
chat

Chat Main Agent

Receives and processes a streaming chat request via the AgentService.

This endpoint streams the agent's response in real-time using Server-Sent Events.

Args: request: The chat request data containing message and project_id (pre-validated). agent_service: The AgentService instance (dependency).

Returns: StreamingResponse with Server-Sent Events containing streaming chat data.

Raises: HTTPException: 400 for validation errors. HTTPException: 404 if project not found or user doesn't own it. HTTPException: 500 for unexpected errors.

post/api/v1/chat/stream

Request body

messagestring required
project_idstring uuid required
current_focused_layer_idstring uuid nullable
action_type'new_enrichment' | 'new_layer' | 'analyze_row' | 'invoke_skill'

Enum for different action types in the system.

action_subtypestring nullable

Optional preset identifier that disambiguates actions sharing an action_type. For detail-panel presets, matches the client-side noteSource (e.g. 'environment', 'zoning', 'summary').

hidden_contextobject nullable
current_view_idstring nullable
iterate_over_rowsboolean
selected_modelstring nullable

Model-picker selection for this chat (a curated picker key, see GET /chat/models). Persisted on the chat; honored only when the workspace's model-picker feature toggle is on.

continue_turnboolean

Continue a terminally-failed turn from its persisted partial without a new prompt. The FE sends an empty message and the endpoint runs a promptless turn on the persisted history (the same no-user-bubble shape as a tool approval, minus the approval payload) so the agent resumes where it left off.

Example request

{
  "project_id": "00000000-0000-0000-0000-000000000001",
  "current_focused_layer_id": "00000000-0000-0000-0000-000000000000"
}

Response

Successful Response

{"stackTrail":"paths:/api/v1/chat/stream:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}