Ground chat completions on Azure AI Search without Data source

This example pipeline demonstrates the workaround described in the Azure AI Foundry Chat Completions Snap's Known Issues for grounding a response on an Azure AI Search index now that Data source configurations no longer work.

Download this pipeline.

Before you run this pipeline

Selecting your own accounts is not enough to run this pipeline — it also requires the following pipeline parameters and Snap field values, and two expressions that assume the sample hotels-sample-index schema.

Pipeline parameter Description
question The question to answer. Defaults to Which hotel has a bowling alley?
searchService Required. The Azure AI Search service name — the part before .search.windows.net.
indexName Required. The Azure AI Search index name.

On the Azure AI Foundry Chat Completions Snap, set Deployment ID to your own chat deployment. This is a Snap field, not a pipeline parameter.

Two expressions reference the sample index's HotelName and Description fields. Replace them with your own index's field names:

  • On the HTTP Client Snap, the Raw entity field's select value, "HotelName, Description", lists the index fields to return.
  • On the Mapper Snap, the expression $entity.value.map(d => d.HotelName + ": " + d.Description).join("\n\n") builds one paragraph per passage from those same fields.
  1. An upstream Snap produces one document per question, with the question available as the question pipeline parameter.
  2. An HTTP Client Snap calls the Azure AI Search REST API directly and returns the top matching documents.
    Select a Secured Headers Account that holds the Azure AI Search query key in an api-key header, rather than storing the key in a pipeline parameter or plain header.
  3. A Mapper Snap joins the returned documents into a single text block.
  4. The Azure AI Foundry Chat Completions Snap answers the question using only that text block.
    The Prompt includes the question and the joined passages, and the System prompt instructs the model to answer using only the provided sources and to say it doesn't know when the sources don't contain the answer. Data source configurations is left empty.
To reuse the example pipelines:
  1. Download and import the SLP file into your Environment.
  2. Configure Snap accounts.
  3. Provide Pipeline parameters, if any.