-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add product support plugin using fast-graphrag
- Loading branch information
Showing
11 changed files
with
9,555 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.venv | ||
docs | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TELEGRAM_BOT_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM python:3.10.1-slim | ||
|
||
# Install build dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
WORKDIR /app | ||
|
||
# Copy project files | ||
COPY pyproject.toml . | ||
COPY . . | ||
RUN uv venv | ||
RUN uv sync --frozen | ||
# Run the application | ||
CMD ["uv", "run", "telegram_bot.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Product Support Plugin | ||
|
||
A RAG (Retrieval Augmented Generation) plugin for analyzing product support based on given documentation to identify key features, user interactions, data collection methods, and how different components of the platform work together. | ||
|
||
## Overview | ||
|
||
This plugin processes documentation from Mapeo, an offline-first mapping and monitoring platform, to provide insights about: | ||
|
||
- Key features and functionality | ||
- User interaction patterns | ||
- Data collection methodologies | ||
- Component integrations | ||
- System architecture | ||
|
||
## Requirements | ||
|
||
- Python 3.10.1 or higher | ||
- uv package manager (recommended) | ||
- Dependencies listed in pyproject.toml | ||
|
||
## Installation | ||
|
||
1. Clone the repository: | ||
|
||
## Usage | ||
|
||
The plugin can be used in three ways: | ||
|
||
- As a CLI tool for direct queries | ||
- Through the Telegram bot interface | ||
- By importing and calling from your Python code | ||
|
||
To install dependencies with uv (recommended): | ||
|
||
### Docker | ||
|
||
To run the Awana Telegram Bot using Docker, you can use the following command: | ||
|
||
```bash | ||
docker run -v ./bot:/app/mapeo_docs -e TELEGRAM_BOT_TOKEN=xxx:xxx-xxx -e OPENAI_API_KEY=sk-proj-xxx communityfirst/awana_telegram_bot | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from main import initialize_grag, query | ||
|
||
def main(): | ||
print("Welcome to Product Support Assistant!") | ||
print("Ask questions about the product. Type 'exit' or 'quit' to end the session.") | ||
|
||
# Initialize the GraphRAG once | ||
grag = initialize_grag() | ||
|
||
while True: | ||
question = input("\nYour question: ").strip() | ||
|
||
if question.lower() in ['exit', 'quit']: | ||
print("Goodbye!") | ||
break | ||
|
||
if not question: | ||
print("Please enter a valid question.") | ||
continue | ||
|
||
try: | ||
response = query(question, grag) | ||
print("\nAnswer:", response) | ||
except Exception as e: | ||
print(f"An error occurred: {str(e)}") | ||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.