Support `NativeOutput` and JSON mode on `SambaNovaProvider`, best-effort

Merged
DO
14h ago
+107-3

Written by Claude Code on behalf of @DouweM.

Part of #12086 (the SambaNova provider half of its decision; family mappings go through #12101).

Why

SambaNova documents response_format with json_object and json_schema, but SambaNovaProvider's profile advertised neither, so NativeOutput raised before sending and PromptedOutput couldn't use JSON mode. SambaNova accepts strict: true but says it "currently has no behavioral effect".

What changes

Per the maintainer decision on #12086, SambaNovaProvider.model_profile now sets supports_json_object_output=True and supports_json_schema_output=True. It also sets openai_supports_strict_tool_definition=False, which leaves strict out of the schema and tool definitions, the same way OllamaProvider does. JSON Schema adherence is best-effort; NativeOutput still validates the output and retries.

New public surface: none.

Verification: in tests/providers/test_sambanova_provider.py:

  • test_json_output_profile_flags;
  • test_native_output_omits_strict (json_schema response format with no strict);
  • test_prompted_output_uses_json_object.

All three fail on main.

What changes for existing users: on SambaNova, NativeOutput works (best-effort) instead of raising, PromptedOutput without tools sends json_object, and tool definitions no longer carry strict, which SambaNova ignores. The SambaNova docs section says so.

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.

šŸ¤– Generated with Claude Code


Summary by cubic

Enables JSON output support on SambaNovaProvider on a best-effort basis. Previously NativeOutput raised before sending because the provider advertised no JSON output support, and PromptedOutput couldn't use JSON mode.

  • The provider now advertises both json_schema and json_object output and omits strict from request payloads and tool definitions, since SambaNova reports it has no behavioral effect.
  • JSON Schema adherence is best-effort; output is still validated and retried on mismatch.
  • Pins the new JSON flags in the family resolution matrix and adds tests for NativeOutput, PromptedOutput, and strict=True tools sent without strict.
  • This implements the SambaNova half of issue #12086; family mappings are handled separately.