Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add end session method #71

Merged
merged 10 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ Zep: Long-Term Memory for ‍AI Assistants.
<br />

<p align="center">
<a href="https://docs.getzep.com/deployment/quickstart/">Quick Start</a> |
<a href="https://docs.getzep.com/">Documentation</a> |
<a href="https://docs.getzep.com/sdk/langchain/">LangChain</a> and
<a href="https://docs.getzep.com/sdk/langchain/">LlamaIndex</a> Support |
<a href="https://help.getzep.com">Documentation</a> |
<a href="https://help.getzep.com/langchain/overview">LangChain</a> |
<a href="https://discord.gg/W8Kw6bsgXQ">Discord</a><br />
<a href="https://www.getzep.com">www.getzep.com</a>
</p>
Expand Down
11 changes: 10 additions & 1 deletion examples/memory/memory_example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ async function main() {

const client = new ZepClient({
apiKey: projectApiKey,
environment: "https://api.development.getzep.com/api/v2",
});

// Create a user
Expand Down Expand Up @@ -58,7 +59,7 @@ async function main() {
// Add memory. We could do this in a batch, but we'll do it one by one rather to
// ensure that summaries and other artifacts are generated correctly.
try {
for (const { role, role_type, content } of history) {
for await (const { role, role_type, content } of history) {
await client.memory.add(sessionID, {
messages: [{ role, roleType: role_type, content }],
});
Expand Down Expand Up @@ -247,6 +248,14 @@ async function main() {
console.error("Got error:", error);
}
}

// End session - this will trigger summarization and other background tasks on the completed session
try {
await client.memory.endSession(sessionID);
console.debug("Ended session: ", sessionID);
} catch (error) {
console.debug("Got error:", error);
}
}

main();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getzep/zep-cloud",
"version": "1.0.1",
"version": "1.0.2",
"private": false,
"repository": "https://github.com/getzep/zep-js",
"description": "Zep: Fast, scalable building blocks for production LLM apps",
Expand Down
26 changes: 13 additions & 13 deletions src/api/resources/document/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -139,7 +139,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -252,7 +252,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -366,7 +366,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -479,7 +479,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -594,7 +594,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -699,7 +699,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -804,7 +804,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -909,7 +909,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -1014,7 +1014,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -1117,7 +1117,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -1232,7 +1232,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down Expand Up @@ -1351,7 +1351,7 @@ export class Document {
headers: {
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "zep-cloud",
"X-Fern-SDK-Version": "1.0.1",
"X-Fern-SDK-Version": "1.0.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await this._getCustomAuthorizationHeaders()),
Expand Down
Loading
Loading