-
Notifications
You must be signed in to change notification settings - Fork 788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change AIFunction.InvokeAsync to accept AIFunctionArguments #6158
Conversation
src/Libraries/Microsoft.Extensions.AI.Abstractions/Functions/AIFunctionArguments.cs
Show resolved
Hide resolved
@SteveSandersonMS, @halter73, as this is a fundamental change, I'd like a second review before merging. Thanks! |
src/Libraries/Microsoft.Extensions.AI.Abstractions/Functions/AIFunctionArguments.cs
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIRealtimeExtensions.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posted some minor questions but the overall thing look great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I agree that adding an optional IServiceProvider argument to OpenAIRealtimeExtensions.HandleToolCallsAsync would be a good idea, but that could be done as a follow up.
src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs
Outdated
Show resolved
Hide resolved
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIRealtimeExtensions.cs
Outdated
Show resolved
Hide resolved
- Adds a new AIFunctionArguments type. - Changes AIFunction.InvokeAsync to accept an AIFunctionArguments instead of an arbitrary enumerable. - Changes FunctionInvokingChatClient to accept an IServiceProvider and expose it as a Services property, and to then pass that IServiceProvider into the AIFunction via AIFunctionArguments.Services. - Augments FunctionInvocationContext with an AIFunctionArguments property. - Changes AIFunctionFactory to special-case parameters of type IServiceProvider and AIFunctionArguments, sourcing from AIFunctionArguments. - Makes AIJsonSchemaCreateOptions a record.
f5e7c7b
to
fe4453c
Compare
Microsoft Reviewers: Open in CodeFlow