start adding dummy nodes

This commit is contained in:
William Jeynes
2026-01-28 21:26:34 +00:00
parent a3201d17a2
commit c6416622e4
14 changed files with 188 additions and 61 deletions
+21 -18
View File
@@ -1,21 +1,24 @@
import { task, entrypoint } from "@langchain/langgraph";
import { BaseMessage, SystemMessage } from "@langchain/core/messages";
import { ChatOpenAI } from "@langchain/openai"
import { arithmeticTools } from "../tools/arithmetic";
// import { SystemMessage } from "@langchain/core/messages";
// import { GraphNode } from "@langchain/langgraph";
// import { MessagesState } from "../state";
// import { arithmeticTools } from "../tools/arithmetic";
// import { ChatOpenAI } from "@langchain/openai"
const model = new ChatOpenAI({
model: "gpt-5-mini"
});
// const model = new ChatOpenAI({
// model: "gpt-5-mini"
// });
const modelWithTools = model.bindTools(arithmeticTools);
// 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,
]);
});
// export const llmCall: GraphNode<typeof MessagesState> = async (state) => {
// const response = await modelWithTools.invoke([
// new SystemMessage(
// "You are a helpful assistant tasked with performing arithmetic on a set of inputs. Any calculation, no matter how trivial, should be done with tools. Output the final answer with %%% on each side"
// ),
// ...state.messages,
// ]);
// return {
// messages: [response],
// llmCalls: 1,
// };
// };