Giter Club home page Giter Club logo

vercel-proxy-openai's People

Contributors

linlin00000000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vercel-proxy-openai's Issues

一直遇到超时的问题

Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.._completion_with_retry in 1.0 seconds as it raised APIError: Invalid response object from API: 'An error occurred with this application.\n\nROUTER_EXTERNAL_TARGET_ERROR\n' (HTTP response code was 502).

请问这个和通过vercel转发有关系么

访问不到

用apifox 调用会出现
An error occurred with this application.

ROUTER_EXTERNAL_TARGET_ERROR

出现了openai.error.InvalidRequestError: Invalid URL (POST /v1/chat/completions/chat/completions)

您好,我在按您的教程配置完成后仍然出现了如下问题,想咨询一下解决方案:
openai.error.InvalidRequestError: Invalid URL (POST/v1/chat/completions/chat/completions)

代码如下:
import openai

openai.api_key = "****"
host = '*****'
url = f'https://{host}/v1/chat/completions'
openai.api_base = url
messages = [
{"role": "system", "content": "You are a news creator"},
{"role": "user",
"content": f"Write a news article with the title 你好 that spans 3-4 paragraphs and comprehensively covers pertinent and vital information on the topic. Your piece should be both informative and engaging, capturing readers' attention and keeping them informed throughout."},
]

调用 GPT-3.5-turbo API

completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=messages
)

获取生成的新闻稿内容

print(completion.choices[0].message["content"]

提示以下错误

{
"error": {
"message": "Invalid URL (GET /)",
"type": "invalid_request_error",
"param": null,
"code": null
}
}

looking at the logs, hkg1 is the culprit so I disabled it

{
"rewrites": [
{ "source": "/", "destination": "https://api.openai.com" },
{
"source": "/:match*",
"destination": "https://api.openai.com/:match*"
}
],
"github": {
"silent": true
},
"regions": [
"arn1",
"bom1",
"cdg1",
"cle1",
"cpt1",
"dub1",
"fra1",
"gru1",
// "hkg1", ip blocked by openai
"hnd1",
"iad1",
"icn1",
"kix1",
"lhr1",
"pdx1",
"sfo1",
"sin1",
"syd1"
]
}

Python调用api方法时该怎么修改呢?

比如
原始调用方法是

import openai
openai.api_key = api
chat = openai.ChatCompletion.create(
            model="gpt-3.5-turbo",
            messages=messages,
            max_tokens=400,
        )

这段代码是不是修改成

import openai
openai.api_key = api
host = 'YOUR DOMAIN'
url=`https://${host}/v1/chat/completions`
openai.api_base= url
chat = openai.ChatCompletion.create(
            model="gpt-3.5-turbo",
            messages=messages,
            max_tokens=400,
        )

发布失败

Reliability: vercel-proxy-openai
·
Failed after 6s

image

访问也是404

请教使用方法问题

纯小白,自己会照葫芦画瓢。

使用方法
访问 openai api 时,将 "api.openai.com" 换成你的自定义域名,例如
const host = 'YOUR DOMAIN'
const url = https://${host}/v1/chat/completions
在其他 chatgpt 项目中,可以将变量 "OPENAI_API_BASE_URL" 设置为你的域名

我在别人开发好的项目里填入域名都无法成功,和我没操作第一条有关系吗?谢谢

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.