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://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.1.tar.gz (9.5 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.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Gentoro-0.1.1.tar.gz
  • Upload date:
  • Size: 9.5 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.1.tar.gz
Algorithm Hash digest
SHA256 bfc5e9fdba092ac786da997e011f723c32158af2b8741e1eb3d9ce2fbe646626
MD5 4940439bcb0d4dde80ffcc173e7cafe0
BLAKE2b-256 ce9bb6ae960252ca765f3649cca01c58e57d699c4606dbb3944f472017722dec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Gentoro-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e28c3da7e66de5a7f4cea1aed8bb36e3781efae8739ae8ac47cf450d21e303e
MD5 dfaac0a8c6ca010ffaf4b0890bde4bd2
BLAKE2b-256 123c883cdf3b264cd47776be31637df4fdd57903efdf88fea701f94a8a7c4b85

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