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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for flyteplugins_gemini-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e940c17b09c162f33b2379d9cc312b20700d858f38cf149fd1d9a833d1d9b5a2
MD5 9bedb980ca18637c62059679a0d18dd6
BLAKE2b-256 998fe02b09fdc5dd67aad8ba7c752fec4dfb504d84691c5e22afea4a0d3e57f9

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