feat: implement client-initiated real-time human input event streams

- Add HumanInputRequiredEvent and HumanInputCompletedEvent to task_events.py
- Implement HTTP server with WebSocket, SSE, and long-polling endpoints
- Add EventStreamManager for connection and event management
- Integrate event emission in agent executor human input flow
- Add comprehensive tests for server endpoints and event integration
- Add optional FastAPI dependencies for server functionality
- Include documentation and example usage
- Maintain backward compatibility with existing human input flow

Addresses issue #3259 for WebSocket/SSE/long-polling human input events

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-08-02 16:05:43 +00:00
parent 88ed91561f
commit ea560d0af1
12 changed files with 1440 additions and 2 deletions

View File

@@ -69,6 +69,11 @@ docling = [
aisuite = [
"aisuite>=0.1.10",
]
server = [
"fastapi>=0.104.0",
"uvicorn>=0.24.0",
"websockets>=12.0",
]
[tool.uv]
dev-dependencies = [
@@ -86,6 +91,10 @@ dev-dependencies = [
"pytest-timeout>=2.3.1",
"pytest-xdist>=3.6.1",
"pytest-split>=0.9.0",
"fastapi>=0.104.0",
"uvicorn>=0.24.0",
"websockets>=12.0",
"httpx>=0.25.0",
]
[project.scripts]