Integration utility for Mistral AI API to provide GPT-based functionalities.
Project description
MistralGPTIntegration
MistralGPTIntegration
is a Python package designed to provide GPT-based functionalities using the Mistral AI API. It enables users to quickly obtain comprehensive, context-aware responses from the GPT model.
Installation
To install MistralGPTIntegration
, you can use pip:
pip install MistralGPTIntegration
Usage
After installation, MistralGPTIntegration
can be used in your Python scripts.
Example:
from mistralgptintegration import MistralGPTIntegration
api_key = "<your_api_key>"
mistral = MistralGPTIntegration(api_key)
prompt = "Once upon a time"
response = mistral.query_gpt(prompt)
print(response)
api_key
: Your Mistral API key.model_name
: The name of the Mistral model to use. Defaults tomistral-tiny
.temperature
: The temperature to use for the model. Defaults to0.1
.top_p
: The top_p to use for the model. Defaults to1.0
.max_tokens
: The maximum number of tokens to generate. Defaults to150
.
Customizing Your Queries
You can customize the behavior of MistralGPTIntegration
by adjusting the parameters, such as the temperature, top_p, max_tokens, etc., to fit the specific needs of your queries or to tweak the behavior of the Mistral model.
Output Example
When you query the GPT model, it processes your prompt and returns a response. Here is an example of the output:
{
"id": "chatcmpl-2nZBPOX2WU3DKseoZ2A4TnEgFr2Ve",
"object": "chat.completion",
"created": 1623792013,
"model": "gpt-3.5-turbo",
"usage": {
"prompt_tokens": 56,
"completion_tokens": 31,
"total_tokens": 87
},
"choices": [
{
"message": {
"role": "assistant",
"content": "in a land far, far away, there lived a kind and just king. He ruled his kingdom with wisdom and courage, beloved by his people. His name was King Arthur."
},
"finish_reason": "stop",
"index": 0
}
]
}
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
License
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
Hashes for MistralGPTIntegration-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5043562de9d0e15f7096d4427e3cf526691060f6d89d1c56836a2b3f86c6651a |
|
MD5 | 410016a8d7d7548fa815b209a629429c |
|
BLAKE2b-256 | 0935a2dffae849b270212cc6b8584f1c06ed685de141c7e3433ac0c98159da1d |
Hashes for MistralGPTIntegration-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cee3c9297424a8f3dde010790a38a59a386b4e1bb362d5b1bacb470fb7c84d7 |
|
MD5 | fa1e652fa94fec380fb3bacaa8b130ea |
|
BLAKE2b-256 | 72728896bd4e2d33d6e1a68845331d5a4d8e358cdbc62c9a00bea32045c321f3 |