Repository navigation
Question on AzureOpenAI.py #546
Replies: 1 comment
|
That file is gone. Current DSPy does not do that. Configure Azure as a LiteLLM model string: import dspy
lm = dspy.LM(
"azure/gpt-4o",
api_key=os.environ["AZURE_OPENAI_API_KEY"],
api_base="https://YOUR_RESOURCE.openai.azure.com",
api_version="2024-08-01-preview",
)
dspy.configure(lm=lm)
If you are still on a 2.4.x tree with kwargs = {k: v for k, v in self.kwargs.items() if k not in ("api_base", "api_version", "api_key")}
return self.client.chat.completions.create(**kwargs)The upgrade is the actual fix. The old class is not maintained. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey team, just a quick question, I noticed that in azure_openai.py line 109, we are building self.kwargs with
api_baseapi_versionandapi_keyplus other args. then self.kwargs are used in chat_request in function chat.completions.create. However those three args I mentioned are not expected in chat.completions.create and they are only used to initialise the AzureOpenAiClient. then why are we including them in the self.kwargs ?(Asking this because it's throwing error for me)
All reactions