Store results of Natural language query, the successful GraphQL query, and the results from the Graph in a Google Cloud Postgres Database if the query that GPT generated returned a result from the Graph's API
Columns: User_input, graphql_query, datetime the query was sent to openAI, and the returned_data
Insert logic to check before sending the data to:
OpenAI: Has this lowercased natural language query been sent before? If so, use cached results from the database and display the returned_data for that natural language query. Ideally we can use a semantic model to check if the intent behind the query is the same even if it was worded differently.
The Graph: Did this query even if different return the same GraphQL query that another query did? If so, do not call out to the Graph's API and instead display the returned_data
The goal:
To reduce the number of times we send queries to the Graph or OpenAI API's.
Requirements:
Store results of Natural language query, the successful GraphQL query, and the results from the Graph in a Google Cloud Postgres Database if the query that GPT generated returned a result from the Graph's API Columns: User_input, graphql_query, datetime the query was sent to openAI, and the returned_data
Insert logic to check before sending the data to:
The goal: To reduce the number of times we send queries to the Graph or OpenAI API's.