{"id":23050,"library":"azure-cognitiveservices-knowledge-qnamaker","title":"Azure QnA Maker Client Library for Python","description":"Microsoft Azure QnA Maker Client Library for Python enables programmatic management of QnA Maker knowledge bases and endpoints. Current version 0.3.1 is stable but in maintenance mode; Azure recommends migrating to the newer question answering service via azure-ai-language-questionanswering. Release cadence is low.","status":"maintenance","version":"0.3.1","language":"python","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","cognitiveservices","qnamaker","knowledge-base","question-answering"],"install":[{"cmd":"pip install azure-cognitiveservices-knowledge-qnamaker","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required for REST client operations","package":"msrest","optional":false},{"reason":"Common Azure SDK utilities","package":"azure-common","optional":false}],"imports":[{"note":"Wrong path: QnAMakerClient is directly under the package, not a submodule.","wrong":"from azure.cognitiveservices.knowledge.qnamaker.qn_amaker_client import QnAMakerClient","symbol":"QnAMakerClient","correct":"from azure.cognitiveservices.knowledge.qnamaker import QnAMakerClient"},{"note":"Runtime client is in a separate 'runtime' subpackage.","wrong":"from azure.cognitiveservices.knowledge.qnamaker import QnAMakerRuntimeClient","symbol":"QnAMakerRuntimeClient","correct":"from azure.cognitiveservices.knowledge.qnamaker.runtime import QnAMakerRuntimeClient"},{"note":"","wrong":null,"symbol":"models","correct":"from azure.cognitiveservices.knowledge.qnamaker import models"}],"quickstart":{"code":"import os\nfrom azure.cognitiveservices.knowledge.qnamaker import QnAMakerClient\nfrom azure.cognitiveservices.knowledge.qnamaker.models import QnADTO\nfrom msrest.authentication import CognitiveServicesCredentials\n\nsubscription_key = os.environ.get('QNAMAKER_SUBSCRIPTION_KEY', '')\nendpoint = os.environ.get('QNAMAKER_ENDPOINT', 'https://<your-resource-name>.cognitiveservices.azure.com')\n\ncredentials = CognitiveServicesCredentials(subscription_key)\nclient = QnAMakerClient(endpoint, credentials)\n\n# List all knowledge bases\nkbs = client.knowledgebase.list()\nfor kb in kbs.knowledgebases:\n    print(kb.name, kb.id)","lang":"python","description":"Authenticate and list QnA Maker knowledge bases."},"warnings":[{"fix":"Migrate to azure-ai-language-questionanswering (pip install azure-ai-language-questionanswering)","message":"QnA Maker service is being retired. Azure recommends using the newer question answering service via the 'azure-ai-language-questionanswering' package.","severity":"deprecated","affected_versions":"all"},{"fix":"Use 'from azure.cognitiveservices.knowledge.qnamaker.runtime import QnAMakerRuntimeClient' for runtime operations.","message":"The runtime client (QnAMakerRuntimeClient) is imported from a different subpackage ('runtime') than the management client.","severity":"gotcha","affected_versions":"all"},{"fix":"Pass 'endpoint' as first argument: QnAMakerClient(endpoint, credentials).","message":"In version 0.3.0, the 'QnAMakerClient' constructor changed: 'endpoint' is now required and the 'base_url' parameter was removed.","severity":"breaking","affected_versions":"0.3.0+"}],"env_vars":null,"search_vec":"'0.3.1':28 'ai':47 'answer':42,62 'azur':1,9,35,46,54 'azure-ai-language-questionansw':45 'base':23,59 'cadenc':51 'client':4,12 'cognitiveservic':55 'current':26 'enabl':16 'endpoint':25 'knowledg':22,58 'knowledge-bas':57 'languag':48 'librari':5,13 'low':53 'mainten':33 'maker':3,11,21 'manag':18 'microsoft':8 'migrat':37 'mode':34 'newer':40 'programmat':17 'python':7,15 'qna':2,10,20 'qnamak':56 'question':41,61 'question-answ':60 'questionansw':49 'recommend':36 'releas':50 'servic':43 'stabl':30 'version':27 'via':44","created_at":"2026-05-01T06:02:08.645119+00:00","updated_at":"2026-05-01T06:02:08.645119+00:00","problems":[{"fix":"Upgrade to the latest: pip install --upgrade azure-cognitiveservices-knowledge-qnamaker","cause":"Often caused by incomplete installation or using a very old version (pre-0.2.0).","error":"ImportError: cannot import name 'QnAMakerClient' from 'azure.cognitiveservices.knowledge.qnamaker'"},{"fix":"Use QnAMakerClient (not QnAMakerRuntimeClient) for knowledge base management.","cause":"Using the runtime client instead of the management client. The runtime client does not have knowledgebase operations.","error":"AttributeError: 'QnAMakerClient' object has no attribute 'knowledgebase'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.3.1","cli_name":"","cli_version":null,"type":"library","homepage":"https://azure.microsoft.com/en-us/services/cognitive-services/qna-maker/","github":"https://github.com/Azure/azure-sdk-for-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/azure-cognitiveservices-knowledge-qnamaker/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["azure","ai-ml","llm-agents"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}