Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

RuntimeInstructions.ts

17 lines974 Bytes

1/** Shared runtime context; omit model and effort when the harness manages them dynamically. */
2export function buildRuntimeInstructions(runtime: {
3 readonly harness: string;
4 readonly model?: string | undefined;
5 readonly reasoningEffort?: string | undefined;
6}): string {
7 const harness = toSingleLine(runtime.harness);
8 const model = toSingleLine(runtime.model ?? "");
9 const effort = toSingleLine(runtime.reasoningEffort ?? "");
10 const modelInfo = model && model !== "auto" && model !== "default" ? `, as ${model}` : "";
11 const effortInfo = effort ? ` with ${effort} reasoning effort` : "";
12 return `<runtime_info>In case you're asked: you are running in T3 Code through the ${harness} harness${modelInfo}${effortInfo}. No need to mention this otherwise. You can embed images and videos in your response using Markdown with absolute file paths.</runtime_info>`;
14​
15function toSingleLine(value: string): string {
16 return value.replaceAll(/\s+/g, " ").trim();