Metis Python Client
This Python client is designed to provide developers with a seamless integration into the Metisai api platform, enabling the efficient management and customization of generative AI-driven chatbots and image generation models.
Features
- API Integration: Easy access to Metis'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 Metis Python Client, run the following command:
pip install metisai
Usage
Session
Here’s a quick example of how to use the client to interact with Metis:
import metisai
# Initialize the client
metisbot = metisai.MetisBot(api_key=METIS_API_KEY, bot_id=METIS_BOT_ID)
# Initialize a session
session = metisbot.create_session()
message = metisbot.send_message(session, "Suggest me a list of 5 gifts for a 30 years boy who is tech-fan.")
print(message.content)
message2 = metisbot.send_message(session, "What if he is a book lover?")
print(message2.content)
# Delete a session
metisbot.delete_session(session)
Async
Here’s an example of async operation (this is not asyncio):
import metisai
# Initialize the client
metisbot = metisai.MetisBot(api_key=METIS_API_KEY, bot_id=METIS_BOT_ID)
prompt = "Suggest me a list of 5 gifts for a 30 years boy who is tech-fan."
session = metisbot.create_session()
task = metisbot.send_message_async(session, prompt)
while True:
task_result = metisbot.retrieve_async_task(session, task)
if task_result.status == "FINISHED":
break
time.sleep(1)
print(task_result.message.content)
print()
metisbot.delete_session(session)
Stream
Here’s an example of stream usage:
import metisai
# Initialize the client
metisbot = metisai.MetisBot(api_key=METIS_API_KEY, bot_id=METIS_BOT_ID)
prompt = "Suggest me a list of 5 gifts for a 30 years boy who is tech-fan."
stream = metisbot.stream_messages(
session, prompt, split_criteria={"line": True}
)
for message in stream:
print(message.message.content)
metisbot.delete_session(session)
Configuration
Before using the client, ensure you configure it with your API key:
metisbot = metisai.MetisBot(api_key=METIS_API_KEY, bot_id=METIS_BOT_ID)
Documentation
For more detailed information about the client's methods and additional functionalities, refer to the Metis Documentation.
Support
If you encounter any issues or have questions, please contact hello@metisai.ir.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for metisai 0.4.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| metisai-0.4.6.tar.gz | 17.9 kB | Without provenance | Details for metisai-0.4.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| metisai-0.4.6-py3-none-any.whl | Python 3 | none | any | Details for metisai-0.4.6-py3-none-any.whl |
Total release size: 34.7 kB
Release files / metisai-0.4.6.tar.gz
| Download URL | metisai-0.4.6.tar.gz |
|---|---|
| Size | 17.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
715d359f6e1623c9f7f769d23f7d373b66921f8596073a0acde9c22d8d0a92de
|
|
BLAKE2b-256 checksum How to use checksums |
ecf2109bb0c572af8c8458f0e2aaf118ee0031f36382ce00392242d6efbb560c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / metisai-0.4.6-py3-none-any.whl
| Download URL | metisai-0.4.6-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b26dc0c2ef1e86a64657adb83490bed879018618b4b4d9d7b00c28a6beccd13c
|
|
BLAKE2b-256 checksum How to use checksums |
db552c0f04277071f92a79ab9ac85f540a58ea709d53303f11784d06e58844e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for metisai 0.4.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.