A Python package designed to provide direct inline support for developers. It integrates GPT (Generative Pre-trained Transformer) functionality directly into Python applications, enabling developers to handle errors effectively by suggesting appropriate changes.
Project description
InlineGPT
InlineGPT is a Python package that integrates Google's Generative AI models directly into your Python applications to provide inline error handling and suggestions for code corrections.
Installation
You can install InlineGPT via pip:
pip install InlineGPT
Getting Started
To use InlineGPT, you need to obtain an API key from Google AI Studio.
Example Usage
from inline.inlinegpt import InlineGPT
import os
# Initialize your API KEY
gpt = InlineGPT(os.environ.get('G_API_KEY'))
try:
result = 10 / 0
except ZeroDivisionError as e:
print(f"Error: {e}")
gpt.get_solution("test.py", e)
Output
The get_solution
method analyzes the code in file_name
and the provided error_message
, then generates a response suggesting how to resolve the error using Google's Generative AI models.
Contributing
We welcome contributions to InlineGPT! Please fork the repository and submit pull requests to contribute.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Issues
If you encounter any issues with InlineGPT or have suggestions for improvements, please open an issue on GitHub.
Additional Notes:
- Dependencies: InlineGPT relies on
google.generativeai
for its AI capabilities. Ensure you have the necessary permissions and API key from Google AI Studio. - Error Handling: If the API key is invalid or not provided, InlineGPT will raise an initialization error.
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
File details
Details for the file inlinegpt-0.1.0.tar.gz
.
File metadata
- Download URL: inlinegpt-0.1.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52e5829c5802ee2480ab2640c6375afce0bebfdef1c2e911c0d9696348e5519f |
|
MD5 | 56f98d6dfe92f2364e9725bbf3c80862 |
|
BLAKE2b-256 | f66b6e018d8f8cc18e1438ea8b8d66912f211334dc953ecc497905ce859a8bfa |
File details
Details for the file InlineGPT-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: InlineGPT-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1b6febb4f05a5eef7a036d488e74a658af896ce3e862a060a2c8711e3d7eae8 |
|
MD5 | 479daf5b6726a8fd2ff6a3fd4e64c4e7 |
|
BLAKE2b-256 | 8cc27f795a366b88f5a4b46d645760d5439e7511c9398c1ba15d964023a6fde3 |