Skip to content

Feature request: Propose context-specific default example questions #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
costas80 opened this issue Mar 27, 2025 · 0 comments
Open

Comments

@costas80
Copy link
Contributor

Following from Gurubase issues 190 (support for contexts/tags) and 226 (management of default example questions), this feature would extend the Gurubase widget to load and display default example questions as proposals when the chat panel is in an "empty state". This would occur upon initial panel opening or once the user chooses to start a new thread.

In terms of the examples presented, these would be the ones specific to the current context, or the default ones if no context is defined. Presenting such examples would be beneficial in suggesting frequently asked questions or the key entry points that the admin would want to highlight, with an added value increasing significantly if the Guru defines contexts, configured with specific default questions.

In terms of implementation I see two approaches described below.

Option 1: Lazy fetching

  • No change in the widget's initialisation.
  • When the widget is opened and is in an empty state (upon first opening or clearing the chat panel), the widget will make an API call to retrieve the default questions to present (leveraging also the current context, if one is defined).
  • While the questions are being fetched the widget displays "skeleton screen" placeholders as discussed in Busy indicator when loading additional data following answers #49.
  • Once a set of default example questions are loaded for a given context (or the overall default), these are cached to avoid repeat requests and pending displays before simply displaying the same examples. The browser's session storage is a good option for the caching.

👍 Calls made to the Gurubase API only when (and if) needed. Consider that most documentation visitors would not interact with the widget at all.
👎 Examples will be pending whenever the user accesses the chat and the default examples have not been loaded.

Option 2: Eager fetching

  • Eagerly prefetch the default example questions before the user toggles the widget's chat panel.
  • Prefetching takes place at the widget's initialisation to fetch the current context's example questions (or the default ones if no context is defined).
  • In terms of loading the questions when the context changes we have two options:
    • Load everything at initialisation time as part of the initial API call to Gurubase.
    • Load when a context switch has been detected.
  • Once examples are loaded (in full or progressively) we cache them using the session storage.
  • If the user toggles the chat panel before the prefetching completes, we display "skeleton screen" placeholders as discussed in Busy indicator when loading additional data following answers #49.

👍 Background calls resulting in no/less waiting time when the chat panel displays or resets.
👎 Increased API calls (both in quantity and payload size depending on the approach), when the user may never in fact engage with the Guru.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant