Skip to content

Conversation

@kzu
Copy link
Member

@kzu kzu commented Jul 7, 2025

  • Add OpenAI/Grok subnamespace: helps organize functionality areas
  • Adds OpenAI WebSearchTool-specific extensions under that namespace: region, city, timezone, context size.
  • Cross-provider compatibility by interpreting WebSearchTool as GrokSearch(Auto) with a GrokWebSource(country).

* Add OpenAI/Grok subnamespace: helps organize functionality areas
* Adds OpenAI WebSearchTool-specific extensions under that namespace: region, city, timezone, context size.
* Cross-provider compatibility by interpreting WebSearchTool as GrokSearch(Auto) with a GrokWebSource(country).
@kzu kzu requested a review from Copilot July 7, 2025 17:12
@kzu
Copy link
Member Author

kzu commented Jul 7, 2025

12 skipped 12 skipped

🧪 Details on Ubuntu 24.04.2 LTS

from dotnet-retest v0.7.1 on .NET 8.0.17 with 💜 by @devlooped

Copy link
Contributor

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

Adds support for OpenAI-specific web search options (region, city, timezone, context size) via a new sub-namespace, and ensures Grok compatibility by mapping the same tool to Grok’s live search API.

  • Introduces WebSearchTool under Devlooped.Extensions.AI with an extensible Properties bag.
  • Supplies OpenAI extensions (Region, City, TimeZone, ContextSize) in Devlooped.Extensions.AI.OpenAI.
  • Maps WebSearchTool to GrokChatWebSearchOptions in Devlooped.Extensions.AI.Grok.
  • Adjusts namespaces for OpenAI/Grok client types and updates README with usage examples.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/AI/WebSearchTool.cs Implements WebSearchTool with base country filtering and property bag.
src/AI/OpenAI/WebSearchToolExtensions.cs Adds extension block for WebSearchTool to configure region, city, timezone, and context size.
src/AI/OpenAI/OpenAIChatClient.cs Moves OpenAIChatClient into the OpenAI sub-namespace.
src/AI/Grok/GrokSearchTool.cs Relocates GrokSearchTool into the Grok sub-namespace.
src/AI/Grok/GrokClient.cs Maps WebSearchTool under GrokChatClient to GrokWebSource; qualifies global::OpenAI.
src/AI/Grok/GrokChatOptions.cs Moves GrokChatOptions into the Grok sub-namespace.
src/AI/Grok/GrokChatClient.cs Adds handling for WebSearchTool in the pipeline; global-qualifies OpenAI types.
src/AI.Tests/ToolsTests.cs Updates tests to qualify OpenAIClientOptions with global::OpenAI.
src/AI.Tests/RetrievalTests.cs Qualifies OpenAIClientOptions and FileUploadPurpose with global::OpenAI.
src/AI.Tests/OpenAITests.cs Adds a live-search test using WebSearchTool; imports updated OpenAI namespace.
src/AI.Tests/GrokTests.cs Qualifies OpenAIClientOptions import and ensures Grok namespace usage.
readme.md Documents WebSearchTool usage for both OpenAI and Grok clients with examples.
Comments suppressed due to low confidence (4)

src/AI/WebSearchTool.cs:7

  • [nitpick] The summary only mentions country filtering. Update it to reflect that this tool also supports region, city, timezone, and context size.
/// Basic web search tool that can limit the search to a specific country.

src/AI/OpenAI/WebSearchToolExtensions.cs:32

  • No tests cover the Region property; consider adding unit tests to verify that setting Region correctly updates both Properties and the underlying Location.
        public string? Region

src/AI/WebSearchTool.cs:12

  • The private field region is declared but never used. Consider removing it to reduce dead code.
    string? region;

src/AI.Tests/OpenAITests.cs:99

  • The test references WebSearchTool but only imports Devlooped.Extensions.AI.OpenAI. You need using Devlooped.Extensions.AI; (or fully qualify) so that WebSearchTool resolves correctly.
            Tools = [new WebSearchTool("AR")

@kzu kzu merged commit e1d5857 into main Jul 7, 2025
7 checks passed
@kzu kzu deleted the dev/WebSearch branch July 7, 2025 18:06
@kzu kzu added the enhancement New feature or request label Jul 7, 2025
@devlooped devlooped locked and limited conversation to collaborators Aug 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants