Gentoro Python SDK for AI tool execution and authentication
Project description
Gentoro Python SDK
Overview
Welcome to the Gentoro Python SDK documentation. This guide will help you integrate and use the SDK in your project.
Supported Python Versions
This SDK is compatible with Python >= 3.10.
Installation
To get started with the SDK, install it using pip:
pip install Gentoro==0.1.9
Authentication
The Gentoro API uses an API Key (X-API-Key) for authentication. You must provide this key when making API requests.
To obtain an API Key, register at Gentoro's API Portal.
Setting the API Key
When initializing the SDK, provide the configuration as follows:
import os
from Gentoro import Gentoro, SdkConfig, Providers
from dotenv import load_dotenv
import openai
# Load environment variables from .env file
load_dotenv()
# Initialize the Gentoro and OpenAI instances
_gentoro = Gentoro(SdkConfig(provider=Providers.OPENAI))
_openAI = openai.OpenAI()
# Define the OpenAI model we want to use
MODEL = 'gpt-4o-mini'
# Initial messages to OpenAI
messages = [{"role": "user", "content": "list 10 of my slack channels"}]
# Send message, along with available tools to OpenAI
openai_response = _openAI.chat.completions.create(
model=MODEL,
messages=messages,
tools=_gentoro.get_tools(os.getenv("GENTORO_BRIDGE_UID"), messages)
)
messages += _gentoro.run_tools(os.getenv("GENTORO_BRIDGE_UID"), messages, openai_response)
# Continue with communication with OpenAI
response = _openAI.chat.completions.create(
model=MODEL,
messages=messages,
tools=_gentoro.get_tools(os.getenv("GENTORO_BRIDGE_UID"), messages)
)
# Prints the response with the answer
print("final response",response.choices[0].message.content)
SDK Services
Methods
get_tools(bridge_uid: str, messages: Optional[List[Dict]] = None) -> List[Dict]
Fetches available tools for a specific bridge_uid.
Example usage:
tools = _gentoro.get_tools("BRIDGE_ID", messages=[])
print("Tools:", tools)
run_tools(bridge_uid: str, messages: List[Dict], tool_calls: List[Dict]) -> List[Dict]
Executes the tools requested by the AI model.
Example usage:
execution_result = _gentoro.run_tools("BRIDGE_ID", messages=[], tool_calls=tool_calls)
print("Execution Result:", execution_result)
Providers
A provider defines how the SDK should handle and generate content:
License
This SDK is licensed under the Apache-2.0 License. See the LICENSE file for more details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Gentoro-0.1.9.tar.gz.
File metadata
- Download URL: Gentoro-0.1.9.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc4dacbf2457bb495abdca8cea02022e16cccd70b73e2c1559ca9175f1fa55d2
|
|
| MD5 |
89a3f0f47f931c2bc50c457ad8c6570a
|
|
| BLAKE2b-256 |
968b7f95e00796e97a46538bb0dfef73b9ab89a36dbde5b20663e5b34e5a8de9
|
File details
Details for the file Gentoro-0.1.9-py3-none-any.whl.
File metadata
- Download URL: Gentoro-0.1.9-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c9d263c27667971a2264d7dd0bc8ee9981f1fa92c46106db96ef819946937a6
|
|
| MD5 |
c68dda2cc6161db0b36ed6c51ec164d7
|
|
| BLAKE2b-256 |
f80a176cc40d4533a2242d4cc77cb9d8884e0d10f34fc5fffbbf47b556c4158d
|