Skip to main content

Google Gemini plugin for flyte

Project description

Flyte Gemini Plugin

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

Installation

pip install flyteplugins-gemini

Usage

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

env = flyte.TaskEnvironment(
    "gemini-agent",
    secrets=[flyte.Secret(key="google_api_key", as_env_var="GOOGLE_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="gemini-2.5-flash",
    )

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 Gemini 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

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_gemini-2.3.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file flyteplugins_gemini-2.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flyteplugins_gemini-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcd8dfb2639a6eb1abfb7dd61f6ab6d01d7bad993e373ab2acb9db27c2913113
MD5 6b95b9f2dfa89415fad70837cb9bb515
BLAKE2b-256 3a7828b6f4b3b9f94bd956fc6454f5818a194465b524a320bfad1999c4c3eeda

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