Ask Sage Python Client API
Project description
Ask Sage Python Client v1.2.4
This is the official Python client for the Ask Sage API. It allows you to interact with the Ask Sage service, providing a simple and pythonic way to make requests to the service.
Check Ask Sage API documentation here:
Ask Sage User API: https://app.swaggerhub.com/apis-docs/NICOLASCHAILLAN_1/user-api/1.0
Ask Sage Server API: https://app.swaggerhub.com/apis-docs/NICOLASCHAILLAN_1/server_ask-sage_api/1.0
Installation
You can install the Ask Sage Python client via pip:
pip install asksageclient
Usage
First, import the client:
from asksageclient import AskSageClient
Then, instantiate the client:
client = AskSageClient('your_email_here', 'your_api_key_here') Warning: Do not store credentials in code, use environment variables/secrets instead
Now, you can use the client to interact with the Ask Sage service. For example, to interact with the main endpoint:
response = client.query(message='Who is Nic Chaillan?')
print(response)
Endpoints
The client provides methods for all the Ask Sage API endpoints:
get_models
add_dataset
delete_dataset
assign_dataset
get_user_logs
get_user_logins
query
query_plugin
execute_plugin
follow_up_questions
tokenizer
get_personas
get_datasets
get_plugins
count_monthly_tokens
count_monthly_teach_tokens
train
train_with_file
file
Each method corresponds to an endpoint of the Ask Sage API. The content
parameter should be a dictionary containing the data you want to send in the request body.
Error Handling
The client includes basic error handling. If a request fails, it will print an error message and return None
.
Contributing
Contributions are welcome! Please submit a pull request or create an issue to contribute to this project.
License
See the LICENSE file for 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
Built Distribution
File details
Details for the file asksageclient-1.2.4.tar.gz
.
File metadata
- Download URL: asksageclient-1.2.4.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bac2daf8f39d5808c3fa56555191043ae3150eb08533ffab55df041e795a688f |
|
MD5 | 2b92cbee0f27fc68f613f2d43eafe7a3 |
|
BLAKE2b-256 | 2c7cbc27b513aa8e3abfc0b5166cb30cdab8ae52b41a24edf971a873787ce91f |
File details
Details for the file asksageclient-1.2.4-py3-none-any.whl
.
File metadata
- Download URL: asksageclient-1.2.4-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfcc52355fd4e1e00d5ad81daa0a2a07b3e299556f6d04b5131baf2547806f7e |
|
MD5 | c8991aa4b69854918aee1425ec820a90 |
|
BLAKE2b-256 | c0011eb71a45e9beeb13c9b5bb7e017b0f2204209c421cc8bc78075110fc73f8 |