Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion agent/auxiliary_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ def create(self, **kwargs) -> Any:
messages=messages,
tools=tools,
max_tokens=max_tokens,
reasoning_config=None,
reasoning_config=kwargs.get("reasoning_config"),
tool_choice=normalized_tool_choice,
is_oauth=self._is_oauth,
)
Expand All @@ -1009,6 +1009,19 @@ def create(self, **kwargs) -> Any:
if not _forbids_sampling_params(model):
anthropic_kwargs["temperature"] = temperature

# Pass through any caller-supplied extra_body so providers behind
# Anthropic-compatible gateways can receive their per-vendor request
# fields (e.g. thinking control, metadata, service_tier). The dict
# form is the documented Anthropic SDK passthrough for non-standard
# request body keys; merge on top of whatever build_anthropic_kwargs
# already produced to preserve call-time settings.
caller_extra_body = kwargs.get("extra_body")
if caller_extra_body and isinstance(caller_extra_body, dict):
existing = anthropic_kwargs.get("extra_body") or {}
if not isinstance(existing, dict):
existing = {}
anthropic_kwargs["extra_body"] = {**existing, **caller_extra_body}

response = self._client.messages.create(**anthropic_kwargs)
_transport = get_transport("anthropic_messages")
_nr = _transport.normalize_response(
Expand Down