Skip to content

Commit

Permalink
feat: add dynamic Bedrock model ID selection
Browse files Browse the repository at this point in the history
  • Loading branch information
nl0 committed Nov 29, 2024
1 parent ccfbd00 commit 49096e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions catalog/app/components/Assistant/Model/Bedrock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const MODULE = 'Bedrock'

const MODEL_ID = 'us.anthropic.claude-3-5-sonnet-20241022-v2:0'

function getModelId() {
return (window as any).QUILT_BEDROCK_MODEL_ID || MODEL_ID
}

const mapContent = (contentBlocks: BedrockRuntime.ContentBlocks | undefined) =>
Eff.pipe(
contentBlocks,
Expand Down Expand Up @@ -118,7 +122,7 @@ export function LLMBedrock(bedrock: BedrockRuntime) {
enter: [
Log.br,
'model id:',
MODEL_ID,
getModelId(),
Log.br,
'prompt:',
prompt,
Expand All @@ -130,7 +134,7 @@ export function LLMBedrock(bedrock: BedrockRuntime) {
Eff.Effect.tryPromise(() =>
bedrock
.converse({
modelId: MODEL_ID,
modelId: getModelId(),
system: [{ text: prompt.system }],
messages: messagesToBedrock(prompt.messages),
toolConfig: prompt.toolConfig && toolConfigToBedrock(prompt.toolConfig),
Expand Down

0 comments on commit 49096e6

Please sign in to comment.