From 9b84c16ccaee10d530b726dcb90ec7e1cdb0853a Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Thu, 2 Jan 2025 15:53:12 +0100 Subject: [PATCH] feat(adapters): update embedding support for Bedrock Signed-off-by: Tomas Dvorak --- src/adapters/bedrock/chat.ts | 3 +-- tests/e2e/adapters/bedrock/chat.test.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/adapters/bedrock/chat.ts b/src/adapters/bedrock/chat.ts index 65235cd8..c3e99ef5 100644 --- a/src/adapters/bedrock/chat.ts +++ b/src/adapters/bedrock/chat.ts @@ -217,8 +217,7 @@ export class BedrockChatLLM extends ChatLLM { contentType: "application/json", accept: "application/json", body: JSON.stringify({ - texts: input.map((msgs) => msgs.map((msg) => msg.text)), - input_type: "search_document", + texts: input.flat().map((msg) => msg.text), ...options?.body, }), }); diff --git a/tests/e2e/adapters/bedrock/chat.test.ts b/tests/e2e/adapters/bedrock/chat.test.ts index e7696a6f..88fe53b7 100644 --- a/tests/e2e/adapters/bedrock/chat.test.ts +++ b/tests/e2e/adapters/bedrock/chat.test.ts @@ -1,5 +1,5 @@ /** - * Copyright 2024 IBM Corp. + * Copyright 2025 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.