Toolbox For Using Gemini Agents SDK
Project description
SDK For Simplified usage of Gemini Agents. Give Gemini Ability to use your custom functions in seveal code lines:
import vertexai
from vertexai.generative_models import (
GenerativeModel,
)
from gemini_toolbox import declarations
from gemini_toolbox import client
def get_current_time():
"""returns current time"""
return "6pm PST"
def say_to_duck(say):
"""say something to a duck"""
return f"duck answer is: duck duck {say} duck duck duck"
all_functions_tools = declarations.generate_tool_from_functions([get_current_time, say_to_duck])
vertexai.init(project="model-registry-v2", location="us-west1")
model = GenerativeModel(model_name="gemini-1.5-pro", tools=[all_functions_tools])
client = client.GeminiChatClient([get_current_time, say_to_duck], model, debug=True)
print(client.send_message("say to the duck message: I am hungry"))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gemini_toolbox-0.2.0.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for gemini_toolbox-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09606ad54ee736549a688664427caa4dc39659882e6d58eb2a13faafaf90e261 |
|
MD5 | 95d06d628a4a7d8dbadbdb3695b19272 |
|
BLAKE2b-256 | 3cecc607bc3ea77f2448fd23b0b7c17a1be29b4d6c1ab3b9e3e4dad487e6f91e |