Skip to content

Commit

Permalink
chore: Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-paliychuk committed May 2, 2024
1 parent 8a8d9ed commit ac27fba
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 25 deletions.
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,18 @@ Zep allows you to be more intentional about constructing your prompt:
- **Dialog Classification:** Instantly and accurately classify chat dialog. Understand user intent and emotion, segment users, and more. Route chains based on semantic context, and trigger events.
- **Structured Data Extraction:** Quickly extract business data from chat conversations using a schema you define. Understand what your Assistant should ask for next in order to complete its task.


## Zep TypeScript / JavaScript Client

This is the TypeScript / JavaScript client package for the Zep service. For more information about Zep, see https://github.com/getzep/zep

## Installation

```bash
npm install @getzep/zep-js
```

## Zep cloud Installation
In order to install zep js sdk with zep-cloud support, you will need to install
a pre-release version tagged with `@next`.
a pre-release version tagged with `@preview`.

```bash
npm install @getzep/zep-js@next
npm install @getzep/zep-js@preview
```

You will also need to provide a Zep Project API key to your zep client for cloud support.
You can find out about zep projects in our [cloud docs](https://help.getzep.com/projects.html)

### Using langchain zep classes with `zep-js@next`:
### Using langchain zep classes with `zep-js@preview`:
In the pre-release version `zep-js` sdk comes with `ZepChatMessageHistory`, `ZepVectorStore` and `ZepMemory`
classes that are compatible with [`Langchain's JS expression language`](https://js.langchain.com/docs/expression_language/)

Expand Down
2 changes: 0 additions & 2 deletions examples/documents/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ function naiveSplitText(text: string, maxChunkSize: number): string[] {
*/
async function main() {
const projectApiKey = process.env.ZEP_API_KEY;
const projectApiUrl = process.env.ZEP_API_URL;

const file = "babbages_calculating_engine.txt";
const maxChunkSize = 500;
Expand All @@ -119,7 +118,6 @@ async function main() {

const client = new ZepClient({
apiKey: projectApiKey,
environment: projectApiUrl,
});
const collection = await client.document.addCollection(collectionName, {
description: "Babbage's Calculating Engine", // optional
Expand Down
1 change: 0 additions & 1 deletion examples/langchain/message_history_anthropic_example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { ChatAnthropic } from "@langchain/anthropic";
async function main() {
const zepClient = new ZepClient({
apiKey: process.env.ZEP_API_KEY,
environment: process.env.ZEP_API_URL,
});

const prompt = ChatPromptTemplate.fromMessages([
Expand Down
1 change: 0 additions & 1 deletion examples/langchain/message_history_example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { ConsoleCallbackHandler } from "@langchain/core/tracers/console";
async function main() {
const zepClient = new ZepClient({
apiKey: process.env.ZEP_API_KEY,
environment: process.env.ZEP_API_URL,
});

const prompt = ChatPromptTemplate.fromMessages([
Expand Down
1 change: 0 additions & 1 deletion examples/langchain/message_history_vector_store_example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ async function combineDocuments(
async function main() {
const zepClient = new ZepClient({
apiKey: process.env.ZEP_API_KEY,
environment: process.env.ZEP_API_URL,
});

const vectorStore = await ZepVectorStore.init({
Expand Down
1 change: 0 additions & 1 deletion examples/langchain/vector_store_example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ async function combineDocuments(
async function main() {
const zepClient = new ZepClient({
apiKey: process.env.ZEP_API_KEY,
environment: process.env.ZEP_API_URL,
});

const vectorStore = await ZepVectorStore.init({
Expand Down
2 changes: 0 additions & 2 deletions examples/memory/memory_example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ function sleep(ms: number) {

async function main() {
const projectApiKey = process.env.ZEP_API_KEY;
const projectApiUrl = process.env.ZEP_API_URL;

const client = new ZepClient({
apiKey: projectApiKey,
environment: projectApiUrl,
});

// Create a user
Expand Down
4 changes: 1 addition & 3 deletions examples/users/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { CreateUserRequest, UpdateUserRequest } from "../../src/api";

async function main() {
const projectApiKey = process.env.ZEP_API_KEY;
const projectApiUrl = process.env.ZEP_API_URL;

const client = new ZepClient({
apiKey: projectApiKey,
environment: projectApiUrl,
});

// Create multiple users
Expand All @@ -31,7 +29,7 @@ async function main() {
}

// Update the first user
const users = await client.user.list();
const users = await client.user.listOrdered();
const { userId } = (await client.user.listOrdered())[0];
const userRequest: UpdateUserRequest = {
email: "updated_user@example.com",
Expand Down
2 changes: 2 additions & 0 deletions src/api/resources/memory/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ export class Memory {
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
console.log("_response", _response.body);
return await serializers.Memory.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
Expand Down Expand Up @@ -746,6 +747,7 @@ export class Memory {
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
console.log("_response", _response);
if (_response.ok) {
return;
}
Expand Down

0 comments on commit ac27fba

Please sign in to comment.