LibreChat/examples/sdk-runtime/minimal.cjs
Danny Avila 4c6da07a7a
🚠 feat: Bridge Registered SDK Agents to Remote Runtimes (#18150)
* feat: bridge registered SDK agents to remote runtimes

* docs: make remote runtime parity gates explicit

* fix: bound runtime authorization admission and shutdown

* fix: reject unresolved runtime secrets and preserve checkpoint queries

* fix: order remote policy hooks after preceding events
2026-11-14 10:56:05 -05:00

30 lines
860 B
JavaScript

const { Run, Providers, FakeChatModel } = require('@librechat/agents');
/** Smallest key-free example: a real SDK Run, streamed through the native Agents UI. */
async function createMinimalRun({ config, compileOptions, identity, agent, signal }) {
const run = await Run.create({
...config,
returnContent: true,
tokenCounter: () => 1,
graphConfig: {
type: 'standard',
signal,
compileOptions,
agents: [
{
agentId: identity.agentId,
provider: Providers.OPENAI,
instructions: agent.instructions,
tools: [],
clientOptions: { model: 'gpt-4.1-mini' },
},
],
},
});
run.Graph.overrideModel = new FakeChatModel({
responses: ['Hello from the separate SDK runtime.'],
sleep: 10,
});
return run;
}
module.exports = { createMinimalRun };