mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
Add OpenAI Responses support
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user