feat(sdk): 普通 prompt 逐条上报用户时区
session/prompt 与 session/query 接受可选 timeZone,TS/Python 客户端透传;省略时逐条采样进程时区,写入 sdk-user 来源的 clientTimeZone。time-context 读取不带 rpcId 的 user 来源时区。补持久化记录、Agent Note、升级指南、README,并刷新 SDK snapshot。
This commit is contained in:
1 parent
71ce86fae6
commit
dca075e2a2
109 files changed
+1428
-421
No files matched your search
@@ -193,9 +193,10 @@ class DeepSeekHarness:
|
||||
*,
|
||||
session_id: str | None = None,
|
||||
on_notification: Callable[[Notification], None] | None = None,
|
||||
time_zone: str | None = None,
|
||||
) -> RunResult:
|
||||
"""Run input to completion on a fresh or named Session and return its RunResult."""
|
||||
return self.start_session(session_id).run(input, on_notification=on_notification)
|
||||
return self.start_session(session_id).run(input, on_notification=on_notification, time_zone=time_zone)
|
||||
|
||||
|
||||
class Session:
|
||||
@@ -218,6 +219,7 @@ class Session:
|
||||
input: str | list[JsonObject],
|
||||
*,
|
||||
on_notification: Callable[[Notification], None] | None = None,
|
||||
time_zone: str | None = None,
|
||||
) -> RunResult:
|
||||
"""Run text or content blocks through native input routing.
|
||||
|
||||
@@ -232,11 +234,14 @@ class Session:
|
||||
wire order. Every result retains this Session id, its root events and
|
||||
Session-tree notifications, including overlapping work. Native refusals
|
||||
return finish_reason="error". Routing, transport and observer failures
|
||||
raise without rolling back work.
|
||||
raise without rolling back work. ``time_zone`` is the user zone for an
|
||||
ordinary prompt, UTC or an IANA Area/Location name; omitted, the runtime
|
||||
samples its process zone. Native commands record no zone, and an invalid
|
||||
zone raises before routing.
|
||||
"""
|
||||
self.harness.start()
|
||||
with self.harness.client.subscribe_session_notifications(self.id) as subscription:
|
||||
response = self.harness.client._query(self.id, input)
|
||||
response = self.harness.client._query(self.id, input, time_zone)
|
||||
if isinstance(response, CommandExecution):
|
||||
activity = _RunActivity(self.id, "command", response.command_id)
|
||||
while True:
|
||||
|
||||
Reference in new issue
Block a user