Skip to content

Commit e703245

Browse files
committed
lol whoops reset
1 parent 990f8cd commit e703245

File tree

2 files changed

+280
-158
lines changed

2 files changed

+280
-158
lines changed

app/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _get_openai_client():
4444
"""Lazily initialize the Azure OpenAI client."""
4545
global _openai_client
4646
if _openai_client is None:
47-
from azure.openai import AzureOpenAI
47+
from openai import AzureOpenAI
4848
_openai_client = AzureOpenAI(
4949
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
5050
api_key=os.environ["AZURE_OPENAI_API_KEY"],
@@ -61,11 +61,13 @@ def _get_content_safety_client():
6161
# no api_version parameter is needed (unlike the OpenAI SDK).
6262
# TODO: Uncomment and configure
6363
from azure.ai.contentsafety import ContentSafetyClient
64+
from azure.ai.contentsafety.models import AnalyzeTextOptions
6465
from azure.core.credentials import AzureKeyCredential
6566
_content_safety_client = ContentSafetyClient(
6667
endpoint=os.environ["AZURE_CONTENT_SAFETY_ENDPOINT"],
6768
credential=AzureKeyCredential(os.environ["AZURE_CONTENT_SAFETY_KEY"]),
6869
)
70+
results=_content_safety_client.analyze_text(AnalyzeTextOptions(text="Some text to check"))
6971
raise NotImplementedError("Configure the Content Safety client")
7072
return _content_safety_client
7173

@@ -118,8 +120,8 @@ def classify_311_request(request_text: str) -> dict:
118120
temperature=0,
119121
)
120122
# TODO: Step 1.3 - Parse the JSON response with
121-
json.loads(response.choices[0].message.content)
122-
raise NotImplementedError("Implement classify_311_request in Step 1")
123+
return json.loads(response.choices[0].message.content)
124+
#raise NotImplementedError("Implement classify_311_request in Step 1")
123125

124126

125127
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)