Skip to content

Commit 744131b

Browse files
committed
Add anthropic model alias to models supported list
1 parent d110ab9 commit 744131b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

patchwork/common/client/llm/anthropic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ def _anthropic_to_openai_response(model: str, anthropic_response: Message) -> Ch
7676

7777

7878
class AnthropicLlmClient(LlmClient):
79-
__allowed_model_prefix = "claude-3-"
80-
__definitely_allowed_models = {"claude-2.0", "claude-2.1", "claude-instant-1.2"}
79+
__non_aws_alias = {"claude-3-7-sonnet-latest", "claude-3-5-haiku-latest", "claude-3-5-sonnet-latest", "claude-3-opus-latest"}
8180
__100k_models = {"claude-2.0", "claude-instant-1.2"}
8281

8382
def __init__(self, api_key: Optional[str] = None, is_aws: bool = False):
@@ -259,6 +258,7 @@ def __adapt_chat_completion_request(
259258
def get_models(self) -> set[str]:
260259
rv = set()
261260
if not self.__is_aws:
261+
rv.update(self.__non_aws_alias)
262262
for model_info in self.__client.models.list():
263263
rv.add(model_info.id)
264264
else:

patchwork/steps/FileAgent/FileAgent.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def __init__(self, inputs):
2121
task = mustache_render(inputs["task"], data)
2222

2323
self.strat_kwargs = dict(
24-
model="apac.anthropic.claude-3-5-sonnet-20241022-v2:0",
24+
model="claude-3-5-sonnet-latest",
25+
# model="apac.anthropic.claude-3-5-sonnet-20241022-v2:0",
2526
llm_client=AioLlmClient.create_aio_client(inputs),
2627
template_data=dict(),
2728
system_prompt_template=f"""\
@@ -35,8 +36,8 @@ def __init__(self, inputs):
3536
agent_configs=[
3637
AgentConfig(
3738
name="Assistant",
38-
model="apac.anthropic.claude-3-5-sonnet-20241022-v2:0",
39-
# model="anthropic.claude-3-7-sonnet-20250219-v1:0",
39+
model="claude-3-7-sonnet-latest",
40+
# model="apac.anthropic.claude-3-5-sonnet-20241022-v2:0",
4041
tool_set=dict(),
4142
system_prompt="""\
4243
You are a assistant that is supposed to help me with a set of files. These files are commonly tabular formatted like csv, xls or xlsx.

0 commit comments

Comments
 (0)