diff --git a/litellm/llms/sap/chat/transformation.py b/litellm/llms/sap/chat/transformation.py index 8274c8ad359..dbad6944d73 100755 --- a/litellm/llms/sap/chat/transformation.py +++ b/litellm/llms/sap/chat/transformation.py @@ -266,7 +266,8 @@ class GenAIHubOrchestrationConfig(OpenAIGPTConfig): stream_config = {} if "stream_options" in optional_params: stream_options = optional_params.pop("stream_options", {}) - stream_config["chunk_size"] = stream_options.get("chunk_size", 100) + if "chunk_size" in stream_options: + stream_config["chunk_size"] = stream_options.get("chunk_size") if "delimiters" in stream_options: stream_config["delimiters"] = stream_options.get("delimiters") diff --git a/litellm/llms/sap/embed/transformation.py b/litellm/llms/sap/embed/transformation.py index 7202d4bcbf2..7f4532a50e6 100644 --- a/litellm/llms/sap/embed/transformation.py +++ b/litellm/llms/sap/embed/transformation.py @@ -167,7 +167,8 @@ class GenAIHubEmbeddingConfig(BaseEmbeddingConfig): input_dict = {"text": input} if optional_params.get("type"): input_dict["type"] = optional_params.get("type") - masking = {"masking": optional_params.get("masking")} if optional_params.get("masking") else {} + masking = optional_params.get("masking") + masking = {"masking": masking} if masking is not None else {} body = { "config": { "modules": { diff --git a/tests/test_litellm/llms/sap/chat/test_sap_transformation.py b/tests/test_litellm/llms/sap/chat/test_sap_transformation.py index 127d9c2f922..3ecb8028af8 100644 --- a/tests/test_litellm/llms/sap/chat/test_sap_transformation.py +++ b/tests/test_litellm/llms/sap/chat/test_sap_transformation.py @@ -426,9 +426,12 @@ class TestSAPTransformationIntegration: headers={} ) assert "translation" not in config["config"]["modules"][0] - assert config["config"]["modules"][1]["translation"] == translation_config + translation = config["config"]["modules"][1]["translation"] + assert translation["input"]["config"]["source_language"] == "en-US" + assert translation["input"]["config"]["target_language"] == "de-DE" + assert translation["output"]["config"]["target_language"] == "fr-FR" assert config["config"]["modules"][1]["prompt_templating"]["model"]["name"] == "gpt-5" assert config["config"]["modules"][0]["prompt_templating"]["model"]["name"] == "gpt-4o" assert config["config"]["modules"][0]["prompt_templating"]["model"]["params"] == {} assert config["config"]["modules"][1]["prompt_templating"]["prompt"]["template"][0]["content"] == "Hello world!" - assert config["config"]["modules"][0]["prompt_templating"]["prompt"]["template"][0]["content"] == "Hello." \ No newline at end of file + assert config["config"]["modules"][0]["prompt_templating"]["prompt"]["template"][0]["content"] == "Hello."