Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Aipolabs Python SDK

PyPI version

The official Python SDK for the Aipolabs API. Currently in private beta, breaking changes are expected.

The Aipolabs Python SDK provides convenient access to the Aipolabs REST API from any Python 3.10+ application.

Documentation

The REST API documentation is available here.

Installation

pip install aipolabs

or with poetry:

poetry add aipolabs

Usage

Aipolabs platform is built with agent-first principles. Although you can call each of the APIs below any way you prefer in your application, we strongly recommend trying the Agent-centric features and taking a look at the examples to get the most out of the platform and to enable the full potential and vision of future agentic applications.

Client

from aipolabs import Aipolabs

client = Aipolabs(
    # it reads from environment variable by default so you can omit it if you set it in your environment
    api_key=os.environ.get("AIPOLABS_API_KEY")
)

Apps

Types

from aipolabs.types.apps import App, AppDetails

Methods

# search for apps, returns list of basic app data, sorted by relevance to the intent
# all parameters are optional
apps: list[App] = client.apps.search(intent="I want to search the web", limit=10, offset=0)
# get detailed information about an app, including functions supported by the app
app_details: AppDetails = client.apps.get(app_name="BRAVE_SEARCH")

Functions

Types

from aipolabs.types.functions import Function, FunctionExecutionResult

Methods

# search for functions, returns list of basic function data, sorted by relevance to the intent
# all parameters are optional
functions: list[Function] = client.functions.search(
    app_names=["BRAVE_SEARCH", "TAVILY"],
    intent="I want to search the web",
    limit=10,
    offset=0
)
# get function definition of a specific function, this is the schema you can feed into LLM
# the actual format is defined by the inference provider, currently only openai is supported
function_definition: dict = client.functions.get(function_name="BRAVE_SEARCH__WEB_SEARCH")
# execute a function with the provided parameters
result: FunctionExecutionResult = client.functions.execute(
    function_name="BRAVE_SEARCH__WEB_SEARCH",
    function_parameters={"query": "what is the weather in barcelona"}
)

if result.success:
    print(result.data)
else:
    print(result.error)

Agent-centric features

The SDK provides a suite of features and helper functions to make it easier and more seamless to use functions in LLM powered agentic applications. This is our vision and the recommended way of trying out the SDK.

Meta Functions and Unified Function Calling Handler

We provide 4 meta functions that can be used with LLMs as tools directly, and a unified handler for function calls. With these the LLM can discover apps and functions (that our platform supports) and execute them autonomously.

from aipolabs import meta_functions

# meta functions
tools = [
    meta_functions.AipolabsSearchApps.SCHEMA,
    meta_functions.AipolabsSearchFunctions.SCHEMA,
    meta_functions.AipolabsGetFunctionDefinition.SCHEMA,
    meta_functions.AipolabsExecuteFunction.SCHEMA,
]
# unified function calling handler
result = client.handle_function_call(
    tool_call.function.name, json.loads(tool_call.function.arguments)
)

There are mainly two ways to use the platform with the meta functions:

Please also see agent_with_preplanned_tools.py for comparison where the specific functions are pre selected and provided to the LLM.

Metadata

Release files for aipotheosislabs 0.0.1b3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aipotheosislabs 0.0.1b3
File Size Uploaded Provenance Actions
aipotheosislabs-0.0.1b3.tar.gz 12.7 kB Without provenance Details for aipotheosislabs-0.0.1b3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aipotheosislabs 0.0.1b3
File Interpreter ABI Platform Actions
aipotheosislabs-0.0.1b3-py3-none-any.whl Python 3 none any Details for aipotheosislabs-0.0.1b3-py3-none-any.whl

Total release size: 30.0 kB

Release files / aipotheosislabs-0.0.1b3.tar.gz

Download URL aipotheosislabs-0.0.1b3.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fcbe9fece3503e3522de4b62be5966083ab5aafda56e34655ff55dd6bb9854b9
BLAKE2b-256 checksum
How to use checksums
fb55d92792110e91d3eda70773a25caa40692d0cd15c706bc058bf90ca3a3a99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.13.0 Darwin/23.6.0

Release files / aipotheosislabs-0.0.1b3-py3-none-any.whl

Download URL aipotheosislabs-0.0.1b3-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
806f5b48ac4a3cee90360f7d1e27bc587c1d9dd5381fb52b59c7791a85c519d2
BLAKE2b-256 checksum
How to use checksums
c74b8a8b5cd99f87f01545c8bbd87fab5bfe08d660ad412d900bd7c0f0bcc0e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.13.0 Darwin/23.6.0

Security for aipotheosislabs 0.0.1b3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page