Giter Club home page Giter Club logo

Comments (9)

QAbot-zh avatar QAbot-zh commented on May 23, 2024

参数传对了吗?我使用是正常的

from one-api.

xueycn avatar xueycn commented on May 23, 2024

第三方API为:https://api.aigcapi.io
联系第三方在线客服,反馈该api经测试可以生成图片。实测用Chatbox会发生如下报错:

屏幕截图 2023-11-28 111530

遇到了来自 OpenAI API 的错误,一般是由错误设置或账户问题引起的。请检查 AI 设置和账户情况,或者[点击这里查看常见问题文档](https://chatboxai.app/redirect_app/faqs/zh-Hans)。

API Error: Status Code 400, {"error":{"message":"relay error (request id: 20231128031447596282495QuQFC4Ki)","type":"one_api_error","param":"","code":"n_not_within_range"}}

from one-api.

ShinChven avatar ShinChven commented on May 23, 2024

参数传对了吗?我使用是正常的

请问能提供一个正确的调用示例吗?

from one-api.

QAbot-zh avatar QAbot-zh commented on May 23, 2024

参数传对了吗?我使用是正常的

请问能提供一个正确的调用示例吗?

就是用的官方库:

response = openai.Image.create(prompt=query, model='dall-e-3', size='1024x1024',style='vivid', quality='standard', n=1)
image_url = response["data"][0]["url"]

from one-api.

ShinChven avatar ShinChven commented on May 23, 2024

参数传对了吗?我使用是正常的

请问能提供一个正确的调用示例吗?

就是用的官方库:

response = openai.Image.create(prompt=query, model='dall-e-3', size='1024x1024',style='vivid', quality='standard', n=1)
image_url = response["data"][0]["url"]
from openai import OpenAI


# Set your OpenAI API key and custom domain endpoint
api_key = '<api_key>'
api_base = '<host>/v1/'  # Replace with your custom domain URL
prompt = 'gundam in a ruined cityscape'

client = OpenAI(api_key=api_key, base_url=api_base)

response = client.images.generate(prompt=prompt, model='dall-e-3', size='1024x1024',style='vivid', quality='standard', n=1)
# image_url = response["data"][0]["url"]

print(response)
openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

不太对。 openai==1.3.5

from one-api.

QAbot-zh avatar QAbot-zh commented on May 23, 2024

参数传对了吗?我使用是正常的

请问能提供一个正确的调用示例吗?

就是用的官方库:

response = openai.Image.create(prompt=query, model='dall-e-3', size='1024x1024',style='vivid', quality='standard', n=1)
image_url = response["data"][0]["url"]
from openai import OpenAI


# Set your OpenAI API key and custom domain endpoint
api_key = '<api_key>'
api_base = '<host>/v1/'  # Replace with your custom domain URL
prompt = 'gundam in a ruined cityscape'

client = OpenAI(api_key=api_key, base_url=api_base)

response = client.images.generate(prompt=prompt, model='dall-e-3', size='1024x1024',style='vivid', quality='standard', n=1)
# image_url = response["data"][0]["url"]

print(response)
openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

不太对。 openai==1.3.5

404的话检查你的网络问题以及上游代理key的问题
image

from one-api.

ShinChven avatar ShinChven commented on May 23, 2024

参数传对了吗?我使用是正常的

请问能提供一个正确的调用示例吗?

就是用的官方库:

response = openai.Image.create(prompt=query, model='dall-e-3', size='1024x1024',style='vivid', quality='standard', n=1)
image_url = response["data"][0]["url"]
from openai import OpenAI


# Set your OpenAI API key and custom domain endpoint
api_key = '<api_key>'
api_base = '<host>/v1/'  # Replace with your custom domain URL
prompt = 'gundam in a ruined cityscape'

client = OpenAI(api_key=api_key, base_url=api_base)

response = client.images.generate(prompt=prompt, model='dall-e-3', size='1024x1024',style='vivid', quality='standard', n=1)
# image_url = response["data"][0]["url"]

print(response)
openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

不太对。 openai==1.3.5

404的话检查你的网络问题以及上游代理key的问题 image

fullRequestURL := getFullRequestURL(baseURL, requestURL, channelType)

找到问题了,此处没有对 Azure 的渠道做兼容,或者兼容得不对。

from one-api.

ShinChven avatar ShinChven commented on May 23, 2024

参数传对了吗?我使用是正常的

请问能提供一个正确的调用示例吗?

就是用的官方库:

response = openai.Image.create(prompt=query, model='dall-e-3', size='1024x1024',style='vivid', quality='standard', n=1)
image_url = response["data"][0]["url"]
from openai import OpenAI


# Set your OpenAI API key and custom domain endpoint
api_key = '<api_key>'
api_base = '<host>/v1/'  # Replace with your custom domain URL
prompt = 'gundam in a ruined cityscape'

client = OpenAI(api_key=api_key, base_url=api_base)

response = client.images.generate(prompt=prompt, model='dall-e-3', size='1024x1024',style='vivid', quality='standard', n=1)
# image_url = response["data"][0]["url"]

print(response)
openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

不太对。 openai==1.3.5

404的话检查你的网络问题以及上游代理key的问题 image

https://github.com/songquanpeng/one-api/blob/main/controller/relay-utils.go#L191

这一行代码很可疑,好像直接跳过了,没有进去找 Azure 的路由。

因为调用 DALL-E-3 的时候 传入了requestURL从而忽略了openai/deployments

from one-api.

ShinChven avatar ShinChven commented on May 23, 2024

我似乎修完了,等下搞个PR

from one-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.