From fb3437ca01b399ecceafd05eb0dc249a6efd9151 Mon Sep 17 00:00:00 2001 From: glay Date: Sun, 8 Dec 2024 23:47:16 +0800 Subject: [PATCH] Update app/client/platforms/bedrock.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加友好提示 Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- app/client/platforms/bedrock.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/client/platforms/bedrock.ts b/app/client/platforms/bedrock.ts index 63de78347..0368d71db 100644 --- a/app/client/platforms/bedrock.ts +++ b/app/client/platforms/bedrock.ts @@ -583,12 +583,24 @@ export class BedrockApi implements LLMApi { } } + /** + * Usage tracking is not supported for Bedrock API. + * @throws {Error} Always throws an error indicating the operation is not supported. + */ async usage() { - return { used: 0, total: 0 }; + throw new Error( + "Usage tracking is not supported for Bedrock API. Use AWS CloudWatch metrics instead." + ); } + /** + * Model listing is not supported for Bedrock API. + * @throws {Error} Always throws an error indicating the operation is not supported. + */ async models() { - return []; + throw new Error( + "Model listing is not supported for Bedrock API. Configure available models in AWS Console." + ); } }