Skip to content

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 }

ConsultationRequestRequest

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
requestingAgent
required
Requestingagent

Requesting agent ID

string
>= 1 characters
targetAgent
required
Targetagent

Target agent ID

string
>= 1 characters
consultationType
required
Consultationtype

Consultation type

string
>= 1 characters
taskDescription
required
Taskdescription

Task description

string
>= 1 characters
context
Any of:
MessageContextInfo

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
taskId
Any of:
string
sessionId
Any of:
string
conversationId
Any of:
string
priority
Any of:
string
requiresResponse
Any of:
boolean
timeoutMs
Any of:
integer
metadata
Any of:
object
key
additional properties
string

Successful Response

ConsultationRequestResponse

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 tracking
  • assigned_agent: Agent ID assigned to handle the consultation
  • estimated_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"
}
object
status
required
Status

Operation status

string
consultationId
required
Consultationid

Unique consultation identifier

string
assignedAgent
required
Assignedagent

Agent assigned to handle consultation

string
estimatedResponseTime
Any of:
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