Skip to content

External controlled tool calling with ToolCallingManager cannot really work. #2511

@chickenlj

Description

@chickenlj

Bug description

As defined below, executeToolCalls(Prompt prompt, ChatResponse chatResponse) in Spring AI requires prompt to get Options configuration as the context to get tool definition, prepare ToolContext, etc.

But if I use ToolCall outside the scope of ChatClient, there's no way for me to get the prompt that was used in ChatClient that inited the tool calling request.

public interface ToolCallingManager {

	/**
	 * Resolve the tool definitions from the model's tool calling options.
	 */
	List<ToolDefinition> resolveToolDefinitions(ToolCallingChatOptions chatOptions);

	/**
	 * Execute the tool calls requested by the model.
	 */
	ToolExecutionResult executeToolCalls(Prompt prompt, ChatResponse chatResponse);

}

Simply put, where I can get the prompt instance to call toolCallingManager.executeToolCalls(prompt, chatResponse);

Environment
1.0.0-M6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions