mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
(sap) fix after bot review
This commit is contained in:
parent
3a9610fcf8
commit
1bd5b6339f
3 changed files with 5 additions and 6 deletions
|
|
@ -34,7 +34,7 @@ from .models import ResponseFormatJSONSchema, ResponseFormat, OrchestrationReque
|
|||
from .handler import GenAIHubOrchestrationError, AsyncSAPStreamIterator, SAPStreamIterator
|
||||
|
||||
def validate_dict(data: dict, model) -> dict:
|
||||
return model(**data).model_dump(by_alias=True, exclude_none=True)
|
||||
return model(**data).model_dump(by_alias=True, exclude_unset=True)
|
||||
|
||||
|
||||
class GenAIHubOrchestrationConfig(OpenAIGPTConfig):
|
||||
|
|
@ -240,7 +240,7 @@ class GenAIHubOrchestrationConfig(OpenAIGPTConfig):
|
|||
optional_modules = {}
|
||||
optional_modules_lst = ["grounding", "masking", "filtering", "translation"]
|
||||
for module in optional_modules_lst:
|
||||
if params.get(module, None) is None:
|
||||
if params.get(module, None) is not None:
|
||||
optional_modules[module] = params.pop(module)
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class EmbeddingsModules(BaseModel):
|
|||
|
||||
class EmbeddingInput(BaseModel):
|
||||
text: Union[str, List[str]]
|
||||
type: Literal["text", "document", "query"] = "text"
|
||||
type: Optional[Literal["text", "document", "query"]] = None
|
||||
|
||||
class EmbeddingConfig(BaseModel):
|
||||
modules: EmbeddingsModules
|
||||
|
|
@ -73,7 +73,7 @@ class EmbeddingRequest(BaseModel):
|
|||
|
||||
|
||||
def validate_dict(data: dict, model) -> dict:
|
||||
return model(**data).model_dump(exclude_none=True, by_alias=True)
|
||||
return model(**data).model_dump(exclude_unset=True, by_alias=True)
|
||||
|
||||
|
||||
class GenAIHubEmbeddingConfig(BaseEmbeddingConfig):
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@ def test_basic_config_transform(fake_token_creator, fake_deployment_url):
|
|||
}
|
||||
},
|
||||
'input': {
|
||||
'text': 'Hi',
|
||||
'type': 'text'
|
||||
'text': 'Hi'
|
||||
}
|
||||
}
|
||||
with patch(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue