(sap) fix after bot review

This commit is contained in:
Vasilisa Parshikova 2026-03-11 21:36:28 +04:00 • committed by Sameer Kankute
parent 315f1755e8
commit 6123651b30
No known key found for this signature in database
3 changed files with 9 additions and 4 deletions

View file

@ -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")

View file

@ -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": {

View file

@ -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."
assert config["config"]["modules"][0]["prompt_templating"]["prompt"]["template"][0]["content"] == "Hello."