99} from "@aws-sdk/client-bedrock-runtime"
1010import { fromIni } from "@aws-sdk/credential-providers"
1111import { Anthropic } from "@anthropic-ai/sdk"
12- import { SingleCompletionHandler } from "../"
1312import {
1413 BedrockModelId ,
1514 ModelInfo as SharedModelInfo ,
@@ -26,6 +25,7 @@ import { MultiPointStrategy } from "../transform/cache-strategy/multi-point-stra
2625import { ModelInfo as CacheModelInfo } from "../transform/cache-strategy/types"
2726import { AMAZON_BEDROCK_REGION_INFO } from "../../shared/aws_regions"
2827import { convertToBedrockConverseMessages as sharedConverter } from "../transform/bedrock-converse-format"
28+ import type { SingleCompletionHandler , ApiHandlerCreateMessageMetadata } from "../index"
2929
3030const BEDROCK_DEFAULT_TEMPERATURE = 0.3
3131const BEDROCK_MAX_TOKENS = 4096
@@ -189,7 +189,11 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
189189 this . client = new BedrockRuntimeClient ( clientConfig )
190190 }
191191
192- override async * createMessage ( systemPrompt : string , messages : Anthropic . Messages . MessageParam [ ] ) : ApiStream {
192+ override async * createMessage (
193+ systemPrompt : string ,
194+ messages : Anthropic . Messages . MessageParam [ ] ,
195+ metadata ?: ApiHandlerCreateMessageMetadata ,
196+ ) : ApiStream {
193197 let modelConfig = this . getModel ( )
194198 // Handle cross-region inference
195199 const usePromptCache = Boolean ( this . options . awsUsePromptCache && this . supportsAwsPromptCache ( modelConfig ) )
@@ -769,7 +773,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
769773 > = {
770774 ACCESS_DENIED : {
771775 patterns : [ "access" , "denied" , "permission" ] ,
772- messageTemplate : `You don't have access to the model specified.
776+ messageTemplate : `You don't have access to the model specified.
773777
774778Please verify:
7757791. Try cross-region inference if you're using a foundation model
0 commit comments