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,
]);
+382 -357
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -17,6 +17,7 @@
"@langchain/core": "^1.1.17",
"@langchain/langgraph": "^1.1.2",
"@langchain/langgraph-sdk": "^1.5.5",
"@langchain/ollama": "^1.2.6",
"@langchain/openai": "^1.2.3",
"axios": "^1.13.5",
"compute-cosine-similarity": "^1.1.0",