feat: support Claude 4 Interleaved thinking (beta) (#164)
This commit is contained in:
@@ -567,6 +567,10 @@ class BedrockModel(BaseChatModel):
|
||||
assert "function" in chat_request.tool_choice
|
||||
tool_config["toolChoice"] = {"tool": {"name": chat_request.tool_choice["function"].get("name", "")}}
|
||||
args["toolConfig"] = tool_config
|
||||
# add Additional fields to enable extend thinking
|
||||
if chat_request.extra_body:
|
||||
# reasoning_config will not be used
|
||||
args["additionalModelRequestFields"] = chat_request.extra_body
|
||||
return args
|
||||
|
||||
def _create_response(
|
||||
|
||||
@@ -107,6 +107,7 @@ class ChatRequest(BaseModel):
|
||||
tools: list[Tool] | None = None
|
||||
tool_choice: str | object = "auto"
|
||||
stop: list[str] | str | None = None
|
||||
extra_body: dict | None = None
|
||||
|
||||
|
||||
class Usage(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user