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

[Bug] Azure Open AI 的验证功能失效 #102

Closed
3 of 4 tasks
JiyuShao opened this issue Jan 10, 2024 · 8 comments
Closed
3 of 4 tasks

[Bug] Azure Open AI 的验证功能失效 #102

JiyuShao opened this issue Jan 10, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@JiyuShao
Copy link

Please search before asking

  • I searched in the issues and found nothing similar.

Please read README

  • I have read the usage instructions section in README in detail.

Please check your network and OpenAI API quota

  • I am sure it is not a network issue or an OpenAI API quota issue.

OpenAI Translator Bob Plugin version

2.2.0

系统版本 | System version

macOS 12.2.1

Bob version

Bob 1.8.2 [148]

复现步骤 | Reproduce step

使用 Azure OpenAI,配置完成后点击验证出错,但是保存后能正常使用

你看到了什么错误?What errors do you see?

image

你期望看到什么?What did you expect to see?

验证的逻辑应该与正常使用的逻辑相同,失败与成功的表现一致

还有其他的内容吗?Anything else?

验证的时候请求了 https://xxx.openai.azure.com/v1/models 接口,返回结果如下:
{"error":{"code":"404","message": "Resource not found"}}

image

你是否愿意提交一份 PR 来修改这个错误?Are you willing to submit a PR?

  • 我愿意提供 PR! I'm willing to submit a PR!
@JiyuShao JiyuShao added the bug Something isn't working label Jan 10, 2024
@liby
Copy link
Member

liby commented Jan 10, 2024

@JiyuShao
Copy link
Author

验证的还是报错:
image

image

正常的请求如下:
image

@liby
Copy link
Member

liby commented Jan 11, 2024

@JiyuShao
Copy link
Author

一样的问题,应该是 POST Body 的格式不对
https://github.com/openai-translator/bob-plugin-openai-translator/blob/v2.2.2/src/main.js#L366

Body 下面这个格式是失败的:
{"max_tokens":5,"prompt":"Once upon a time"}

Body 下面这个格式是成功的:
{"stream":true,"messages":[{"content":"You are a translation engine that can only translate text and cannot interpret it.","role":"system"},{"content":"translate from en to zh-Hans:\n\nOnce upon a time","role":"user"}],"frequency_penalty":1,"model":"gpt-3.5-turbo-16k","temperature":0.20000000000000001,"presence_penalty":1,"top_p":1,"max_tokens":1000}

@liby
Copy link
Member

liby commented Jan 11, 2024

@JiyuShao
Copy link
Author

挺奇怪的,我是看着官方的 Example 是这样写的 https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2023-05-15/examples/completions.json#L9

  • 这个是 completion 的示例,Completions API 已经过时了
  • 代码里用的是 chat completion 的接口,所以应该参考这个 Example

@liby
Copy link
Member

liby commented Jan 12, 2024

已经更新了 https://github.com/openai-translator/bob-plugin-openai-translator/releases/tag/v2.2.3

@JiyuShao
Copy link
Author

可以了

@liby liby closed this as completed Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants