@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
18 lines (17 loc) • 819 B
JavaScript
import { getProviderRules } from "./registry.js";
function loadFinalResultTool() {
const tool = getProviderRules("structured-output").finalResultTool;
if (!tool) {
throw new Error('Provider rules file "structured-output.json" has no finalResultTool');
}
return tool;
}
const TOOL = loadFinalResultTool();
/** Internal tool name, filtered out of every returned tool call and execution. */
export const FINAL_RESULT_TOOL_NAME = TOOL.name;
/** The tool's description, as sent to the model. */
export const FINAL_RESULT_TOOL_DESCRIPTION = TOOL.description;
/** A system-prompt instruction naming the tool (the final-result tool by default). */
export function finalResultToolInstruction(kind, toolName = FINAL_RESULT_TOOL_NAME) {
return TOOL.instructions[kind].replaceAll("{tool}", toolName);
}