Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Oct 15, 2024
1 parent 4d2c01e commit bbebd6c
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 52 deletions.
2 changes: 1 addition & 1 deletion src/api/resources/graph/client/requests/AddDataRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import * as Zep from "../../../../index";
export interface AddDataRequest {
data?: string;
groupId?: string;
type?: Zep.ModelsGraphDataType;
type?: Zep.GraphDataType;
userId?: string;
}
11 changes: 7 additions & 4 deletions src/api/resources/memory/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1405,19 +1405,22 @@ export class Memory {
* Add memory to the specified session.
*
* @param {string} sessionId - The ID of the session to which memory should be added.
* @param {Zep.ApidataAddMemoryRequest} request
* @param {Zep.AddMemoryRequest} request
* @param {Memory.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Zep.InternalServerError}
*
* @example
* await zep.memory.add("sessionId", {
* messages: [{}]
* messages: [{
* content: "content",
* roleType: Zep.RoleType.NoRole
* }]
* })
*/
public async add(
sessionId: string,
request: Zep.ApidataAddMemoryRequest,
request: Zep.AddMemoryRequest,
requestOptions?: Memory.RequestOptions
): Promise<Zep.SuccessResponse> {
const _response = await (this._options.fetcher ?? core.fetcher)({
Expand All @@ -1435,7 +1438,7 @@ export class Memory {
...(await this._getCustomAuthorizationHeaders()),
},
contentType: "application/json",
body: await serializers.ApidataAddMemoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
body: await serializers.AddMemoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
abortSignal: requestOptions?.abortSignal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import * as Zep from "../../../../index";
/**
* @example
* {
* messages: [{}]
* messages: [{
* content: "content",
* roleType: Zep.RoleType.NoRole
* }]
* }
*/
export interface ApidataAddMemoryRequest {
export interface AddMemoryRequest {
/** Additional instruction for generating the facts. Zep Cloud Only, will be ignored on Community Edition. */
factInstruction?: string;
/** A list of message objects, where each message contains a role and content. */
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/memory/client/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export { type ExtractDataRequest } from "./ExtractDataRequest";
export { type MemoryGetSessionFactsRequest } from "./MemoryGetSessionFactsRequest";
export { type AddFactsRequest } from "./AddFactsRequest";
export { type MemoryGetRequest } from "./MemoryGetRequest";
export { type ApidataAddMemoryRequest } from "./ApidataAddMemoryRequest";
export { type AddMemoryRequest } from "./AddMemoryRequest";
export { type MemoryGetSessionMessagesRequest } from "./MemoryGetSessionMessagesRequest";
export { type ModelsMessageMetadataUpdate } from "./ModelsMessageMetadataUpdate";
export { type MemorySearchPayload } from "./MemorySearchPayload";
Expand Down
3 changes: 3 additions & 0 deletions src/api/types/Fact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

export interface Fact {
createdAt?: string;
expiredAt?: string;
fact?: string;
invalidAt?: string;
name?: string;
rating?: number;
sourceNodeName?: string;
targetNodeName?: string;
uuid?: string;
validAt?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

export type ModelsGraphDataType = "text" | "json" | "message";
export type GraphDataType = "text" | "json" | "message";

export const ModelsGraphDataType = {
export const GraphDataType = {
Text: "text",
Json: "json",
Message: "message",
Expand Down
4 changes: 2 additions & 2 deletions src/api/types/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import * as Zep from "../index";

export interface Message {
/** The content of the message. */
content?: string;
content: string;
/** The timestamp of when the message was created. */
createdAt?: string;
/** The metadata associated with the message. */
metadata?: Record<string, unknown>;
/** The role of the sender of the message (e.g., "user", "assistant"). */
role?: string;
/** The type of the role (e.g., "user", "system"). */
roleType?: Zep.RoleType;
roleType: Zep.RoleType;
/** The number of tokens in the message. */
tokenCount?: number;
/** The timestamp of when the message was last updated. */
Expand Down
2 changes: 1 addition & 1 deletion src/api/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export * from "./ClassifySessionRequest";
export * from "./CreateDocumentRequest";
export * from "./FactRatingExamples";
export * from "./FactRatingInstruction";
export * from "./ModelsGraphDataType";
export * from "./GraphDataType";
export * from "./SearchScope";
export * from "./SearchType";
export * from "./UpdateDocumentListRequest";
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
import * as serializers from "../../../../index";
import * as Zep from "../../../../../api/index";
import * as core from "../../../../../core";
import { ModelsGraphDataType } from "../../../../types/ModelsGraphDataType";
import { GraphDataType } from "../../../../types/GraphDataType";

export const AddDataRequest: core.serialization.Schema<serializers.AddDataRequest.Raw, Zep.AddDataRequest> =
core.serialization.object({
data: core.serialization.string().optional(),
groupId: core.serialization.property("group_id", core.serialization.string().optional()),
type: ModelsGraphDataType.optional(),
type: GraphDataType.optional(),
userId: core.serialization.property("user_id", core.serialization.string().optional()),
});

export declare namespace AddDataRequest {
interface Raw {
data?: string | null;
group_id?: string | null;
type?: ModelsGraphDataType.Raw | null;
type?: GraphDataType.Raw | null;
user_id?: string | null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as serializers from "../../../../index";
import * as Zep from "../../../../../api/index";
import * as core from "../../../../../core";
import { Message } from "../../../../types/Message";

export const AddMemoryRequest: core.serialization.Schema<serializers.AddMemoryRequest.Raw, Zep.AddMemoryRequest> =
core.serialization.object({
factInstruction: core.serialization.property("fact_instruction", core.serialization.string().optional()),
messages: core.serialization.list(Message),
summaryInstruction: core.serialization.property("summary_instruction", core.serialization.string().optional()),
});

export declare namespace AddMemoryRequest {
interface Raw {
fact_instruction?: string | null;
messages: Message.Raw[];
summary_instruction?: string | null;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export { UpdateSessionRequest } from "./UpdateSessionRequest";
export { EndSessionRequest } from "./EndSessionRequest";
export { ExtractDataRequest } from "./ExtractDataRequest";
export { AddFactsRequest } from "./AddFactsRequest";
export { ApidataAddMemoryRequest } from "./ApidataAddMemoryRequest";
export { AddMemoryRequest } from "./AddMemoryRequest";
export { ModelsMessageMetadataUpdate } from "./ModelsMessageMetadataUpdate";
export { MemorySearchPayload } from "./MemorySearchPayload";
6 changes: 6 additions & 0 deletions src/serialization/types/Fact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,28 @@ import * as core from "../../core";

export const Fact: core.serialization.ObjectSchema<serializers.Fact.Raw, Zep.Fact> = core.serialization.object({
createdAt: core.serialization.property("created_at", core.serialization.string().optional()),
expiredAt: core.serialization.property("expired_at", core.serialization.string().optional()),
fact: core.serialization.string().optional(),
invalidAt: core.serialization.property("invalid_at", core.serialization.string().optional()),
name: core.serialization.string().optional(),
rating: core.serialization.number().optional(),
sourceNodeName: core.serialization.property("source_node_name", core.serialization.string().optional()),
targetNodeName: core.serialization.property("target_node_name", core.serialization.string().optional()),
uuid: core.serialization.string().optional(),
validAt: core.serialization.property("valid_at", core.serialization.string().optional()),
});

export declare namespace Fact {
interface Raw {
created_at?: string | null;
expired_at?: string | null;
fact?: string | null;
invalid_at?: string | null;
name?: string | null;
rating?: number | null;
source_node_name?: string | null;
target_node_name?: string | null;
uuid?: string | null;
valid_at?: string | null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import * as serializers from "../index";
import * as Zep from "../../api/index";
import * as core from "../../core";

export const ModelsGraphDataType: core.serialization.Schema<
serializers.ModelsGraphDataType.Raw,
Zep.ModelsGraphDataType
> = core.serialization.enum_(["text", "json", "message"]);
export const GraphDataType: core.serialization.Schema<serializers.GraphDataType.Raw, Zep.GraphDataType> =
core.serialization.enum_(["text", "json", "message"]);

export declare namespace ModelsGraphDataType {
export declare namespace GraphDataType {
type Raw = "text" | "json" | "message";
}
8 changes: 4 additions & 4 deletions src/serialization/types/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { RoleType } from "./RoleType";

export const Message: core.serialization.ObjectSchema<serializers.Message.Raw, Zep.Message> = core.serialization.object(
{
content: core.serialization.string().optional(),
content: core.serialization.string(),
createdAt: core.serialization.property("created_at", core.serialization.string().optional()),
metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
role: core.serialization.string().optional(),
roleType: core.serialization.property("role_type", RoleType.optional()),
roleType: core.serialization.property("role_type", RoleType),
tokenCount: core.serialization.property("token_count", core.serialization.number().optional()),
updatedAt: core.serialization.property("updated_at", core.serialization.string().optional()),
uuid: core.serialization.string().optional(),
Expand All @@ -22,11 +22,11 @@ export const Message: core.serialization.ObjectSchema<serializers.Message.Raw, Z

export declare namespace Message {
interface Raw {
content?: string | null;
content: string;
created_at?: string | null;
metadata?: Record<string, unknown> | null;
role?: string | null;
role_type?: RoleType.Raw | null;
role_type: RoleType.Raw;
token_count?: number | null;
updated_at?: string | null;
uuid?: string | null;
Expand Down
2 changes: 1 addition & 1 deletion src/serialization/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export * from "./ClassifySessionRequest";
export * from "./CreateDocumentRequest";
export * from "./FactRatingExamples";
export * from "./FactRatingInstruction";
export * from "./ModelsGraphDataType";
export * from "./GraphDataType";
export * from "./SearchScope";
export * from "./SearchType";
export * from "./UpdateDocumentListRequest";

0 comments on commit bbebd6c

Please sign in to comment.