Shared contract for Flyte agent-SDK adapters.
Project description
flyteplugins-agents-core
The shared contract every Flyte agent-SDK adapter is built on, so they all follow one common format.
It is SDK-agnostic — no agent SDK is a dependency here. Adapters depend on it and
implement the contract; assert_adapter_conforms enforces that in CI.
What's in it
durable_step(request_key, run, *, name, dumps, loads)— record a call as a durable, replayableflyte.traceleaf (the model-turn durability mechanism). The real, non-serializable call is captured in therunclosure, so the trace only ever sees the serializablerequest_key.fingerprint(payload)— a deterministic memo key from a request payload.ToolTaskResolver/attach_tool_resolver(task)— make a tool-backing task resolve to itself on the worker (via the tool's__wrapped_task__hook) instead of re-dispatching, which would otherwise recurse indefinitely.ReportTimeline— render agent events into a tab of the Flyte task report.flyteplugins.agents.core.testing.assert_adapter_conforms(module)— the conformance check every adapter runs as a one-line test.
The rule every adapter follows
The agent run is a Flyte @env.task (the durable parent); each model turn
is a flyte.trace (a memoized, replayable leaf); each tool is a Flyte task
invoked as a durable child action.
Writing an adapter
A flyteplugins-agents-<sdk> package depends on this core and exposes, at
minimum, tool and run_agent (see the conformance contract). Its tool
object exposes __wrapped_task__; run_agent runs the SDK's loop inside the
calling @env.task, wraps the model in a durable provider built on durable_step,
and renders the trace via ReportTimeline.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flyteplugins_agents_core-2.5.9-py3-none-any.whl.
File metadata
- Download URL: flyteplugins_agents_core-2.5.9-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88c947d801909cf2338867bba6aa7ea2e3cbda95462760b4916c95618160a38a
|
|
| MD5 |
236d153eaa0b8677ada0093929cad19f
|
|
| BLAKE2b-256 |
61c7fa3ac88b2139fdfddfb6660e91da890387fea11fc55c66f011d4a590b3a6
|