[Microsoft.Extensions.AI] Questions on undocumented features #6389
-
What's the intended way to manage the following features:
TIA |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
You can access state from the underlying provider via RawRepresentation and/or AdditionalProperties. So if you know you're working with a provider that surfaces refusal information in a certain way, you can access it there. Refusals haven't become widespread enough for us to want to promote it up to first-class API, though we recently added ErrorContent, and we could possibly choose to map refusal information to that.
Can you elaborate on the question? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the answer.
I work in streaming mode and need to manually invoke the tools.
Is this the correct/intended workflow? |
Beta Was this translation helpful? Give feedback.
-
Thanks. |
Beta Was this translation helpful? Give feedback.
If you don't want to use the automatic invocation and instead want to use manual invocation, you would just do effectively the same thing that FunctionInvocationChatClient is doing here:
extensions/src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs
Lines 326 to 416 in 7b2620c