Skip to content

Commit 92cde35

Browse files
committed
resolve CI issues
1 parent fc72dbf commit 92cde35

File tree

3 files changed

+9
-13
lines changed
  • apps
    • 4_streamlit_chat_history
    • 5_streamlit_query_chat_history
    • 8_streamlit_azure_openai_batch

3 files changed

+9
-13
lines changed

apps/4_streamlit_chat_history/main.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ def store_chat_history(container: ContainerProxy):
3838
pprint(response)
3939

4040

41-
# To reuse the session for Cosmos DB, just define the container globally
42-
container = get_container_client()
43-
4441
with st.sidebar:
4542
azure_openai_endpoint = st.text_input(
4643
label="AZURE_OPENAI_ENDPOINT",
@@ -116,5 +113,7 @@ def store_chat_history(container: ContainerProxy):
116113
}
117114
)
118115
# !! Here's the only difference from apps/2_streamlit_chat/main.py
119-
store_chat_history(container)
116+
store_chat_history(
117+
container=get_container_client(),
118+
)
120119
st.chat_message("assistant").write(msg)

apps/5_streamlit_query_chat_history/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ def get_container_client() -> ContainerProxy:
2121
)
2222

2323

24-
container = get_container_client()
25-
2624
with st.sidebar:
2725
"[Azure Portal](https://portal.azure.com/)"
2826
"[Azure OpenAI Studio](https://oai.azure.com/resource/overview)"
@@ -57,7 +55,7 @@ def convert_to_epoch(d: datetime.date) -> int:
5755
]
5856

5957
with st.spinner("Retrieving chat history. Please wait."):
60-
items = container.query_items(
58+
items = get_container_client().query_items(
6159
query=query,
6260
parameters=parameters,
6361
enable_cross_partition_query=True,

apps/8_streamlit_azure_openai_batch/main.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@
3636
"[Azure OpenAI Studio](https://oai.azure.com/resource/overview)"
3737
"[View the source code](https://github.com/ks6088ts-labs/workshop-azure-openai/blob/main/apps/8_streamlit_azure_openai_batch/main.py)"
3838

39-
client = AzureOpenAI(
40-
api_key=azure_openai_api_key,
41-
api_version=azure_openai_api_version,
42-
azure_endpoint=azure_openai_endpoint,
43-
)
44-
4539
st.title("8_streamlit_azure_openai_batch")
4640

4741
if not azure_openai_api_key or not azure_openai_endpoint or not azure_openai_api_version or not azure_openai_gpt_model:
@@ -53,6 +47,11 @@
5347
# ---------------
5448
st.header("Upload batch file")
5549
st.info("Upload a file in JSON lines format (.jsonl)")
50+
client = AzureOpenAI(
51+
api_key=azure_openai_api_key,
52+
api_version=azure_openai_api_version,
53+
azure_endpoint=azure_openai_endpoint,
54+
)
5655
uploaded_file = st.file_uploader("Upload an input file in JSON lines format", type=("jsonl"))
5756
if uploaded_file:
5857
bytes_data = uploaded_file.read()

0 commit comments

Comments
 (0)