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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for flyteplugins_gemini-2.3.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ccb51e2b5d098498616f2d3528e307000552b93d620017d11fcaa68e112b439
MD5 0c48619891ab7715cdb8f54e1da5fc87
BLAKE2b-256 cc7b9d3dedb2decceafa8dd9f11cdbae0b85c1a300253631aceeadd59570e9cc

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