want to do q&A with azure open ai search with index and indexer on JSON data alone only.

Polisetty, Balaji 0 Reputation points
2023-12-19T03:19:53.4533333+00:00

I want to do azure open ai search on json data alone. i have huge data on json data only.

i created index and indexer.

what is best way to ask question on json data with GPT 4 model.

 "json": {
        "cellbattery_Level": "100",
        "cellBattery_Cap": "3221",
      
}

if i ask question whats is the battery level i am not getting answer if i ask for cellbattery_Level i am able to get answer.

what should i do to get answers if i ask for cellbattery_Level .

one more question -

is there any possiblity to have prediction questions based on the previous answer.

Like if the question is how is my code looking ? prompts like its good / i have review comments /its not good/ its bad. do we have any option to do like that ?

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,353 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,098 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2023-12-19T17:22:39.5566667+00:00

    @Polisetty, Balaji Thanks for reaching here! To enable natural language queries on JSON data using Azure AI Search with a GPT-4 model, you would typically need to configure the search service to understand and process natural language questions.

    You can index JSON blobs similar to the sample and leverage the indexer to ingest these JSON blobs into a search index. Alternatively, you can use the Push API to upsert your json into a search index. Here are some high level steps-

    • Index Configuration:
    • Ensure that the fields in your index are set up with the correct attributes (searchable, filterable, sortable, etc.) depending on how you want to query them
    • Indexer Configuration (if using 'pull' approach):
    • When setting up the indexer, map your source data fields to the appropriate index fields.
      • You can use field mappings to transform property names in the source data to more user-friendly field names in the index that could be better suited for natural language queries.
      • Also encourage you to take advantage of creating vector representations of your data so you can benefit from vector and/or hybrid search.
      • You can take advantage of the "Import and Vectorize" feature in the Portal and Azure AI Search will handle this process for you.
      • Integrate with Azure OpenAI service:
      • In order to ground your data to a model like GPT-4, they are multiple methods of doing this. You can use tools like LangChain, Llamaindex, and Semantic Kernel to have an orchestration to demonstrate the RAG process using your Azure AI search index and Azure OpenAI service with GPT-4 - IMHO, this is more of a code-first approach. Example repo: azure-search-vector-samples/demo-python/code/azure-search-vector-python-llamaindex-sample.ipynb at main · Azure/azure-search-vector-samples (github.com)
      • Alternatively, you can use Azure AI On Your Data and add your search index and begin chatting with it in natural language (Using your data with Azure OpenAI Service - Azure OpenAI | Microsoft Learn) - IMHO, this is more of a no-code approach
      • Try testing your desired queries to see if you are getting the desired results back. If not, you may need to iterate on some advanced RAG strategies such as leveraging an LLM to write a query to Azure AI search that can ask for the cell battery given an ID.  Re: Predictive Questions
    • For predictive queries like "how is my code looking?" you would need a model that understands the context of code quality, which might be beyond the scope of a typical search index.
    • You could potentially use the OpenAI Codex model, which is designed to understand and generate code, and integrate it similarly to how you might use GPT-4.

    Hope this helps.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.