-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add Claude Fable 5 across Anthropic, Bedrock, Vertex AI, and Azure AI #30064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7480337
1a080a2
b52f249
b475cf7
07a5662
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -920,10 +920,15 @@ def map_openai_params( | |
| continue | ||
| value = [value] | ||
| optional_params["stopSequences"] = value | ||
| if param == "temperature": | ||
| optional_params["temperature"] = value | ||
| if param == "top_p": | ||
| optional_params["topP"] = value | ||
| if param == "temperature" or param == "top_p": | ||
| AnthropicConfig._apply_sampling_param( | ||
| optional_params=optional_params, | ||
| model=model, | ||
| param=param, | ||
| value=value, | ||
| drop_params=drop_params, | ||
| output_key="topP" if param == "top_p" else param, | ||
| ) | ||
| if param == "tools" and isinstance(value, list): | ||
| self._apply_tool_call_transformation( | ||
| tools=cast(List[OpenAIChatCompletionToolParam], value), | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
|
|
@@ -1221,7 +1226,9 @@ def _transform_inference_params(self, inference_params: dict) -> InferenceConfig | |
| inference_params["topK"] = inference_params.pop("top_k") | ||
| return InferenceConfig(**inference_params) | ||
|
|
||
| def _handle_top_k_value(self, model: str, inference_params: dict) -> dict: | ||
| def _handle_top_k_value( | ||
| self, model: str, inference_params: dict, drop_params: bool = False | ||
| ) -> dict: | ||
| base_model = BedrockModelInfo.get_base_model(model) | ||
|
|
||
| val_top_k = None | ||
|
|
@@ -1230,16 +1237,25 @@ def _handle_top_k_value(self, model: str, inference_params: dict) -> dict: | |
| elif "top_k" in inference_params: | ||
| val_top_k = inference_params.pop("top_k") | ||
|
|
||
| if val_top_k: | ||
| if val_top_k is not None: | ||
| if base_model.startswith("anthropic"): | ||
| return {"top_k": val_top_k} | ||
| top_k_params: dict = {} | ||
| AnthropicConfig._apply_sampling_param( | ||
| optional_params=top_k_params, | ||
| model=model, | ||
| param="top_k", | ||
| value=val_top_k, | ||
| drop_params=drop_params, | ||
| output_key="top_k", | ||
| ) | ||
| return top_k_params | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Converse skips top_k zero gatingLow Severity Bedrock converse only runs sampling gating for Additional Locations (1)Reviewed by Cursor Bugbot for commit b475cf7. Configure here. |
||
| if base_model.startswith("amazon.nova"): | ||
| return {"inferenceConfig": {"topK": val_top_k}} | ||
|
|
||
| return {} | ||
|
|
||
| def _prepare_request_params( | ||
| self, optional_params: dict, model: str | ||
| self, optional_params: dict, model: str, drop_params: bool = False | ||
| ) -> Tuple[dict, dict, dict, Optional[OutputConfigBlock]]: | ||
| """Prepare and separate request parameters.""" | ||
| # Consume the internal ``_output_config_normalized`` marker set by | ||
|
|
@@ -1338,7 +1354,7 @@ def _prepare_request_params( | |
|
|
||
| # Only set the topK value in for models that support it | ||
| additional_request_params.update( | ||
| self._handle_top_k_value(model, inference_params) | ||
| self._handle_top_k_value(model, inference_params, drop_params) | ||
| ) | ||
|
|
||
| # Filter out internal/MCP-related parameters that shouldn't be sent to the API | ||
|
|
@@ -1572,6 +1588,7 @@ def _transform_request_helper( | |
| optional_params: dict, | ||
| messages: Optional[List[AllMessageValues]] = None, | ||
| headers: Optional[dict] = None, | ||
| drop_params: bool = False, | ||
| ) -> CommonRequestObject: | ||
| ## VALIDATE REQUEST | ||
| """ | ||
|
|
@@ -1618,7 +1635,7 @@ def _transform_request_helper( | |
| additional_request_params, | ||
| request_metadata, | ||
| output_config, | ||
| ) = self._prepare_request_params(optional_params, model) | ||
| ) = self._prepare_request_params(optional_params, model, drop_params) | ||
|
|
||
| original_tools = inference_params.pop("tools", []) | ||
|
|
||
|
|
@@ -1701,6 +1718,7 @@ async def _async_transform_request( | |
| optional_params=optional_params, | ||
| messages=messages, | ||
| headers=headers, | ||
| drop_params=litellm_params.get("drop_params") is True, | ||
| ) | ||
|
|
||
| bedrock_messages = ( | ||
|
|
@@ -1758,6 +1776,7 @@ def _transform_request( | |
| optional_params=optional_params, | ||
| messages=messages, | ||
| headers=headers, | ||
| drop_params=litellm_params.get("drop_params") is True, | ||
| ) | ||
|
|
||
| ## TRANSFORMATION ## | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.