Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
plugins: 'code-review@claude-code-plugins'
model: claude-opus-4-6
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
9 changes: 8 additions & 1 deletion src/celeste/modalities/text/providers/anthropic/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Anthropic models for text modality."""

from celeste.constraints import ImagesConstraint, Range, Schema
from celeste.constraints import Bool, ImagesConstraint, Range, Schema
from celeste.core import Modality, Operation, Parameter, Provider
from celeste.models import Model

Expand All @@ -17,6 +17,7 @@
Parameter.MAX_TOKENS: Range(min=1, max=64000),
TextParameter.THINKING_BUDGET: Range(min=-1, max=64000),
TextParameter.OUTPUT_SCHEMA: Schema(),
TextParameter.WEB_SEARCH: Bool(),
TextParameter.IMAGE: ImagesConstraint(),
},
),
Expand All @@ -30,6 +31,7 @@
Parameter.MAX_TOKENS: Range(min=1, max=64000),
TextParameter.THINKING_BUDGET: Range(min=-1, max=32000),
TextParameter.OUTPUT_SCHEMA: Schema(),
TextParameter.WEB_SEARCH: Bool(),
TextParameter.IMAGE: ImagesConstraint(),
},
),
Expand All @@ -43,6 +45,7 @@
Parameter.MAX_TOKENS: Range(min=1, max=32000),
TextParameter.THINKING_BUDGET: Range(min=-1, max=32000),
TextParameter.OUTPUT_SCHEMA: Schema(),
TextParameter.WEB_SEARCH: Bool(),
TextParameter.IMAGE: ImagesConstraint(),
},
),
Expand All @@ -56,6 +59,7 @@
Parameter.MAX_TOKENS: Range(min=1, max=64000),
TextParameter.THINKING_BUDGET: Range(min=-1, max=32000),
TextParameter.OUTPUT_SCHEMA: Schema(),
TextParameter.WEB_SEARCH: Bool(),
TextParameter.IMAGE: ImagesConstraint(),
},
),
Expand All @@ -69,6 +73,7 @@
Parameter.MAX_TOKENS: Range(min=1, max=64000),
TextParameter.THINKING_BUDGET: Range(min=-1, max=32000),
TextParameter.OUTPUT_SCHEMA: Schema(),
TextParameter.WEB_SEARCH: Bool(),
TextParameter.IMAGE: ImagesConstraint(),
},
),
Expand All @@ -81,6 +86,7 @@
parameter_constraints={
Parameter.MAX_TOKENS: Range(min=1, max=64000),
TextParameter.THINKING_BUDGET: Range(min=-1, max=64000),
TextParameter.WEB_SEARCH: Bool(),
TextParameter.IMAGE: ImagesConstraint(),
},
),
Expand All @@ -93,6 +99,7 @@
parameter_constraints={
Parameter.MAX_TOKENS: Range(min=1, max=32000),
TextParameter.THINKING_BUDGET: Range(min=-1, max=32000),
TextParameter.WEB_SEARCH: Bool(),
TextParameter.IMAGE: ImagesConstraint(),
},
),
Expand Down
10 changes: 10 additions & 0 deletions src/celeste/modalities/text/providers/anthropic/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
from celeste.providers.anthropic.messages.parameters import (
ThinkingMapper as _ThinkingMapper,
)
from celeste.providers.anthropic.messages.parameters import (
WebSearchMapper as _WebSearchMapper,
)

from ...parameters import TextParameter

Expand Down Expand Up @@ -63,11 +66,18 @@ class OutputSchemaMapper(_OutputFormatMapper):
name = TextParameter.OUTPUT_SCHEMA


class WebSearchMapper(_WebSearchMapper):
"""Map web_search to Anthropic's tools parameter."""

name = TextParameter.WEB_SEARCH


ANTHROPIC_PARAMETER_MAPPERS: list[ParameterMapper] = [
TemperatureMapper(),
MaxTokensMapper(),
ThinkingBudgetMapper(),
OutputSchemaMapper(),
WebSearchMapper(),
]

__all__ = ["ANTHROPIC_PARAMETER_MAPPERS"]
Loading