-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path__init__.py
More file actions
40 lines (34 loc) · 1.05 KB
/
__init__.py
File metadata and controls
40 lines (34 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""LangChain 集成模块
使用 AgentRunConverter 将 LangChain 事件转换为 AG-UI 协议事件:
>>> from agentrun.integration.langchain import AgentRunConverter
>>>
>>> async def invoke_agent(request: AgentRequest):
... converter = AgentRunConverter()
... async for event in agent.astream_events(input_data, version="v2"):
... for item in converter.convert(event):
... yield item
支持多种调用方式:
- agent.astream_events(input, version="v2") - 支持 token by token
- agent.stream(input, stream_mode="updates") - 按节点输出
- agent.astream(input, stream_mode="updates") - 异步按节点输出
"""
from agentrun.integration.langgraph.agent_converter import (
AgentRunConverter,
) # 向后兼容
from .builtin import (
knowledgebase_toolset,
model,
sandbox_toolset,
skill_tools,
tool_resource,
toolset,
)
__all__ = [
"AgentRunConverter",
"model",
"toolset",
"sandbox_toolset",
"knowledgebase_toolset",
"tool_resource",
"skill_tools",
]