Check out my new repo where I have implemented a summarizer (Map Reduce/Refine) implementation using Semantic Kernel and OpenAI GPT. Summarizer may not express well everything this application can do. It really uses the GPT's foundational model abilities to summarize, translate, perform risk analysis, generate content such as code and demand letters, etc.
I implemented this app as a C# Minimal API serving both static files and acting as an API server, but with minor modifications, the same code could power an async job to process a large number of files, for example, in a storage account.
Summarizer is also a powerful playground. You don’t need to give it a large text source. It can reply to a simple prompt. However, if you do give it a large text resource, you can accomplish pretty amazing tasks.
Summarization and RAG pattern can be combined into a powerful solution where based on users' choices the system could answer from multiple sources using the RAG pattern or provide deep answers and insights from specific documents and sources using summarization.
Note: I've kept most of the code in the `src/frontend/src/App.tsx`` file for simpler understanding.
- Bun javascript runtime and all-in-one tool
- React
- Axios
- React-markdown
- TailwindCSS
- .NET 7 C# Minimal API
- Semantic Kernel (still in Preview)
- Middleware:
- Static Files
- CORS
Requirements: requirements.txt
fastapi
uvicorn[standard]
semantic-kernel
python-dotenv
Requirements: requirements.txt
fastapi
uvicorn[standard]
langchain
python-dotenv
Note: To ge these values, you will need an Azure OpenAI account and deploy a GPT model to a region.
On the src/backend
and src/pybackend
folders, you will need to create a .env
file and set the following values:
DEPLOYMENT_NAME=<MODEL_NAME>
ENDPOINT=https://<NAME>.openai.azure.com/
API_KEY=<API_KEY>
From a Bash/zsh prompt type the following commands:
- Type:
make run
- Open a browser at:
http://localhost:5084
- Type:
make run-py
- Open a browser at:
http://localhost:8000
- Type:
make run-pylang
- Open a browser at:
http://localhost:8000
- Type:
make docker-run
- Open a browser at:
http://localhost:8080
- Type:
make docker-py-run
- Open a browser at:
http://localhost:8080
- Type:
make docker-pylang-run
- Open a browser at:
http://localhost:8080
Note: Make sure to provide the required server environment variables if running from somewhere else.
- Type:
make docker