Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jan 29, 2025
1 parent dc62b6e commit 0fe69d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/memory_agent/state.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseMessage } from "@langchain/core/messages";
import { Annotation, messagesStateReducer } from "@langchain/langgraph";
import { Annotation, Messages, messagesStateReducer } from "@langchain/langgraph";

/**
* Main graph state.
Expand All @@ -8,7 +8,7 @@ export const GraphAnnotation = Annotation.Root({
/**
* The messages in the conversation.
*/
messages: Annotation<BaseMessage[]>({
messages: Annotation<BaseMessage[], Messages>({
reducer: messagesStateReducer,
default: () => [],
}),
Expand Down
11 changes: 8 additions & 3 deletions tests/agent.int.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from "@jest/globals";
import { MemorySaver, MemoryStore } from "@langchain/langgraph";
import { MemorySaver, InMemoryStore } from "@langchain/langgraph";
import { builder } from "../src/memory_agent/graph.js";

describe("Memory Graph", () => {
Expand Down Expand Up @@ -27,7 +27,7 @@ describe("Memory Graph", () => {
)(
"should store memories for %s conversation",
async (_, conversation) => {
const memStore = new MemoryStore();
const memStore = new InMemoryStore();
const graph = builder.compile({
store: memStore,
checkpointer: new MemorySaver(),
Expand All @@ -41,7 +41,12 @@ describe("Memory Graph", () => {
],
},
{
configurable: { userId, thread_id: "thread" },
configurable: {
userId,
thread_id: "thread",
model: "gpt-4o-mini",
systemPrompt: "You are a helpful assistant.",
},
},
);
}
Expand Down

0 comments on commit 0fe69d3

Please sign in to comment.