Skip to content

.Net: Add sample showing how to use web and file search #12611

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

Conversation

markwallace-microsoft
Copy link
Member

Motivation and Context

Partial fix for #12562

Description

Contribution Checklist

@markwallace-microsoft markwallace-microsoft requested a review from a team as a code owner June 27, 2025 09:54
@markwallace-microsoft markwallace-microsoft added the .NET Issue or Pull requests regarding .NET code label Jun 27, 2025
@github-actions github-actions bot changed the title Add sample showing how to use web and file search .Net: Add sample showing how to use web and file search Jun 27, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds samples demonstrating how to utilize web and file search capabilities with the OpenAIResponseAgent, along with updates to support reasoning models and new agent invoke options.

  • Updated BaseResponsesAgentTest to use ChatModelId and added FileClient and VectorStoreClient.
  • Changed invoke option types in OpenAIResponseAgent to OpenAIResponseAgentInvokeOptions.
  • Added new sample files demonstrating tool usage for web search, file search, and reasoning with summaries.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
dotnet/src/InternalUtilities/samples/AgentUtilities/BaseResponsesAgentTest.cs Updated client instantiation, changed model identifier, and added file and vector store clients; EnableLogging default has changed.
dotnet/src/Agents/OpenAI/OpenAIResponseAgentInvokeOptions.cs Added support to propagate ResponseCreationOptions in constructor overloads.
dotnet/src/Agents/OpenAI/OpenAIResponseAgent.cs Updated invoke options type from OpenAIAssistantAgentInvokeOptions to OpenAIResponseAgentInvokeOptions.
dotnet/src/Agents/OpenAI/Extensions/OpenAIResponseExtensions.cs Extended response conversion for ReasoningResponseItem and added helper conversion for summary texts.
dotnet/samples/GettingStartedWithAgents/OpenAIResponse/Step04_OpenAIResponseAgent_Tools.cs New sample demonstrating usage of web search and file search tools.
dotnet/samples/GettingStartedWithAgents/OpenAIResponse/Step03_OpenAIResponseAgent_ReasoningModel.cs Added test for using a reasoning model with summaries, including multi-line prompt usage.

@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Jun 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 27, 2025
@markwallace-microsoft markwallace-microsoft added the kernel Issues or pull requests impacting the core kernel label Jun 30, 2025
@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Jun 30, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jun 30, 2025
### Motivation and Context

Partial fix for #12562 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 30, 2025
@markwallace-microsoft
Copy link
Member Author

One unrelated integration tests failure

[xUnit.net 00:01:46.63]     SemanticKernel.IntegrationTests.Connectors.AzureOpenAI.AzureOpenAIChatClientRequiredFunctionChoiceBehaviorTests.SpecifiedInPromptInstructsConnectorToInvokeKernelFunctionAutomaticallyAsync [FAIL]
[xUnit.net 00:01:46.63]       Microsoft.SemanticKernel.KernelFunctionCanceledException : The invocation of function 'Function_6310afcda1474806a53c33cdbc83035e' was canceled.
[xUnit.net 00:01:46.63]       ---- System.Threading.Tasks.TaskCanceledException : The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
[xUnit.net 00:01:46.63]       -------- System.TimeoutException : The operation was canceled.
[xUnit.net 00:01:46.63]       ------------ System.Threading.Tasks.TaskCanceledException : The operation was canceled.
[xUnit.net 00:01:46.63]       ---------------- System.IO.IOException : Unable to read data from the transport connection: Operation canceled.
[xUnit.net 00:01:46.63]       -------------------- System.Net.Sockets.SocketException : Operation canceled

@markwallace-microsoft markwallace-microsoft added this pull request to the merge queue Jun 30, 2025
Merged via the queue into microsoft:main with commit 16da89a Jun 30, 2025
20 checks passed
@markwallace-microsoft markwallace-microsoft deleted the users/markwallace/issue_12562_1 branch June 30, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants