[GH-ISSUE #12] nextchat先显示Failed to fetch而后显示empty response from server;chathub插件报错404;直接用curl命令则后台能正常返回 #11

Closed
opened 2026-02-27 07:17:20 +03:00 by kerem · 12 comments
Owner

Originally created by @rakaki on GitHub (Jul 31, 2025).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/12

终端显示如下:

2025/7/31 17:10:09
[Server] Received request: OPTIONS http://192.168.31.237:3000/v1/chat/completions
[Config] Ignoring invalid MODEL_PROVIDER in path segment: v1
OPTIONS REQUEST SUCCESS
Originally created by @rakaki on GitHub (Jul 31, 2025). Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/12 终端显示如下: ``` 2025/7/31 17:10:09 [Server] Received request: OPTIONS http://192.168.31.237:3000/v1/chat/completions [Config] Ignoring invalid MODEL_PROVIDER in path segment: v1 OPTIONS REQUEST SUCCESS ```
kerem closed this issue 2026-02-27 07:17:20 +03:00
Author
Owner

@rakaki commented on GitHub (Jul 31, 2025):

使用chathub插件,终端报错如下:

7/31/2025, 11:42:26 AM
[Server] Received request: POST http://192.168.31.204:3000/v1/chat/completions
[Config] Ignoring invalid MODEL_PROVIDER in path segment: v1
[Request Convert] Converting request from openai to gemini-cli-oauth
[Function: toGeminiRequestFromOpenAI]
[Request Conversion] Warning: Conversation does not start with a 'user' role.
[Content Generation] Model: o3-mini, Stream: true
[System Prompt Manager] System prompt updated in file for provider 'gemini'.
7/31/2025, 11:42:26 AM [INPUT]:
hello
--------------------------------------

[Auth Token] Time until expiry: 00h 58m 52s

[Server] Error during stream processing: Error: Request failed with status code 404
    at Gaxios._request (/root/AIClient-2-API/node_modules/gaxios/build/cjs/src/gaxios.js:154:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async OAuth2Client.requestAsync (/root/AIClient-2-API/node_modules/google-auth-library/build/src/auth/oauth2client.js:463:20)
    at async GeminiApiService.streamApi (file:///root/AIClient-2-API/src/gemini/gemini-core.js:247:25)
    at async GeminiApiService.generateContentStream (file:///root/AIClient-2-API/src/gemini/gemini-core.js:312:26)
    at async GeminiApiServiceAdapter.generateContentStream (file:///root/AIClient-2-API/src/adapter.js:68:9)
    at async handleStreamRequest (file:///root/AIClient-2-API/src/common.js:211:26)
    at async handleContentGenerationRequest (file:///root/AIClient-2-API/src/common.js:364:9)
    at async Server.requestHandler (file:///root/AIClient-2-API/src/api-server.js:448:28)
<!-- gh-comment-id:3139638753 --> @rakaki commented on GitHub (Jul 31, 2025): 使用chathub插件,终端报错如下: ``` 7/31/2025, 11:42:26 AM [Server] Received request: POST http://192.168.31.204:3000/v1/chat/completions [Config] Ignoring invalid MODEL_PROVIDER in path segment: v1 [Request Convert] Converting request from openai to gemini-cli-oauth [Function: toGeminiRequestFromOpenAI] [Request Conversion] Warning: Conversation does not start with a 'user' role. [Content Generation] Model: o3-mini, Stream: true [System Prompt Manager] System prompt updated in file for provider 'gemini'. 7/31/2025, 11:42:26 AM [INPUT]: hello -------------------------------------- [Auth Token] Time until expiry: 00h 58m 52s [Server] Error during stream processing: Error: Request failed with status code 404 at Gaxios._request (/root/AIClient-2-API/node_modules/gaxios/build/cjs/src/gaxios.js:154:23) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async OAuth2Client.requestAsync (/root/AIClient-2-API/node_modules/google-auth-library/build/src/auth/oauth2client.js:463:20) at async GeminiApiService.streamApi (file:///root/AIClient-2-API/src/gemini/gemini-core.js:247:25) at async GeminiApiService.generateContentStream (file:///root/AIClient-2-API/src/gemini/gemini-core.js:312:26) at async GeminiApiServiceAdapter.generateContentStream (file:///root/AIClient-2-API/src/adapter.js:68:9) at async handleStreamRequest (file:///root/AIClient-2-API/src/common.js:211:26) at async handleContentGenerationRequest (file:///root/AIClient-2-API/src/common.js:364:9) at async Server.requestHandler (file:///root/AIClient-2-API/src/api-server.js:448:28) ```
Author
Owner

@justlikemaki commented on GitHub (Jul 31, 2025):

provider 'gemini' 只能用 gemini-2.5-flash 和 gemini-2.5-pro

<!-- gh-comment-id:3139783237 --> @justlikemaki commented on GitHub (Jul 31, 2025): provider 'gemini' 只能用 gemini-2.5-flash 和 gemini-2.5-pro
Author
Owner

@justlikemaki commented on GitHub (Jul 31, 2025):

nextchat先显示Failed to fetch,应该是发起options请求的校验,每个客户端请求方式都不一样,没有适配,可以忽略

<!-- gh-comment-id:3139792088 --> @justlikemaki commented on GitHub (Jul 31, 2025): nextchat先显示Failed to fetch,应该是发起options请求的校验,每个客户端请求方式都不一样,没有适配,可以忽略
Author
Owner

@rakaki commented on GitHub (Jul 31, 2025):

那么nextchat应该如何配置。我目前是选择openai服务商,接口填http://192.168.31.237:3000,api key是123456,模型选择gpt-4o,现象就是本issue的现象

<!-- gh-comment-id:3140000920 --> @rakaki commented on GitHub (Jul 31, 2025): 那么nextchat应该如何配置。我目前是选择openai服务商,接口填http://192.168.31.237:3000,api key是123456,模型选择gpt-4o,现象就是本issue的现象
Author
Owner

@justlikemaki commented on GitHub (Jul 31, 2025):

不支持gpt-4o,不能填自定义模型吗?
也可以直接使用gemini服务商来对接。

<!-- gh-comment-id:3140083854 --> @justlikemaki commented on GitHub (Jul 31, 2025): 不支持gpt-4o,不能填自定义模型吗? 也可以直接使用gemini服务商来对接。
Author
Owner

@rakaki commented on GitHub (Aug 1, 2025):

nextchat采用自定义模型,google接口,仍然没有返回回答,日志如下:

2025/8/1 11:26:16
[Server] Received request: OPTIONS http://localhost:3000/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse
[Config] Ignoring invalid MODEL_PROVIDER in path segment: v1beta
OPTIONS REQUEST SUCCESS

配置:https://youke1.picui.cn/s1/2025/08/01/688c34f9ecaaf.png

<!-- gh-comment-id:3142051578 --> @rakaki commented on GitHub (Aug 1, 2025): nextchat采用自定义模型,google接口,仍然没有返回回答,日志如下: ``` 2025/8/1 11:26:16 [Server] Received request: OPTIONS http://localhost:3000/v1beta/models/gemini-2.5-flash:streamGenerateContent?alt=sse [Config] Ignoring invalid MODEL_PROVIDER in path segment: v1beta OPTIONS REQUEST SUCCESS ``` 配置:https://youke1.picui.cn/s1/2025/08/01/688c34f9ecaaf.png
Author
Owner

@justlovemaki commented on GitHub (Aug 1, 2025):

OPTIONS REQUEST SUCCESS,说明是options请求,并不是发消息用的post请求。ai对话框和命令行的截图有吗?

<!-- gh-comment-id:3142067188 --> @justlovemaki commented on GitHub (Aug 1, 2025): OPTIONS REQUEST SUCCESS,说明是options请求,并不是发消息用的post请求。ai对话框和命令行的截图有吗?
Author
Owner

@justlovemaki commented on GitHub (Aug 1, 2025):

https://github.com/user-attachments/assets/f114efae-6652-492c-87e4-713f634e1242

自定义AI资源,url只能填外网可访问的IP或域名,我是做了内网穿透

<!-- gh-comment-id:3142201652 --> @justlovemaki commented on GitHub (Aug 1, 2025): https://github.com/user-attachments/assets/f114efae-6652-492c-87e4-713f634e1242 自定义AI资源,url只能填外网可访问的IP或域名,我是做了内网穿透
Author
Owner

@rakaki commented on GitHub (Aug 1, 2025):

OPTIONS REQUEST SUCCESS,说明是options请求,并不是发消息用的post请求。ai对话框和命令行的截图有吗?
截图如下

Image
<!-- gh-comment-id:3142807931 --> @rakaki commented on GitHub (Aug 1, 2025): > OPTIONS REQUEST SUCCESS,说明是options请求,并不是发消息用的post请求。ai对话框和命令行的截图有吗? 截图如下 <img width="1896" height="1185" alt="Image" src="https://github.com/user-attachments/assets/a65abc39-d30e-4035-a7ad-ccf599db5fb1" />
Author
Owner

@rakaki commented on GitHub (Aug 1, 2025):

请教下您用的是哪个版本的nextchat,我没找到这个功能

8.1.mp4

自定义AI资源,url只能填外网可访问的IP或域名,我是做了内网穿透

<!-- gh-comment-id:3142851281 --> @rakaki commented on GitHub (Aug 1, 2025): 请教下您用的是哪个版本的nextchat,我没找到这个功能 > 8.1.mp4 > > 自定义AI资源,url只能填外网可访问的IP或域名,我是做了内网穿透
Author
Owner

@justlovemaki commented on GitHub (Aug 1, 2025):

https://nextchat.club/ 网页版

<!-- gh-comment-id:3142954548 --> @justlovemaki commented on GitHub (Aug 1, 2025): https://nextchat.club/ 网页版
Author
Owner

@justlovemaki commented on GitHub (Aug 1, 2025):

OPTIONS REQUEST SUCCESS,说明是options请求,并不是发消息用的post请求。ai对话框和命令行的截图有吗?
截图如下

Image

你这个hello的请求都发过去,console模式是会打印输入输出的

<!-- gh-comment-id:3142987384 --> @justlovemaki commented on GitHub (Aug 1, 2025): > > OPTIONS REQUEST SUCCESS,说明是options请求,并不是发消息用的post请求。ai对话框和命令行的截图有吗? > > 截图如下 > > <img alt="Image" width="1896" height="1185" src="https://private-user-images.githubusercontent.com/88972415/473316375-a65abc39-d30e-4035-a7ad-ccf599db5fb1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTQwMzEyNzMsIm5iZiI6MTc1NDAzMDk3MywicGF0aCI6Ii84ODk3MjQxNS80NzMzMTYzNzUtYTY1YWJjMzktZDMwZS00MDM1LWE3YWQtY2NmNTk5ZGI1ZmIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA4MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwODAxVDA2NDkzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA4MzdmNzcwZDA3OGQ4N2E5MmZhZjg0YjA2M2E0MTE2MzEwNDA5NGVkOGM2Zjk4NjFiZjA3MjU1MzNkNjcwZTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.cljzkEl5JJ7bVcgpoIY5A7kEZxXFGhCLlvo_SOstesc"> 你这个hello的请求都发过去,console模式是会打印输入输出的
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AIClient-2-API-justlovemaki#11
No description provided.