Rename customMessageTransformer to customConvertToLlm

This commit is contained in:
Mario Zechner 2025-12-28 11:07:22 +01:00
parent 13a1991ec2
commit 6a6d1a59f4
2 changed files with 3 additions and 7 deletions

View file

@ -79,7 +79,7 @@ export function createSystemNotification(
* Custom message transformer that extends defaultConvertToLlm. * Custom message transformer that extends defaultConvertToLlm.
* Handles system-notification messages by converting them to user messages. * Handles system-notification messages by converting them to user messages.
*/ */
export function customMessageTransformer(messages: AgentMessage[]): Message[] { export function customConvertToLlm(messages: AgentMessage[]): Message[] {
// First, handle our custom system-notification type // First, handle our custom system-notification type
const processed = messages.map((m): AgentMessage => { const processed = messages.map((m): AgentMessage => {
if (m.role === "system-notification") { if (m.role === "system-notification") {

View file

@ -25,11 +25,7 @@ import "./app.css";
import { icon } from "@mariozechner/mini-lit"; import { icon } from "@mariozechner/mini-lit";
import { Button } from "@mariozechner/mini-lit/dist/Button.js"; import { Button } from "@mariozechner/mini-lit/dist/Button.js";
import { Input } from "@mariozechner/mini-lit/dist/Input.js"; import { Input } from "@mariozechner/mini-lit/dist/Input.js";
import { import { createSystemNotification, customConvertToLlm, registerCustomMessageRenderers } from "./custom-messages.js";
createSystemNotification,
customMessageTransformer,
registerCustomMessageRenderers,
} from "./custom-messages.js";
// Register custom message renderers // Register custom message renderers
registerCustomMessageRenderers(); registerCustomMessageRenderers();
@ -179,7 +175,7 @@ Feel free to use these tools when needed to provide accurate and helpful respons
tools: [], tools: [],
}, },
// Custom transformer: convert custom messages to LLM-compatible format // Custom transformer: convert custom messages to LLM-compatible format
convertToLlm: customMessageTransformer, convertToLlm: customConvertToLlm,
}); });
agentUnsubscribe = agent.subscribe((event: any) => { agentUnsubscribe = agent.subscribe((event: any) => {