agent

Interface to agent SSE. Replaces the previous Assistant module.
Description:
  • Interface to agent SSE. Replaces the previous Assistant module.
Source:
Returns:
Type
object

Methods

(inner) getAgentResultsStream(intent, parameters) → {ReadableStream}

Description:
  • Retrieve a stream of agent results from Constructor.io API
Source:
Example
const readableStream = constructorio.agent.getAgentResultsStream('I want to get shoes', {
    domain: "nike_sportswear",
});
const reader = readableStream.getReader();
const { value, done } = await reader.read();
Parameters:
Name Type Description
intent string Intent to use to perform an intent based recommendations
parameters object Additional parameters to refine result set
Properties
Name Type Attributes Description
domain string Domain name (e.g. "groceries", "recipes")
threadId string <optional>
Conversation thread ID for multi-turn dialogue
guard boolean <optional>
Enable content moderation
numResultsPerEvent number <optional>
Max products per search_result event
numResultEvents number <optional>
Max number of search_result events
numResultsPerPage number <optional>
Deprecated: use numResultsPerEvent instead
preFilterExpression object <optional>
Faceting expression to scope search results. Please refer to https://docs.constructor.com/reference/configuration-collections
fmtOptions object <optional>
The format options used to refine result groups. Please refer to https://docs.constructor.com/reference/v1-asa-retrieve-intent#query-params for details
Properties
Name Type Attributes Description
fields Array.<string> <optional>
Product fields to return
hidden_fields Array.<string> <optional>
Hidden fields to return
qsParam object <optional>
Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.com/reference/v1-asa-retrieve-intent#query-params
Returns:
Returns a ReadableStream.
Type
ReadableStream