Skip to content

Commit 8680068

Browse files
committed
feature(aws_models): anthropic_version param should be set in constructor and is for bedrock only
1 parent fbe22a2 commit 8680068

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dsp/modules/aws_models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ def __init__(
204204
self.aws_provider = aws_provider
205205
self.provider = aws_provider.get_provider_name()
206206

207+
if isinstance(self.aws_provider, Bedrock):
208+
self.kwargs["anthropic_version"] = "bedrock-2023-05-31"
209+
207210
for k, v in kwargs.items():
208211
self.kwargs[k] = v
209212

@@ -233,7 +236,6 @@ def _create_body(self, prompt: str, **kwargs) -> tuple[int, dict[str, str | floa
233236
],
234237
},
235238
]
236-
query_args["anthropic_version"] = "bedrock-2023-05-31"
237239
return (n, query_args)
238240

239241
def _call_model(self, body: str) -> str:

0 commit comments

Comments
 (0)