Skip to content

Writers Room Stream

POST
/api/chat/writers-room/stream

Writers’ Room: stream responses from all three agents concurrently.

Fans out the user message to Ishvana, Hawken, and Lagan in parallel. Each SSE chunk includes an agentUsed field so the frontend can attribute content to the correct agent. A final {"type": "complete"} event is sent after all agents finish.

EnhancedChatRequest

Enhanced chat interaction request model with advanced features.

Request model for advanced chat interactions supporting conversation threading, agent selection, persona/stance control, and targeted RAG document pinning. Uses IshvanaBaseModel for automatic snake_case → camelCase JSON conversion.

Fields: message: User’s chat message content project_id: Project context identifier (default: “my-project”) conversation_id: Existing thread ID to continue conversation (optional) agent_type: Preferred agent specialization (default: “general”) use_rag: Whether to use RAG for context retrieval (default: True) temperature: LLM temperature for creativity (default: 0.7, range: 0.0-2.0) max_tokens: Maximum tokens in AI response (default: 2048) search_results_count: Number of RAG results to retrieve (default: 10) persona: AI persona to adopt (e.g., ‘Lore Scholar’, ‘Creative Editor’) stance: Response stance (e.g., ‘brainstorming’, ‘critical’, ‘analytical’) pinned_document_ids: Specific documents to prioritize in RAG search requested_at: Timestamp when request was created (auto-generated)

Persona Examples: - ‘Lore Scholar’: Deep lore expert, analytical and precise - ‘Creative Editor’: Collaborative writing partner, supportive and creative - ‘World Historian’: Detail-oriented worldbuilding assistant - ‘Technical Writer’: Documentation and structure expert

Stance Examples: - ‘brainstorming’: Exploratory, idea-generating, open-ended - ‘critical’: Analytical, evaluative, constructive feedback - ‘analytical’: Detailed analysis, structured thinking - ‘supportive’: Encouraging, collaborative, affirming

Used By: - POST /api/chat/enhanced endpoint - Enhanced chat UI with persona/stance controls - Threaded conversation management - Targeted RAG document exploration - Dynamic AI voice adjustment

object
message
required
Message

User message

string
projectId
Any of:
string
threadId
Any of:
string
conversationId
Any of:
string
agentType
Agenttype

Preferred agent type

string
default: general
agent
Any of:
string
projectType
Any of:
string
workflowType
Any of:
string
useRag
Userag

Use RAG for context

boolean
default: true
temperature
Temperature

LLM temperature

number
default: 0.7
maxTokens
Maxtokens

Maximum tokens

integer
default: 2048
searchResultsCount
Searchresultscount

RAG search results

integer
default: 10
persona
Any of:
string
stance
Any of:
string
pinnedDocumentIds
Any of:
Array<string>
images
Any of:
Array<object>
ImageAttachment

Base64-encoded image attached to a chat message.

object
mediaType
required
Mediatype

MIME type (image/png, image/jpeg, image/gif, image/webp)

string
data
required
Data

Base64-encoded image data

string
context
Any of:
AgentChatContext

Ambient author context attached to a freeform agent request.

object
activeUrl
Any of:
string
pageTitle
Any of:
string
pageContentExcerpt
Any of:
string
activeDocumentTitle
Any of:
string
activeDocumentExcerpt
Any of:
string
writersRoom
Writersroom

Writers’ Room multi-agent mode

boolean
skipUserPersist
Skipuserpersist

Skip user message persistence (used by WR to avoid duplicates)

boolean
requestedAt
Requestedat

Enhanced chat request timestamp

string format: date-time

Successful Response

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object