NAME
Langertha::Knarr::Request - Normalized chat request shared across all Knarr protocols
VERSION
version 1.001
DESCRIPTION
The normalized request shape that every Langertha::Knarr::Protocol parser produces and every Langertha::Knarr::Handler receives. Wire-protocol-specific quirks (OpenAI's choices, Anthropic's system outside messages, A2A's JSON-RPC envelope, etc.) are handled by the protocol's parse_chat_request and don't leak into the handler API.
The original wire-format body is preserved in "raw" for handlers (like Langertha::Knarr::Handler::Passthrough) that need to forward it verbatim.
protocol
Required. Short string identifying the parser that produced this request: openai, anthropic, ollama, a2a, acp, agui.
model
Optional model id from the request body.
messages
ArrayRef of message hashes ({ role => ..., content => ... }).
stream
Boolean. Whether the client requested streaming.
temperature, max_tokens, tools, system
Optional generation parameters and tool definitions, if the protocol extracted them.
session_id
Optional session id, used for per-session state. Pulled from protocol-specific fields (e.g. OpenAI's user, A2A's sessionId, or the x-session-id header).
raw
The original decoded request body. Useful for passthrough handlers that need to forward without re-encoding.
extra
Per-protocol scratch space (e.g. JSON-RPC id for A2A, run_id for ACP).
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha-knarr/issues.
IRC
Join #langertha on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.