Skip to content

Commit

Permalink
Merge pull request #197 from Azure-Samples/updates
Browse files Browse the repository at this point in the history
More updates
  • Loading branch information
pamelafox authored Oct 12, 2024
2 parents 49696b1 + 4d1a804 commit 0a1aeb4
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 49 deletions.
5 changes: 3 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
AZURE_OPENAI_API_VERSION="2024-02-15-preview"
AZURE_OPENAI_ENDPOINT="https://YOUR-ENDPOINT-HERE.openai.azure.com/"
AZURE_OPENAI_API_VERSION=2024-02-15-preview
AZURE_OPENAI_ENDPOINT=https://YOUR-ENDPOINT-HERE.openai.azure.com/
# Name of the Azure OpenAI GPT deployment (different from the model name)
AZURE_OPENAI_CHAT_DEPLOYMENT=gpt4o-mini
AZURE_TENANT_ID=YOUR-TENANT-ID
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ azd pipeline config

## Development server

Assuming you've run the steps in [Opening the project](#opening-the-project) and the steps in [Deploying](#deploying), you can now run the Quart app in your development environment:
Assuming you've run the steps to [open the project](#getting-started) and the steps in [Deploying](#deploying), you can now run the Quart app in your development environment:
1. Copy `.env.sample.azure` into `.env`:
Expand All @@ -158,7 +158,13 @@ Assuming you've run the steps in [Opening the project](#opening-the-project) and
azd env get-value AZURE_OPENAI_ENDPOINT
```
1. Run the development server:
3. Run this command to get the value of `AZURE_TENANT_ID` from your deployed resource group and paste it in the `.env` file:
```shell
azd env get-value AZURE_TENANT_ID
```
4. Run the development server:
```shell
python -m quart --app src.quartapp run --port 50505 --reload
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ azd pipeline config

## Development server

Assuming you've run the steps in [Opening the project](#opening-the-project) and the steps in [Deploying](#deploying), you can now run the Quart app in your development environment:
Assuming you've run the steps to [open the project](#getting-started) and the steps in [Deploying](#deploying), you can now run the Quart app in your development environment:
1. Copy `.env.sample.azure` into `.env`:
Expand All @@ -175,7 +175,7 @@ Assuming you've run the steps in [Opening the project](#opening-the-project) and
azd env get-value AZURE_OPENAI_ENDPOINT
```
1. Run the development server:
3. Run the development server:
```shell
python -m quart --app src.quartapp run --port 50505 --reload
Expand Down
58 changes: 31 additions & 27 deletions src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
#
aiofiles==24.1.0
# via quart
aiohappyeyeballs==2.3.4
aiohappyeyeballs==2.4.3
# via aiohttp
aiohttp==3.10.0
aiohttp==3.10.10
# via quartapp (pyproject.toml)
aiosignal==1.3.1
# via aiohttp
annotated-types==0.7.0
# via pydantic
anyio==4.4.0
anyio==4.6.0
# via
# httpx
# openai
# watchfiles
attrs==23.2.0
attrs==24.2.0
# via aiohttp
azure-core==1.31.0
# via azure-identity
Expand All @@ -29,21 +29,21 @@ blinker==1.8.2
# via
# flask
# quart
certifi==2024.7.4
certifi==2024.8.30
# via
# httpcore
# httpx
# requests
cffi==1.16.0
cffi==1.17.1
# via cryptography
charset-normalizer==3.3.2
charset-normalizer==3.4.0
# via requests
click==8.1.7
# via
# flask
# quart
# uvicorn
cryptography==43.0.0
cryptography==43.0.1
# via
# azure-identity
# msal
Expand All @@ -56,7 +56,7 @@ frozenlist==1.4.1
# via
# aiohttp
# aiosignal
gunicorn==22.0.0
gunicorn==23.0.0
# via quartapp (pyproject.toml)
h11==0.14.0
# via
Expand All @@ -68,17 +68,17 @@ h2==4.1.0
# via hypercorn
hpack==4.0.0
# via h2
httpcore==1.0.5
httpcore==1.0.6
# via httpx
httptools==0.6.1
# via uvicorn
httpx==0.27.0
httpx==0.27.2
# via openai
hypercorn==0.17.3
# via quart
hyperframe==6.0.1
# via h2
idna==3.7
idna==3.10
# via
# anyio
# httpx
Expand All @@ -92,42 +92,46 @@ jinja2==3.1.4
# via
# flask
# quart
markupsafe==2.1.5
jiter==0.6.1
# via openai
markupsafe==3.0.1
# via
# jinja2
# quart
# werkzeug
msal==1.30.0
msal==1.31.0
# via
# azure-identity
# msal-extensions
msal-extensions==1.2.0
# via azure-identity
multidict==6.0.5
multidict==6.1.0
# via
# aiohttp
# yarl
openai==1.37.2
openai==1.51.2
# via quartapp (pyproject.toml)
packaging==24.1
# via gunicorn
portalocker==2.10.1
# via msal-extensions
priority==2.0.0
# via hypercorn
propcache==0.2.0
# via yarl
pycparser==2.22
# via cffi
pydantic==2.8.2
pydantic==2.9.2
# via openai
pydantic-core==2.20.1
pydantic-core==2.23.4
# via pydantic
pyjwt[crypto]==2.9.0
# via msal
python-dotenv==1.0.1
# via
# quartapp (pyproject.toml)
# uvicorn
pyyaml==6.0.1
pyyaml==6.0.2
# via
# quartapp (pyproject.toml)
# uvicorn
Expand All @@ -144,7 +148,7 @@ sniffio==1.3.1
# anyio
# httpx
# openai
tqdm==4.66.4
tqdm==4.66.5
# via openai
typing-extensions==4.12.2
# via
Expand All @@ -153,22 +157,22 @@ typing-extensions==4.12.2
# openai
# pydantic
# pydantic-core
urllib3==2.2.2
urllib3==2.2.3
# via requests
uvicorn[standard]==0.30.5
uvicorn[standard]==0.31.1
# via quartapp (pyproject.toml)
uvloop==0.19.0
uvloop==0.20.0
# via uvicorn
watchfiles==0.22.0
watchfiles==0.24.0
# via uvicorn
websockets==12.0
websockets==13.1
# via uvicorn
werkzeug==3.0.3
werkzeug==3.0.4
# via
# flask
# quart
# quartapp (pyproject.toml)
wsproto==1.2.0
# via hypercorn
yarl==1.9.4
yarl==1.14.0
# via aiohttp
16 changes: 8 additions & 8 deletions tests/snapshots/test_app/test_chat_stream_text/result.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{"delta": {"content": null, "function_call": null, "role": "assistant", "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {}}
{"delta": {"content": "The", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " capital", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " of", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " France", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " is", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " Paris.", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": null, "function_call": null, "role": null, "tool_calls": null}, "finish_reason": "stop", "index": 0, "logprobs": null, "content_filter_results": {}}
{"delta": {"content": null, "function_call": null, "refusal": null, "role": "assistant", "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {}}
{"delta": {"content": "The", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " capital", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " of", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " France", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " is", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " Paris.", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": null, "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": "stop", "index": 0, "logprobs": null, "content_filter_results": {}}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{"delta": {"content": null, "function_call": null, "role": "assistant", "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {}}
{"delta": {"content": "The", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " capital", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " of", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " Germany", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " is", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " Berlin.", "function_call": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": null, "function_call": null, "role": null, "tool_calls": null}, "finish_reason": "stop", "index": 0, "logprobs": null, "content_filter_results": {}}
{"delta": {"content": null, "function_call": null, "refusal": null, "role": "assistant", "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {}}
{"delta": {"content": "The", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " capital", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " of", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " Germany", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " is", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": " Berlin.", "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": null, "index": 0, "logprobs": null, "content_filter_results": {"hate": {"filtered": false, "severity": "safe"}, "self_harm": {"filtered": false, "severity": "safe"}, "sexual": {"filtered": false, "severity": "safe"}, "violence": {"filtered": false, "severity": "safe"}}}
{"delta": {"content": null, "function_call": null, "refusal": null, "role": null, "tool_calls": null}, "finish_reason": "stop", "index": 0, "logprobs": null, "content_filter_results": {}}

0 comments on commit 0a1aeb4

Please sign in to comment.