This Streamlit application creates an interactive chat interface that leverages Opper's AI capabilities to answer questions about Opper documentation.
- Chat interface for asking questions about Opper
- Automatic retrieval of relevant information from Opper documentation
- Dynamic creation and querying of a documentation index
- Source attribution for answers
- Code detection and warning
-
Install required packages:
pip install streamlit opperai requests beautifulsoup4
-
Set the Opper API key as an environment variable:
export OPPER_API_KEY=your_api_key_here
-
Run the Streamlit app:
streamlit run app.py
- The app crawls Opper documentation to create an index (if not already existing).
- User inputs are processed to determine if knowledge retrieval is necessary.
- Relevant information is fetched from the index when needed.
- Responses are generated using Opper's AI, incorporating the retrieved knowledge.
- Code snippets in responses are detected and flagged with a warning.
- Sources of information are provided for transparency.
Ensure you have the necessary permissions and comply with Opper's terms of service when using their API and documentation.