Forum Discussion
Jamie-Bech
Sep 12, 2024Copper Contributor
Setup Teams Toolkit RAG bot with Azure Ai Search indexes
Hello, new to the forum and im trying to learn how i could create a Teams RAG bot which would use Azure Ai Search indexers aswell as default OPENAI LLM. I have a Azure OpenAI created and working....
balasubramanim
Sep 20, 2024Iron Contributor
Jamie-Bech,
To achieve this, you can try the following.
Use the Azure AI Search SDK in your bot code to query the existing index and retrieve the PDF data. This way, you won't need to upload PDFs manually.
Configure the bot to use the existing index by specifying the index name and API key in your bot configuration.
Use the azure-ai-search package in your bot code to interact with the Azure AI Search service and retrieve the PDF data.
sample code to start
from azure.ai.search import SearchClient
from azure.ai.search.models import SearchResults
# Configure the search client
search_client = SearchClient("your_index_name", "your_api_key")
# Query the index
results = search_client.search("your_query")
# Process the search results
for result in results:
print(result.document["docTitle"])
print(result.document["description"])
This should help you use the existing Azure AI Search index with your Teams RAG bot
To achieve this, you can try the following.
Use the Azure AI Search SDK in your bot code to query the existing index and retrieve the PDF data. This way, you won't need to upload PDFs manually.
Configure the bot to use the existing index by specifying the index name and API key in your bot configuration.
Use the azure-ai-search package in your bot code to interact with the Azure AI Search service and retrieve the PDF data.
sample code to start
from azure.ai.search import SearchClient
from azure.ai.search.models import SearchResults
# Configure the search client
search_client = SearchClient("your_index_name", "your_api_key")
# Query the index
results = search_client.search("your_query")
# Process the search results
for result in results:
print(result.document["docTitle"])
print(result.document["description"])
This should help you use the existing Azure AI Search index with your Teams RAG bot
- Jamie-BechSep 25, 2024Copper Contributor
Hello balasubramanim!
Thank you for the guidance. Got it to work after some tweaks, and help from your guide. Thank you once again!