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

@@ -28,7 +28,7 @@ type TranslateRequestFunc func(string, []byte, bool) []byte
//
// Returns:
// - []string: An array of translated response strings
type TranslateResponseFunc func(ctx context.Context, modelName string, rawJSON []byte, param *any) []string
type TranslateResponseFunc func(ctx context.Context, modelName string, originalRequestRawJSON, requestRawJSON, rawJSON []byte, param *any) []string
// TranslateResponseNonStreamFunc defines a function type for translating non-streaming API responses.
// It processes response data and returns a single translated response string.
@@ -41,7 +41,7 @@ type TranslateResponseFunc func(ctx context.Context, modelName string, rawJSON [
//
// Returns:
// - string: A single translated response string
type TranslateResponseNonStreamFunc func(ctx context.Context, modelName string, rawJSON []byte, param *any) string
type TranslateResponseNonStreamFunc func(ctx context.Context, modelName string, originalRequestRawJSON, requestRawJSON, rawJSON []byte, param *any) string
// TranslateResponse contains both streaming and non-streaming response translation functions.
// This structure allows clients to handle both types of API responses appropriately.