You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you just pass your endpoint to the Azure ChatCompletionsClient, it will not work properly with Mirascope (or likely any OpenAI-compatible client). Requests will return something like:
File ".../site-packages/mirascope/core/base/_create.py", line 232, in inner
response = create(stream=False, **call_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../site-packages/mirascope/core/base/_utils/_get_create_fn_or_async_create_fn.py", line 135, in create_or_stream
return cast(_NonStreamedResponse, sync_func(**kwargs))
^^^^^^^^^^^^^^^^^^^
File ".../site-packages/azure/ai/inference/_patch.py", line 656, in complete
map_error(status_code=response.status_code, response=response, error_map=error_map)
File ".../site-packages/azure/core/exceptions.py", line 163, in map_error
raise error
azure.core.exceptions.ResourceNotFoundError: (404) Resource not found
Code: 404
Message: Resource not found
Discussed on Slack an easy way to increase DX with an example in the docs or a note about it in the Azure custom client section:
from azure.ai.inference import ChatCompletionsClient
from azure.core.credentials import AzureKeyCredential
from mirascope.core import azure
@azure.call(
"gpt-4o-mini",
client=ChatCompletionsClient(
endpoint="https://my-endpoint.openai.azure.com/openai/deployments/gpt-4o-mini/",
credential=AzureKeyCredential("...")
)
)
def hello():
return "Hello, how are you?"
print(hello())
Description
If you just pass your endpoint to the Azure ChatCompletionsClient, it will not work properly with Mirascope (or likely any OpenAI-compatible client). Requests will return something like:
Discussed on Slack an easy way to increase DX with an example in the docs or a note about it in the Azure custom client section:
Ref: https://mirascope-community.slack.com/archives/C072S9P1R38/p1736630556580189
The text was updated successfully, but these errors were encountered: