From d4e6bef7dec32ef6607fd0983cf4c786f7aecd9c Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 6 Mar 2025 00:41:20 -0800 Subject: [PATCH] stash changes --- litellm/litellm_core_utils/streaming_handler.py | 7 +++---- litellm/proxy/proxy_config.yaml | 10 ++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py index 3bc800fe310..f453687450b 100644 --- a/litellm/litellm_core_utils/streaming_handler.py +++ b/litellm/litellm_core_utils/streaming_handler.py @@ -955,9 +955,8 @@ class CustomStreamWrapper: if reasoning_content: if self.sent_first_thinking_block is False: self.thinking_content += ( - (model_response.choices[0].delta.content or "") - + f"{model_response.choices[0].delta.reasoning_content}" - ) + model_response.choices[0].delta.content or "" + ) + f"{model_response.choices[0].delta.reasoning_content}" self.sent_first_thinking_block = True return None elif ( @@ -974,7 +973,7 @@ class CustomStreamWrapper: and not self.sent_last_thinking_block and model_response.choices[0].delta.content ): - self.thinking_content += "" + self.thinking_content += "" model_response.choices[0].delta.content = self.thinking_content self.sent_last_thinking_block = True diff --git a/litellm/proxy/proxy_config.yaml b/litellm/proxy/proxy_config.yaml index 86c32b610a0..35bb99a3698 100644 --- a/litellm/proxy/proxy_config.yaml +++ b/litellm/proxy/proxy_config.yaml @@ -1,12 +1,14 @@ model_list: - - model_name: fake-openai-endpoint + - model_name: bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0 litellm_params: - model: openai/my-fake-model - api_key: my-fake-key - api_base: https://exampleopenaiendpoint-production.up.railway.app/ + model: bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0 + thinking: {"type": "enabled", "budget_tokens": 1024} + max_tokens: 1080 general_settings: store_model_in_db: true store_prompts_in_spend_logs: true +litellm_settings: + merge_reasoning_content_in_choices: true