copilotkit 0.1.75a4__tar.gz → 0.1.75a6__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.75a6}/PKG-INFO +1 -1
  2. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/__init__.py +2 -2
  3. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/copilotkit_lg_middleware.py +9 -9
  4. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/pyproject.toml +1 -1
  5. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/README.md +0 -0
  6. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/action.py +0 -0
  7. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/agent.py +0 -0
  8. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/crewai/__init__.py +0 -0
  9. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/crewai/copilotkit_integration.py +0 -0
  10. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/crewai/crewai_agent.py +0 -0
  11. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/crewai/crewai_sdk.py +0 -0
  12. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/exc.py +0 -0
  13. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/html.py +0 -0
  14. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/integrations/__init__.py +0 -0
  15. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/integrations/fastapi.py +0 -0
  16. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/langchain.py +0 -0
  17. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/langgraph.py +0 -0
  18. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/langgraph_agent.py +0 -0
  19. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/langgraph_agui_agent.py +0 -0
  20. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/logging.py +0 -0
  21. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/parameter.py +0 -0
  22. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/protocol.py +0 -0
  23. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/runloop.py +0 -0
  24. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/sdk.py +0 -0
  25. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/copilotkit/types.py +0 -0
  26. {copilotkit-0.1.75a4 → copilotkit-0.1.75a6}/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.75a6
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
  ]
@@ -15,7 +15,6 @@ Example:
15
15
  """
16
16
 
17
17
  from typing import Any, Callable, Awaitable, ClassVar, List
18
- from typing_extensions import NotRequired
19
18
 
20
19
  from langchain_core.messages import AIMessage
21
20
  from langchain.agents.middleware import (
@@ -28,8 +27,7 @@ from langgraph.runtime import Runtime
28
27
 
29
28
  from .langgraph import CopilotContextItem
30
29
 
31
-
32
- class CopilotKitState(AgentState):
30
+ class CopilotKitState:
33
31
  """Extended state schema for CopilotKit middleware."""
34
32
 
35
33
  # CopilotKit frontend tools passed via state
@@ -37,7 +35,11 @@ class CopilotKitState(AgentState):
37
35
  context: List[CopilotContextItem]
38
36
 
39
37
  # Private state for CopilotKit middleware
40
- copilotkit: NotRequired[dict[str, Any]]
38
+ intercepted_tool_calls: Any
39
+ original_ai_message_id: Any
40
+
41
+ class StateSchema(AgentState):
42
+ copilotkit: CopilotKitState
41
43
 
42
44
 
43
45
  class CopilotKitMiddleware(AgentMiddleware[CopilotKitState, Any]):
@@ -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,8 @@ 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", [])
80
+ print(request.state)
78
81
 
79
82
  if not frontend_tools:
80
83
  return await handler(request)
@@ -190,6 +193,3 @@ class CopilotKitMiddleware(AgentMiddleware[CopilotKitState, Any]):
190
193
  # Delegate to sync implementation
191
194
  return self.after_agent(state, runtime)
192
195
 
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.6"
4
4
  description = "CopilotKit python SDK"
5
5
  authors = ["Markus Ecker <markus.ecker@gmail.com>"]
6
6
  license = "MIT"
File without changes