PraisonAI is a sophisticated chatbot built using the Streamlit framework. It integrates multiple language model providers to offer a flexible and customizable conversational experience. This project includes tools for managing and editing chatbot agents, and can be configured to use different AI frameworks.
Contact Info | |
---|---|
Joseph LePore |
- Multiple LLM Providers: Select from various language model providers such as OpenAI, Ollama Mistral, FastChat, LM Studio, Mistral, Groq, and Anthropic.
- Agent Management: Create, edit, and manage multiple chatbot agents with customizable roles and tools.
- Flexible Frameworks: Supports different frameworks for generating responses including CrewAi, AutoGen.
- Interactive UI: Streamlit-based interface with wide mode configuration for enhanced usability.
- Custom Tools: Create and manage custom tools to enhance chatbot capabilities.
- Text-to-Speech (TTS): Utilize Edge TTS for converting text responses into speech.
To set up the PraisonAI Chatbot, follow these steps:
-
Clone the repository:
git clone https://github.com/leporejoseph/praisonai-chatbot.git cd praisonai-chatbot
-
Install the dependencies (including the latest versions):
pip install -r requirements.txt --upgrade
-
Run the application:
streamlit run app.py
The chatbot configuration is managed through the .env
file and Streamlit sidebar. Here are some key settings:
- LLM Settings: Choose the language model provider and set API keys.
- Agent Settings: Select or create agents, customize their roles, tools, and other properties.
Ensure the .env
file contains the appropriate API keys and settings for your chosen LLM provider. The file is automatically initialized with default values if not present.
Once the application is running, you can interact with the chatbot through the Streamlit interface. Use the sidebar to configure LLM and agent settings.
To edit an existing agent:
- Select the agent from the dropdown menu in the sidebar.
- Click on "Edit Agent" to open the edit dialog.
- Modify the agent's roles, tools, and other properties as needed.
- Click "Update" to save the changes.
To create a new tool:
- Click on "Create New Tool" in the sidebar.
- Define the tool class and save it.
To edit an existing tool:
- Select the tool from the list in the sidebar.
- Modify the tool class definition and save it.
Click to expand the list of important functions
- update_model: Updates the selected model and API key.
- generate_response: Generates a response using the specified framework and prompt.
- edit_agent_dialog: Dialog for editing an existing agent.
- create_tool_dialog: Dialog for creating a new tool.
- edit_tool_dialog: Dialog for editing an existing tool.
- initialize_env: Initializes the environment variables.
- update_env: Updates the environment variables based on the selected model.
- get_api_key: Retrieves the API key for the selected model.
- get_agents_list: Retrieves the list of available agents.
- load_yaml: Loads a YAML file.
- save_yaml: Saves data to a YAML file.
- load_conversation_history: Loads the conversation history.
- save_conversation_history: Saves the conversation history.
- clear_conversation_history: Clears the conversation history.
- load_selected_llm_provider: Loads the selected LLM provider from the configuration.
- save_selected_llm_provider: Saves the selected LLM provider to the configuration.
- initialize_session_state: Initializes the session state.
- load_tools_from_file: Loads custom tools from a file.
- edit_tool_in_file: Edits an existing tool in the file.
- load_tool_class_definition: Loads the class definition of a tool.
- delete_tool_from_file: Deletes a tool from the file.
- synthesize_text_to_speech: Converts text to speech using Edge TTS.
- transcribe_audio: Transcribes audio files using Groq.
- save_transcription_to_file: Saves transcription data to a file.
- list_documents: Lists documents in a specified directory.
- load_document_content: Loads content from a document.
- update_document_content: Updates the content of a document.
We welcome contributions to improve PraisonAI Chatbot. To contribute:
-
Fork the repository:
git fork https://github.com/leporejoseph/praisonai-chatbot.git
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes and commit them:
git commit -m "Add your message here"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.