Skip to main content

A Python client for Tapsage to streamline API interactions, enabling easy management and customization of AI-driven chatbots and image models.

Project description

Tapsage Python Client

This Python client is designed to provide developers with a seamless integration into the Tapsage platform, enabling the efficient management and customization of generative AI-driven chatbots and image generation models.

Features

  • API Integration: Easy access to Tapsage's API endpoints for model selection, configuration, and management.
  • Model Customization: Tools to customize and fine-tune large language models (LLMs) for text and image generation according to specific requirements.
  • Monitoring: Capabilities to monitor the performance and quality of AI models, ensuring optimal functionality.
  • Simplified Deployment: Streamlined processes for transitioning from model development to production.

Installation

To install the Tapsage Python Client, run the following command:

pip install tapsage-client

Usage

Session

Here’s a quick example of how to use the client to interact with Tapsage:

import tapsage

# Initialize the client
tapbot = tapsage.TapSageBot(api_key=TAPSAGE_API_KEY, bot_id=TAPSAGE_BOT_ID)

# Initialize a session
session = tapbot.create_session()
message = tapbot.send_message(session, "Suggest me a list of 5 gifts for a 30 years boy who is tech-fan.")
print(message.content)
message2 = tapbot.send_message(session, "What if he is a book lover?")
print(message2.content)

# Delete a session
tapbot.delete_session(session)

Async

Here’s an example of async operation:

import tapsage

# Initialize the client
tapbot = tapsage.TapSageBot(api_key=TAPSAGE_API_KEY, bot_id=TAPSAGE_BOT_ID)

prompt = "Suggest me a list of 5 gifts for a 30 years boy who is tech-fan."
session = tapbot.create_session()
task = tapbot.send_message_async(session, prompt)

while True:
    task_result = tapbot.retrieve_async_task(session, task)
    if task_result.status == "FINISHED":
        break
    time.sleep(1)
print(task_result.message.content)
print()
tapbot.delete_session(session)

Stream

Here’s an example of stream usage:

import tapsage

# Initialize the client
tapbot = tapsage.TapSageBot(api_key=TAPSAGE_API_KEY, bot_id=TAPSAGE_BOT_ID)

prompt = "Suggest me a list of 5 gifts for a 30 years boy who is tech-fan."
stream = tapbot.stream_messages(
    session, prompt, split_criteria={"line": True}
)
for message in stream:
    print(message.message.content)
tapbot.delete_session(session)

Configuration

Before using the client, ensure you configure it with your API key:

tapbot = tapsage.TapSageBot(api_key=TAPSAGE_API_KEY, bot_id=TAPSAGE_BOT_ID)

Documentation

For more detailed information about the client's methods and additional functionalities, refer to the Tapsage Documentation.

Support

If you encounter any issues or have questions, please contact hello@tapsage.com.

License

This project is licensed under the MIT 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

tapsage_client-0.10.1.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

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

tapsage_client-0.10.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file tapsage_client-0.10.1.tar.gz.

File metadata

  • Download URL: tapsage_client-0.10.1.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for tapsage_client-0.10.1.tar.gz
Algorithm Hash digest
SHA256 2ea57b19839cc7a0b89a1bb73816a878948c4d31832bf9e610991644a39c0ec8
MD5 50250c731484f2588b718e7db8223247
BLAKE2b-256 667700f49c406910049c66d7f8b51e59af3c237f76da05a4b55b0be92873b6e7

See more details on using hashes here.

File details

Details for the file tapsage_client-0.10.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tapsage_client-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 473fdfe514d2bfee599132d76c3661d3de58c875fea9c9410f3e18e28a681aa4
MD5 b5c9f4d2abd231f06837c5697c8b138a
BLAKE2b-256 1b794439ca4e0ab5bc4df1c4d0f444dca0393266c31f7a31dfa5e85b9f21a960

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