# LiteGPT
LiteGPT is a simple Python library designed for interacting with APIs, enabling text query submission and image generation in a chat format. It supports saving chat history and configuring an HTTP client with the option to use HTTP/2 for faster data transfer. The library is built with a simplified interface, making it easy to integrate with various chatbots or user applications working with generative AI.
## Features
- **Text Queries:** The `ask` method sends user queries to the API and processes the response. It includes support for message history, allowing continuous dialogue.
- **Image Generation:** The `image` method sends a text description to generate an image and returns the result in JSON format.
- **Message History Management:** The library supports working with message history through the external `History` class, making it easy to track the conversation and improve the user experience.
## Documentation
For detailed documentation on how to use LiteGPT, please refer to the official documentation:
[LiteGPT Documentation](https://red-3.gitbook.io/litegpt)
## Installation
You can install the `LiteGPT` library from PyPI using `pip`:
```bash
pip install litegpt
```
## Usage
**Text Queries**
The ask function allows you to send a query to the AI chat and receive a response while maintaining chat history.
```python
from litegpt import LiteGPT
# Initialize LiteGPT and send a query
bot = LiteGPT()
response = bot.ask("Your query here...")
print(response)
```
**Text Queries Async**
```python
from litegpt import AsyncLiteGPT
import asyncio
async def main():
# Initialize LiteGPT and send a query
bot = AsyncLiteGPT()
response = await bot.ask("Your query here...")
print(response)
asyncio.run(main())
```
Raw data
{
"_id": null,
"home_page": "https://github.com/RedPiarOfficial/LiteGPT",
"name": "litegpt",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "artificial-intelligence, ai, lite, gpt, assistant, chatbot, image-generator",
"author": "RedPiar",
"author_email": "Redpiar.official@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/db/a0/5204d93d35179d8821bea4756b8efa6e50ea9010acb6ea667254310d1c4e/litegpt-1.3.3.tar.gz",
"platform": null,
"description": "# LiteGPT\r\n\r\nLiteGPT is a simple Python library designed for interacting with APIs, enabling text query submission and image generation in a chat format. It supports saving chat history and configuring an HTTP client with the option to use HTTP/2 for faster data transfer. The library is built with a simplified interface, making it easy to integrate with various chatbots or user applications working with generative AI.\r\n\r\n## Features\r\n\r\n- **Text Queries:** The `ask` method sends user queries to the API and processes the response. It includes support for message history, allowing continuous dialogue.\r\n- **Image Generation:** The `image` method sends a text description to generate an image and returns the result in JSON format.\r\n- **Message History Management:** The library supports working with message history through the external `History` class, making it easy to track the conversation and improve the user experience.\r\n\r\n## Documentation\r\nFor detailed documentation on how to use LiteGPT, please refer to the official documentation:\r\n[LiteGPT Documentation](https://red-3.gitbook.io/litegpt)\r\n\r\n## Installation\r\n\r\nYou can install the `LiteGPT` library from PyPI using `pip`:\r\n\r\n```bash\r\npip install litegpt\r\n```\r\n## Usage\r\n\r\n**Text Queries**\r\n\r\nThe ask function allows you to send a query to the AI chat and receive a response while maintaining chat history.\r\n\r\n```python\r\nfrom litegpt import LiteGPT\r\n\r\n# Initialize LiteGPT and send a query\r\nbot = LiteGPT()\r\nresponse = bot.ask(\"Your query here...\")\r\nprint(response)\r\n```\r\n\r\n**Text Queries Async**\r\n\r\n```python\r\nfrom litegpt import AsyncLiteGPT\r\nimport asyncio\r\n\r\nasync def main():\r\n\t# Initialize LiteGPT and send a query\r\n\tbot = AsyncLiteGPT()\r\n\tresponse = await bot.ask(\"Your query here...\")\r\n\tprint(response)\r\nasyncio.run(main())\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "LiteGPT provides free access to the ChatGPT and image generator",
"version": "1.3.3",
"project_urls": {
"Homepage": "https://github.com/RedPiarOfficial/LiteGPT",
"Source": "https://github.com/RedPiarOfficial/LiteGPT"
},
"split_keywords": [
"artificial-intelligence",
" ai",
" lite",
" gpt",
" assistant",
" chatbot",
" image-generator"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "510f9c40c43295b5a3d8af9b09bfad07ecb09c2fff2703d7eaa69ec15924646e",
"md5": "baa70ca4c4b9c1f5bdb7dd30eabfb145",
"sha256": "31e702d28cab772b108a02e93ae2d6764f2318a89ebb277c4b0679a3658c7126"
},
"downloads": -1,
"filename": "litegpt-1.3.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "baa70ca4c4b9c1f5bdb7dd30eabfb145",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 6894,
"upload_time": "2024-11-27T18:16:58",
"upload_time_iso_8601": "2024-11-27T18:16:58.590365Z",
"url": "https://files.pythonhosted.org/packages/51/0f/9c40c43295b5a3d8af9b09bfad07ecb09c2fff2703d7eaa69ec15924646e/litegpt-1.3.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dba05204d93d35179d8821bea4756b8efa6e50ea9010acb6ea667254310d1c4e",
"md5": "af4e0de9f61531ca04eda94a1bb6835a",
"sha256": "d5a9ba13928aab888356103982166d503e9d6820d0b929d0453861cce12b227d"
},
"downloads": -1,
"filename": "litegpt-1.3.3.tar.gz",
"has_sig": false,
"md5_digest": "af4e0de9f61531ca04eda94a1bb6835a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 6038,
"upload_time": "2024-11-27T18:17:01",
"upload_time_iso_8601": "2024-11-27T18:17:01.682347Z",
"url": "https://files.pythonhosted.org/packages/db/a0/5204d93d35179d8821bea4756b8efa6e50ea9010acb6ea667254310d1c4e/litegpt-1.3.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-27 18:17:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "RedPiarOfficial",
"github_project": "LiteGPT",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "litegpt"
}