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 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 model, it processes your prompt and returns a response. Here is an example of the output:
{
"id": "63213d34c61f4d96b893d7b1afc2b893",
"object": "chat.completion",
"created": 1706372087,
"model": "mistral-small",
"choices": [
{
"message": {
"role": "assistant",
"content": "some text"
},
"finish_reason": "stop",
"index": 0
}
],
"usage": {
"prompt_tokens": 318,
"total_tokens": 622,
"completion_tokens": 304
}
}
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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 736f18bfb603f5e0251db2d488c15fb26d44d7d77d311538136a9b0ec4eb46d4 |
|
MD5 | 860e048d3d11fcd163de0b186c171b0b |
|
BLAKE2b-256 | 6590889119c6082feda792e871816a182af94fdd07189651ceb85d2cd80661e2 |
Hashes for MistralGPTIntegration-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d111b1d9c6e64f6b00e9d10cd600719c8f741e009d679820aab6423e607b6b21 |
|
MD5 | b7375d7fb491922b88fbb2c73a278160 |
|
BLAKE2b-256 | ecd52a3aafb0da732474d9f69c88d00bf68d7db9ac9b3c22b688233d21223a9c |