-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(model): Add support for Azure openAI #1137
feat(model): Add support for Azure openAI #1137
Conversation
…ment variables to adapt to Azure openAI
LLM_MODEL=proxyllm |
@likenamehaojie Thanks for your PR, We will make a test and merge it. |
@likenamehaojie Thank you for your contribution. But there is still a small problem, please use the following command to format the python code: Of course, we recommend that you install pre-commit hooks with following command: |
…ment variables to adapt to Azure openAI
I have adjusted the code format @fangyinc |
OpeanAI LLM 2024-01-31 16:02:06 212eb64a67ea dbgpt.model.cluster.worker.default_worker[1] ERROR Model inference error, detail: Traceback (most recent call last):
File "/app/dbgpt/model/cluster/worker/default_worker.py", line 246, in async_generate_stream
async for output in generate_stream_func(
File "/app/dbgpt/model/proxy/llms/chatgpt.py", line 41, in chatgpt_generate_stream
async for r in client.generate_stream(request):
File "/app/dbgpt/model/proxy/llms/chatgpt.py", line 188, in generate_stream
async for r in self.generate_stream_v1(messages, payload):
File "/app/dbgpt/model/proxy/llms/chatgpt.py", line 216, in generate_stream_v1
chat_completion = await self.client.chat.completions.create(
File "/app/dbgpt/model/proxy/llms/chatgpt.py", line 121, in client
self._api_type, self._client = _build_openai_client(
File "/app/dbgpt/model/utils/chatgpt_utils.py", line 152, in _build_openai_client
return api_type, AsyncOpenAI(
TypeError: AsyncOpenAI.__init__() got an unexpected keyword argument 'api_azure_deployment'
2024-01-31 16:02:06 212eb64a67ea dbgpt.agent.agents.llm.llm_client[1] ERROR Call LLMClient error, Model server error!code=1, error msg is **LLMServer Generate Error, Please CheckErrorInfo.**: AsyncOpenAI.__init__() got an unexpected keyword argument 'api_azure_deployment', detail: Traceback (most recent call last):
File "/app/dbgpt/agent/agents/llm/llm_client.py", line 184, in _completions_create
parsed_output = self._output_parser.parse_model_nostream_resp(
File "/app/dbgpt/core/interface/output_parser.py", line 109, in parse_model_nostream_resp
raise ValueError(
ValueError: Model server error!code=1, error msg is **LLMServer Generate Error, Please CheckErrorInfo.**: AsyncOpenAI.__init__() got an unexpected keyword argument 'api_azure_deployment'
2024-01-31 16:02:06 212eb64a67ea dbgpt.agent.agents.base_agent[1] ERROR model:proxyllm generate Failed!LLM Chat Generrate Error!(Model server error!code=1, error msg is **LLMServer Generate Error, Please CheckErrorInfo.**: AsyncOpenAI.__init__() got an unexpected keyword argument 'api_azure_deployment') |
@fangyinc 最新版本的OPENAI是不是对这个方法做了修改? |
API_AZURE_DEPLOYMENT @fangyinc need add this environment variables,use main branch to test |
|
PROXY_API_TYPE=azure .is add this ? @fangyinc |
![]() |
Aha, what I mean is not that Azure openAI cannot work, but that OpenAI cannot work~ |
OK,I will fix this bug! |
@fangyinc already fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR, LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, LGTM.
这个是怎么配置进DB-GPT的,也是这种azure模型,但是不知道怎么配置进DB-GPT |
Co-authored-by: like <[email protected]> Co-authored-by: csunny <[email protected]>
Support Azure OpenAI Proxy
Description
Added support for Azure openAI and added API_AZURE_DEPLOYMENT environment variables to adapt to Azure openAI
How Has This Been Tested?
The test translation has been completed
Snapshots:
Include snapshots for easier review.
Checklist: