Skip to content

Commit

Permalink
test: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas2D committed Aug 28, 2024
1 parent 0ab142c commit 6386ad6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/adapters/openai/chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@

import { verifyDeserialization } from "@tests/e2e/utils.js";
import { OpenAIChatLLM } from "@/adapters/openai/chat.js";
import { OpenAI } from "openai";

describe("OpenAI ChatLLM", () => {
const getInstance = () => {
return new OpenAIChatLLM({
modelId: "gpt-4o",
client: new OpenAI({
apiKey: "123",
}),
});
};

Expand Down
6 changes: 4 additions & 2 deletions tests/e2e/adapters/langchain/chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ import { BaseMessage, Role } from "@/llms/primitives/message.js";
import { ChatOpenAI } from "@langchain/openai";
import { LangChainChatLLM } from "@/adapters/langchain/llms/chat.js";

describe("Adapter LangChain Chat LLM", () => {
const apiKey = process.env.OPENAI_API_KEY;

describe.runIf(Boolean(apiKey))("Adapter LangChain Chat LLM", () => {
const createChatLLM = () => {
const model = new ChatOpenAI({
temperature: 0,
apiKey: process.env.OPENAI_API_KEY,
apiKey,
});
return new LangChainChatLLM(model);
};
Expand Down

0 comments on commit 6386ad6

Please sign in to comment.