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
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,7 @@ It will look like the following:
75
75
1. Run `azd env set AZURE_OPENAI_RESOURCE_GROUP {Name of existing resource group that OpenAI service is provisioned to}`
76
76
1. Run `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT {Name of existing ChatGPT deployment}`. Only needed if your ChatGPT deployment is not the default 'chat'.
77
77
1. Run `azd env set AZURE_OPENAI_GPT_DEPLOYMENT {Name of existing GPT deployment}`. Only needed if your ChatGPT deployment is not the default 'davinci'.
78
+
1. Run `azd env set AZURE_OPENAI_EMB_DEPLOYMENT {Name of existing GPT embedding deployment}`. Only needed if your embeddings deployment is not the default 'embedding'.
78
79
1. Run `azd up`
79
80
80
81
> NOTE: You can also use existing Search and Storage Accounts. See `./infra/main.parameters.json` for list of environment variables to pass to `azd env set` to configure those existing resources.
# just use 'az login' locally, and managed identity when deployed on Azure). If you need to use keys, use separate AzureKeyCredential instances with the
32
33
# keys for each service
33
34
# If you encounter a blocking error during a DefaultAzureCredntial resolution, you can exclude the problematic credential by using a parameter (ex. exclude_shared_token_cache_credential=True)
Copy file name to clipboardExpand all lines: app/backend/approaches/chatreadretrieveread.py
+45-24Lines changed: 45 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -23,24 +23,23 @@ class ChatReadRetrieveReadApproach(Approach):
23
23
"""
24
24
system_message_chat_conversation="""Assistant helps the company employees with their healthcare plan questions, and questions about the employee handbook. Be brief in your answers.
25
25
Answer ONLY with the facts listed in the list of sources below. If there isn't enough information below, say you don't know. Do not generate answers that don't use the sources below. If asking a clarifying question to the user would help, ask the question.
26
-
For tabular information return it as an html table. Do not return markdown format.
26
+
For tabular information return it as an html table. Do not return markdown format. If the question is not in English, answer in the language used in the question.
27
27
Each source has a name followed by colon and the actual information, always include the source name for each fact you use in the response. Use square brackets to reference the source, e.g. [info1.txt]. Don't combine sources, list each source separately, e.g. [info1.txt][info2.pdf].
28
28
{follow_up_questions_prompt}
29
29
{injected_prompt}
30
30
"""
31
31
follow_up_questions_prompt_content="""Generate three very brief follow-up questions that the user would likely ask next about their healthcare plan and employee handbook.
32
-
Use double angle brackets to reference the questions, e.g. <<Are there exclusions for prescriptions?>>.
33
-
Try not to repeat questions that have already been asked.
34
-
Only generate questions and do not generate any text before or after the questions, such as 'Next Questions'"""
32
+
Use double angle brackets to reference the questions, e.g. <<Are there exclusions for prescriptions?>>.
33
+
Try not to repeat questions that have already been asked.
34
+
Only generate questions and do not generate any text before or after the questions, such as 'Next Questions'"""
35
35
36
36
query_prompt_template="""Below is a history of the conversation so far, and a new question asked by the user that needs to be answered by searching in a knowledge base about employee healthcare plans and the employee handbook.
37
-
Generate a search query based on the conversation and the new question.
38
-
Do not include cited source filenames and document names e.g info.txt or doc.pdf in the search query terms.
39
-
Do not include any text inside [] or <<>> in the search query terms.
40
-
Do not include any special characters like '+'.
41
-
If the question is not in English, translate the question to English before generating the search query.
42
-
43
-
Search Query:
37
+
Generate a search query based on the conversation and the new question.
38
+
Do not include cited source filenames and document names e.g info.txt or doc.pdf in the search query terms.
39
+
Do not include any text inside [] or <<>> in the search query terms.
40
+
Do not include any special characters like '+'.
41
+
If the question is not in English, translate the question to English before generating the search query.
42
+
If you cannot generate a search query, return just the number 0.
44
43
"""
45
44
query_prompt_few_shots= [
46
45
{'role' : USER, 'content' : 'What are my health plans?' },
@@ -49,16 +48,19 @@ class ChatReadRetrieveReadApproach(Approach):
49
48
{'role' : ASSISTANT, 'content' : 'Health plan cardio coverage' }
0 commit comments