Skip to content

Commit

Permalink
prefer driver.executeQuery to session.run
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardFaucher committed Dec 13, 2024
1 parent 67b37f5 commit 18d4b76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/langchain-community/src/stores/message/neo4j.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ export class Neo4jChatMessageHistory extends BaseListChatMessageHistory {
`;

try {
const messages = await this.driver.session().run(getMessagesCypherQuery, {
const { records } = await this.driver.executeQuery(getMessagesCypherQuery, {
sessionId: this.sessionId,
});
const results = messages.records.map((record: Record) =>
const results = records.map((record: Record) =>
record.get("result")
);

Expand All @@ -130,7 +130,7 @@ export class Neo4jChatMessageHistory extends BaseListChatMessageHistory {
`;

try {
await this.driver.session().run(addMessageCypherQuery, {
await this.driver.executeQuery(addMessageCypherQuery, {
sessionId: this.sessionId,
type: message.getType(),
content: message.content,
Expand All @@ -151,7 +151,7 @@ export class Neo4jChatMessageHistory extends BaseListChatMessageHistory {
`;

try {
await this.driver.session().run(clearMessagesCypherQuery, {
await this.driver.executeQuery(clearMessagesCypherQuery, {
sessionId: this.sessionId,
});
} catch (e) {
Expand Down

0 comments on commit 18d4b76

Please sign in to comment.