AxMemory
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L224
Implements
Constructors
Constructor
new AxMemory(): AxMemory;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L228
Returns
AxMemory
Methods
addFunctionResults()
addFunctionResults(results: readonly AxFunctionResult[], sessionId?: string): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L259
Parameters
| Parameter | Type |
|---|---|
results | readonly AxFunctionResult[] |
sessionId? | string |
Returns
void
Implementation of
addRequest()
addRequest(value: (
| {
cache?: boolean;
content: string;
role: "system";
}
| {
content: | string
| (
| {
cache?: boolean;
text: string;
type: "text";
}
| {
altText?: string;
cache?: boolean;
details?: "high" | "low" | "auto";
image: string;
mimeType: string;
optimize?: "auto" | "quality" | "size";
type: "image";
}
| {
cache?: boolean;
data: string;
duration?: number;
format?: "wav" | "mp3" | "ogg";
transcription?: string;
type: "audio";
}
| {
cache?: boolean;
data: string;
extractedText?: string;
filename?: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
extractedText?: string;
filename?: string;
fileUri: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
cachedContent?: string;
description?: string;
title?: string;
type: "url";
url: string;
})[];
name?: string;
role: "user";
}
| {
cache?: boolean;
content?: string;
functionCalls?: object[];
name?: string;
role: "assistant";
}
| {
cache?: boolean;
functionId: string;
isError?: boolean;
result: string;
role: "function";
})[], sessionId?: string): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L244
Parameters
| Parameter | Type |
|---|---|
value | ( | { cache?: boolean; content: string; role: "system"; } | { content: | string | ( | { cache?: boolean; text: string; type: "text"; } | { altText?: string; cache?: boolean; details?: "high" | "low" | "auto"; image: string; mimeType: string; optimize?: "auto" | "quality" | "size"; type: "image"; } | { cache?: boolean; data: string; duration?: number; format?: "wav" | "mp3" | "ogg"; transcription?: string; type: "audio"; } | { cache?: boolean; data: string; extractedText?: string; filename?: string; mimeType: string; type: "file"; } | { cache?: boolean; extractedText?: string; filename?: string; fileUri: string; mimeType: string; type: "file"; } | { cache?: boolean; cachedContent?: string; description?: string; title?: string; type: "url"; url: string; })[]; name?: string; role: "user"; } | { cache?: boolean; content?: string; functionCalls?: object[]; name?: string; role: "assistant"; } | { cache?: boolean; functionId: string; isError?: boolean; result: string; role: "function"; })[] |
sessionId? | string |
Returns
void
Implementation of
addResponse()
addResponse(results: readonly AxChatResponseResult[], sessionId?: string): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L251
Parameters
| Parameter | Type |
|---|---|
results | readonly AxChatResponseResult[] |
sessionId? | string |
Returns
void
Implementation of
addTag()
addTag(name: string, sessionId?: string): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L273
Parameters
| Parameter | Type |
|---|---|
name | string |
sessionId? | string |
Returns
void
Implementation of
getLast()
getLast(sessionId?: string):
| undefined
| {
chat: object[];
role: "function" | "system" | "user" | "assistant";
tags?: string[];
updatable?: boolean;
};
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L289
Parameters
| Parameter | Type |
|---|---|
sessionId? | string |
Returns
| undefined
| {
chat: object[];
role: "function" | "system" | "user" | "assistant";
tags?: string[];
updatable?: boolean;
}
Implementation of
history()
history(index: number, sessionId?: string): (
| {
cache?: boolean;
content: string;
role: "system";
}
| {
content: | string
| (
| {
cache?: boolean;
text: string;
type: "text";
}
| {
altText?: string;
cache?: boolean;
details?: "high" | "low" | "auto";
image: string;
mimeType: string;
optimize?: "auto" | "quality" | "size";
type: "image";
}
| {
cache?: boolean;
data: string;
duration?: number;
format?: "wav" | "mp3" | "ogg";
transcription?: string;
type: "audio";
}
| {
cache?: boolean;
data: string;
extractedText?: string;
filename?: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
extractedText?: string;
filename?: string;
fileUri: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
cachedContent?: string;
description?: string;
title?: string;
type: "url";
url: string;
})[];
name?: string;
role: "user";
}
| {
cache?: boolean;
content?: string;
functionCalls?: object[];
name?: string;
role: "assistant";
}
| {
cache?: boolean;
functionId: string;
isError?: boolean;
result: string;
role: "function";
})[];
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L285
Parameters
| Parameter | Type |
|---|---|
index | number |
sessionId? | string |
Returns
(
| {
cache?: boolean;
content: string;
role: "system";
}
| {
content: | string
| (
| {
cache?: boolean;
text: string;
type: "text";
}
| {
altText?: string;
cache?: boolean;
details?: "high" | "low" | "auto";
image: string;
mimeType: string;
optimize?: "auto" | "quality" | "size";
type: "image";
}
| {
cache?: boolean;
data: string;
duration?: number;
format?: "wav" | "mp3" | "ogg";
transcription?: string;
type: "audio";
}
| {
cache?: boolean;
data: string;
extractedText?: string;
filename?: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
extractedText?: string;
filename?: string;
fileUri: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
cachedContent?: string;
description?: string;
title?: string;
type: "url";
url: string;
})[];
name?: string;
role: "user";
}
| {
cache?: boolean;
content?: string;
functionCalls?: object[];
name?: string;
role: "assistant";
}
| {
cache?: boolean;
functionId: string;
isError?: boolean;
result: string;
role: "function";
})[]
Implementation of
removeByTag()
removeByTag(name: string, sessionId?: string): AxMemoryData;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L281
Parameters
| Parameter | Type |
|---|---|
name | string |
sessionId? | string |
Returns
Implementation of
reset()
reset(sessionId?: string): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L293
Parameters
| Parameter | Type |
|---|---|
sessionId? | string |
Returns
void
Implementation of
rewindToTag()
rewindToTag(name: string, sessionId?: string): AxMemoryData;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L277
Parameters
| Parameter | Type |
|---|---|
name | string |
sessionId? | string |
Returns
Implementation of
updateResult()
updateResult(result: Readonly<AxChatResponseResult & object>, sessionId?: string): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/mem/memory.ts#L266
Parameters
| Parameter | Type |
|---|---|
result | Readonly<AxChatResponseResult & object> |
sessionId? | string |
Returns
void