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 Gentoro==0.1.2

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 import Gentoro, SdkConfig, Authentication, AuthenticationScope, Providers

config = SdkConfig(
    api_key="your_api_key_here",  # Your Gentoro API Key
    base_url="https://gentoro.com",  # Base URL where the Gentoro API is hosted
    auth_mod_base_url="https://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.3.tar.gz (10.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.3-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Gentoro-0.1.3.tar.gz
  • Upload date:
  • Size: 10.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.3.tar.gz
Algorithm Hash digest
SHA256 dfa14300f0f3195fc97614ecbaa303ee338a34b794dc0ea9f7c33fdda2e7ea62
MD5 e63b1ccf70d676815203d197ea698039
BLAKE2b-256 931a448122659bff00fc801358489a020c49d7d093dadae7f62d383445131883

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Gentoro-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.0 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 65b98dc0f02120f4f15824e9f32a92790c659ab1cef8bebfb6b5f97bc29a7aa2
MD5 ca897dba0904309cbe5542e7827ce71b
BLAKE2b-256 6d3f5c09037f9a89da40e816bc484f2e14aaa35a8a79e3542c2c975d639ba137

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