Request expert consultation from agent
POST /api/agent-communication/consultations/request
Request expert consultation from a specialized agent.
Initiates a consultation request where one agent seeks advice or collaboration from another agent’s specialized expertise. Routes through communication hub with proper consultation tracking and response management.
Args: request: ConsultationRequestRequest containing requesting_agent, target_agent, consultation_type, task_description, and optional context
Returns:
ConsultationRequestResponse: Consultation tracking ID and assigned agent.
The status field is "pending" when the consultation message was
delivered and is awaiting the target agent’s reply, or "failed" when
the hub could not deliver the consultation request.
Raises: HTTPException(400): Hub-level validation failure (empty content, etc.). HTTPException(404): Target agent is not registered with the hub. HTTPException(500): Unexpected internal failure while routing.
Example Request: POST /consultations/request { “requestingAgent”: “HAWKEN”, “targetAgent”: “LAGAN”, “consultationType”: “code_review”, “taskDescription”: “Review this implementation for best practices” }
Example Response: { “status”: “pending”, “consultationId”: “consult_abc123def”, “assignedAgent”: “LAGAN”, “estimatedResponseTime”: null }
Request Body required
Section titled “Request Body required ”Request model for requesting agent consultation.
Initiates a consultation request where one agent seeks advice or collaboration from another agent for specialized expertise.
Fields: requesting_agent: Agent requesting the consultation target_agent: Agent being consulted consultation_type: Type of consultation (advice, collaboration, review, etc.) task_description: Description of the task requiring consultation context: Optional consultation context and parameters
JSON Example: { “requestingAgent”: “HAWKEN”, “targetAgent”: “LAGAN”, “consultationType”: “code_review”, “taskDescription”: “Review this implementation for best practices”, “context”: {“language”: “python”, “complexity”: “medium”} }
Used By: - POST /api/agent-communication/consultations/request - Consultation workflow UI - Agent collaboration system
object
Requesting agent ID
Target agent ID
Consultation type
Task description
Context information for agent messages.
Provides contextual metadata for message routing, processing, and tracking in agent communication.
Fields: task_id: Associated task identifier session_id: Session identifier conversation_id: Conversation thread ID priority: Message priority requires_response: Whether response expected timeout_ms: Response timeout metadata: Additional context metadata
Used By: - SendMessageRequest.context - ConsultationRequestRequest.context - Message routing and tracking
object
Responses
Section titled “ Responses ”Successful Response
Consultation request response model.
Provides confirmation and tracking information for agent consultation requests. Includes consultation ID, assigned agent, and estimated response time.
Fields:
status: Operation status (success/error)consultation_id: Unique consultation identifier for trackingassigned_agent: Agent ID assigned to handle the consultationestimated_response_time: Optional estimated response time string
Usage: POST /api/agent-communication/consultations/request returns this response model.
JSON Example:
{
"status": "success",
"consultationId": "consult_123",
"assignedAgent": "hawken",
"estimatedResponseTime": "2-5 minutes"
}Validation Error