diff --git a/catalog/app/utils/AWS/Bedrock/Bedrock.tsx b/catalog/app/utils/AWS/Bedrock/Bedrock.ts similarity index 83% rename from catalog/app/utils/AWS/Bedrock/Bedrock.tsx rename to catalog/app/utils/AWS/Bedrock/Bedrock.ts index 1fa2ae030f2..e252f5fbe58 100644 --- a/catalog/app/utils/AWS/Bedrock/Bedrock.tsx +++ b/catalog/app/utils/AWS/Bedrock/Bedrock.ts @@ -12,8 +12,18 @@ import { CONTENT_TYPE, bedrockBodyToMessage, createMessage } from './Message' const MODEL_ID = 'anthropic.claude-3-sonnet-20240229-v1:0' const ANTHROPIC_VERSION = 'bedrock-2023-05-31' + +// https://docs.aws.amazon.com/bedrock/latest/userguide/key-definitions.html +// Token – A sequence of characters that a model can interpret or predict as a single unit of meaning. +// Not a word, but eiher word, or phrase, or punctuaction mark, or word suffix or prefix. export const MAX_TOKENS = 100000 +// Bedrock calls are not free +// https://aws.amazon.com/bedrock/pricing/ +// +// You can use `MOCK_BEDROCK = true` to mock Bedrock API response +const MOCK_BEDROCK = false + export function useBedrock( overrides?: Partial, ) { @@ -66,6 +76,4 @@ function useMock() { ) } -const MOCK_BEDROCK = false - export const use = MOCK_BEDROCK ? useMock : useBedrock