LLMProxy.GuardrailPipeline (llm_proxy v0.1.0)

Copy Markdown View Source

Runs configured LLMProxy.Guardrail callbacks around requests, responses, and stream events.

Summary

Functions

after_response(response, context)

@spec after_response(LLMProxy.Response.t(), LLMProxy.Guardrail.context()) ::
  {:ok, LLMProxy.Response.t()} | {:error, term()}

before_request(request, context)

@spec before_request(LLMProxy.Protocol.Request.t(), LLMProxy.Guardrail.context()) ::
  {:ok, LLMProxy.Protocol.Request.t()} | {:error, term()}

on_stream_event(event, context)

@spec on_stream_event(LLMProxy.Stream.Event.t(), LLMProxy.Guardrail.context()) ::
  {:ok, LLMProxy.Stream.Event.t() | nil} | {:error, term()}