Skip to main content

Chat Completions Memory

Gabber Memory Contexts can be used in OpenAI-Compatible /chat/completions requests.

When using memory, you should only provide a single message in the messages field of the completion request. The Gabber backend will automatically fetch the history to fill in messages.

Making a Requesting with Memory

To use memory, an additional gabber field must be used in the completion request containing the Gabber Voice Id of interest.


const gabberMemoryContext = "<your memory context>"; // You probably want to fetch this from somewhere based on the user

const body = {
model: selectedLlm.id,
messages: [
{ role: "user", content: "Hello" },
],
stream: true,
gabber: {
context: gabberMemoryContext
}
};

const responseStream = await openAI.chat.completions.create(
{ stream: true, model: "", messages: [] }, // To satisfy the OpenAI SDK typings
{ body },
);