You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/tutorial-rag-build-solution-query.md
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,30 @@ Results from the first query`"how much of earth is covered by water"` should loo
123
123
124
124
:::image type="content" source="media/tutorial-rag-solution/chat-results-1.png" alt-text="Screenshot of an LLM response to a simple question using a single match from search results.":::
125
125
126
-
### Changing the inputs
126
+
It's common for LLMs to return different answers, even if the prompt and queries are unchanged. Your result might look very different from the example.
127
+
128
+
> [!NOTE]
129
+
> In testing this tutorial, we saw a variety of responses, some more relevant than others. A few times, repeating the same request caused a deterioration in the response, most likely due to confusion in the chat history, possibly with the model registering the repeated requests as dissatisfaction with the generated answer. Managing chat history is out of scope for this tutorial, but including it in your application code should mitigate or even eliminate this behavior.
130
+
131
+
## Add a filter
132
+
133
+
Recall that you created a `locations` field using applied AI, populated with places recognized by the Entity Recognition skill. The field definition for locations includes the `filterable` attribute. Let's repeat the previous request, but this time adding a filter that selects on the term *ice* in the locations field.
134
+
135
+
Replace the search_results definition with the following example that includes a filter:
Results from the filtered query should now look similar to the following response.
146
+
147
+
:::image type="content"source="media/tutorial-rag-solution/chat-results-filter.png" alt-text="Screenshot of an LLM response after a filter is added.":::
148
+
149
+
## Change the inputs
127
150
128
151
Increasing or decreasing the number of inputs to the LLM can have a large effect on the response. Try running the same query again after setting `top=3`. When you increase the inputs, the model returns different results each time, even if the query doesn't change.
129
152
@@ -133,7 +156,7 @@ Here's one example of what the model returns after increasing the inputs to 3.
133
156
134
157
Because the model is bound to just the grounding data, the answer becomes more expansive as you increase size of the input. You can use relevance tuning to potentially generate more focused answers.
135
158
136
-
### Changing the prompt
159
+
## Change the prompt
137
160
138
161
You can also change the prompt to control the format of the output, tone, and whether you want the model to supplement the answer with its own training data by changing the prompt.
0 commit comments