Skip to content

Commit fc62631

Browse files
add for pro mode
1 parent fb251ac commit fc62631

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

python/content_understanding_client.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ def _get_training_data_config(
4949
"kind": "blob",
5050
"prefix": storage_container_path_prefix,
5151
}
52+
53+
def _get_pro_mode_reference_docs_config(
54+
self, storage_container_sas_url, storage_container_path_prefix
55+
):
56+
return {
57+
"kind": "reference",
58+
"containerUrl": storage_container_sas_url,
59+
"prefix": storage_container_path_prefix,
60+
"fileListPath": "sources.jsonl",
61+
}
5262

5363
def _get_headers(self, subscription_key, api_token, x_ms_useragent):
5464
"""Returns the headers for the HTTP requests.
@@ -116,6 +126,8 @@ def begin_create_analyzer(
116126
analyzer_template_path: str = "",
117127
training_storage_container_sas_url: str = "",
118128
training_storage_container_path_prefix: str = "",
129+
pro_mode_reference_docs_storage_container_sas_url: str = "",
130+
pro_mode_reference_docs_storage_container_path_prefix: str = "",
119131
):
120132
"""
121133
Initiates the creation of an analyzer with the given ID and schema.
@@ -150,6 +162,15 @@ def begin_create_analyzer(
150162
training_storage_container_path_prefix,
151163
)
152164

165+
if (
166+
pro_mode_reference_docs_storage_container_sas_url
167+
and pro_mode_reference_docs_storage_container_path_prefix
168+
): # noqa
169+
analyzer_template["knowledgeSources"] = self._get_pro_mode_reference_docs_config(
170+
pro_mode_reference_docs_storage_container_sas_url,
171+
pro_mode_reference_docs_storage_container_path_prefix,
172+
)
173+
153174
headers = {"Content-Type": "application/json"}
154175
headers.update(self._headers)
155176

0 commit comments

Comments
 (0)