Add OpenAI Responses support

This commit is contained in:
Luis Pater
2025-09-01 17:38:24 +08:00
parent e11637dc62
commit 3acdec51bd
54 changed files with 2394 additions and 144 deletions

View File

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

View File

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