Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Conversation History, "Vanilla" chat page, and tweaked local dev settings for hot swap #259

Closed
wants to merge 67 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
235491a
added keyvault to bicep main.parameters.json #1
bdleavitt Apr 24, 2023
925312d
created ChatGPT UI page / placeholders
bdleavitt Apr 24, 2023
c39ba81
Merge pull request #2 from bdleavitt/issue/1-add-keyvault
bdleavitt Apr 24, 2023
ddca7a3
Edit ISSUE_TEMPLATE for use in new project #3
kjpap Apr 25, 2023
0cdcf35
Edit ISSUE_TEMPLATE for use in new project (#3)
kjpap Apr 25, 2023
94d4af4
Simplify ISSUE_TEMPLATE to remove warnings #7
kjpap Apr 25, 2023
a12de78
Simplify ISSUE_TEMPLATE to remove warnings (#7)
kjpap Apr 25, 2023
7597f63
added vanilla chat using chat/completions format
bdleavitt Apr 29, 2023
b091d40
added cosmosdb to bicep
bdleavitt Apr 30, 2023
fa5be60
Merge pull request #15 from bdleavitt/feat-deploy-cosmos-with-repo
bdleavitt Apr 30, 2023
afad5c6
Merge branch 'main' of https://github.com/bdleavitt/chatgpt-on-azure …
bdleavitt Apr 30, 2023
5457713
Merge pull request #16 from bdleavitt/feat-add-chatgpt-ui-issue13
bdleavitt Apr 30, 2023
3b67b48
fixed typo in azure.yaml was breaking azd deploy
bdleavitt Apr 30, 2023
778727a
Merge pull request #17 from bdleavitt/bug-fix-azd-deploy
bdleavitt Apr 30, 2023
21ed467
Add "Design/Wiki Reference" to ISSUE_TEMPLATE #20
kjpap May 5, 2023
2e7ef59
Merge pull request #21 from bdleavitt/issue/20-update-issue-temp
bdleavitt May 5, 2023
a0db0bc
Add CODEOWNERS to repo for req approver(s)
kjpap May 5, 2023
9593a16
Edit ISSUE_TEMPLATE trivially to test diff
kjpap May 5, 2023
51ad5a9
Merge pull request #22 from bdleavitt/issue/add-codeowners
bdleavitt May 5, 2023
e7987cd
added system prompt override
bdleavitt May 8, 2023
df8fa5d
Added comment in code for ChatCompletions
bdleavitt May 8, 2023
45d1385
updated typos
bdleavitt May 8, 2023
44f0fd7
Change chatgptread.py to accept system prompt override #13
kjpap May 8, 2023
8c633ae
made changes for local dev for hot refresh
bdleavitt May 17, 2023
3ac6a31
I'm going to have a scratch folder, dang it.
bdleavitt May 17, 2023
87e7860
add auth utils for fe/be dummy user for local dev
bdleavitt May 17, 2023
b760921
Merge pull request #27 from bdleavitt/bdl-add-auth
bdleavitt May 17, 2023
fc53b38
Add cosmosDB service. API TS NOT COMPLETE #28
kjpap May 18, 2023
188c38e
Update README.md
bdleavitt May 18, 2023
8b76c53
updated requirements.txt to include azure-cosmos
bdleavitt May 19, 2023
ea4f10c
Merge branch '28-as-a-user-i-want-my-chats-to-be-saved' into issue/5-…
bdleavitt May 19, 2023
96d637e
Merge pull request #29 from bdleavitt/issue/5-cosmos-db-backend
bdleavitt May 19, 2023
c51a04f
bicep for cosmos to use "userId" as partition key
bdleavitt May 19, 2023
10becb4
fixed header for to check for auth user
bdleavitt May 19, 2023
38af92b
updated frontend to get and pass conversation_id
bdleavitt May 19, 2023
02af43f
store messages and conversations
bdleavitt May 19, 2023
ff2e9fa
approach name from "chatgpt" to "chatconversation"
bdleavitt May 19, 2023
a8349ef
update cosmosdb conv+message structure / methods
bdleavitt May 20, 2023
3b601eb
Add backend routes for conversation CRUD
bdleavitt May 20, 2023
221e1de
api updates and conversation types to models
bdleavitt May 20, 2023
0fedc12
frontend components for conversation history
bdleavitt May 20, 2023
31d96b4
more frontend nonesense to update convo list
bdleavitt May 20, 2023
d96f5d2
change msg sort and update convo on msg create
bdleavitt May 20, 2023
b7dbea9
Add loading conversation to UI
bdleavitt May 20, 2023
52099b4
added logic to handle duplicate messages
bdleavitt May 20, 2023
54273e3
Added delete converation to UI and backend
bdleavitt May 20, 2023
8e57463
add debugging
azeltov May 22, 2023
d33acef
fix role definition
azeltov May 22, 2023
a7f2494
add debug.ps script and clean up debug sh script
azeltov May 22, 2023
3880df5
add an extra space between the ask a ? and chatgpt
azeltov May 22, 2023
90cce91
add title to conversation
bdleavitt May 22, 2023
7b14ea2
Merge branch '28-as-a-user-i-want-my-chats-to-be-saved' of https://gi…
bdleavitt May 22, 2023
b7fa4bb
package updates?
bdleavitt May 22, 2023
699cfea
fix error "Error: local variable 'generate_title' referenced before…
azeltov May 22, 2023
2de8684
add title generation
bdleavitt May 22, 2023
0d5e006
Merge branch '28-as-a-user-i-want-my-chats-to-be-saved' of https://gi…
bdleavitt May 22, 2023
fe1cdf9
Merge pull request #32 from bdleavitt/28-as-a-user-i-want-my-chats-to…
bdleavitt May 22, 2023
5d3f5d2
update readme arch diagram
bdleavitt May 31, 2023
8d097e1
add local dev instructions to readme
bdleavitt Jun 1, 2023
5d8cdab
updated debug.ps1 to not launch frontend app
bdleavitt Jun 1, 2023
3fb7c8a
Delete confirmation and styles
bdleavitt Jun 1, 2023
2b8d332
update readme
bdleavitt Jun 1, 2023
f6838d4
Merge pull request #33 from bdleavitt/6-as-a-user-i-want-to-delete-my…
bdleavitt Jun 1, 2023
2891169
clear chat on delete
bdleavitt Jun 1, 2023
d5afcfd
Merge pull request #35 from bdleavitt/6-as-a-user-i-want-to-delete-my…
bdleavitt Jun 1, 2023
3784a78
added key based auth for cosmos
bdleavitt Jun 2, 2023
280d6f8
added key or aad auth for cosmos
bdleavitt Jun 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Codeowners for chatgpt-on-azure

# Global owners of repo
# One of these owners needs to approve every pull request
* @bdleavitt @kjpap
35 changes: 11 additions & 24 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
<!--
IF SUFFICIENT INFORMATION IS NOT PROVIDED VIA THE FOLLOWING TEMPLATE THE ISSUE MIGHT BE CLOSED WITHOUT FURTHER CONSIDERATION OR INVESTIGATION
-->
> Please provide us with the following information:
> ---------------------------------------------------------------

### This issue is for a: (mark with an `x`)
```
- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
[ ] bug report -> please search issues before submitting
[ ] feature request (including template changes)
[ ] documentation issue or request
[ ] regression (a behavior that used to work and stopped in a new release)
```

### Minimal steps to reproduce
>

### Any log messages given by the failure
### Description
Please include any relevant information, including repro steps for a bug (with log messages, version, OS, etc..)
>

### Expected/desired behavior
>

### OS and Version?
> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

### Versions
>
Please include any acceptance criteria here (should look like tasks to complete for the issue to be resolved)
- [ ]

### Design/Wiki Reference
Please add URLs to the design/wiki. Please note that README should be updated with relevant information as part of feature development to be code complete.
### Mention any other details that might be useful

> ---------------------------------------------------------------
> Thanks! We'll be in touch soon.
>
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Azure az webapp deployment details
.azure
.azure*
*_env

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

scratch/

# C extensions
*.so

Expand Down Expand Up @@ -144,4 +146,5 @@ cython_debug/
# NPM
npm-debug.log*
node_modules
static/
static/
app/frontend/package-lock.json
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ChatGPT + Enterprise data with Azure OpenAI and Cognitive Search
# ChatGPT + Enterprise data with Azure OpenAI... Now with "Vanilla" Chat experience and Conversation History (powered by CosmosDB)

[![Open in GitHub Codespaces](https://img.shields.io/static/v1?style=for-the-badge&label=GitHub+Codespaces&message=Open&color=brightgreen&logo=github)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=599293758&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
[![Open in Remote - Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Remote%20-%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/azure-samples/azure-search-openai-demo)
Expand Down Expand Up @@ -77,6 +77,30 @@ It will look like the following:

> NOTE: You can also use existing Search and Storage Accounts. See `./infra/main.parameters.json` for list of environment variables to pass to `azd env set` to configure those existing resources.

#### For local development
If you are modifying this app locally, you can greatly speed up the time to change and test the app by allowing the app to "hot reload". To do this open two separate terminal sessions.

**Start the backend flask app with hot reload**
Run `debug.ps1` or `debug.sh`
```
cd ./app
pwsh ./debug.ps1
```
or in bash
```
cd ./app
bash ./debug.sh
```

**Start the frontend app with hot reload**
Run the following command to enable hot reload on the frontend
```
cd ./app/frontend
npm run dev
```
This will create a VITE server instance that will reload when code changes. You can access the frontend app locally (i.e. http://localhost:5173/). The VITE server is set to proxy API calls to the flask application using the settings in `frontend/vite.config.ts` (i.e. https://localhost:5000).


#### Deploying or re-deploying a local clone of the repo:
* Simply run `azd up`

Expand Down Expand Up @@ -123,4 +147,4 @@ Once in the web app:

If you see this error while running `azd deploy`: `read /tmp/azd1992237260/backend_env/lib64: is a directory`, then delete the `./app/backend/backend_env folder` and re-run the `azd deploy` command. This issue is being tracked here: https://github.com/Azure/azure-dev/issues/1237

If the web app fails to deploy and you receive a '404 Not Found' message in your browser, run 'azd deploy'.
If the web app fails to deploy and you receive a '404 Not Found' message in your browser, run 'azd deploy'.
Loading