RapidaAI SDK to integrate rapida.ai APIs
Project description
Rapida Python SDK
The Rapida Python SDK provides a powerful interface for interacting with Rapida AI services. This SDK simplifies the process of making API calls, handling authentication, and managing responses from Rapida endpoints.
Installation
To install the Rapida Python SDK, use the following command:
pip install rapida-python
Quick Start
Here's how to get started with the Rapida Python SDK:
from rapida import ConnectionConfig
connection_config = ConnectionConfig.default_connection_config(
ConnectionConfig.with_sdk(
"{your-api-key-here}"
)
)
Authentication
You can configure the Rapida SDK to authenticate using your API Key or Personal Token:
Authenticating with API Key
import os
from rapida.connections import ConnectionConfig
connection_config = ConnectionConfig.default_connection_config(
ConnectionConfig.with_sdk(
os.environ["RAPIDA_API_KEY"] # API Key from environment variables
)
)
Authenticating with Personal Token
import os
from rapida.connections import ConnectionConfig
connection_config = ConnectionConfig.default_connection_config(
ConnectionConfig.with_personal_token(
os.environ["RAPIDA_AUTHORIZATION_TOKEN"], # Authorization Token
os.environ["RAPIDA_AUTH_ID"], # Authentication ID
os.environ["RAPIDA_PROJECT_ID"], # Project ID
)
)
Configuration Options
ConnectionConfig accepts multiple options for configuring the SDK:
with_sdk(api_key: str): Sets the API key for authentication.with_personal_token(auth_token: str, auth_id: str, project_id: str): Configures the connection for personal tokens.with_webplugin_client(api_key: str, user_id: Optional[str] = None): Configures web plugin client authentication.with_debugger(authorization: str, user_id: str, project_id: str): Configures debugger authentication.with_custom_endpoint(endpoint: Optional[dict] = None, debug: Optional[bool] = None): Overrides the default assistant, web, and endpoint API hosts.with_local(): Uses local service endpoints and insecure gRPC channels for local development.default_connection_config(auth): Creates aConnectionConfigwith the supplied auth metadata.
Example using custom endpoints:
from rapida import ConnectionConfig
connection_config = ConnectionConfig.default_connection_config(
ConnectionConfig.with_sdk("{your-api-key-here}")
).with_custom_endpoint(
{
"assistant": "assistant.example.com:50051",
"web": "api.example.com:50051",
"endpoint": "endpoint.example.com:50051",
}
)
Compatibility
This SDK requires Python 3.9 or later. Ensure your system meets this requirement:
python --version
To upgrade or specify a version, use the following command:
pip install --upgrade rapida-python
Conclusion
The Rapida Python SDK provides everything necessary to integrate seamlessly with Rapida AI services, offering flexible configuration and authentication options. With the examples provided, you should be able to get started quickly and make advanced API calls as needed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rapida_python-0.1.29.tar.gz.
File metadata
- Download URL: rapida_python-0.1.29.tar.gz
- Upload date:
- Size: 122.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
003c9b211eff7d38525055939854984c473024c00de754932398565efa2ceff3
|
|
| MD5 |
4175b92202e99969d4469e5e0eb93d40
|
|
| BLAKE2b-256 |
a60e5320e22ec67c827be948832291067e78af00b4649f047ae1bd388ea26224
|
File details
Details for the file rapida_python-0.1.29-py3-none-any.whl.
File metadata
- Download URL: rapida_python-0.1.29-py3-none-any.whl
- Upload date:
- Size: 162.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72abe64fcfa5ea7c3484eaa192302cc08e6a2e3a5034162ea4b0ea78392ea4e5
|
|
| MD5 |
9392359dd78b43df4573183d50f1d1b0
|
|
| BLAKE2b-256 |
da4b65edba1866ad927163970fc3dd9f79919a7f061d37234cb5552bb307455c
|