https://github.com/gbaeke/custom-gpt
Custom GPT to query baeke.info
https://github.com/gbaeke/custom-gpt
Last synced: 2 months ago
JSON representation
Custom GPT to query baeke.info
- Host: GitHub
- URL: https://github.com/gbaeke/custom-gpt
- Owner: gbaeke
- License: mit
- Created: 2023-11-26T16:13:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-26T21:40:28.000Z (over 1 year ago)
- Last Synced: 2024-12-27T20:38:40.710Z (4 months ago)
- Language: Jupyter Notebook
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# custom-gpt
Custom GPT to query baeke.info
See this blog post: https://blog.baeke.info/?p=4178
**Important:** The blog post uses an API that presents a "final answer" generated by an Azure OpenAI GPT model and based on Azure AI search context. That's ok if you want to use the API on its own. With a custom GPT in ChatGPT, it is more efficient to just present a JSON array to ChatGPT with the Azure AI search results. That allows ChatGPT to generate the answer, is faster, and avoids Azure OpenAI cost. If you want to use that method instead, check the `azure-ai-search` folder and use the `app.py` from that folder. The OpenAPI spec is different, so use `openapi-search.json` instead when you define the custom action in your GPT.
## Modify .env
Add your Azure OpenAI API key and the Azure AI Search API key.
Generate and add the API key to protect this API.
## Modify app.py
Ensure the URLs to your Azure OpenAI instance and Azure AI Search instance are correct.
Set the correct index name.
## Build the container
Ensure deploy.sh is executable with `chmod +x deploy.sh`
Ensure Docker is installed.
Run `./deploy.sh build`
## Run the container locally
Run `./deploy.sh run`. Now test the POST request to http://localhost:8000/generate_request. Use the apicall.http file but modify it with the correct API key you set in .env
## Deploy to Azure Container Apps
Run `./deploy.sh up`. This requires the Azure CLI on your machine. You should be logged in to your subscription with `az login`.