schrodinger.application.bunsen.tool module

schrodinger.application.bunsen.tool.get_bunsen_service()
class schrodinger.application.bunsen.tool.Provider(tag: str, description: str = '', *, parent=None)

Bases: QObject

__init__(tag: str, description: str = '', *, parent=None)
addTool(ToolClass)

Register a Tool class with this provider.

getToolSummaries() list[dict]

Return name and description for every registered tool.

getSchemas() list[dict]

Return the full schema for every registered tool.

getJsonSchemas() list[dict]

Return JSON Schema tool definitions for BTI registration.

Each dict contains name (prefixed with the provider tag), description, and input_schema. The built-in help tool is excluded because structured schemas make it redundant.

getTag()
getDescription()
getToolClass(tool_name: str) type

Return the Tool subclass registered under tool_name.

Raises:

ValueError – If no tool with that name is registered.

class schrodinger.application.bunsen.tool.ToolParam(name: str, type: str, description: str = '')

Bases: object

name: str
type: str
description: str = ''
__init__(name: str, type: str, description: str = '') None
class schrodinger.application.bunsen.tool.Tool(call_id: str, args: dict, parent=None)

Bases: QObject

Base class for tools that Bunsen can invoke.

Subclasses must define the class attributes PROVIDER, NAME, DESCRIPTION, and PARAMS, and implement main.

responseReady

A pyqtSignal emitted by instances of the class.

NAME: str = ''
DESCRIPTION: str = ''
PARAMS: tuple[ToolParam, ...] = ()
RESPONSE_FILES: tuple[str, ...] = ()
classmethod getSchema() dict

Return a dict describing this tool for Bunsen.

__init__(call_id: str, args: dict, parent=None)
getCallId()
run()
main(**kwargs)

The main function is responsible for calling self.sendResponse() itself or in a downstream callback or slot. This allows for both synchronous and asynchronous tool implementations.

getTempFile(suffix: str) str

Create a temporary file tracked for cleanup.

Parameters:

suffix – File extension (without dot), e.g. "mae".

Returns:

Path to the new temporary file.

sendResponse(result: dict)