tools: surface tool source in chat additions api (#256558)

For MCP I can already kind of get this from the tool name, but for
extension tools we previously had no way to know which extension
provided the tool.

This PR adds a `LanguageModelToolInformation.source` containing details
about where the tool came from. I also use this to include the MCP
server instructions which is needed for #250017.

cc @aeschli @roblourens
This commit is contained in:
Connor Peet
2025-07-17 13:25:25 -07:00
committed by GitHub
parent dac120d094
commit 25d003bcf6
12 changed files with 172 additions and 49 deletions

View File

@@ -1855,6 +1855,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
LanguageModelToolResult: extHostTypes.LanguageModelToolResult,
LanguageModelToolResult2: extHostTypes.LanguageModelToolResult2,
LanguageModelDataPart: extHostTypes.LanguageModelDataPart,
LanguageModelToolExtensionSource: extHostTypes.LanguageModelToolExtensionSource,
LanguageModelToolMCPSource: extHostTypes.LanguageModelToolMCPSource,
ExtendedLanguageModelToolResult: extHostTypes.ExtendedLanguageModelToolResult,
PreparedTerminalToolInvocation: extHostTypes.PreparedTerminalToolInvocation,
LanguageModelChatToolMode: extHostTypes.LanguageModelChatToolMode,