Low-level request execution shared by every resource module.
Handles JSON encoding/decoding, retry-with-backoff on retriable errors,
and emits :telemetry events around every call:
[:zep, :request, :start]-%{system_time: t}/%{method:, url:, resource:, action:}[:zep, :request, :stop]-%{duration: t}/%{method:, url:, resource:, action:, status:}[:zep, :request, :exception]-%{duration: t}/%{method:, url:, resource:, action:, kind:, reason:}
This is not part of the public API surface used directly by callers -
see Zep.Thread, Zep.Graph, etc. for the documented, typed functions.
Summary
Functions
Drops nil values from a keyword list/map of query params before encoding.
Issues an HTTP request against the Zep API and decodes the JSON response.
URL-encodes a single path segment (thread IDs, user IDs, UUIDs, etc).
Types
Functions
Drops nil values from a keyword list/map of query params before encoding.
@spec request(Zep.Client.t(), method(), String.t(), keyword()) :: {:ok, term()} | {:error, Zep.Error.t() | Zep.TransportError.t()}
Issues an HTTP request against the Zep API and decodes the JSON response.
telemetry_meta should include at least :resource and :action atoms
(e.g. resource: :thread, action: :list) so telemetry handlers/loggers
can attribute calls meaningfully.
@spec segment(String.t() | non_neg_integer()) :: String.t()
URL-encodes a single path segment (thread IDs, user IDs, UUIDs, etc).