copilotkit 0.1.75a4__tar.gz → 0.1.75a5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/PKG-INFO +1 -1
  2. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/__init__.py +2 -2
  3. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/copilotkit_lg_middleware.py +6 -7
  4. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/pyproject.toml +1 -1
  5. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/README.md +0 -0
  6. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/action.py +0 -0
  7. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/agent.py +0 -0
  8. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/crewai/__init__.py +0 -0
  9. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/crewai/copilotkit_integration.py +0 -0
  10. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/crewai/crewai_agent.py +0 -0
  11. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/crewai/crewai_sdk.py +0 -0
  12. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/exc.py +0 -0
  13. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/html.py +0 -0
  14. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/integrations/__init__.py +0 -0
  15. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/integrations/fastapi.py +0 -0
  16. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/langchain.py +0 -0
  17. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/langgraph.py +0 -0
  18. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/langgraph_agent.py +0 -0
  19. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/langgraph_agui_agent.py +0 -0
  20. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/logging.py +0 -0
  21. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/parameter.py +0 -0
  22. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/protocol.py +0 -0
  23. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/runloop.py +0 -0
  24. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/sdk.py +0 -0
  25. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/types.py +0 -0
  26. {copilotkit-0.1.75a4 → copilotkit-0.1.75a5}/copilotkit/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: copilotkit
3
- Version: 0.1.75a4
3
+ Version: 0.1.75a5
4
4
  Summary: CopilotKit python SDK
5
5
  License: MIT
6
6
  Keywords: copilot,copilotkit,langgraph,langchain,ai,langsmith,langserve
@@ -6,7 +6,7 @@ from .parameter import Parameter
6
6
  from .agent import Agent
7
7
  from .langgraph_agent import LangGraphAgent
8
8
  from .langgraph_agui_agent import LangGraphAGUIAgent
9
- from .copilotkit_lg_middleware import copilotkit_middleware
9
+ from .copilotkit_lg_middleware import CopilotKitMiddleware
10
10
 
11
11
 
12
12
 
@@ -22,5 +22,5 @@ __all__ = [
22
22
  'CrewAIAgent', # pyright: ignore[reportUnsupportedDunderAll] pylint: disable=undefined-all-variable
23
23
  'LangGraphAgent', # pyright: ignore[reportUnsupportedDunderAll] pylint: disable=undefined-all-variable
24
24
  "LangGraphAGUIAgent",
25
- "copilotkit_middleware"
25
+ "CopilotKitMiddleware"
26
26
  ]
@@ -28,8 +28,7 @@ from langgraph.runtime import Runtime
28
28
 
29
29
  from .langgraph import CopilotContextItem
30
30
 
31
-
32
- class CopilotKitState(AgentState):
31
+ class CopilotKitState:
33
32
  """Extended state schema for CopilotKit middleware."""
34
33
 
35
34
  # CopilotKit frontend tools passed via state
@@ -39,6 +38,9 @@ class CopilotKitState(AgentState):
39
38
  # Private state for CopilotKit middleware
40
39
  copilotkit: NotRequired[dict[str, Any]]
41
40
 
41
+ class StateSchema(AgentState):
42
+ copilotkit: CopilotKitState
43
+
42
44
 
43
45
  class CopilotKitMiddleware(AgentMiddleware[CopilotKitState, Any]):
44
46
  """CopilotKit Middleware for LangGraph agents.
@@ -59,7 +61,7 @@ class CopilotKitMiddleware(AgentMiddleware[CopilotKitState, Any]):
59
61
  request: ModelRequest,
60
62
  handler: Callable[[ModelRequest], ModelResponse],
61
63
  ) -> ModelResponse:
62
- frontend_tools = request.state.get("copilotkit", {}).get("tools", [])
64
+ frontend_tools = request.state.get("copilotkit", {}).get("actions", [])
63
65
 
64
66
  if not frontend_tools:
65
67
  return handler(request)
@@ -74,7 +76,7 @@ class CopilotKitMiddleware(AgentMiddleware[CopilotKitState, Any]):
74
76
  request: ModelRequest,
75
77
  handler: Callable[[ModelRequest], Awaitable[ModelResponse]],
76
78
  ) -> ModelResponse:
77
- frontend_tools = request.state.get("copilotkit", {}).get("tools", [])
79
+ frontend_tools = request.state.get("copilotkit", {}).get("actions", [])
78
80
 
79
81
  if not frontend_tools:
80
82
  return await handler(request)
@@ -190,6 +192,3 @@ class CopilotKitMiddleware(AgentMiddleware[CopilotKitState, Any]):
190
192
  # Delegate to sync implementation
191
193
  return self.after_agent(state, runtime)
192
194
 
193
-
194
- # Pre-created instance for convenience
195
- copilotkit_middleware = CopilotKitMiddleware()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "copilotkit"
3
- version = "0.1.75-alpha.4"
3
+ version = "0.1.75-alpha.5"
4
4
  description = "CopilotKit python SDK"
5
5
  authors = ["Markus Ecker <markus.ecker@gmail.com>"]
6
6
  license = "MIT"
File without changes