Get Persona Context
POST /api/chat/personas/context
Get streaming context for persona and stance combination
Retrieves comprehensive metadata for a specific persona and stance combination, including traits, expertise, approach, tone, and streaming configuration. Useful for UI display and streaming setup.
Args: persona: Persona type ID stance: Stance type ID
Returns: Dict containing: - persona: Persona details (type, base, traits, expertise) - stance: Stance details (type, approach, tone, focus) - streaming_metadata: Streaming configuration and version info
Example Request: POST /chat/personas/context { “persona”: “creative_editor”, “stance”: “supportive” }
Example Response: { “persona”: { “type”: “creative_editor”, “base”: “You are an experienced creative editor…”, “traits”: [“constructive”, “writer-focused”, …], “expertise”: [“prose improvement”, “story structure”, …] }, “stance”: { “type”: “supportive”, “approach”: “Be encouraging and confidence-building…”, “tone”: “encouraging and positive”, “focus”: “confidence-building and progress” }, “streaming_metadata”: { “timestamp”: “2024-01-15T10:00:00”, “persona_engine_version”: “1.0.0”, “streaming_enabled”: true } }
Request Body required
Section titled “Request Body required ”Request model for persona context retrieval.
Retrieves comprehensive metadata for a specific persona and stance combination including traits, expertise, approach, tone, and streaming configuration.
Fields: persona: Persona type ID (e.g., “creative_editor”, “technical_writer”) stance: Stance type ID (e.g., “supportive”, “concise”, “brainstorming”)
JSON Example: { “persona”: “creative_editor”, “stance”: “supportive” }
Used By: - POST /api/chat/personas/context - Streaming setup - UI persona display
object
Persona type ID
Stance type ID
Responses
Section titled “ Responses ”Successful Response
Response model for persona context retrieval.
Returns comprehensive metadata for persona and stance combination including traits, expertise, approach, tone, and streaming configuration for streaming setup and UI display.
Fields:
persona: Persona details (dict with type, base, traits, expertise)stance: Stance details (dict with type, approach, tone, focus)streaming_metadata: Streaming configuration and version info (dict with timestamp, version, streaming_enabled)
Persona Object Structure:
type: Persona type IDbase: Base persona description/prompttraits: List of persona traitsexpertise: List of expertise areas
Stance Object Structure:
type: Stance type IDapproach: Stance approach descriptiontone: Tone descriptionfocus: Focus area description
Streaming Metadata Structure:
timestamp: Context generation timestamp (ISO 8601)persona_engine_version: Persona engine versionstreaming_enabled: Whether streaming is enabled
Usage: POST /api/chat/personas/context returns this response model for streaming configuration, persona/stance metadata display, and context-aware prompt generation.
JSON Example:
{
"persona": {
"type": "creative_editor",
"base": "You are an experienced creative editor...",
"traits": ["constructive", "writer-focused", "detail-oriented"],
"expertise": ["prose improvement", "story structure", "character arcs"]
},
"stance": {
"type": "supportive",
"approach": "Be encouraging and confidence-building...",
"tone": "encouraging and positive",
"focus": "confidence-building and progress"
},
"streamingMetadata": {
"timestamp": "2025-01-30T10:00:00Z",
"persona_engine_version": "1.0.0",
"streaming_enabled": true
}
}object
Persona details (type, base, traits, expertise)
object
Persona type ID
Base persona description/prompt
List of persona traits
List of expertise areas
Stance details (type, approach, tone, focus)
object
Stance type ID
Stance approach description
Tone description
Focus area description
Streaming configuration and version info
object
Context generation timestamp (ISO 8601)
Persona engine version
Whether streaming is enabled
Validation Error