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 22, 2024
1 parent e47850c commit c8fbed2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 22 deletions.
8 changes: 6 additions & 2 deletions langchain/src/chat_models/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ async function _initChatModelHelper(
return new ChatGoogleGenerativeAI({ model, ...kwargs });
}
case "fireworks": {
throw new Error("Dynamic imports from @langchain/community not supported.");
throw new Error(
"Dynamic imports from @langchain/community not supported."
);
// _checkPackage("@langchain/community/chat_models/fireworks");
// const { ChatFireworks } = await import(
// "@langchain/community/chat_models/fireworks"
Expand All @@ -115,7 +117,9 @@ async function _initChatModelHelper(
return new ChatOllama({ model, ...kwargs });
}
case "together": {
throw new Error("Dynamic imports from @langchain/community not supported.");
throw new Error(
"Dynamic imports from @langchain/community not supported."
);
// _checkPackage("@langchain/community/chat_models/togetherai");
// const { ChatTogetherAI } = await import(
// "@langchain/community/chat_models/togetherai"
Expand Down
3 changes: 0 additions & 3 deletions libs/langchain-aws/src/tests/embeddings.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,12 @@ test.skip("Test end to end with MemoryVectorStore", async () => {
// })
// );
// expect(vectorStore.memoryVectors).toHaveLength(3);

// const resultOne = await vectorStore.similaritySearch("hello world", 1);
// const resultOneMetadatas = resultOne.map(({ metadata }) => metadata);
// expect(resultOneMetadatas).toEqual([{ id: 2 }]);

// const resultTwo = await vectorStore.similaritySearch("hello world", 2);
// const resultTwoMetadatas = resultTwo.map(({ metadata }) => metadata);
// expect(resultTwoMetadatas).toEqual([{ id: 2 }, { id: 3 }]);

// const resultThree = await vectorStore.similaritySearch("hello world", 3);
// const resultThreeMetadatas = resultThree.map(({ metadata }) => metadata);
// expect(resultThreeMetadatas).toEqual([{ id: 2 }, { id: 3 }, { id: 1 }]);
Expand Down
7 changes: 1 addition & 6 deletions libs/langchain-groq/src/tests/agent.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ test.skip("Model is compatible with OpenAI tools agent and Agent Executor", asyn
// ["human", "{input}"],
// ["placeholder", "{agent_scratchpad}"],
// ]);

// const currentWeatherTool = new DynamicStructuredTool({
// name: "get_current_weather",
// description: "Get the current weather in a given location",
Expand All @@ -29,22 +28,18 @@ test.skip("Model is compatible with OpenAI tools agent and Agent Executor", asyn
// }),
// func: async () => Promise.resolve("28 °C"),
// });

// const agent = await createOpenAIToolsAgent({
// llm,
// tools: [currentWeatherTool],
// prompt,
// });

// const agentExecutor = new AgentExecutor({
// agent,
// tools: [currentWeatherTool],
// });

// const input = "What's the weather like in Paris?";
// const { output } = await agentExecutor.invoke({ input });

// console.log(output);
// expect(output).toBeDefined();
// expect(output).toContain("The current temperature in Paris is 28 °C");
});
});
9 changes: 1 addition & 8 deletions libs/langchain-mistralai/src/tests/agent.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,16 @@ test("Model is compatible with OpenAI tools agent and Agent Executor", async ()
// temperature: 0,
// model: "mistral-large-latest",
// });

// const systemMessage = SystemMessagePromptTemplate.fromTemplate(
// "You are an agent capable of retrieving current weather information."
// );
// const humanMessage = HumanMessagePromptTemplate.fromTemplate("{input}");
// const agentScratchpad = new MessagesPlaceholder("agent_scratchpad");

// const prompt = ChatPromptTemplate.fromMessages([
// systemMessage,
// humanMessage,
// agentScratchpad,
// ]);

// const currentWeatherTool = new DynamicStructuredTool({
// name: "get_current_weather",
// description: "Get the current weather in a given location",
Expand All @@ -73,22 +70,18 @@ test("Model is compatible with OpenAI tools agent and Agent Executor", async ()
// }),
// func: async () => Promise.resolve("28 °C"),
// });

// const agent = await createOpenAIToolsAgent({
// llm,
// tools: [currentWeatherTool],
// prompt,
// });

// const agentExecutor = new AgentExecutor({
// agent,
// tools: [currentWeatherTool],
// });

// const input = "What's the weather like in Paris?";
// const { output } = await agentExecutor.invoke({ input });

// console.log(output);
// expect(output).toBeDefined();
// expect(output).toContain("The current temperature in Paris is 28 °C");
});
});
4 changes: 1 addition & 3 deletions libs/langchain-mistralai/src/tests/chat_models.int.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { test } from "@jest/globals";
import {
ChatPromptTemplate,
} from "@langchain/core/prompts";
import { ChatPromptTemplate } from "@langchain/core/prompts";
import { StructuredTool } from "@langchain/core/tools";
import { z } from "zod";
import {
Expand Down

0 comments on commit c8fbed2

Please sign in to comment.