features-app-resources

command
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: BSD-2-Clause Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command features-app-resources shows pipeline.WorkerConfig.AppResources.

AppResources is whatever the application wants to share across a session: database handles, HTTP clients, feature flags, per-user state, observability clients, in-memory caches. The framework passes it through untouched and exposes it as the worker's AppResources, so any code with a handle on the worker can read or change it.

Two of the read sites are shown here:

  • Tool handlers read it from llm.FunctionCallParams.AppResources.
  • Custom processors read it from Running().AppResources().

Two small loggers stand in for the shared thing: a toolCallLogger written from the tool handlers, and a transcriptionLogger written from a custom processor in the pipeline. A real application might pass a database pool, a Redis client or an SDK client just as well. The mechanics are the same whatever goes in: build it once, hand it to the worker, read it at each site, inspect it after the session.

The resources are bundled in a typed appResources struct and asserted back to it at each read site. The worker does not care what type it is given, but a typed container is safer than lookups by string key.

DEEPGRAM_API_KEY=… CARTESIA_API_KEY=… OPENAI_API_KEY=… \
  go run ./examples/features/features-app-resources

Then open http://localhost:7860, connect, and ask about the weather.

Jump to

Keyboard shortcuts

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