首页 > 其他分享 >Why I‘m getting 404 Resource Not Found to my newly Azure OpenAI deployment?

Why I‘m getting 404 Resource Not Found to my newly Azure OpenAI deployment?

时间:2024-09-07 08:55:14浏览次数:8  
标签:resource Resource getting URL 404 OpenAI Azure openai

题意:为什么我新部署的Azure OpenAI服务会出现404资源未找到的错误?

问题背景:

I've gone through this quickstart and I created my Azure OpenAI resource + created a model deployment which is in state succeedded. I also playaround it in Azure OpenAI Studio - Microsoft Azure and it works there.

我已经按照快速入门指南操作,创建了我的Azure OpenAI资源,并成功部署了一个模型。我也在Azure OpenAI Studio - Microsoft Azure中测试了它,并且在那里工作正常。

But, If I try to reach it from REST API is returns 404 Resource Not Found. I defined the api-key header, and took the url and json from Code View -> json from inside the playground.

但是,如果我尝试通过REST API访问它,它会返回404资源未找到。我已经定义了api-key头部,并且从playground里面的Code View->json获取了URL和JSON。

I'm executing

POST https://raz-openai.openai.azure.com/openai/deployments/raz-model-2/completions?api-version=2022-12-01 { "prompt": "", "max_tokens": 100 } with api-key header

Am I missing another step?

我是不是遗漏了其他步骤?

问题解决:

I was also getting a 404 calling the Chat Completions API (https://{resource}.openai.azure.com/openai/deployments/{deployment}/chat/completions) and it turned out that I was using the wrong version. Each model has one or more versions that can be found at Azure OpenAI Service REST API reference.

我在调用聊天补全API(https://{resource}.openai.azure.com/openai/deployments/{deployment}/chat/completions)时也遇到了404错误,后来发现是我使用了错误的版本。每个模型都有一个或多个版本,可以在Azure OpenAI服务REST API参考中找到。

For me, hitting the chat completions (ChatGPT), the correct URL with version was:

对于我来说,在调用聊天补全(ChatGPT)时,带有版本的正确URL是:

https://{resource}.openai.azure.com/openai/deployments/{deployment}/chat/completions?api-version=2023-03-15-preview

Any other version will give a 404 Resource Not Found.

任何其他版本都会返回404资源未找到错误。

Also, here are the definitions of those variables:

另外,以下是这些变量的定义:

  • Resource: Take from the Azure endpoint URL, which can be found on the Overview page in your OpenAI Services resource. The format should be something like https://{resource}.openai.azure.com/

资源(Resource):从Azure端点URL中获取,该URL可以在你的OpenAI服务资源的“概览”页面中找到。URL的格式应该类似于https://{resource}.openai.azure.com/,其中{resource}是你的OpenAI资源名称。这个URL是你与Azure OpenAI服务进行交互的基础,用于构建指向不同API端点的请求。

  • Deployment (aka deployment-id): You can find this in the Azure portal under the Model Deployments section. Each model has a "Model Deployment Name" and this is your Deployment ID. This isn't going to be the OpenAI name (like gpt-35-turbo) but rather the name you gave it when creating the model deployment.

部署(Deployment)(也称为部署ID):你可以在Azure门户的“模型部署”部分找到这个信息。每个模型都有一个“模型部署名称”,这就是你的部署ID。这个名称不是OpenAI的模型名称(如gpt-35-turbo),而是你在创建模型部署时自己指定的名称。确保在调用API时使用了正确的部署名称,以便能够正确地与你的自定义模型部署进行交互。

标签:resource,Resource,getting,URL,404,OpenAI,Azure,openai
From: https://blog.csdn.net/suiusoar/article/details/141981980

相关文章

  • 网站提示“404 Not Found:请求的资源未找到”错误如何解决
    当您遇到“404NotFound:请求的资源未找到”的错误时,可以按照以下步骤来尝试解决问题:检查URL是否正确:确认URL没有拼写错误。检查是否有任何字符被错误地添加或删除。确保使用正确的大小写(某些服务器区分大小写)。清除浏览器缓存和Cookies:浏览器缓存可能会保存旧的页面......
  • Spring 6 资源Resources 相关操作
    Java全能学习+面试指南:https://javaxiaobear.cn1、SpringResources概述Java的标准java.net.URL类和各种URL前缀的标准处理程序无法满足所有对low-level资源的访问,比如:没有标准化的URL实现可用于访问需要从类路径或相对于ServletContext获取的资源。并且缺少某些Spring所需要的......
  • 如果我想在Android应用中实现资源的自动管理,除了try-with-resources语句,还有哪些设计
    在Android应用开发中,除了使用try-with-resources语句来实现资源的自动管理,还可以参考以下设计模式和最佳实践:1.**单例模式(Singleton)**:  -对于需要全局访问的资源,如数据库连接或共享的配置对象,可以使用单例模式来确保只有一个实例被创建,并在应用的整个生命周期中复用。2......
  • Docker Push Error "denied: requested access to the resource is denied": 终极解决
    预览版:终极解决方案——把库删了,再重新建一个名字一样的,然后push一般dockerlogin登录之后,sudodockerpushusername/dockername:latest就能成功push了。然后我还是有报错:xxxxxxxxxxxx:Preparingxxxxxxxxxxxx:Preparingxxxxxxxxxxxx:Preparingxxxxxxxxxxxx:Preparing......
  • ROS2 Moveit2 - moveit_resources_panda_moveit_config包简介
    moveit_resources_panda_moveit_config是一个在MoveIt框架中常用的资源包,包含了Panda机器人模型(FrankaEmikaPanda)的配置文件。这个包用于测试和演示MoveIt的功能。它通常包含以下内容:URDF/XACRO文件:描述Panda机器人的几何、动力学和运动学模型。SRDF文件:描述Pand......
  • tail: inotify resources exhausted
    "tail:inotifyresourcesexhausted"这个错误表明系统的inotify资源已经耗尽。inotify是Linux内核的一项功能,用于监视文件系统中的事件,例如文件的创建、删除、修改等。tail-f命令使用inotify来实时监视文件的变化,如果系统中的inotify资源耗尽,tail会退回到使用轮询(pol......
  • 使用ClassLoader.getSystemResource更新上线后空指针异常
     目录 问题描述:原问题代码:问题原因以及解决思路:解决方法:问题描述:项目中使用到一个功能,于是在资源路径下加了点依赖包:更新上线后,发现使用ClassLoader.getSystemResource("dependencies")找不到依赖包原问题代码:URLresourceURL=ClassLoader.getSystemResource(......
  • windows系统配置nginx环境运行pbootcms访问首页直接404的问题
    近来在协助客户处理安装过程中遭遇的这样一个状况,在安装pbootcms之后,访问后台的/admin.php能够成功,然而直接访问首页却显示404错误。运行环境所采用的运行环境为:windows操作系统加上nginx服务器再加上php语言的组合环境。详细经过客户表示伪静态规则始终未能生效,经过......
  • [Spring]@Autowired 和 @Resource
    注入Bean的注解有哪些?Spring内置的@Autowired以及JDK内置的@Resource和@Inject都可以用于注入Bean。AnnotationPackageSource@Autowiredorg.springframework.bean.factorySpring2.5+@[email protected]......
  • 网站提示404 - 页面未找到:服务器无法找到请求的网页怎么办
    当网站提示 404NotFound 错误时,这意味着服务器无法找到客户端请求的网页。这种错误通常是因为页面不存在、URL错误、链接损坏或服务器配置问题等原因造成的。以下是解决 404NotFound 错误的一些常见方法:常见原因页面不存在:请求的页面已被删除或从未存在。URL错误:输......