# fh-chat
fh-chat is a flexible library built for [FastHTML](https://fastht.ml/) applications, enabling easy integration of AI-powered chat functionality with support for multiple AI backends.
## Features
- Support for multiple AI backends: Anthropic, OpenAI, and Claudette
- Real-time streaming responses for a responsive chat experience
- Chat UI using DaisyUI and Tailwind CSS
- Message state stored client side in the HTML
- Easy-to-use API for quick implementation
## Installation
```bash
pip install fh-chat
```
## Quick Start
Check out the examples [here](https://github.com/rian-dolphin/fasthtml-chat/tree/main/examples) to get started. As with any FastHTML app you can run them using python like:
```bash
python examples/min_example.py
```
## Supported AI Clients
- Anthropic: Use the `anthropic` library
## How It Works
fh-chat uses FastHTML's HTMX integration to handle real-time updates. The chat interface is rendered server-side, and messages are streamed to the client using chunked transfer encoding. The state is stored in the HTML using hidden tags. This approach ensures a smooth chat experience without the need for complex client-side JavaScript.
## Customization
The chat interface uses DaisyUI and Tailwind CSS for styling. You can customise the Tailwind of the chat page and we plan to add more customisability options.
## License
[MIT License](LICENSE)
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## Support
If you encounter any problems or have any questions, please open an issue on the GitHub repository.
Raw data
{
"_id": null,
"home_page": "https://github.com/rian-dolphin/fasthtml-chat",
"name": "fh-chat",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Rian Dolphin",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/b9/94/fe2fee58b896de40dd5a080c26cf3b736ed9e8cfb5f8fb56411386c7a8f8/fh-chat-0.3.1.tar.gz",
"platform": null,
"description": "# fh-chat\n\nfh-chat is a flexible library built for [FastHTML](https://fastht.ml/) applications, enabling easy integration of AI-powered chat functionality with support for multiple AI backends.\n\n## Features\n\n- Support for multiple AI backends: Anthropic, OpenAI, and Claudette\n- Real-time streaming responses for a responsive chat experience\n- Chat UI using DaisyUI and Tailwind CSS\n- Message state stored client side in the HTML\n- Easy-to-use API for quick implementation\n\n## Installation\n\n```bash\npip install fh-chat\n```\n\n## Quick Start\n\nCheck out the examples [here](https://github.com/rian-dolphin/fasthtml-chat/tree/main/examples) to get started. As with any FastHTML app you can run them using python like:\n\n```bash\npython examples/min_example.py\n```\n\n## Supported AI Clients\n\n- Anthropic: Use the `anthropic` library\n\n## How It Works\n\nfh-chat uses FastHTML's HTMX integration to handle real-time updates. The chat interface is rendered server-side, and messages are streamed to the client using chunked transfer encoding. The state is stored in the HTML using hidden tags. This approach ensures a smooth chat experience without the need for complex client-side JavaScript.\n\n## Customization\n\nThe chat interface uses DaisyUI and Tailwind CSS for styling. You can customise the Tailwind of the chat page and we plan to add more customisability options.\n\n## License\n\n[MIT License](LICENSE)\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## Support\n\nIf you encounter any problems or have any questions, please open an issue on the GitHub repository.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A package for chat functionality in FastHTML.",
"version": "0.3.1",
"project_urls": {
"Homepage": "https://github.com/rian-dolphin/fasthtml-chat"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "338498ae39686832718fd2052f06f74bbb747ed5f0ba5dbb340acc4af818b725",
"md5": "908944f2843ed35c266bc4bfedb0549f",
"sha256": "576e40dbbdb249186e0e61bcc125f0b12fa4e6e7f15e682cade43cdb19ac6483"
},
"downloads": -1,
"filename": "fh_chat-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "908944f2843ed35c266bc4bfedb0549f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 9310,
"upload_time": "2024-08-23T12:37:16",
"upload_time_iso_8601": "2024-08-23T12:37:16.712641Z",
"url": "https://files.pythonhosted.org/packages/33/84/98ae39686832718fd2052f06f74bbb747ed5f0ba5dbb340acc4af818b725/fh_chat-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b994fe2fee58b896de40dd5a080c26cf3b736ed9e8cfb5f8fb56411386c7a8f8",
"md5": "2340db4504add46da440e503c46f90b8",
"sha256": "12e02df2246dd753b571a7ce0f6df80f779ae235d4e98915a551e552c687df44"
},
"downloads": -1,
"filename": "fh-chat-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "2340db4504add46da440e503c46f90b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4960,
"upload_time": "2024-08-23T12:37:17",
"upload_time_iso_8601": "2024-08-23T12:37:17.996476Z",
"url": "https://files.pythonhosted.org/packages/b9/94/fe2fee58b896de40dd5a080c26cf3b736ed9e8cfb5f8fb56411386c7a8f8/fh-chat-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-23 12:37:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rian-dolphin",
"github_project": "fasthtml-chat",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fh-chat"
}