Add support for custom parameters for LLM

This commit is contained in:
Bobby Lindsey
2025-01-23 16:07:13 -07:00
committed by GitHub
parent 73740ffd21
commit ea49b3a045

View File

@@ -136,6 +136,7 @@ class LLM:
api_version: Optional[str] = None,
api_key: Optional[str] = None,
callbacks: List[Any] = [],
**custom_params: Dict[str, Any],
):
self.model = model
self.timeout = timeout
@@ -156,6 +157,7 @@ class LLM:
self.api_key = api_key
self.callbacks = callbacks
self.context_window_size = 0
self.custom_params = custom_params
litellm.drop_params = True
@@ -237,6 +239,7 @@ class LLM:
"api_key": self.api_key,
"stream": False,
"tools": tools,
**self.custom_params["custom_params"],
}
# Remove None values from params