SyncObject#

Understand request ownership, phases, and runtime limits. See the guide.

class zett_agent.sync_runtime.SyncObject(wrapped, *, runtime=None)[源代码]#

A blocking view of an existing Agent, provider, tool, or storage object.

The original object remains available as wrapped. Attribute reads and writes access the original object directly on the caller thread; they do not provide synchronization. Async method results are awaited and async iterators become SyncStream. Methods and tools can be called normally. Leaving this scope closes only a runtime created by this view. Explicitly call provider.aclose() on the view to release a caller-owned SDK client.

Dynamic method lookup is typed as Any; this view does not reproduce an arbitrary object's static interface. Use SyncAgent for explicitly typed Agent methods, or SyncRuntime.call for a typed callable boundary.

示例

Use any provider's ordinary API synchronously:

with provider.sync() as blocking:
    try:
        with blocking.stream(request) as events:
            for event in events:
                print(event)
    finally:
        blocking.aclose()
参数:
wrapped: _T#

Original service object; its resources remain caller-owned.

runtime: SyncRuntime#

Shared or privately owned bridge used to execute method calls.