Skip to main content

Ask Sage Python Client API

Project description

Ask Sage Python Client

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')

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:

  • add_dataset
  • delete_dataset
  • assign_dataset
  • get_user_logs
  • get_user_logins
  • query
  • query_with_file
  • query_plugin
  • follow_up_questions
  • tokenizer
  • get_personas
  • get_datasets
  • get_plugins
  • count_monthly_tokens
  • count_monthly_teach_tokens
  • train
  • 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.0.51.tar.gz (5.8 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.0.51-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: asksageclient-1.0.51.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for asksageclient-1.0.51.tar.gz
Algorithm Hash digest
SHA256 08a3072e58e5860c2950599e7d8e7d51d0b07f110f73bb89d61e0ed685ecf409
MD5 2c84383dc291df2efb13335c34dfa35c
BLAKE2b-256 cdae15243a6f29cae2fb6118a0735c621d2cca2b1f0418c7a2e7fb28c47ce8cf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: asksageclient-1.0.51-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for asksageclient-1.0.51-py3-none-any.whl
Algorithm Hash digest
SHA256 b10e511912c1b5f0d3ddf2281a9e47f0cb1b02834d657b77e57e2b1d29d1fc46
MD5 8448e419a8da53d9f19e3d0da9234302
BLAKE2b-256 dc0d4ce29283cc77b18c91cc0d056b2fd3043eddf91de926152e6e53c02290f4

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