Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Flyte Anthropic Plugin

This plugin provides integration between Flyte and Anthropic's Claude API, enabling you to use Flyte tasks as tools for Claude agents.

Installation

pip install flyteplugins-anthropic

Usage

import flyte
from flyteplugins.anthropic import function_tool, Agent, run_agent

env = flyte.TaskEnvironment(
    "claude-agent",
    secrets=[flyte.Secret(key="anthropic_api_key", as_env_var="ANTHROPIC_API_KEY")],
)

@env.task
async def get_weather(city: str) -> str:
    """Get the current weather for a city."""
    return f"The weather in {city} is sunny, 72F"

@env.task
async def agent_task(prompt: str) -> str:
    tools = [function_tool(get_weather)]
    return await run_agent(
        prompt=prompt,
        tools=tools,
        model="claude-sonnet-4-20250514",
    )

if __name__ == "__main__":
    flyte.init_from_config()
    run = flyte.run(agent_task, prompt="What's the weather in San Francisco?")
    print(run.result)

Features

  • Convert Flyte tasks to Claude tool definitions automatically
  • Support for both sync and async tasks
  • Automatic type conversion from Python type hints to JSON schema
  • Integration with Flyte's task environment for secrets and resources

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_anthropic-2.5.7b1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file flyteplugins_anthropic-2.5.7b1-py3-none-any.whl.

File metadata

File hashes

Hashes for flyteplugins_anthropic-2.5.7b1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ef06b698f5370c16b10e4994f10bc7690a7370bca0cd4d8fd67feb471325180
MD5 f5eb104a32b2abb951b32a504b0237fa
BLAKE2b-256 24699bd07967b4f96d43ea3724e4ac7d12222d0f2603e693a803ee0c9fc4ab51

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