Create Streaming Prompt
POST /api/chat/personas/prompt
Create streaming-optimized system prompt
Generates a comprehensive system prompt optimized for streaming responses with the specified persona, stance, and optional additional context.
Args: persona: Persona type ID stance: Stance type ID context: Optional additional context to include
Returns: Dict containing: - system_prompt: The generated streaming-optimized prompt - persona: Persona ID used - stance: Stance ID used - has_context: Whether additional context was included
Example Request: POST /chat/personas/prompt { “persona”: “technical_writer”, “stance”: “concise”, “context”: “Documentation for API endpoints” }
Example Response: { “system_prompt”: “You are a technical writer who excels at creating clear…”, “persona”: “technical_writer”, “stance”: “concise”, “has_context”: true }
Request Body required
Section titled “Request Body required ”Request model for streaming prompt creation.
Creates a streaming-optimized system prompt for specified persona and stance combination with optional additional context for customization.
Fields: persona: Persona type ID (e.g., “technical_writer”, “lore_scholar”) stance: Stance type ID (e.g., “concise”, “detailed”, “brainstorming”) context: Optional additional context to include in the prompt
JSON Example: { “persona”: “technical_writer”, “stance”: “concise”, “context”: “API documentation for backend services” }
Used By: - POST /api/chat/personas/prompt - Streaming chat initialization - Custom prompt generation
object
Persona type ID
Stance type ID
Optional additional context
Responses
Section titled “ Responses ”Successful Response
Response model for streaming prompt creation.
Returns streaming-optimized system prompt for specified persona and stance combination with optional additional context for real-time streaming responses.
Fields:
system_prompt: Generated streaming-optimized prompt textpersona: Persona ID used for prompt generationstance: Stance ID used for prompt generationhas_context: Whether additional context was included in prompt
Prompt Generation: The system prompt combines:
- Base persona description and traits
- Stance approach and tone
- Optional additional context (if provided)
- Streaming optimization for real-time response generation
Usage: POST /api/chat/personas/prompt returns this response model for streaming prompt generation, real-time response setup, and context-aware AI interactions.
JSON Example:
{
"systemPrompt": "You are a technical writer. Adopt a concise approach. Context: API docs.",
"persona": "technical_writer",
"stance": "concise",
"hasContext": true
}
Note: The systemPrompt field contains a comprehensive prompt string combining persona description, stance approach, and optional context for streaming-optimized responses. The actual prompt is much longer than shown in this example.
object
Generated streaming-optimized prompt text
Persona ID used for prompt generation
Stance ID used for prompt generation
Whether additional context was included in prompt
Validation Error