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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for flyteplugins_gemini-2.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 69904f0d5806bd1ec790dfd6e4db03a3fa846f37a4d767da2c821124e508be72
MD5 b9d0e2587c2c24c83cf4fb05a55e5415
BLAKE2b-256 047defe13cfbb792b2372d5fda148787f3e5245f4e23a75aeb0c61d057fd2500

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