Skip to main content

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.7.

Installation

To get started with the SDK, install it using pip:

pip install -e .

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:

from Gentoro.Gentoro import Gentoro, SdkConfig, Authentication, AuthenticationScope, Providers

config = SdkConfig(
    api_key="your_api_key_here",  # Your Gentoro API Key
    base_url="https://stage.gentoro.com",  # Base URL where the Gentoro API is hosted
    auth_mod_base_url="https://stage.gentoro.com/auth",  # Authentication module base URL
    provider=Providers.OPENAI,
    authentication=Authentication(scope=AuthenticationScope.API_KEY)
)

gentoro_instance = Gentoro(config)
bridge_uid = "BRIDGE_ID"  # Example bridge UID

# Fetch tools
tools = gentoro_instance.get_tools(bridge_uid)
print("Fetched tools:", tools)

# Execute a tool
tool_calls = [
    {
        "id": "tool_123",
        "type": "function",
        "details": {"name": "example_tool", "arguments": "{}"}
    }
]

execution_result = gentoro_instance.run_tools(bridge_uid, messages=[], tool_calls=tool_calls)
print("Execution result:", execution_result)

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_instance.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_instance.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:

class Providers(str, Enum):
    OPENAI = "openai"
    ANTHROPIC = "anthropic"
    OPENAI_ASSISTANTS = "openai_assistants"
    VERCEL = "vercel"
    GENTORO = "gentoro"

License

This SDK is licensed under the Apache-2.0 License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Gentoro-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Gentoro-0.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file Gentoro-0.1.0.tar.gz.

File metadata

  • Download URL: Gentoro-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for Gentoro-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fd2d5e91afa585d4da817051fb9ee2a6ce635c79c83979de23d34fb14afd227b
MD5 eb0ba5295d27a3f86f87657549edf677
BLAKE2b-256 6a105579cf6a37792a26411bf6e3162cf3e1f8637ac2de4fe53cf1f5be479377

See more details on using hashes here.

File details

Details for the file Gentoro-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: Gentoro-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for Gentoro-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b94e8b69f6565e58086fd157889aec72bba7c75d68b26e51470ab06630c58b0c
MD5 200c96b913fc5af3f6260fdcdc616311
BLAKE2b-256 378554d43a2b9c276e75f8965d639909c7a7371df78a9b7c00ea275db1c39078

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