Skip to content

Recommend Persona

POST
/api/chat/personas/recommend

Get recommended persona for a task

Analyzes a task description and recommends the most appropriate AI persona to use. Uses keyword matching to suggest personas based on the task content.

Args: task_description: Description of the task to perform

Returns: Dict containing: - recommended_persona: Persona ID or null if no match - confidence: Match confidence (placeholder for now) - task_analyzed: The analyzed task description

Example Request: POST /chat/personas/recommend { “task_description”: “Help me edit my fantasy novel” }

Example Response: { “recommended_persona”: “creative_editor”, “confidence”: “high”, “task_analyzed”: “Help me edit my fantasy novel” }

PersonaRecommendationRequest

Request model for persona recommendation endpoint.

Analyzes task description to recommend the most appropriate AI persona for handling the task based on content keywords and task type.

Fields: task_description: Description of the task requiring persona recommendation

JSON Example: { “taskDescription”: “Help me write a fantasy novel” }

Used By: - POST /api/chat/personas/recommend - Persona selection UI - Intelligent agent routing

object
taskDescription
required
Taskdescription

Task description for persona matching

string

Successful Response

PersonaRecommendationResponse

Response model for persona recommendation endpoint.

Returns recommended persona for a given task based on content analysis and keyword matching for intelligent persona selection.

Fields:

  • recommended_persona: Recommended persona ID (optional, None if no match found)
  • confidence: Match confidence score (0.0-1.0)
  • task_analyzed: The task description that was analyzed

JSON Example:

{
  "recommendedPersona": "creative_editor",
  "confidence": 0.85,
  "taskAnalyzed": "Help me edit my fantasy novel"
}
object
recommendedPersona
Any of:
string
confidence
required
Confidence

Match confidence score (0.0-1.0)

number
<= 1
taskAnalyzed
required
Taskanalyzed

The task description that was analyzed

string

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