Zep.Context (Zep v1.0.0)

Copy Markdown View Source

Custom context-rendering templates, referenced by template_id from Zep.Thread.get_user_context/3 and Zep.Thread.add_messages/4.

Summary

Functions

Creates a new context template with the given name and template string.

Deletes a context template by template_id.

Fetches a single context template by template_id.

Lists all context templates in the project.

Updates an existing context template's :name and/or :template body.

Functions

create_template(client_or_opts, name, template)

@spec create_template(Zep.Client.t() | keyword(), String.t(), String.t()) ::
  {:ok, Zep.Schemas.ContextTemplate.t()} | {:error, term()}

Creates a new context template with the given name and template string.

delete_template(client_or_opts, template_id)

@spec delete_template(Zep.Client.t() | keyword(), String.t()) ::
  {:ok, term()} | {:error, term()}

Deletes a context template by template_id.

get_template(client_or_opts, template_id)

@spec get_template(Zep.Client.t() | keyword(), String.t()) ::
  {:ok, Zep.Schemas.ContextTemplate.t()} | {:error, term()}

Fetches a single context template by template_id.

list_templates(client_or_opts)

@spec list_templates(Zep.Client.t() | keyword()) ::
  {:ok, [Zep.Schemas.ContextTemplate.t()]} | {:error, term()}

Lists all context templates in the project.

update_template(client_or_opts, template_id, opts \\ [])

@spec update_template(Zep.Client.t() | keyword(), String.t(), keyword()) ::
  {:ok, Zep.Schemas.ContextTemplate.t()} | {:error, term()}

Updates an existing context template's :name and/or :template body.