llmclient

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package llmclient provides decorators that apply session-level policy to any gollem.LLMClient, independent of which provider built it.

Policy lives here rather than on a concrete client type (or on a routing type such as the CLI's composite client) because Warren constructs LLM clients in more than one place: the main LLM configuration and the webfetch tool each build their own. Tying a policy to one construction site silently skips the others, so the policy is expressed as a wrapper applied wherever a client is born.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithPromptCache

func WithPromptCache(client gollem.LLMClient, enabled bool) gollem.LLMClient

WithPromptCache returns a client that enables provider prompt caching on every session it creates. When enabled is false the client is returned unchanged, so callers never pay for a wrapper that does nothing.

Only Claude acts on the option: it marks the stable prefix (system prompt and tool definitions) and the conversation tail with ephemeral cache_control so repeated prefixes are served from Claude's prompt cache. Gemini and OpenAI cache automatically and ignore it, so wrapping a non-Claude client is harmless but pointless.

Types

This section is empty.

Jump to

Keyboard shortcuts

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