Skip to content
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

更新Azure OpenAI配置模版 #34

Merged
merged 3 commits into from
Jun 10, 2024
Merged

更新Azure OpenAI配置模版 #34

merged 3 commits into from
Jun 10, 2024

Conversation

shog86
Copy link
Contributor

@shog86 shog86 commented Jun 7, 2024

No description provided.

@idootop
Copy link
Owner

idootop commented Jun 7, 2024

👍 多谢 PR,填的很细致。我认为 .env 模版里简单介绍下字段的含义就好了,详细的参数说明和配置教程可以放到 readme 的 faq 里。如果你能整理成一条如何配置 azure 账号的 faq,就更好了。

@otkHsiao
Copy link

otkHsiao commented Jun 8, 2024

deployment需要作为参数加在 https://github.com/idootop/mi-gpt/blob/8d3bbd2992c80f3a6d7d5f6cc0a9793835bf0fc5/src/services/openai.ts#L110C21-L110C33
这个后面。或者直接把deployment值写在OPENAI_MODEL上也能生效吧。
虽然我今天还没跑通azure,时间不够。不过我觉得应该这么改一下。

@idootop
Copy link
Owner

idootop commented Jun 8, 2024

不从参数传入,OpenAI sdk 默认会从环境变量读取。你可以仅配置环境变量测试下。

@idootop idootop merged commit b4a147b into idootop:main Jun 10, 2024
@idootop
Copy link
Owner

idootop commented Jun 10, 2024

deployment需要作为参数加在 https://github.com/idootop/mi-gpt/blob/8d3bbd2992c80f3a6d7d5f6cc0a9793835bf0fc5/src/services/openai.ts#L110C21-L110C33 这个后面。或者直接把deployment值写在OPENAI_MODEL上也能生效吧。 虽然我今天还没跑通azure,时间不够。不过我觉得应该这么改一下。

大概懂你的意思了,多谢反馈,下个版本我修复下。

@idootop
Copy link
Owner

idootop commented Jun 10, 2024

@otkHsiao 已修复,下个版本更新:b8c646f

@otkHsiao
Copy link

@idootop 我其实想说的是this._client!.chat.completions.create的参数里有一项是deployment,具体的逻辑在AzureOpenAI里:优先使用传入的deployment,否则使用model。
anyway,目前的代码逻辑也没有问题~已跑通Azure的配置。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants