Skip to content

Commit

Permalink
Merge pull request #169 from microsoft/python
Browse files Browse the repository at this point in the history
corrected azure execution bug
  • Loading branch information
sethjuarez authored Jan 16, 2025
2 parents 16316fa + 89664af commit b18a21e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runtime/prompty/prompty/azure/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ async def invoke_async(self, data: str) -> typing.Union[str, AsyncPromptyStream]
raw: APIResponse = (
await client.chat.completions.with_raw_response.create(**args)
)
response = ChatCompletion.model_validate_json(raw.text())
if raw is not None and raw.text is not None and isinstance(raw.text, str):
response = ChatCompletion.model_validate_json(raw.text)

for k, v in raw.headers.raw:
trace(k.decode("utf-8"), v.decode("utf-8"))

Expand Down

0 comments on commit b18a21e

Please sign in to comment.