Commit 5adf6f6
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 locallyFile tree
7 files changed
+1825
-39
lines changed- core
- internal/testutil
- providers
- anthropic
- openai
- schemas
- tests/integrations/python/tests
7 files changed
+1825
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
0 commit comments