Skip to main content

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, replayable flyte.trace leaf (the model-turn durability mechanism). The real, non-serializable call is captured in the run closure, so the trace only ever sees the serializable request_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flyteplugins_agents_core-2.5.9-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file flyteplugins_agents_core-2.5.9-py3-none-any.whl.

File metadata

File hashes

Hashes for flyteplugins_agents_core-2.5.9-py3-none-any.whl
Algorithm Hash digest
SHA256 88c947d801909cf2338867bba6aa7ea2e3cbda95462760b4916c95618160a38a
MD5 236d153eaa0b8677ada0093929cad19f
BLAKE2b-256 61c7fa3ac88b2139fdfddfb6660e91da890387fea11fc55c66f011d4a590b3a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page