[](https://badge.fury.io/py/MistralGPTIntegration)
[](https://opensource.org/licenses/MIT)
[](https://pepy.tech/project/MistralGPTIntegration)
# 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:
```bash
pip install MistralGPTIntegration
```
## Usage
After installation, `MistralGPTIntegration` can be used in your Python scripts.
Example:
```python
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 to `mistral-tiny`.
- `temperature`: The temperature to use for the model. Defaults to `0.1`.
- `top_p`: The top_p to use for the model. Defaults to `1.0`.
- `max_tokens`: The maximum number of tokens to generate. Defaults to `150`.
## 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:
```json
{
"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](https://github.com/chigwell/MistralGPTIntegration/issues).
## License
[MIT](https://choosealicense.com/licenses/mit/)
Raw data
{
"_id": null,
"home_page": "https://github.com/chigwell/MistralGPTIntegration",
"name": "MistralGPTIntegration",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Eugene Evstafev",
"author_email": "chigwel@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ea/9c/3ce95bb59c78752f7ae230ffa622d485b22a5124b2bf1d8633a717041a2f/MistralGPTIntegration-0.0.3.tar.gz",
"platform": null,
"description": "[](https://badge.fury.io/py/MistralGPTIntegration)\n[](https://opensource.org/licenses/MIT)\n[](https://pepy.tech/project/MistralGPTIntegration)\n\n# MistralGPTIntegration\n\n`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.\n\n## Installation\n\nTo install `MistralGPTIntegration`, you can use pip:\n\n```bash\npip install MistralGPTIntegration\n```\n\n## Usage\n\nAfter installation, `MistralGPTIntegration` can be used in your Python scripts.\n\nExample:\n\n```python\nfrom mistralgptintegration import MistralGPTIntegration\n\napi_key = \"<your_api_key>\"\nmistral = MistralGPTIntegration(api_key)\nprompt = \"Once upon a time\"\nresponse = mistral.query_gpt(prompt)\nprint(response)\n```\n\n- `api_key`: Your Mistral API key.\n- `model_name`: The name of the Mistral model to use. Defaults to `mistral-tiny`.\n- `temperature`: The temperature to use for the model. Defaults to `0.1`.\n- `top_p`: The top_p to use for the model. Defaults to `1.0`.\n- `max_tokens`: The maximum number of tokens to generate. Defaults to `150`.\n\n## Customizing Your Queries\n\nYou 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.\n\n## Output Example\n\nWhen you query the model, it processes your prompt and returns a response. Here is an example of the output:\n\n```json\n{\n \"id\": \"63213d34c61f4d96b893d7b1afc2b893\",\n \"object\": \"chat.completion\",\n \"created\": 1706372087,\n \"model\": \"mistral-small\",\n \"choices\": [\n {\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"some text\"\n },\n \"finish_reason\": \"stop\",\n \"index\": 0\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 318,\n \"total_tokens\": 622,\n \"completion_tokens\": 304\n }\n}\n```\n\n## Contributing\n\nContributions, issues, and feature requests are welcome! Feel free to check [issues page](https://github.com/chigwell/MistralGPTIntegration/issues).\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n",
"bugtrack_url": null,
"license": null,
"summary": "Integration utility for Mistral AI API to provide GPT-based functionalities.",
"version": "0.0.3",
"project_urls": {
"Homepage": "https://github.com/chigwell/MistralGPTIntegration"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a8ff389736d14e199378608bee9d20a3fd9d949ec7c3dc20298e8651f97d5f04",
"md5": "e5e6a7414d3bebced5b0123c0997770e",
"sha256": "8bf6a077d3bda8d185d33a386cb000d6f38f7e859bf2cd75dbf3fbeccb6e91ad"
},
"downloads": -1,
"filename": "MistralGPTIntegration-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e5e6a7414d3bebced5b0123c0997770e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 5122,
"upload_time": "2024-04-12T13:23:22",
"upload_time_iso_8601": "2024-04-12T13:23:22.535227Z",
"url": "https://files.pythonhosted.org/packages/a8/ff/389736d14e199378608bee9d20a3fd9d949ec7c3dc20298e8651f97d5f04/MistralGPTIntegration-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ea9c3ce95bb59c78752f7ae230ffa622d485b22a5124b2bf1d8633a717041a2f",
"md5": "9cc975e60e1961cc9137cf609bc65ba7",
"sha256": "dd1b31412422672c92214412e843aeeafab6a8bbcbca139f3890bba912183515"
},
"downloads": -1,
"filename": "MistralGPTIntegration-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "9cc975e60e1961cc9137cf609bc65ba7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4167,
"upload_time": "2024-04-12T13:23:24",
"upload_time_iso_8601": "2024-04-12T13:23:24.608438Z",
"url": "https://files.pythonhosted.org/packages/ea/9c/3ce95bb59c78752f7ae230ffa622d485b22a5124b2bf1d8633a717041a2f/MistralGPTIntegration-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-12 13:23:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "chigwell",
"github_project": "MistralGPTIntegration",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mistralgptintegration"
}