-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
bugSomething isn't workingSomething isn't workingtriageNeeds triage from engineering teamNeeds triage from engineering team
Description
Describe the bug
I set the toolcallbehavior of allowOnlyKernelFunctions as true, and passed the functions to the kernel
but the kernel make a functiontoolcall by himself and just invoke it.
To Reproduce
Steps to reproduce the behavior:
List<KernelFunction<?>> functions = kernel.getPlugins().stream()
.map(KernelPlugin::getFunctions)
.map(Map::values)
.flatMap(Collection::stream)
.toList();
FunctionResult<String> preResult = kernel
.invokeAsync(function)
.withToolCallBehavior(ToolCallBehavior.allowOnlyKernelFunctions(true, functions))
.withArguments(
KernelFunctionArguments.builder()
.withInput(userInput)
.withVariable("metadata", metadata)
.build())
.withResultType(ContextVariableTypes.getGlobalVariableTypeForClass(String.class))
.block(); // occur exception here, for invoke a self-make functionExpected behavior
Only invoke the passed functions.
Maven
- Version: 3.3.9
- Dependencies: 1.4.3
Platform
- IDE: IDEA
- JDK version: 17
Additional context
Excption: com.azure.core.exception.HttpResponseException: Status code 400, "{"error":{"message":"Invalid 'messages[1].tool_calls[1].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.","type":"invalid_request_error","code":"invalid_value","param":"messages[1].tool_calls[1].function.name"}}"
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriageNeeds triage from engineering teamNeeds triage from engineering team
