llm_request_parser

package
v0.74.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package llm_request_parser implements the SlotOnRequest middleware that detects the LLM provider from the request URL, parses the JSON request body for model and streaming flags, and extracts the user prompt text. Emitted metadata feeds downstream middlewares (guardrail, cost meter) and the access-log terminal sink.

Index

Constants

View Source
const ID = "llm_request_parser"

ID is the registry key for this middleware.

View Source
const Version = "1.0.0"

Version is reported via Middleware.Version().

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct{}

Factory builds llm_request_parser instances from raw config bytes.

func (Factory) ID

func (Factory) ID() string

ID returns the registry identifier.

func (Factory) New

func (Factory) New(rawConfig []byte) (middleware.Middleware, error)

New constructs a middleware instance. Empty, null, and {} configs are accepted; non-empty rawConfig that fails to unmarshal is rejected so misconfigurations surface at chain build time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL