Skip to content

AI-Human Interaction

This example demonstrates how AI agents can interact with humans:

  • Using agent capabilities for human interaction
  • Setting up a human agent in the pool
  • Allowing AI to request human input when needed

How It Works

  1. We set up two agents:
  2. An AI assistant with can_ask_agents capability
  3. A human agent using the special "human" provider type

  4. When the AI assistant encounters a question it can't answer:

  5. It recognizes the need for human input
  6. Uses its can_ask_agents capability to interact with the human agent
  7. Incorporates the human's response into its answer

  8. The conversation might look like this:

    Assistant: I need to check about Project DoomsDay's status. Let me ask the human.
    Human: Project DoomsDay is currently in Phase 2, with 60% completion.
    Assistant: Based on the human's input, Project DoomsDay is in Phase 2 and is 60% complete.
    

This demonstrates how to:

  • Enable AI-human collaboration
  • Control when AI can request human input
  • Integrate human knowledge into AI responses

Open in Pydantic Playground