Skip to content

Conversation

@sgaunet
Copy link
Owner

@sgaunet sgaunet commented Oct 30, 2025

docs(search): add comprehensive Search API documentation

Update README and add example documentation covering Search API features,
usage patterns, and comparison with chat completions.

Changes:

  • Add Search API section to main README with features and pricing
  • Include basic, advanced, and multi-query search examples
  • Add comparison table: Search API vs Chat Completions
  • Create detailed search-example README with build/run instructions
  • Document all search options and validation patterns
  • Add context support examples

Implement direct access to Perplexity's real-time web index via Search API,
providing raw ranked search results without the generative LLM layer.

Core features:
- SearchRequest with functional options pattern (WithSearchMaxResults, etc.)
- Support for single and multi-query searches
- SearchResponse with result items, images, snippets, scores
- SearchRequestValidator with comprehensive validation
- Complete test coverage for request, response, and validation
- Working example demonstrating simple, advanced, and multi-query searches

API endpoint: https://api.perplexity.ai/search
Pricing: $5 per 1K requests (separate from chat completions)
- Align struct field indentation across multiple files
- Fix whitespace alignment in switch case comments
- Add missing newlines at end of files
- Improve code readability with consistent formatting

No functional changes.
Add extensive test coverage including benchmarks, compliance tests,
integration tests, and edge case validation.

Test additions:
- Benchmark tests for request marshaling performance
- API compliance tests verifying specification adherence
- Integration tests for real API interactions (require PPLX_API_KEY)
- Extended validator tests for edge cases (unicode, special chars, long strings)

Total: 1,434 lines of new test coverage
Update README and add example documentation covering Search API features,
usage patterns, and comparison with chat completions.

Changes:
- Add Search API section to main README with features and pricing
- Include basic, advanced, and multi-query search examples
- Add comparison table: Search API vs Chat Completions
- Create detailed search-example README with build/run instructions
- Document all search options and validation patterns
- Add context support examples
@sgaunet sgaunet self-assigned this Oct 30, 2025
@sgaunet sgaunet linked an issue Oct 30, 2025 that may be closed by this pull request
@sgaunet sgaunet added the feature New feature label Oct 30, 2025
@sgaunet sgaunet merged commit b35d971 into v2 Oct 30, 2025
3 checks passed
@sgaunet sgaunet deleted the 111-add-support-for-perplexity-search-api branch October 30, 2025 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Perplexity Search API

2 participants