@coveo/headless-react
    Preparing search index...

    Interface GeneratedAnswerActionCreators

    The generated answer action creators.

    interface GeneratedAnswerActionCreators {
        generateAnswer(): void;
        resetAnswer(): { payload: void; type: string };
        setAnswerGenerationMode(mode: "automatic" | "manual"): void;
    }
    Index

    Methods

    • Generates a new answer using the Answer API.

      This action requires an answer configuration ID to be set in the engine configuration. When present, it will use the Answer API service for enhanced answer generation.

      Returns void

      A dispatchable action.

    • Resets the generated answer state to a clean slate.

      Returns { payload: void; type: string }

      A dispatchable action.

    • Sets the answer generation mode.

      This action updates the engine state to indicate whether answer generation should occur automatically or manually.

      Parameters

      • mode: "automatic" | "manual"

      Returns void