Repository navigation
Conversation
Adds a new @effect/ai-perplexity package providing Effect bindings for
the Perplexity Search API. Exposes a PerplexitySearch service with a
typed search method (returns {title, url, snippet, date?}) plus support
for max_results, search_domain_filter (allow- or deny-list, validated to
not mix), search_recency_filter, and date-range filters.
Reads the API key from PERPLEXITY_API_KEY (with PPLX_API_KEY as a
fallback) via Config.redacted.
Includes unit tests (10 cases) covering body shape, filter forwarding,
mixed-domain rejection, success decoding, HTTP errors, and malformed
response handling.
🦋 Changeset detectedLatest commit: 078c05b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Friendly bump — changeset is present, typecheck/lint/build are clean. Happy to address any feedback on the |
|
Hi @jliounis - apologies but Effect v3 is on a feature freeze now that Effect v4 is in beta. If you'd like to see this functionality added, please open up a PR against the (v4 repo)[https://github.com/Effect-TS/effect-smol]. |
|
Closing per maintainer guidance above: Effect v3 is feature-frozen, and new integrations should target the v4 repo instead. Thanks for the contribution. |
Summary
Adds a new
@effect/ai-perplexitypackage providing Effect bindings for the Perplexity Search API.What's added
PerplexityClient— HTTP client wrapper that handles authentication and error mapping (platformHttpClienterrors →@effect/aiAiError).PerplexitySearch— service with asearch(options)method that returns a typedSearchResponse(results: { title, url, snippet, date? }[]).max_results,max_tokens_per_page,search_domain_filter,search_recency_filter,search_after_date_filter,search_before_date_filter.search_domain_filterdoes not mix allow- and deny-list entries (the API does not accept that), failing fast withAiError.MalformedInputif it does.PERPLEXITY_API_KEY, falling back toPPLX_API_KEY, viaConfig.redacted. A custom URL can be supplied viaPERPLEXITY_API_URLor programmatically.PerplexityConfigtag andwithClientTransformhelper, mirroring the pattern used by@effect/ai-anthropic.Tests
10 unit tests in
packages/ai/perplexity/test/PerplexitySearch.test.ts, all using a mockedHttpClient(HttpClient.make) so no network calls are made:SearchResponseAiError.HttpResponseErrorAiError.MalformedOutputRun with:
All three pass locally.
Docs
packages/ai/perplexity/README.mddocuments installation, authentication, basic usage, available options, and the domain-filter caveat.@effect/ai-perplexityminor) describing the addition.References