copilotkit 0.1.75a4__py3-none-any.whl → 0.1.75a5__py3-none-any.whl
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.
- copilotkit/__init__.py +2 -2
- copilotkit/copilotkit_lg_middleware.py +6 -7
- {copilotkit-0.1.75a4.dist-info → copilotkit-0.1.75a5.dist-info}/METADATA +1 -1
- {copilotkit-0.1.75a4.dist-info → copilotkit-0.1.75a5.dist-info}/RECORD +5 -5
- {copilotkit-0.1.75a4.dist-info → copilotkit-0.1.75a5.dist-info}/WHEEL +0 -0
copilotkit/__init__.py
CHANGED
|
@@ -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
|
|
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
|
-
"
|
|
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("
|
|
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("
|
|
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,7 +1,7 @@
|
|
|
1
|
-
copilotkit/__init__.py,sha256=
|
|
1
|
+
copilotkit/__init__.py,sha256=22bUXudklMop9r1DYkecCaTiHbj_m0Wf4txOU-yfSI4,859
|
|
2
2
|
copilotkit/action.py,sha256=bg_bPusEfN8TMQV1B3lVyMLbHyLn1E7yVYAvfE2_PXA,1691
|
|
3
3
|
copilotkit/agent.py,sha256=e-jPsUQo18FOYUPdE3YNmSLcb5FEfWL6ARScOntyvb8,1663
|
|
4
|
-
copilotkit/copilotkit_lg_middleware.py,sha256=
|
|
4
|
+
copilotkit/copilotkit_lg_middleware.py,sha256=LlLlRxX9ws8JDRJAALPnRJVi1-0nBEcRBeO-w0WuixE,5859
|
|
5
5
|
copilotkit/crewai/__init__.py,sha256=RAkBTwDpFuvD5prULUnoWdl5d8W373cm1ZlqOMeSGbY,1034
|
|
6
6
|
copilotkit/crewai/copilotkit_integration.py,sha256=vd1LVhXo-cpA4PQ_-cZHdKgm67MvrHpx4VJweUvCzPE,14550
|
|
7
7
|
copilotkit/crewai/crewai_agent.py,sha256=maoMnl0WIHUnFAK5ALUKD9z0GvjtfNGi31zi37LyyaE,15323
|
|
@@ -21,6 +21,6 @@ copilotkit/runloop.py,sha256=9pBqWeu4QCRPOizz00se1d0_BvCX3ZIABzNeiXhdyNM,10641
|
|
|
21
21
|
copilotkit/sdk.py,sha256=VEQqA9QAXJS5MDLxtJJdtfrApX9EawCHzp-IXnat5vw,11882
|
|
22
22
|
copilotkit/types.py,sha256=_YQluiHpJGGXYB4eWLk0EocDZp5C8rs3ZsMNFhmXEYU,972
|
|
23
23
|
copilotkit/utils.py,sha256=rOAaaFBXgb3iv_cLH9S2steyGwHmnTjaxQTA53qdtQo,203
|
|
24
|
-
copilotkit-0.1.
|
|
25
|
-
copilotkit-0.1.
|
|
26
|
-
copilotkit-0.1.
|
|
24
|
+
copilotkit-0.1.75a5.dist-info/METADATA,sha256=mCEps29kaADNPa1eQwgUtfhn1UpO0L-eY4Mgly9J2VU,2606
|
|
25
|
+
copilotkit-0.1.75a5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
26
|
+
copilotkit-0.1.75a5.dist-info/RECORD,,
|
|
File without changes
|