Skip to content

Commit

Permalink
chore: Loosen langchain peer dependency, use relevantFacts when compo…
Browse files Browse the repository at this point in the history
…sing memory string
  • Loading branch information
paul-paliychuk committed Oct 4, 2024
1 parent b61e8a5 commit 0ff9aa0
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 270 deletions.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getzep/zep-cloud",
"version": "1.0.11",
"version": "1.0.12",
"private": false,
"repository": "https://github.com/getzep/zep-js",
"description": "Zep: Fast, scalable building blocks for production LLM apps",
Expand All @@ -20,8 +20,8 @@
"zod": "^3.23.8"
},
"peerDependencies": {
"@langchain/core": ">=0.1.29 <0.3.0",
"langchain": ">=0.1.19 <0.3.0"
"@langchain/core": ">=0.1.29 <0.4.0",
"langchain": ">=0.1.19 <0.4.0"
},
"peerDependenciesMeta": {
"langchain": {
Expand All @@ -33,14 +33,15 @@
},
"devDependencies": {
"@faker-js/faker": "^8.4.1",
"@langchain/openai": "0.0.28",
"@langchain/core": "^0.3.7",
"@langchain/openai": "0.3.5",
"@types/jest": "^29.5.12",
"@types/node": "17.0.33",
"@types/node-fetch": "2.6.9",
"@types/qs": "6.9.8",
"@types/url-join": "4.0.1",
"jest": "^29.7.0",
"langchain": "0.1.19",
"langchain": "0.3.2",
"nock": "^13.5.4",
"prettier": "2.7.1",
"ts-jest": "^29.1.4",
Expand Down
5 changes: 3 additions & 2 deletions src/langchain/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export const getZepMessageRoleType = (role: MessageType): RoleType => {
export const condenseZepMemoryIntoHumanMessage = (memory: Memory) => {
let systemPrompt = "";

if (memory.facts) {
systemPrompt += memory.facts.join("\n");
if (memory.relevantFacts) {
const relevantFactStrings: string[] = memory.relevantFacts.map(({fact}) => fact).filter(x => !!x) as string[];
systemPrompt += relevantFactStrings.join("\n");
}

// Extract summary, if present, and messages
Expand Down
Loading

0 comments on commit 0ff9aa0

Please sign in to comment.