feat: add Russian localization and independent STT languages
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { learningLanguageInstruction, type Language } from "../core/i18n.ts";
|
||||
import { Agent } from "@earendil-works/pi-agent-core";
|
||||
import type { AgentEvent, AgentMessage, AgentTool } from "@earendil-works/pi-agent-core";
|
||||
import { invalidInputResult, questionResult } from "./tool-execute.ts";
|
||||
@@ -97,6 +98,7 @@ export type StepUsageCollector = (usage: Usage) => void;
|
||||
|
||||
/** Per-request construction options (the handler wires all of these). */
|
||||
export interface AgentBuildOptions {
|
||||
language?: Language;
|
||||
/** Model + stream function — tests inject a scripted faux engine. */
|
||||
engine?: PiEngine;
|
||||
callPurpose?: { background: boolean };
|
||||
@@ -175,9 +177,10 @@ function baseAgentOptions(kind: AgentKind, opts: AgentBuildOptions, tools: Agent
|
||||
// ("practice" is not a ModelRole) honest about that.
|
||||
const engine = opts.engine ?? piEngineFor(kind as "prober" | "teacher");
|
||||
const stopper = makeQuestionStopper();
|
||||
const systemPrompt = opts.promptSwitches
|
||||
const basePrompt = opts.promptSwitches
|
||||
? composeInstructions(kind, opts.promptSwitches)
|
||||
: composedInstructions[kind]!;
|
||||
const systemPrompt = `${basePrompt}\n\n${learningLanguageInstruction(opts.language ?? "en")}`;
|
||||
// Debug recorder (owner, 2026-10-04): raw provider events when
|
||||
// LH_PROVIDER_EVENTS=1 and the caller handed a chatId; undefined is
|
||||
// the normal no-observer path (tests, env-off).
|
||||
|
||||
Reference in New Issue
Block a user