8000 fix build/import errors for botbuilder-ai, add setup script, folder s… · sathishktk/botbuilder-python@de81cb4 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit de81cb4

Browse files
committed
fix build/import errors for botbuilder-ai, add setup script, folder structure
1 parent 604a6ff commit de81cb4

File tree

8 files changed

+47
-3
lines changed

8 files changed

+47
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__import__('pkg_resources').declare_namespace(__name__)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# coding=utf-8
2+
#------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#------------------------------------------------------------------------
7+
8+
from .language_map import LanguageMap
9+
from .qna_maker import QnAMaker, QnAMakerOptions, MetaData, QueryResult, QueryResults
10+
11+
__all__ = ['LanguageMap',
12+
'QnAMaker',
13+
'QnAMakerOptions',
14+
'MetaData',
15+
'QueryResult',
16+
'QueryResults']

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ class QnAMaker:
1010

1111
def __init__(self, options, http_client):
1212

13-
self.__http_client = _http_client or raise TypeError('HTTP Client failed')
14-
self.__options = options or raise TypeError('Options config error')
13+
self.__http_client = _http_client or False
14+
if not self.__http_client:
15+
raise TypeError('HTTP Client failed')
16+
self.__options = options or False
17+
if not self.__options:
18+
raise TypeError('Options config error')
1519

1620
self.__answerUrl = "%s%s/generateanswer" % (__qnaMakerServiceEndpoint,options.knowledge_base_id)
1721

@@ -29,7 +33,7 @@ def __init__(self, options, http_client):
2933

3034
async def get_answers(question): # HTTP call
3135
headers = {
32-
__api_management_header : self.__options.subscription_key
36+
__api_management_header : self.__options.subscription_key,
3337
"Content-Type" : __json_mime_type
3438
}
3539

libraries/botbuilder-ai/requirements.txt

Whitespace-only changes.

libraries/botbuilder-ai/setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
universal=0

libraries/botbuilder-ai/setup.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from setuptools import setup, find_packages
2+
3+
setup(
4+
name='microsoft-botbuilder-ai',
5+
version='4.0.0-a0',
6+
url='https://www.github.com/Microsoft/botbuilder-python',
7+
long_description='Cognitive services extensions for Microsoft BotBuilder.',
8+
license='MIT',
9+
author='Microsoft',
10+
author_email='bf-reports@microsoft.com',
11+
description='',
12+
packages=find_packages(),
13+
classifiers=[
14+
'Programming Language :: Python',
15+
'Intended Audience :: Bot Developers',
16+
'License :: OSI Approved :: MIT License',
17+
'Operating System :: OS Independent',
18+
'Programming Language :: Python :: 3'
19+
]
20+
)

0 commit comments

Comments
 (0)
0