logancyang / obsidian-copilot

THE Copilot in Obsidian
GNU Affero General Public License v3.0
2.58k stars 179 forks source link

Azure setting issue #98

Closed likemuuxi closed 1 year ago

likemuuxi commented 1 year ago

Help: Can you add an example of Azure settings? I'm not sure about the corresponding relationship between the settings options

logancyang commented 1 year ago

Take the example I have in the video demo image

This is your instance name: under Azure OpenAI resource see this below image

This is your deployment name: under Azure AI Studio see this below image

Let me know if this helps!

likemuuxi commented 1 year ago

I have followed your instructions to set up, but I'm not sure where I went wrong. I am receiving a LangChain error: 404. 

丿ωo? 冷丶 @.***

 

------------------ 原始邮件 ------------------ 发件人: "logancyang/obsidian-copilot" @.>; 发送时间: 2023年7月5日(星期三) 中午11:48 @.>; 抄送: "丿ωo? @.**@.>; 主题: Re: [logancyang/obsidian-copilot] Azure setting issue (Issue #98)

Take the example I have in the video demo

This is your instance name: Azure OpenAI resource

This is your deployment name: Azure AI Studio

Let me know if this helps!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

logancyang commented 1 year ago

@likemuuxi can you show me your Azure pages just like the ones I posted?

likemuuxi commented 1 year ago

image image image

logancyang commented 1 year ago

Looks alright to me. Are you able to curl it?

curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/completions?api-version=VERSION\
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_API_KEY" \
  -d "{
  \"prompt\": \"Once upon a time\",
  \"max_tokens\": 5
}"

replace the params with yours

likemuuxi commented 1 year ago

https://chatgpt327-3.openai.azure.com/openai/deployments/GPT35/completions?api-version=2023-06-25\ { "error": { "code": "404", "message": "Resource not found" } }

image Click on the domain name as shown in the picture, but I am still able to use the model.

logancyang commented 1 year ago

No you need to curl it, clicking on the link won't work. Can you show me your terminal with the curl response?

likemuuxi commented 1 year ago

image

logancyang commented 1 year ago

Ok curl doesn't work, means your params are not correct. Are you sure about the api-version? Can you make sure all your params are correct by testing using this curl command. Once this works, you will be able to use it properly in copilot.

logancyang commented 1 year ago

FYI, I saw 404 myself when I have wrong API version. It is not the model version you see in Azure page apparently. Try "2023-05-15" like I used in the video demo?

likemuuxi commented 1 year ago

FYI, I saw 404 myself when I have wrong API version. It is not the model version you see in Azure page apparently. Try "2023-05-15" like I used in the video demo?

This doesn't work, I wonder if it could be a problem with the deployment region of the model, as it affects API calls

likemuuxi commented 1 year ago

image Can be changed to this parameter input format.

logancyang commented 1 year ago

There's not much I can do to help debug your deployment. One helpful thing I tried was Azure's support chat, they are quite helpful, just let them help you figure out the right params, make sure curl works, and you will be able to use this plugin without an issue. Closing for now since this is not a Copilot issue.

But I see Azure params can be hard to get right at first. Will put the curl command example in the FAQ.

likemuuxi commented 1 year ago

There's not much I can do to help debug your deployment. One helpful thing I tried was Azure's support chat, they are quite helpful, just let them help you figure out the right params, make sure curl works, and you will be able to use this plugin without an issue. Closing for now since this is not a Copilot issue.

But I see Azure params can be hard to get right at first. Will put the curl command example in the FAQ.

Thank you for your patient answer. I received inspiration and found various versions of the API on the following page. After modification, it can be used normally https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#completions

lil-i321 commented 1 year ago

There's not much I can do to help debug your deployment. One helpful thing I tried was Azure's support chat, they are quite helpful, just let them help you figure out the right params, make sure curl works, and you will be able to use this plugin without an issue. Closing for now since this is not a Copilot issue. But I see Azure params can be hard to get right at first. Will put the curl command example in the FAQ.

Thank you for your patient answer. I received inspiration and found various versions of the API on the following page. After modification, it can be used normally https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#completions

你好,请问你是怎么解决这个问题的?我也遇到了同样的问题:“LangChain error: 404.” 我的终结点链接是这个: https://chatg230808.openai.azure.com/openai/deployments/gpt313/chat/completions?api-version=2023-03-15-preview

likemuuxi commented 1 year ago

There's not much I can do to help debug your deployment. One helpful thing I tried was Azure's support chat, they are quite helpful, just let them help you figure out the right params, make sure curl works, and you will be able to use this plugin without an issue. Closing for now since this is not a Copilot issue. But I see Azure params can be hard to get right at first. Will put the curl command example in the FAQ.

Thank you for your patient answer. I received inspiration and found various versions of the API on the following page. After modification, it can be used normally https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference#completions

你好,请问你是怎么解决这个问题的?我也遇到了同样的问题:“LangChain error: 404.” 我的终结点链接是这个: https://chatg230808.openai.azure.com/openai/deployments/gpt313/chat/completions?api-version=2023-03-15-preview

尝试修改插件中的Azure OPENAI API Version 其为下列中的一个 自行尝试 image

lil-i321 commented 1 year ago

There's not much I can do to help debug your deployment. One helpful thing I tried was Azure's support chat, they are quite helpful, just let them help you figure out the right params, make sure curl works, and you will be able to use this plugin without an issue. Closing for now since this is not a Copilot issue. But I see Azure params can be hard to get right at first. Will put the curl command example in the FAQ.

我用了对应的api version,并在本插件中设置了token length,完全ok了。 BYW 如何修改api version 呢?我部署了3个 3.5模型 ,api version 都是[2023-03-15-preview],不同的 api version 有什么区别吗?

likemuuxi commented 1 year ago

我用了对应的api version,并在本插件中设置了token length,完全ok了。 BYW 如何修改api version 呢?我部署了3个 3.5模型 ,api version 都是[2023-03-15-preview],不同的 api version 有什么区别吗?

可以使用即可,不用在意api version 具体区别我想应该去查阅帮助文档

lil-i321 commented 1 year ago

yes,谢谢了,在Azure 部署模型中 没有找到变更api version 的入口。

john-crouch commented 8 months ago

You can get all the necessary info in one fell swoop by:

  1. Navigate to the Azure OpenAI portal
  2. Select "Completions"
  3. Click "View Code"
  4. Copy the endpoint URL (this contains all required infos):

    https://{Open AI Instance name}.openai.azure.com/openai/deployments/{deployment name}/completions?api-version={api version}

  5. Copy the API key as well.

image image image

thinkthinking commented 8 months ago

Take the example I have in the video demo image

This is your instance name: under Azure OpenAI resource see this below image

This is your deployment name: under Azure AI Studio see this below image

Let me know if this helps!

it works, thank you @logancyang