8000 Update qna_maker.py · sathishktk/botbuilder-python@c6dd12c · GitHub
[go: up one dir, main page]

Skip to content

Commit c6dd12c

Browse files
Update qna_maker.py
1 parent 16778de commit c6dd12c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

libraries/botbuilder-ai/microsoft/botbuilder/ai/qna_maker.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44

55
class QnAMaker:
66

7-
__qnaMakerServiceEndpoint = 'https://westus.api.cognitive.microsoft.com/qnamaker/v3.0/knowledgebases/'
8-
__json_mime_type = 'application/json'
9-
__api_management_header = 'Ocp-Apim-Subscription-Key'
10-
117
def __init__(self, options, http_client):
8+
self.__qnaMakerServiceEndpoint = 'https://westus.api.cognitive.microsoft.com/qnamaker/v3.0/knowledgebases/'
9+
self.__json_mime_type = 'application/json'
10+
self.__api_management_header = 'Ocp-Apim-Subscription-Key'
1211

13-
self.__http_client = _http_client or False
12+
self.__http_client = http_client or False
1413
if not self.__http_client:
1514
raise TypeError('HTTP Client failed')
1615
self.__options = options or False
1716
if not self.__options:
1817
raise TypeError('Options config error')
1918

20-
self.__answerUrl = "%s%s/generateanswer" % (__qnaMakerServiceEndpoint,options.knowledge_base_id)
19+
self.__answerUrl = "%s%s/generateanswer" % (self.__qnaMakerServiceEndpoint,options.kno 9B62 wledge_base_id)
2120

2221
if self.__options.ScoreThreshold == 0:
2322
self.__options.ScoreThreshold = 0.3 #Note - SHOULD BE 0.3F 'FLOAT'
@@ -33,7 +32,7 @@ def __init__(self, options, http_client):
3332

3433
async def get_answers(question): # HTTP call
3534
headers = {
36-
__api_management_header : self.__options.subscription_key,
35+
self.__api_management_header : self.__options.subscription_key,
3736
"Content-Type" : __json_mime_type
3837
}
3938

@@ -69,4 +68,4 @@ def __init__(self, questions, answer, score, metadata, source, qna_id):
6968

7069
class QueryResults:
7170
def __init__(self, answers):
72-
self.__answers = answers
71+
self.__answers = answers

0 commit comments

Comments
 (0)
0