feat(structured-output): generic structured-outputs connector + onPageSuggestions widget (PoC)#7065
Draft
FabienMotte wants to merge 2 commits into
Draft
feat(structured-output): generic structured-outputs connector + onPageSuggestions widget (PoC)#7065FabienMotte wants to merge 2 commits into
FabienMotte wants to merge 2 commits into
Conversation
…uggestions widget PoC
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 1 critical |
🟢 Metrics 72 complexity
Metric Results Complexity 72
TIP This summary will be updated as you push new changes.
More templates
algoliasearch-helper
instantsearch-ui-components
instantsearch.css
instantsearch.js
react-instantsearch
react-instantsearch-core
react-instantsearch-nextjs
react-instantsearch-router-nextjs
vue-instantsearch
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Frontend PoC for the generic
structured-outputsendpoint (structured JSON in → structured JSON out, optional streaming). Adds one generic connector and a first thin widget on top of it, plus a PDP demo in the showcase.connectStructuredOutput— generic transport +submit(variables). Builds the endpoint from the search client (/agent-studio/1/agents/{agentId}/structured-outputs) or a customtransport. Non-stream reads{ output }; stream parses NDJSON object snapshots (reusingai-lite'sparseJsonEventStream/processStream) and replacesoutputprogressively. Cancels in-flight requests viaAbortController. Exposes{ output, isLoading, error, submit }.onPageSuggestions— thin widget parameterized bycontextType(pdp/plp/custom); maps context → taskvariables, auto-submits on mount, renders the suggestions list (capped atmaxSuggestions) with overridable templates and a Refresh button.WidgetOnPageSuggestionsin the Agentic view: a PDP-style demo that pulls records from the index, lets you select one, and streams its on-page suggestions underneath. Uses a Vite dev proxy (/agent-backend) to reach the local backend.Notes
transport(swap foragentIdonce it ships to the Algolia API).instantsearch.jsonly (no React/Vue bindings); no UI-components package, debounce, or common-test-suite parity tests — deferred PoC scope.variablesshape ({ contextType, product }) must align with the agent'son_page_suggestionssystem prompt.Test plan
connectStructuredOutputunit tests pass (non-stream, streaming snapshots, custom transport, errors, usage guards)widgets/__tests__/index.test.ts)instantsearch.jstypecheck clean for the new files:8000)