Chat utility library by Spiral.AI
Project description
SpiralChat
SpiralChat is a comprehensive chat utility library developed by Spiral.AI. It provides a set of powerful tools and components for building conversational AI applications.
Features
- Chat Engine: SpiralChat includes a versatile chat engine that can handle multi-turn conversations, maintain conversation history, and generate contextually relevant responses.
- Avatar System: Create and manage multiple AI avatars with unique characteristics, speech habits, and knowledge bases.
- Prompt Templates: Utilize a wide range of customizable prompt templates to structure conversations and guide the AI's responses.
- Memory Management: Efficiently store and retrieve conversation history with built-in memory management capabilities.
- Fact Retrieval: Integrate external knowledge sources and retrieve relevant facts based on the conversation context.
- Gradio Integration: Seamlessly integrate SpiralChat with Gradio, a popular library for building interactive web interfaces for AI models.
- API Support: Interact with popular language models and AI APIs, including OpenAI's GPT models and Anthropic's Claude.
Installation
You can install SpiralChat using pip:
pip install spchat
For development purposes, you can clone the repository and install the package in editable mode along with the development dependencies:
git clone https://github.com/Spiral-AI/SpiralChat.git
cd SpiralChat
pip install -e ".[dev]"
Usage
SpiralChat provides a high-level interface for building conversational AI applications. Here's a simple example of how to use the chat engine:
from spchat import ChatEngine, APIChatEngine
# Create a chat engine instance
e1 = ChatEngine(model="Spiral-AI/hime", template="calm2")
e2 = APIChatEngine(model="sonnet", on_bedrock=True)
# Engage in a conversation
response_1 = e1.respond("Hello, how are you?")
response_2 = e2.respond("Hello, how are you?")
print(response_1)
print(response_2)
For more advanced usage, such as creating avatars, managing memory, and retrieving facts, refer to the documentation and examples provided in the repository.
Documentation
Detailed documentation for SpiralChat can be found in the docs directory. It covers various topics, including:
- Getting started guide
- Chat engine and avatar usage
- Prompt templating
- Memory management
- Fact retrieval
- Gradio integration
- API usage and configuration
Examples
The examples directory contains a collection of example scripts and notebooks demonstrating different use cases and features of SpiralChat. These examples serve as a great starting point for building your own conversational AI applications.
Contributing
Contributions to SpiralChat are welcome! If you find any issues, have suggestions for improvements, or want to add new features, please open an issue or submit a pull request. Make sure to follow the guidelines outlined in the CONTRIBUTING.md file.
Support
If you have any questions, concerns, or need assistance with SpiralChat, please reach out to the Spiral.AI team.
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.