Skip to content

Commit

Permalink
chore: lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jul 18, 2024
1 parent ca624aa commit 398caab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
6 changes: 5 additions & 1 deletion libs/langchain-aws/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,11 @@ export function handleConverseStreamContentBlockDelta(
});
} else {
throw new Error(
`Unsupported content block type(s): ${JSON.stringify(contentBlockDelta.delta, null, 2)}`
`Unsupported content block type(s): ${JSON.stringify(
contentBlockDelta.delta,
null,
2
)}`
);
}
}
Expand Down
17 changes: 10 additions & 7 deletions libs/langchain-aws/src/tests/chat_models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import {
ToolMessage,
AIMessageChunk,
} from "@langchain/core/messages";
import { convertToConverseMessages, handleConverseStreamContentBlockDelta } from "../common.js";
import { concat } from "@langchain/core/utils/stream";
import {
convertToConverseMessages,
handleConverseStreamContentBlockDelta,
} from "../common.js";

test("convertToConverseMessages works", () => {
const messages = [
Expand Down Expand Up @@ -80,21 +83,21 @@ test("Streaming supports empty string chunks", async () => {
contentBlockIndex: 0,
delta: {
text: "Hello ",
}
},
},
{
contentBlockIndex: 0,
delta: {
text: "",
}
},
},
{
contentBlockIndex: 0,
delta: {
text: "world!",
}
}
]
},
},
];

let finalChunk: AIMessageChunk | undefined;
for (const block of contentBlocks) {
Expand All @@ -105,4 +108,4 @@ test("Streaming supports empty string chunks", async () => {
expect(finalChunk).toBeDefined();
if (!finalChunk) return;
expect(finalChunk.content).toBe("Hello world!");
})
});

0 comments on commit 398caab

Please sign in to comment.