update deps. Install ollama for lang chain. Update model to deepseek

This commit is contained in:
William Jeynes
2026-03-31 16:08:28 +01:00
parent b610e8c989
commit 36c30a427d
3 changed files with 389 additions and 363 deletions
+6 -6
View File
@@ -1,22 +1,22 @@
import { HumanMessage, SystemMessage } from "@langchain/core/messages";
import { GraphNode } from "@langchain/langgraph";
import { MessagesState } from "../state";
import { ChatOpenAI } from "@langchain/openai"
import { ChatOllama } from "@langchain/ollama";
import { hydratePrompt } from "../prompts/hydratePrompt";
export function createModelNode(tools: any, promptPath: string): GraphNode<typeof MessagesState> {
return async (state) => {
const sysPrompt = await hydratePrompt(promptPath, state);
const model = new ChatOpenAI({
model: "gpt-5-mini"
const model = new ChatOllama({
model: "deepseek-r1:14b",
temperature: 0.7,
});
const modelWithTools = model.bindTools(Object.values(tools));
const response = await modelWithTools.invoke([
new SystemMessage(
sysPrompt
),
new SystemMessage(sysPrompt),
...state.messages,
]);