mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
(sap) fix after bot review
This commit is contained in:
parent
178ce613e8
commit
9e5d3d418f
3 changed files with 16 additions and 14 deletions
|
|
@ -1,9 +1,8 @@
|
|||
from typing import Union, Literal, Optional, Any, Self
|
||||
from typing import Union, Literal, Optional
|
||||
from enum import Enum
|
||||
import warnings
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator, model_validator
|
||||
from pydantic.config import ExtraValues
|
||||
|
||||
|
||||
def validate_different_content(v: Union[str, dict, list]) -> str:
|
||||
|
|
|
|||
|
|
@ -211,18 +211,18 @@ class GenAIHubOrchestrationConfig(OpenAIGPTConfig):
|
|||
optional_params = dict(optional_params)
|
||||
optional_params.pop("deployment_url", None)
|
||||
|
||||
# Filter strict for GPT models only - SAP AI Core doesn't accept it as a model param
|
||||
# LangChain agents pass strict=true at top level, which fails for GPT models
|
||||
# Anthropic models accept strict, so preserve it for them
|
||||
if model.startswith("gpt") and "strict" in optional_params:
|
||||
optional_params.pop("strict")
|
||||
|
||||
def _build_prompt_module(
|
||||
*,
|
||||
model_name: str,
|
||||
template_messages: List[Dict[str, str]],
|
||||
params: dict,
|
||||
) -> dict:
|
||||
# Filter strict for GPT models only - SAP AI Core doesn't accept it as a model param
|
||||
# LangChain agents pass strict=true at top level, which fails for GPT models
|
||||
# Anthropic models accept strict, so preserve it for them
|
||||
if model.startswith("gpt") and "strict" in optional_params:
|
||||
optional_params.pop("strict")
|
||||
|
||||
model_version = params.pop("model_version", "latest")
|
||||
|
||||
tools_ = params.pop("tools", [])
|
||||
|
|
|
|||
|
|
@ -164,13 +164,16 @@ class GenAIHubEmbeddingConfig(BaseEmbeddingConfig):
|
|||
model_dict["name"] = model
|
||||
model_dict["version"] = optional_params.get("version", "latest")
|
||||
model_dict["params"] = optional_params.get("parameters", {})
|
||||
if optional_params.get("timeout", None) is not None:
|
||||
model_dict["timeout"] = optional_params.get("timeout")
|
||||
if optional_params.get("max_retries", None) is not None:
|
||||
model_dict["max_retries"] = optional_params.get("max_retries")
|
||||
timeout = optional_params.get("timeout", None)
|
||||
if timeout is not None:
|
||||
model_dict["timeout"] = timeout
|
||||
max_retries = optional_params.get("max_retries", None)
|
||||
if max_retries is not None:
|
||||
model_dict["max_retries"] = max_retries
|
||||
input_dict = {"text": input}
|
||||
if optional_params.get("type"):
|
||||
input_dict["type"] = optional_params.get("type")
|
||||
input_type = optional_params.get("type")
|
||||
if input_type is not None:
|
||||
input_dict["type"] = input_type
|
||||
masking = optional_params.get("masking")
|
||||
masking = {"masking": masking} if masking is not None else {}
|
||||
body = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue