Skip to main content

Ask Sage Python Client API

Project description

Ask Sage Python Client v1.31

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: https://docs.asksage.ai

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

asksageclient-1.31.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asksageclient-1.31-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file asksageclient-1.31.tar.gz.

File metadata

  • Download URL: asksageclient-1.31.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for asksageclient-1.31.tar.gz
Algorithm Hash digest
SHA256 80a56b2bd7939cd1b40388ddb793253708a1b0575c683214b882a9ac0b135ed2
MD5 4e2016e63e356f6f3c826c32894bb68a
BLAKE2b-256 5eea613c478497d2ea768c74697e3c8c925e0c599272ebee18997c897967cee7

See more details on using hashes here.

File details

Details for the file asksageclient-1.31-py3-none-any.whl.

File metadata

  • Download URL: asksageclient-1.31-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for asksageclient-1.31-py3-none-any.whl
Algorithm Hash digest
SHA256 7f1e454504ea75bb929e4c07d978e2b8e68d96412c22e8165cb1fcd4bcd94ff7
MD5 22dcfbd4a87128f045a5e912723105ab
BLAKE2b-256 686ff7a067c67e9c7b556ac33340de61f0c63323d7550116cd5cac3b4f32caa6

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