add initial testing

This commit is contained in:
William Jeynes
2026-01-27 22:57:49 +00:00
parent fdf8be2414
commit a3201d17a2
11 changed files with 742 additions and 5 deletions
+21
View File
@@ -0,0 +1,21 @@
import { task, entrypoint } from "@langchain/langgraph";
import { BaseMessage, SystemMessage } from "@langchain/core/messages";
import { ChatOpenAI } from "@langchain/openai"
import { arithmeticTools } from "../tools/arithmetic";
const model = new ChatOpenAI({
model: "gpt-5-mini"
});
const modelWithTools = model.bindTools(arithmeticTools);
export const modelNode = task({ name: "callLlm" }, async (messages: BaseMessage[]) => {
return modelWithTools.invoke([
new SystemMessage(
"You are a helpful assistant tasked with performing arithmetic on a set of inputs."
),
...messages,
]);
});