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

接口调用不成功 #4

Closed
fatwang2 opened this issue Dec 17, 2023 · 18 comments
Closed

接口调用不成功 #4

fatwang2 opened this issue Dec 17, 2023 · 18 comments

Comments

@fatwang2
Copy link

感谢开发者,非常需要这个项目,但是我不管是用你的api地址,还是我自己部署了一个api地址,调用之后响应都是,不知道是哪里的问题。

A server error has occurred

FUNCTION_INVOCATION_FAILED
@sugarforever
Copy link
Owner

sugarforever commented Dec 17, 2023

你好。目前我的部署你可以尝试这样调用。你自己部署的是Docker容器吗?可以看看uvicorn的输出,看看是什么错误?

--header 'Content-Type: application/json' \
--data '{
    "messages": [
        {
            "role": "user",
            "content": "李白最有名的诗是什么?"
        }
    ],
    "model": "spark-api",
    "max_tokens": null,
    "stream": false,
    "n": 1,
    "temperature": 0.7,
    "version": "v2.1"
}'```

@fatwang2
Copy link
Author

您好,我是通过postman调用测试的,我自己部署用的是vercel,也试过你的api地址

@sugarforever
Copy link
Owner

你能把postman里的请求code发来看看吗?curl的就行。如果你用了自己的密钥,记得把app id,key,secret这些隐藏掉

@fatwang2
Copy link
Author

你能把postman里的请求code发来看看吗?curl的就行。如果你用了自己的密钥,记得把app id,key,secret这些隐藏掉

服务器上线后的地址+/v1/chat/completions,headers和 body 也都是跟你一样

@sugarforever
Copy link
Owner

那你在本地开发环境能在localhost跑吗?正常不?还是有同样的问题?

@fatwang2
Copy link
Author

那你在本地开发环境能在localhost跑吗?正常不?还是有同样的问题?

你现在用项目里贴的那个vercel的地址可以直接调用吗?

@sugarforever
Copy link
Owner

那你在本地开发环境能在localhost跑吗?正常不?还是有同样的问题?

你现在用项目里贴的那个vercel的地址可以直接调用吗?

那个部署我已经停掉了。Vercel上的部署无法支持流式。

你可以尝试这个域名 - gateway.openai-cloud.com

这是我的一个新的部署

@fatwang2
Copy link
Author

fatwang2 commented Dec 23, 2023 via email

@sugarforever
Copy link
Owner

sugarforever commented Dec 23, 2023 via email

@fatwang2
Copy link
Author

fatwang2 commented Dec 23, 2023 via email

@fatwang2
Copy link
Author

这里的imageurl不支持base64的编码,只支持图片url,作者考虑优化么?

@sugarforever
Copy link
Owner

sugarforever commented Dec 24, 2023 via email

@fatwang2
Copy link
Author

哈哈 我是希望简化我这个项目的代码 https://github.com/fatwang2/sum4all

@sugarforever
Copy link
Owner

sugarforever commented Dec 24, 2023 via email

@fatwang2
Copy link
Author

fatwang2 commented Dec 25, 2023 via email

@sugarforever
Copy link
Owner

Closing it now as it's not an issue any more. The enhancement mentioned will be tracked by a separate issue.

@fatwang2
Copy link
Author

fatwang2 commented Jan 6, 2024

您好,请问base64是不是暂时依然不支持,我刚才试了下还是不行

@sugarforever
Copy link
Owner

@fatwang2 , I just used a PR #11 to support it.

Please review. You should be able to use the same payload as OpenAI vision API now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants