trying the latest foundry local SDK, running samples of toolcalling and hit error below:
OS: win25h2,
device: rtx 5080
D:\Code\Foundry-Local\samples\cs\GettingStarted\windows>dotnet run --project ToolCallingFoundryLocalSdk/ToolCallingFoundryLocalSdk.csproj -r:win-x64
info: FoundryLocalCore[0]
Service configuration complete.
Registering execution providers... ◵ Done.
Loading model qwen2.5-0.5b-instruct-trtrtx-gpu:2...done.
Chat completion response:
<tool_call>Warning: Parser Error: token "\n" doesn't satisfy the grammar; forced bytes: got '['; applying '\n'
; stopping
Unhandled exception. Microsoft.AI.Foundry.Local.FoundryLocalException: Error from chat_completions command: Error: Microsoft.ML.OnnxRuntimeGenAI.OnnxRuntimeGenAIException: Error committing tokens: Parser Error: token "\n" doesn't satisfy the grammar; forced bytes: got '['; applying '\n'
Tokens: ⟦<tool_call>‧\n⟧
2 tokens, 9 bytes; grm_prefix: ""
Flags:
Parser: {
"compute_time_us": 0,
"rows": 14,
"cached_rows": 0,
"all_items": 17,
"lexer_cost": 3468,
"slices_applied": 0,
"trie_nodes_walked": 0,
"definitive_bytes": 63,
"lexer_ops": 0,
"num_lex_errors": 0,
"num_lexemes": 0
}
Stop: ParserTooComplex
Error: Parser Error: token "\n" doesn't satisfy the grammar; forced bytes: got '['; applying '\n'
at Microsoft.ML.OnnxRuntimeGenAI.Result.VerifySuccess(IntPtr) + 0x47
at Microsoft.ML.OnnxRuntimeGenAI.Generator.GenerateNextToken() + 0x1b
at Microsoft.Neutron.OpenAI.Provider.ChatCompletions.<>c__DisplayClass3_0.<g__DecodeTokens|0>d.MoveNext() + 0x143
--- End of stack trace from previous location ---
at Microsoft.Neutron.OpenAI.TokenPerfExtensions.d__0`2.MoveNext() + 0x33f
--- End of stack trace from previous location ---
at Microsoft.Neutron.OpenAI.TokenPerfExtensions.d__0`2.MoveNext() + 0x75e
--- End of stack trace from previous location ---
at Microsoft.Neutron.OpenAI.TokenPerfExtensions.d__0`2.MoveNext() + 0x9a7
--- End of stack trace from previous location ---
at Microsoft.Neutron.OpenAI.Provider.ChatCompletions.d__3.MoveNext() + 0x7e7
--- End of stack trace from previous location ---
at Microsoft.Neutron.OpenAI.Provider.ChatCompletions.d__3.MoveNext() + 0x9af
--- End of stack trace from previous location ---
at Microsoft.Neutron.OpenAI.Provider.ChatCompletions.d__3.MoveNext() + 0xaf8
--- End of stack trace from previous location ---
at Microsoft.AI.Foundry.Local.ChatClient.d__8.MoveNext() + 0x2cb
--- End of stack trace from previous location ---
at Microsoft.AI.Foundry.Local.ChatClient.d__8.MoveNext() + 0x446
--- End of stack trace from previous location ---
at Microsoft.AI.Foundry.Local.NativeInterop.<>c__DisplayClass11_0.<b__2>d.MoveNext() + 0x467
--- End of stack trace from previous location ---
at Microsoft.AI.Foundry.Local.NativeInterop.<>c__DisplayClass11_0.<b__2>d.MoveNext() + 0x7d9
--- End of stack trace from previous location ---
at Microsoft.AI.Foundry.Local.NativeInterop.d__9.MoveNext() + 0xb8