Chat Completion RAG
Last updated
Last updated
For this setup, you have to take care of following things
Method Inputs
Method Name
AzureChatRAGMethod
Request Type
azure-chatcompletion-rag
Parameters: model
A suitable GPT model as per your use case, e.g. gpt-3.5-turbo-16k
Parameters: systemMessage
This defines the guardrail for the app. In the example below, it's taking from a internal content JSON file and managed parameters.{{Session.StoreDescription}} ,{{App.AIContent.SystemMessage}}
Parameters :userQuestion
The input query from the user. It could also be plain text or it could be derived from input parameters.e.g. 'what services does ACME provide?' or {{UserInput}}
Parameters: streaming
False
Parameters: sessionTime
10 ( Time inminutes which will be used to maintain conversation history)
Parameters: OrganizationID
{{Context.OrganizationID}}
Parameters: EmployeeID
{{Context.EmployeeID}}
You can get the result of the query as a single record or you can get a list of records. You can also define the number of items in the list using Record Limit Parameter.
The method result section is used to define how you want to display the result of the query response.
Method Result
Record JsonPath
$.choices[0].message
Valid Result Template
{{Records}} How else can I help you?
Record Template
{{content}}
Empty Result Template
How else can I help you?
Automatically prompt for next question
False
a. Record JsonPath: The result of each method is returned in JSON and ixHello uses JSONPath query to access those results. By providing the value $.choices[0].message, you are asking the method to read the message of first item in the list of results. The response JSON looks somewhat like this.
b. Valid Result Template: It defines how the result is presented to the user.
By using {{Records}} , you are accessing all the results of the method query.
c. Record Template : This represents a single record and how a record shall be presented to the user. {{content}}
d. Empty Result Template : In case the query does not return any value, this prompt is next displayed to the user.
e. Automatically prompt for next question: This flag is intended for integrations to smart bots like Alexa and Lex, where the user defines if the bot shall prompt the user for next question after the previous query has been answered for the app. For Generative AI apps, this flag is set to false.
Note: Everything parameter that has{{ }} means that the platform is interpreting the value from its parameters, input parameters or managed results.