Skip to content

Commit 5adf6f6

Browse files
authored
feat: core tests for web search, schemas (#1339)
## Summary Enhances web search tool functionality with comprehensive test coverage for various features including streaming, domain filtering, context sizes, multi-turn conversations, and max uses parameter. ## Changes - Added five new comprehensive tests for web search tool capabilities: - Streaming web search responses - Domain filtering for search results - Different search context sizes (low/medium/high) - Multi-turn conversations with web search - Max uses parameter (Anthropic-specific) - Fixed Anthropic provider to properly handle web search streaming events - Added helper functions to validate web search sources and domain patterns - Updated OpenAI test configuration to use gpt-4o instead of gpt-4o-mini - Added JSON marshal/unmarshal tests for ResponsesToolMessageActionStruct and ResponsesTool ## Type of change - [x] Feature - [x] Refactor ## Affected areas - [x] Core (Go) - [x] Providers/Integrations ## How to test Run the comprehensive tests for web search tool functionality: ```sh # Run all web search tool tests go test ./core/internal/testutil -run TestRunWebSearchTool # Run specific web search tool tests go test ./core/internal/testutil -run TestRunWebSearchToolStreamTest go test ./core/internal/testutil -run TestRunWebSearchToolWithDomainsTest go test ./core/internal/testutil -run TestRunWebSearchToolContextSizesTest go test ./core/internal/testutil -run TestRunWebSearchToolMultiTurnTest go test ./core/internal/testutil -run TestRunWebSearchToolMaxUsesTest ``` ## Breaking changes - [x] No ## Related issues Improves test coverage for web search tool functionality. ## Security considerations No security implications. Tests use standard web search functionality with public information. ## Checklist - [x] I added/updated tests where appropriate - [x] I verified builds succeed (Go) - [x] I verified the CI pipeline passes locally
2 parents 26af9bd + baa0c82 commit 5adf6f6

File tree

7 files changed

+1825
-39
lines changed

7 files changed

+1825
-39
lines changed

core/internal/testutil/tests.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ func RunAllComprehensiveTests(t *testing.T, client *bifrost.Bifrost, ctx context
3434
RunEnd2EndToolCallingTest,
3535
RunAutomaticFunctionCallingTest,
3636
RunWebSearchToolTest,
37+
RunWebSearchToolStreamTest,
38+
RunWebSearchToolWithDomainsTest,
39+
RunWebSearchToolContextSizesTest,
40+
RunWebSearchToolMultiTurnTest,
41+
RunWebSearchToolMaxUsesTest,
3742
RunImageURLTest,
3843
RunImageBase64Test,
3944
RunMultipleImagesTest,

0 commit comments

Comments
 (0)