Tokens not replaced in API response

Created on 6 May 2025, 10 days ago

Problem/Motivation

When using the REST resource for performing a search, a configuration array is returned that contains the various messages that can be configured for each custom search page. These include:

  • results message
  • results message - singular
  • no results message
  • no keywords specified message

The problem is that if there are tokens being used in these messages, they are not replaced before creating the response. So all the messages that are returned show the token placeholder, not the token value.

response {8}
  totalResults	1
  pageResultCount	1
  correctedQuery	
  queryCorrected	false
  results [1]
  curated	[]
  configuration {13}
    label	Vertex AI Search
    autocomplete_enable	0
    autocomplete_trigger_length	4
    autocomplete_max_suggestions	10
    resultsPerPage	10
    totalResultsLimit	100
    result_parts	SNIPPETS
    removeDomain	1
    results_message	Results for "[vertex_ai_search:vertex_ai_search_keywords]".  // TOKENS NOT REPLACED
    results_message_singular	Result for "[vertex_ai_search:vertex_ai_search_keywords]".  // TOKENS NOT REPLACED
    no_results_message	We couldn’t find any results for [vertex_ai_search:vertex_ai_search_keywords]. // TOKENS NOT REPLACED
    no_keywords_message	Please specify keywords on which to search. // TOKENS NOT REPLACED
  tokens {4}
  errorMessage	null

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tzura

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024