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

处理url带models的请求 #21

Closed
wwjCMP opened this issue May 1, 2024 · 9 comments
Closed

处理url带models的请求 #21

wwjCMP opened this issue May 1, 2024 · 9 comments

Comments

@wwjCMP
Copy link

wwjCMP commented May 1, 2024

0|glm-free-api | [2024-05-01 14:40:40.300][warning][server.ts<79,20>] [请求有误]: 正确请求为 POST -> /v1/chat/completions,当前请求为 GET -> /v1/chat/completions/models 请纠正

使用cursor 编辑器,它会在url后面加上models,这样就出现上面的问题

@Vinlic
Copy link
Member

Vinlic commented May 1, 2024

base url没有设置正确,请填写到/v1为止,后续的部分不要加。

@Vinlic Vinlic closed this as completed May 1, 2024
@wwjCMP
Copy link
Author

wwjCMP commented May 1, 2024

base url没有设置正确,请填写到/v1为止,后续的部分不要加。

不行的,这个软件它会自动加上models

@wwjCMP
Copy link
Author

wwjCMP commented May 1, 2024

0|glm-free-api | [2024-05-01 17:46:38.859][warning][server.ts<79,20>] [请求有误]: 正确请求为 POST -> /v1/chat/completions,当前请求为 GET -> /v1//models 请纠正

@Vinlic
Copy link
Member

Vinlic commented May 1, 2024

程序加models没问题,目前最新版本都会返回模型列表,base url尾部不要加/,拼接后就变成//

@wwjCMP
Copy link
Author

wwjCMP commented May 1, 2024

0|glm-free-api | [2024-05-01 18:17:58.562][info][server.ts<99,28>] -> POST /v1/chat/completions
0|glm-free-api | [2024-05-01 18:17:58.562][info][chat.ts<176,12>] [
0|glm-free-api | { role: 'system', content: 'You are a helpful assistant.' },
0|glm-free-api | { role: 'user', content: 'Test prompt using gpt-3.5-turbo' }
0|glm-free-api | ]
0|glm-free-api | [2024-05-01 18:17:58.563][info][chat.ts<482,10>] 本次请求上传:0个文件
0|glm-free-api | [2024-05-01 18:17:58.563][info][chat.ts<545,10>]
0|glm-free-api | 对话合并:
0|glm-free-api | <|sytstem|>
0|glm-free-api | You are a helpful assistant.
0|glm-free-api | <|user|>
0|glm-free-api | Test prompt using gpt-3.5-turbo
0|glm-free-api | <|assistant|>
0|glm-free-api |
0|glm-free-api | [2024-05-01 18:17:59.835][success][chat.ts<229,12>] Stream has completed transfer 1082ms
0|glm-free-api | [2024-05-01 18:17:59.839][info][server.ts<66,36>] <- POST /v1/chat/completions 1277ms
0|glm-free-api | [2024-05-01 18:17:59.896][debug][server.ts<75,20>] -> GET /v1/models request is not supported - 127.0.0.1
0|glm-free-api | [2024-05-01 18:17:59.897][warning][server.ts<79,20>] [请求有误]: 正确请求为 POST -> /v1/chat/completions,当前请求为 GET -> /v1/models 请纠正
0|glm-free-api | [2024-05-01 18:17:59.898][info][server.ts<84,24>] <- GET /v1/models 2ms

@wwjCMP
Copy link
Author

wwjCMP commented May 1, 2024

Snipaste_2024-05-01_18-19-17

@Vinlic
Copy link
Member

Vinlic commented May 1, 2024

确认版本是否最新,我这边测试正常,models接口在0.0.23版本才加入支持

@wwjCMP
Copy link
Author

wwjCMP commented May 2, 2024

测试没问题了,我想问一下npm部署怎么进行更新

@Vinlic
Copy link
Member

Vinlic commented May 2, 2024

如果是clone的项目,直接拉最新代码,然后重启即可

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