lm
Properties
An event that is fired when the set of available chat models changes.
A list of all available tools that were registered by all extensions using lm.registerTool. They can be called with lm.invokeTool with input that match their declared inputSchema
.
Functions
Invoke a tool listed in lm.tools by name with the given input. The input will be validated against the schema declared by the tool
Registers a provider that publishes Model Context Protocol servers for the editor to consume. This allows MCP servers to be dynamically provided to the editor in addition to those the user creates in their configuration files.
Register a LanguageModelTool. The tool must also be registered in the package.json languageModelTools
contribution point. A registered tool is available in the lm.tools list for any extension to see. But in order for it to be seen by a language model, it must be passed in the list of available tools in LanguageModelChatRequestOptions.tools.
Select chat models by a selector. This can yield multiple or no chat models and extensions must handle these cases, esp. when no chat model exists, gracefully.