@jupyter-ai/agent-lite
v0.21.0
Published
The building blocks of in-browser AI personas for Jupyter AI: tools, skills, settings and sign-in helpers
Readme
@jupyter-ai/agent-lite
The building blocks of in-browser AI personas for Jupyter AI, in JupyterLab, Notebook 7 and JupyterLite. The Python package is jupyter-ai-agent-lite.
The package is a JupyterLab extension that provides:
IToolRegistry: the tools a persona offers to a model, with the built-indiscover_commands,execute_command,browser_fetch,discover_skillsandload_skilltoolsISkillRegistry: the agent skills loaded from the skills paths or registered by extensionsIAgentSettings: the settings shared by the personas (@jupyter-ai/agent-lite:settings): the commands that require an approval, the commands whose outputs render in the chat, the trusted MIME types and the skills paths- helpers:
getToolInputSchema,parseToolInput,extractMimeBundles,requestApiKeyandforwardAuthCode(OpenRouter sign-in),getAppAttribution
The package has no dependency on the AI SDK.
Usage
A persona extension consumes @jupyter-ai/agent-lite as a shared singleton:
{
"dependencies": {
"@jupyter-ai/agent-lite": "^0.21.0"
},
"jupyterlab": {
"extension": true,
"sharedPackages": {
"@jupyter-ai/agent-lite": {
"bundled": false,
"singleton": true
}
}
}
}Its Python package depends on jupyter-ai-agent-lite, so that the extension is installed.
import { IToolRegistry } from '@jupyter-ai/agent-lite';
const plugin: JupyterFrontEndPlugin<void> = {
id: 'my-persona:tools',
autoStart: true,
requires: [IToolRegistry],
activate: (app: JupyterFrontEnd, tools: IToolRegistry) => {
for (const { name, tool } of tools.namedTools) {
console.log(name, tool.description);
}
}
};See Building an in-browser persona for the complete guide.
