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
1. Invoke the chat and call the search function, passing in a query string to search for.
283
-
284
-
```python
285
-
import azure.identity.aio
286
-
287
-
chat_thread = ChatThread()
288
-
chat_deployment = AZURE_DEPLOYMENT_MODEL
289
-
290
-
asyncwith azure.identity.aio.DefaultAzureCredential() as credential, create_search_client(credential) as search_client, create_openai_client(credential) as openai_client:
291
-
await chat_thread.append_grounded_message(
292
-
search_client=search_client,
293
-
query="Can you recommend a few hotels near the ocean with beach access and good views",
Output isfrom Azure OpenAI, and it consists of recommendations for several hotels. Here's an example of what the output might look like:
@@ -312,10 +258,12 @@ This section uses Visual Studio Code and Python to call the chat completion APIs
312
258
313
259
If you get an authorization error message, wait a few minutes andtry again. It can take several minutes for role assignments to become operational.
314
260
315
-
To experiment further, change the query and rerun the last step to better understand how the model works withyour data.
261
+
To experiment further, change the query and rerun the last step to better understand how the model works withthe grounding data.
316
262
317
263
You can also modify the prompt to change the tone or structure of the output.
318
264
265
+
You might also try the query without semantic ranking by setting `use_semantic_reranker=False`in the query parameters step. Semantic ranking can noticably improve the relevance of query results and the ability of the LLM to return useful information. Experimentation can help you decide whether it makes a difference for your content.
266
+
319
267
## Clean up
320
268
321
269
When you're working in your own subscription, it's a good idea at the end of a project to identify whether you still need the resources you created. Resources left running can cost you money. You can delete resources individually or delete the resource group to delete the entire set of resources.
0 commit comments