Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions echo/agent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware

from copilotkit import CopilotKitRemoteEndpoint, LangGraphAGUIAgent
from copilotkit import CopilotKitRemoteEndpoint, LangGraphAgent
from copilotkit.integrations.fastapi import handler as copilotkit_handler

from agent import create_agent_graph
Expand Down Expand Up @@ -57,12 +57,13 @@ async def copilotkit_endpoint(request: Request, project_id: str, path: Optional[
request.scope.setdefault("path_params", {})
request.scope["path_params"]["path"] = path or ""

agent = LangGraphAGUIAgent(
agent = LangGraphAgent(
name="default",
description="Echo Agentic Chat default agent",
graph=create_agent_graph(project_id=project_id, bearer_token=bearer_token),
)
# Pass agents as a callable (CopilotKit rejects a literal list here).
# CopilotKit currently rejects LangGraphAgent only for literal list inputs.
# Supplying a callable preserves expected runtime behavior in this SDK version.
endpoint = CopilotKitRemoteEndpoint(agents=lambda _context: [agent])
return await copilotkit_handler(request, endpoint)

Expand Down
2 changes: 1 addition & 1 deletion echo/agent/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
description = "Isolated CopilotKit runtime for Echo Agentic Chat"
requires-python = ">=3.11"
dependencies = [
"copilotkit>=0.1.94,<0.2",
"copilotkit>=0.1.77",
"langgraph>=0.2",
"langchain-google-vertexai>=3.2.2",
"google-auth>=2.35",
Expand Down
4 changes: 2 additions & 2 deletions echo/agent/tests/test_main_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def _fake_handler(request, _endpoint):

def test_copilotkit_root_post_rewrites_to_default_path(monkeypatch):
monkeypatch.setattr(main, "copilotkit_handler", _fake_handler)
monkeypatch.setattr(main, "LangGraphAGUIAgent", _DummyLangGraphAgent)
monkeypatch.setattr(main, "LangGraphAgent", _DummyLangGraphAgent)
monkeypatch.setattr(main, "CopilotKitRemoteEndpoint", _DummyEndpoint)

client = TestClient(main.app)
Expand All @@ -42,7 +42,7 @@ def test_copilotkit_root_post_rewrites_to_default_path(monkeypatch):

def test_copilotkit_nested_path_is_preserved(monkeypatch):
monkeypatch.setattr(main, "copilotkit_handler", _fake_handler)
monkeypatch.setattr(main, "LangGraphAGUIAgent", _DummyLangGraphAgent)
monkeypatch.setattr(main, "LangGraphAgent", _DummyLangGraphAgent)
monkeypatch.setattr(main, "CopilotKitRemoteEndpoint", _DummyEndpoint)

client = TestClient(main.app)
Expand Down
32 changes: 10 additions & 22 deletions echo/agent/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading