wisruntime 0.4.0__tar.gz → 0.4.2__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 (37) hide show
  1. {wisruntime-0.4.0/wisruntime.egg-info → wisruntime-0.4.2}/PKG-INFO +1 -1
  2. {wisruntime-0.4.0 → wisruntime-0.4.2}/pyproject.toml +1 -1
  3. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/conversation/__init__.py +55 -53
  4. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/conversation/client.py +336 -320
  5. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/conversation/model.py +166 -167
  6. wisruntime-0.4.2/wisruntime/conversation/recorder.py +306 -0
  7. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/server/server.py +19 -9
  8. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/skill/__init__.py +69 -69
  9. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/skill/client.py +629 -629
  10. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/skill/model.py +128 -128
  11. {wisruntime-0.4.0 → wisruntime-0.4.2/wisruntime.egg-info}/PKG-INFO +1 -1
  12. wisruntime-0.4.0/wisruntime/conversation/recorder.py +0 -183
  13. {wisruntime-0.4.0 → wisruntime-0.4.2}/MANIFEST.in +0 -0
  14. {wisruntime-0.4.0 → wisruntime-0.4.2}/README.md +0 -0
  15. {wisruntime-0.4.0 → wisruntime-0.4.2}/setup.cfg +0 -0
  16. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/__init__.py +0 -0
  17. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/adapters/__init__.py +0 -0
  18. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/adapters/langgraph/__init__.py +0 -0
  19. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/adapters/langgraph/builtin.py +0 -0
  20. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/adapters/langgraph/converter.py +0 -0
  21. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/adapters/langgraph/tool_adapter.py +0 -0
  22. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/adapters/langgraph/wrap_agent.py +0 -0
  23. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/config.py +0 -0
  24. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/exceptions.py +0 -0
  25. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/model.py +0 -0
  26. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/server/__init__.py +0 -0
  27. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/server/dify_handler.py +0 -0
  28. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/server/invoker.py +0 -0
  29. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/server/protocol.py +0 -0
  30. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/tool/__init__.py +0 -0
  31. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/tool/client.py +0 -0
  32. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/tool/model.py +0 -0
  33. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime/tool/protocol.py +0 -0
  34. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime.egg-info/SOURCES.txt +0 -0
  35. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime.egg-info/dependency_links.txt +0 -0
  36. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime.egg-info/requires.txt +0 -0
  37. {wisruntime-0.4.0 → wisruntime-0.4.2}/wisruntime.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wisruntime
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: 企业级 Agent Runtime SDK — 让 AI 工程师专注 Agent 能力开发,无需关心底层基础设施
5
5
  Author: WIS Team
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wisruntime"
7
- version = "0.4.0"
7
+ version = "0.4.2"
8
8
  description = "企业级 Agent Runtime SDK — 让 AI 工程师专注 Agent 能力开发,无需关心底层基础设施"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -1,53 +1,55 @@
1
- """会话模块 / Conversation Module.
2
-
3
- wishub-memory 会话服务的薄写客户端 (agent 通道) + 自动持久化记录器。
4
- 框架无关——任何框架都可以使用,也自动集成进 create_server。
5
-
6
- 两种接入模式:
7
-
8
- **方式一:自动持久化 (推荐,零代码集成)**
9
-
10
- >>> from wisruntime import create_server
11
- >>> from wisruntime.conversation import ConversationClient
12
- >>>
13
- >>> server = create_server(
14
- ... my_agent,
15
- ... conversation_client=ConversationClient(),
16
- ... )
17
- >>> # 之后每次请求自动完成:
18
- >>> # 1. 首轮自动创建会话 (回填 conversation_id 到流式事件)
19
- >>> # 2. 每轮结束后后台追加 user + assistant 两条消息
20
- >>> # 3. 持久化失败不影响响应
21
-
22
- **方式二:手动客户端 (薄写客户端,agent 通道)**
23
-
24
- >>> from wisruntime.conversation import ConversationClient
25
- >>>
26
- >>> async with ConversationClient() as client:
27
- ... conv = await client.create_conversation(user_id="u_001")
28
- ... # 一轮问答需要调用两次:一次 user,一次 assistant
29
- ... await client.append_message(conv.conversation_id, "user", "你好")
30
- ... await client.append_message(conv.conversation_id, "assistant", "你好!")
31
-
32
- 同步版本 (不能在事件循环中调用):
33
- >>> client = ConversationClient()
34
- >>> conv = client.create_conversation_sync(user_id="u_001")
35
- >>> client.append_message_sync(conv.conversation_id, "user", "你好")
36
-
37
- 范围说明:
38
- - 仅 agent 通道写操作 (创建会话 + 追加消息)。历史消息、会话列表等
39
- 读操作走用户通道 (user JWT),由应用侧调用,不在 SDK 范围。
40
- - 依赖中台接口落地:移除两个端点的 agentId 必填要求。落地前 SDK
41
- 通过 agent_id 可选透传兼容两种形态,落地后清理。
42
- """
43
-
44
- from wisruntime.conversation.client import ConversationClient
45
- from wisruntime.conversation.model import ConversationInfo, MessageInfo
46
- from wisruntime.conversation.recorder import ConversationRecorder
47
-
48
- __all__ = [
49
- "ConversationClient",
50
- "ConversationRecorder",
51
- "ConversationInfo",
52
- "MessageInfo",
53
- ]
1
+ """会话模块 / Conversation Module.
2
+
3
+ wishub-memory 会话服务的薄写客户端 (agent 通道) + 自动持久化记录器。
4
+ 框架无关——任何框架都可以使用,也自动集成进 create_server。
5
+
6
+ 两种接入模式:
7
+
8
+ **方式一:自动持久化 (推荐,零代码集成)**
9
+
10
+ >>> from wisruntime import create_server
11
+ >>> from wisruntime.conversation import ConversationClient
12
+ >>>
13
+ >>> server = create_server(
14
+ ... my_agent,
15
+ ... conversation_client=ConversationClient(),
16
+ ... )
17
+ >>> # 之后每次请求自动完成:
18
+ >>> # 1. 首轮自动创建会话 (回填 conversation_id 到流式事件)
19
+ >>> # 2. 每轮结束后后台追加 user + assistant 两条消息
20
+ >>> # 3. 持久化失败不影响响应
21
+
22
+ **方式二:手动客户端 (薄写客户端,agent 通道)**
23
+
24
+ >>> from wisruntime.conversation import ConversationClient
25
+ >>>
26
+ >>> async with ConversationClient() as client:
27
+ ... conv = await client.create_conversation(user_id="u_001")
28
+ ... # 一轮问答需要调用两次:一次 user,一次 assistant
29
+ ... # user_id 是归属锚点,必须与创建时一致 (否则 404)
30
+ ... await client.append_message(conv.conversation_id, "u_001", "user", "你好")
31
+ ... await client.append_message(conv.conversation_id, "u_001", "assistant", "你好!")
32
+
33
+ 同步版本 (不能在事件循环中调用):
34
+ >>> client = ConversationClient()
35
+ >>> conv = client.create_conversation_sync(user_id="u_001")
36
+ >>> client.append_message_sync(conv.conversation_id, "u_001", "user", "你好")
37
+
38
+ 范围说明:
39
+ - 仅 agent 通道写操作 (创建会话 + 追加消息)。历史消息、会话列表等
40
+ 读操作走用户通道 (user JWT),由应用侧调用,不在 SDK 范围。
41
+ - agentCode 由服务端从 API Key 推导,请求体不传 agentId;userId 是
42
+ 归属锚点,追加时必传且须等于目标会话归属用户;appCode 可选一致性
43
+ 声明,提供时透传。
44
+ """
45
+
46
+ from wisruntime.conversation.client import ConversationClient
47
+ from wisruntime.conversation.model import ConversationInfo, MessageInfo
48
+ from wisruntime.conversation.recorder import ConversationRecorder
49
+
50
+ __all__ = [
51
+ "ConversationClient",
52
+ "ConversationRecorder",
53
+ "ConversationInfo",
54
+ "MessageInfo",
55
+ ]