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.4.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.4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: Gentoro-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 414778f646016fc30e8b69a436a9ade4fe4a76e1cb720783c583f4f8cf4d7c0c
MD5 ed0b0e42c4365c26eeb21bb75685ca2d
BLAKE2b-256 5ae1796e7fdf35a1e3e7574eef6d16d6fcd2dfe65d5e8530dbf5df6bc7fe2338

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Gentoro-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 39147e3b900da663a508184eefa886ab846b9a0538da357ab9f839bdee387395
MD5 163d2b0ae8c6ea7555849cfd9b048ee6
BLAKE2b-256 19f9af5652b48cb06435aaeca2a32d09f52a4203803946ad246b3861a70a9ab8

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