Add OpenAI Responses support

This commit is contained in:
Luis Pater
2025-09-02 09:07:44 +08:00
parent e11637dc62
commit ce5d2bad97
54 changed files with 2378 additions and 144 deletions

View File

@@ -34,7 +34,8 @@ import (
//
// Returns:
// - []byte: The transformed request data in Gemini CLI API format
func ConvertClaudeRequestToCLI(modelName string, rawJSON []byte, _ bool) []byte {
func ConvertClaudeRequestToCLI(modelName string, inputRawJSON []byte, _ bool) []byte {
rawJSON := bytes.Clone(inputRawJSON)
var pathsToDelete []string
root := gjson.ParseBytes(rawJSON)
util.Walk(root, "", "additionalProperties", &pathsToDelete)

View File

@@ -41,7 +41,7 @@ type Params struct {
//
// Returns:
// - []string: A slice of strings, each containing a Claude Code-compatible JSON response
func ConvertGeminiCLIResponseToClaude(_ context.Context, _ string, rawJSON []byte, param *any) []string {
func ConvertGeminiCLIResponseToClaude(_ context.Context, _ string, originalRequestRawJSON, requestRawJSON, rawJSON []byte, param *any) []string {
if *param == nil {
*param = &Params{
HasFirstResponse: false,
@@ -251,6 +251,6 @@ func ConvertGeminiCLIResponseToClaude(_ context.Context, _ string, rawJSON []byt
//
// Returns:
// - string: A Claude-compatible JSON response.
func ConvertGeminiCLIResponseToClaudeNonStream(_ context.Context, _ string, _ []byte, _ *any) string {
func ConvertGeminiCLIResponseToClaudeNonStream(_ context.Context, _ string, originalRequestRawJSON, requestRawJSON, _ []byte, _ *any) string {
return ""
}