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
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
File details
Details for the file tapsage_client-0.9.0.tar.gz
.
File metadata
- Download URL: tapsage_client-0.9.0.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6921e7d9b4b70b6763c509e135465f2e33c5a825bdb2bbc6ec0d8da23edbb6fc |
|
MD5 | 27d3550c8be553ee5054e6d75df9f241 |
|
BLAKE2b-256 | 14e9aa8bd3e2e8c75b8a2dda18c8b5b589a1d8852a42a7a88feed5fc3c77f961 |
File details
Details for the file tapsage_client-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: tapsage_client-0.9.0-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87b588b3cc180518db4c0bc33a05c64a794322a42ae7afb965fb25e85c1e02b2 |
|
MD5 | e83abeea047479755c2124328d1df3a8 |
|
BLAKE2b-256 | 38342964b4e32ae77a88c66e079360119c8ccca485273012acf0ed1a73bcf03e |