Import and configure the evaluator of your choice.Documentation Index
Fetch the complete documentation index at: https://docs.learningcommons.org/llms.txt
Use this file to discover all available pages before exploring further.
example.ts
Options
All evaluators accept some base configuration options.Get the Required API
keys for the
evaluators you want to use.
| Field | Type | Description |
|---|---|---|
googleApiKey | string | Google API key, required for evaluators that default to Google models |
openaiApiKey | string | OpenAI API key, required for evaluators that default to OpenAI models |
anthropicApiKey | string | Anthropic API key, required for evaluators that default to Claude or when modelOverride is set to Provider.Anthropic |
modelOverride | ModelOverride | Overrides the evaluator’s default provider and model |
maxRetries | number | Default: 2. Maximum retry attempts for failed evaluator calls |
telemetry | boolean | TelemetryOptions | Default: true. Configuration for collecting telemetry |
logger | Logger | Custom logger for evaluator output |
logLevel | LogLevel | Default: WARN. Logging verbosity level |
partnerKey | string | Your Learning Commons API key, used for authenticated telemetry data collection. Create your API key on the Learning Commons Platform. |
Evaluators are validated and tested against their default models. Results with
other models (using
modelOverride) may vary.Logging
Customize how your evaluator logs information.Log level
Control logging verbosity:Custom logger
You can configure your evaluator with a custom logger:Telemetry
We collect limited usage and performance telemetry by default. This may include performance metrics (latency, token usage), technical metadata (such as SDK version and evaluator type) and related diagnostic information. This telemetry helps us improve evaluator quality, identify edge cases, and optimize performance. You can disable telemetry collection through the configuration options.What you’ll need
While telemetry data collection is not required, we recommend enabling it so
that we can better support your team’s use cases.
What we collect
| Field | Description |
|---|---|
timestamp | ISO 8601 timestamp when evaluation started |
sdk_version | SDK version (e.g., "0.1.0") |
evaluator_type | Which evaluator ran (e.g., "vocabulary", "sentence-structure") |
grade | Grade level evaluated (e.g., "5", "K") |
status | Evaluation outcome ("success" or "error") |
error_code | Error type if status is "error" (e.g., "Error", "TypeError") |
latency_ms | Total evaluation time in milliseconds |
text_length_chars | Length of input text in characters |
provider | LLM provider(s) used (e.g., "openai:gpt-4o", "google:gemini-2.5-pro") |
token_usage | Total tokens consumed (input and output) |
input_text Opt in | Text being evaluated (only included if the telemetry configuration option is set to { enabled: true, recordInputs: true }).Developers are responsible for ensuring that any content they choose to share complies with applicable law and does not include sensitive or regulated information unless they have appropriate authorization to provide it. |
metadata.stage_details | Per-stage breakdown for multi-stage evaluators (optional) |
payload.json