Skip to content

Recommend Stance

POST
/api/chat/stances/recommend

Get recommended stance for a task

Analyzes a task description and recommends the most appropriate response stance to use. Uses keyword matching to suggest stances based on the task content.

Args: task_description: Description of the task to perform

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

Example Request: POST /chat/stances/recommend { “task_description”: “Let’s brainstorm some character ideas” }

Example Response: { “recommended_stance”: “brainstorming”, “confidence”: “high”, “task_analyzed”: “Let’s brainstorm some character ideas” }

StanceRecommendationRequest

Request model for stance recommendation endpoint.

Analyzes task description to recommend the most appropriate response stance (e.g., brainstorming, concise, supportive) for handling the task.

Fields: task_description: Description of the task requiring stance recommendation

JSON Example: { “taskDescription”: “Let’s brainstorm character ideas” }

Used By: - POST /api/chat/stances/recommend - Stance selection UI - Response tone customization

object
taskDescription
required
Taskdescription

Task description for stance matching

string

Successful Response

StanceRecommendationResponse

Response model for stance recommendation endpoint.

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

Fields:

  • recommended_stance: Recommended stance 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:

{
  "recommendedStance": "brainstorming",
  "confidence": 0.85,
  "taskAnalyzed": "Let's brainstorm some character ideas"
}
object
recommendedStance
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