Bug: SK runs his self-made function by ignoring the auto-invoke function config
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the Java example around kernel.invokeAsync(function) and ToolCallBehavior.allowOnlyKernelFunctions(true, functions) with the reported versions. Inspect how the passed functions are handled before the tool call is sent; done means only the supplied kernel functions are invoked and the reported invalid function-name request is no longer produced.
Written by the indexing model from the issue text.
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 function
Expected behavior
Only invoke the passed functions.
Screenshots
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"}}"
- Dominant language
- Java
- Stars
- 276
- Forks
- 56
- Avg merge
- 17h 45m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/semantic-kernel-java
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
microsoft/semantic-kernel-java#334 · 1 comment ·
-
Feature Parity Inquiry: Multi-Agent Orchestration and Roadmap Alignment with Python/.NET Versions Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/semantic-kernel-java#331 · 7 comments ·
-
bug triage
microsoft/semantic-kernel-java#330 · 3 comments · 1 assignee ·
-
bug triage
Difficulty 5/5 Over a week Newbie friendliness 20/100
microsoft/semantic-kernel-java#328 · 1 comment ·
-
microsoft/semantic-kernel-java#323 · 1 reaction · 2 assignees ·
All issues in microsoft/semantic-kernel-java
Similar issues
-
bug untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
emitter:client:csharp feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100