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

插件可以支持OpenAI API格式吗? #36

Open
xieqk opened this issue Oct 24, 2023 · 7 comments
Open

插件可以支持OpenAI API格式吗? #36

xieqk opened this issue Oct 24, 2023 · 7 comments

Comments

@xieqk
Copy link

xieqk commented Oct 24, 2023

No description provided.

@Virtual1257
Copy link

把插件的请求参数换一下就可以了,然后去除prompt的前缀,除了代码补全以外的功能都可以正常使用

image

@xieqk
Copy link
Author

xieqk commented Nov 8, 2023

我试了一下,貌似返回结果不对,后台看到有请求,也正常回复了,但是插件不显示内容
image
对返回结果修改了解码后,前后都会出现undefined的字符,请问你知道是怎么回事吗
image

@Virtual1257
Copy link

我试了一下,貌似返回结果不对,后台看到有请求,也正常回复了,但是插件不显示内容 image 对返回结果修改了解码后,前后都会出现undefined的字符,请问你知道是怎么回事吗 image

因为请求的接口变了,返回的参数格式也变了,要将返回参数的json解析改一改,参照下面修改:
image

@su-zelong
Copy link

我试了一下,貌似返回结果不对,后台看到有请求,也正常回复了,但是插件不显示内容 image 对返回结果修改了解码后,前后都会出现undefined的字符,请问你知道是怎么回事吗 image

因为请求的接口变了,返回的参数格式也变了,要将返回参数的json解析改一改,参照下面修改: image

请问解码文件是哪个啊,没有看到historyPrompt

@carusyte
Copy link

我fork了一个支持 Azure OpenAI 集成的版本,供参考
https://github.com/carusyte/codeshell-vscode

@su-zelong
Copy link

我fork了一个支持 Azure OpenAI 集成的版本,供参考 https://github.com/carusyte/codeshell-vscode

感谢您提供的codeshell
但是我想发送类似:
curl http://localhost:8000/v1/completions
-H "Content-Type: application/json"
-d '{
"model": "facebook/opt-125m",
"prompt": "San Francisco is a",
"max_tokens": 7,
"temperature": 0
}'
(vllm部署本地模型)
类似这种格式的请求,而我观察到 OpenAI中的uri与我想访问的地址不同,我尝试将uri更改成上述格式,但是插件似乎无法正常加载。

@heurainbow
Copy link

建议官方支持一个最新版openai api格式的模式

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

5 participants