A module for integrating various GPT models for diverse tasks.
Project description
GPTIntegration
GPTIntegration is a Python module for integrating GPT models from OpenAI into your projects. It simplifies querying GPT models by handling the setup, communication, and response parsing with the OpenAI API, enabling easy integration and efficient interaction with GPT models.
Installation
To install GPTIntegration, you can use pip:
pip install GPTIntegration
Usage
As a Python Module
You can use GPTIntegration as a module in your Python scripts.
Example:
from gptintegration import GPTIntegration
# Initialize the integration with your OpenAI API key
gpt_integration = GPTIntegration('your-openai-api-key')
# Prepare messages
system_message = "Your system message goes here."
user_messages = ["Your prompt or user message goes here."]
# Query GPT and get the response
response = gpt_integration.query_gpt(system_message, user_messages)
print(response)
Customizing Your Query
You can customize your query by adjusting the initialization parameters of the GPTIntegration class, such as model, temperature, max tokens, and others to fit the specific needs of your application or to tweak the behavior of the GPT model.
Output Example
When you query GPT using GPTIntegration, it sends the system and user messages to the specified GPT model and returns the model's response. Here is an example output:
{
"id": "example-response-id",
"object": "text_completion",
"created": 123456789,
"model": "gpt-3.5-turbo",
...,
"choices": [
{
"text": "Response from the GPT model based on the provided messages...",
"index": 0,
"logprobs": null,
"finish_reason": "length"
}
]
}
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
License
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file GPTIntegration-0.0.7.tar.gz.
File metadata
- Download URL: GPTIntegration-0.0.7.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0571e1644a5e9ac64eabae6fdff6d7d6a169857d2f1174e3d2ab43d22753c08a
|
|
| MD5 |
50709d647510534dac7fd6b703d8fbfe
|
|
| BLAKE2b-256 |
1058a78b68fa3ea31e805a2442203048d5cccb7ff054587407e50bc28e44c95f
|
File details
Details for the file GPTIntegration-0.0.7-py3-none-any.whl.
File metadata
- Download URL: GPTIntegration-0.0.7-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01c6989a7826d791deca0a507e22a784298098c75c9fd736ea928f84426631b9
|
|
| MD5 |
9f4992a1e4024f54df69f8d945f8c15e
|
|
| BLAKE2b-256 |
960681006dfd50b8193fa7da78cdacf1bb25b2234182fe1aa502360f51f58d3a
|