Compare commits

..

2 Commits

Author SHA1 Message Date
Luis Pater bdac24bb4e Update PassthroughGeminiResponseStream to handle [DONE] marker
docker-image / docker (push) Has been cancelled
goreleaser / goreleaser (push) Has been cancelled
- Added logic to return an empty slice when the raw JSON equals the `[DONE]` marker.
- Ensures proper termination of streamed Gemini responses.
2025-09-01 02:00:55 +08:00
Luis Pater 6d30faf9c9 Update Management API CN docs for authentication requirements
- Changed authentication requirements to mandate management keys for all requests, including local access.
- Clarified remote access setup and key provision methods.
- Adjusted the section header.
2025-08-31 15:29:20 +08:00
2 changed files with 33 additions and 30 deletions
+3 -4
View File
@@ -1,4 +1,4 @@
# 管理 API(简体中文)
# 管理 API
基础路径:`http://localhost:8317/v0/management`
@@ -10,9 +10,8 @@
## 认证
- 本地访问(`127.0.0.1``::1`):无需管理密钥
- 远程访问需要同时满足:
- 配置中 `allow-remote-management: true`
- 所有请求(包括本地访问)都必须提供有效的管理密钥.
- 远程访问需要在配置文件中开启远程访问: `allow-remote-management: true`
- 通过以下任意方式提供管理密钥(明文):
- `Authorization: Bearer <plaintext-key>`
- `X-Management-Key: <plaintext-key>`
@@ -1,11 +1,15 @@
package gemini
import (
"bytes"
"context"
)
// PassthroughGeminiResponseStream forwards Gemini responses unchanged.
func PassthroughGeminiResponseStream(_ context.Context, _ string, rawJSON []byte, _ *any) []string {
if bytes.Equal(rawJSON, []byte("[DONE]")) {
return []string{}
}
return []string{string(rawJSON)}
}