v6 version first commit

This commit is contained in:
Luis Pater
2025-09-22 01:40:24 +08:00
parent d42384cdb7
commit 4999fce7f4
171 changed files with 7626 additions and 7494 deletions

View File

@@ -8,6 +8,7 @@ import (
"bytes"
"context"
log "github.com/sirupsen/logrus"
"github.com/tidwall/sjson"
)
@@ -25,6 +26,7 @@ import (
// Returns:
// - []string: A slice of strings, each containing a Gemini CLI-compatible JSON response.
func ConvertGeminiResponseToGeminiCLI(_ context.Context, _ string, originalRequestRawJSON, requestRawJSON, rawJSON []byte, _ *any) []string {
log.Debug("ConvertGeminiResponseToGeminiCLI")
if bytes.Equal(rawJSON, []byte("[DONE]")) {
return []string{}
}
@@ -44,6 +46,7 @@ func ConvertGeminiResponseToGeminiCLI(_ context.Context, _ string, originalReque
// Returns:
// - string: A Gemini CLI-compatible JSON response.
func ConvertGeminiResponseToGeminiCLINonStream(_ context.Context, _ string, originalRequestRawJSON, requestRawJSON, rawJSON []byte, _ *any) string {
log.Debug("ConvertGeminiResponseToGeminiCLINonStream")
json := `{"response": {}}`
rawJSON, _ = sjson.SetRawBytes([]byte(json), "response", rawJSON)
return string(rawJSON)