Spaces:
Paused
Paused
Mirrowel JoeGrimes123 commited on
Commit ·
96e1b97
1
Parent(s): 3269e93
feat(provider): add support for Claude Opus 4.5 model
Browse filesAdd claude-opus-4-5 to available models in Antigravity provider with
proper mapping to thinking variant when reasoning_effort is provided.
Changes:
- Add claude-opus-4-5 to AVAILABLE_MODELS list
- Update docstrings to include Claude Opus 4.5
- Extend reasoning_effort mapping to support both Sonnet and Opus models
- Apply Claude tool schema transformation for claude-opus-* prefix
Cherry-picked from PR #15
Co-authored-by: JoeGrimes123 <joegrimes123@outlook.com>
src/rotator_library/providers/antigravity_provider.py
CHANGED
|
@@ -6,6 +6,7 @@ A clean, well-structured provider for Google's Antigravity API, supporting:
|
|
| 6 |
- Gemini 2.5 (Pro/Flash) with thinkingBudget
|
| 7 |
- Gemini 3 (Pro/Image) with thinkingLevel
|
| 8 |
- Claude (Sonnet 4.5) via Antigravity proxy
|
|
|
|
| 9 |
|
| 10 |
Key Features:
|
| 11 |
- Unified streaming/non-streaming handling
|
|
@@ -62,6 +63,7 @@ AVAILABLE_MODELS = [
|
|
| 62 |
#"gemini-3-pro-image-preview",
|
| 63 |
#"gemini-2.5-computer-use-preview-10-2025",
|
| 64 |
"claude-sonnet-4-5", # Internally mapped to -thinking variant when reasoning_effort is provided
|
|
|
|
| 65 |
]
|
| 66 |
|
| 67 |
# Default max output tokens (including thinking) - can be overridden per request
|
|
@@ -436,6 +438,7 @@ class AntigravityProvider(AntigravityAuthBase, ProviderInterface):
|
|
| 436 |
- Gemini 2.5 (Pro/Flash) with thinkingBudget
|
| 437 |
- Gemini 3 (Pro/Image) with thinkingLevel
|
| 438 |
- Claude Sonnet 4.5 via Antigravity proxy
|
|
|
|
| 439 |
|
| 440 |
Features:
|
| 441 |
- Unified streaming/non-streaming handling
|
|
@@ -1993,8 +1996,8 @@ class AntigravityProvider(AntigravityAuthBase, ProviderInterface):
|
|
| 1993 |
|
| 1994 |
# Map base Claude model to -thinking variant when reasoning_effort is provided
|
| 1995 |
if self._is_claude(internal_model) and reasoning_effort:
|
| 1996 |
-
if internal_model
|
| 1997 |
-
internal_model = "
|
| 1998 |
|
| 1999 |
# Map gemini-3-pro-preview to -low/-high variant based on thinking config
|
| 2000 |
if model == "gemini-3-pro-preview" or internal_model == "gemini-3-pro-preview":
|
|
@@ -2070,7 +2073,7 @@ class AntigravityProvider(AntigravityAuthBase, ProviderInterface):
|
|
| 2070 |
# Subsequent parallel calls: leave as-is (no signature)
|
| 2071 |
|
| 2072 |
# Claude-specific tool schema transformation
|
| 2073 |
-
if internal_model.startswith("claude-sonnet-"):
|
| 2074 |
self._apply_claude_tool_transform(antigravity_payload)
|
| 2075 |
|
| 2076 |
return antigravity_payload
|
|
|
|
| 6 |
- Gemini 2.5 (Pro/Flash) with thinkingBudget
|
| 7 |
- Gemini 3 (Pro/Image) with thinkingLevel
|
| 8 |
- Claude (Sonnet 4.5) via Antigravity proxy
|
| 9 |
+
- Claude (Opus 4.5) via Antigravity proxy
|
| 10 |
|
| 11 |
Key Features:
|
| 12 |
- Unified streaming/non-streaming handling
|
|
|
|
| 63 |
#"gemini-3-pro-image-preview",
|
| 64 |
#"gemini-2.5-computer-use-preview-10-2025",
|
| 65 |
"claude-sonnet-4-5", # Internally mapped to -thinking variant when reasoning_effort is provided
|
| 66 |
+
"claude-opus-4-5", # Internally mapped to -thinking variant when reasoning_effort is provided
|
| 67 |
]
|
| 68 |
|
| 69 |
# Default max output tokens (including thinking) - can be overridden per request
|
|
|
|
| 438 |
- Gemini 2.5 (Pro/Flash) with thinkingBudget
|
| 439 |
- Gemini 3 (Pro/Image) with thinkingLevel
|
| 440 |
- Claude Sonnet 4.5 via Antigravity proxy
|
| 441 |
+
- Claude Opus 4.5 via Antigravity proxy
|
| 442 |
|
| 443 |
Features:
|
| 444 |
- Unified streaming/non-streaming handling
|
|
|
|
| 1996 |
|
| 1997 |
# Map base Claude model to -thinking variant when reasoning_effort is provided
|
| 1998 |
if self._is_claude(internal_model) and reasoning_effort:
|
| 1999 |
+
if internal_model in ["claude-sonnet-4-5", "claude-opus-4-5"] and not internal_model.endswith("-thinking"):
|
| 2000 |
+
internal_model = f"{internal_model}-thinking"
|
| 2001 |
|
| 2002 |
# Map gemini-3-pro-preview to -low/-high variant based on thinking config
|
| 2003 |
if model == "gemini-3-pro-preview" or internal_model == "gemini-3-pro-preview":
|
|
|
|
| 2073 |
# Subsequent parallel calls: leave as-is (no signature)
|
| 2074 |
|
| 2075 |
# Claude-specific tool schema transformation
|
| 2076 |
+
if internal_model.startswith("claude-sonnet-") or internal_model.startswith("claude-opus-"):
|
| 2077 |
self._apply_claude_tool_transform(antigravity_payload)
|
| 2078 |
|
| 2079 |
return antigravity_payload
|