update deps. Install ollama for lang chain. Update model to deepseek
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
|
||||
|
||||
Generated
+382
-357
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user