From 5090d9853bccf13a8c68ed3eb8010945394abd0f Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Wed, 24 Sep 2025 00:20:49 +0800 Subject: [PATCH] feat(translators): improve system instruction extraction and input handling for OpenAI and Claude responses - Enhanced support for extracting system instructions from input arrays. - Improved input message role and type determination logic for consistent message processing. - Refined instruction handling logic across translator types for better compatibility. --- internal/runtime/executor/claude_executor.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/runtime/executor/claude_executor.go b/internal/runtime/executor/claude_executor.go index 8d8c62c6..c9665385 100644 --- a/internal/runtime/executor/claude_executor.go +++ b/internal/runtime/executor/claude_executor.go @@ -45,6 +45,7 @@ func (e *ClaudeExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, r } from := opts.SourceFormat to := sdktranslator.FromString("claude") + // Use streaming translation to preserve function calling, except for claude. body := sdktranslator.TranslateRequest(from, to, req.Model, bytes.Clone(req.Payload), from != to) if !strings.HasPrefix(req.Model, "claude-3-5-haiku") {