added support for text based conversations
This commit is contained in:
Родитель
8ef2f7a298
Коммит
7ce80513bb
|
@ -0,0 +1,3 @@
|
|||
local.settings.json
|
||||
.venv
|
||||
.vscode
|
|
@ -0,0 +1,11 @@
|
|||
# To enable ssh & remote debugging on app service change the base image to the one below
|
||||
# FROM mcr.microsoft.com/azure-functions/python:4-python3.9-appservice
|
||||
FROM mcr.microsoft.com/azure-functions/python:4-python3.9
|
||||
|
||||
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
|
||||
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
|
||||
|
||||
COPY requirements.txt /
|
||||
RUN pip install -r /requirements.txt
|
||||
|
||||
COPY . /home/site/wwwroot
|
|
@ -118,6 +118,15 @@ def create_skillset():
|
|||
skill["uri"] = skill["uri"].replace('{function_name}', os.getenv('function_name')).replace('{code}', os.getenv('function_key'))
|
||||
skill["uri"] = skill["uri"].replace('{openai_function_name}', os.getenv('openai_function_name')).replace('{openai_function_key}', os.getenv('openai_function_key'))
|
||||
|
||||
if len(os.getenv('OPENAI_PROMPT_KEYS', [])) > 0:
|
||||
for field in os.getenv('OPENAI_PROMPT_KEYS').replace(' ','').split(','):
|
||||
open_ai_skill['outputs'].append(
|
||||
{
|
||||
"name": field.split(':')[0],
|
||||
"targetName": field.split(':')[0]
|
||||
}
|
||||
)
|
||||
|
||||
r = requests.put(url, headers=headers, json=body)
|
||||
logging.info(r.json())
|
||||
|
||||
|
|
|
@ -0,0 +1,411 @@
|
|||
{
|
||||
"name": "YOUR_INDEX_NAME",
|
||||
"fields": [
|
||||
{
|
||||
"name": "ConversationId",
|
||||
"type": "Edm.String",
|
||||
"facetable": true,
|
||||
"filterable": true,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": false,
|
||||
"sortable": true,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "Messages",
|
||||
"type": "Collection(Edm.ComplexType)",
|
||||
"analyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": [
|
||||
{
|
||||
"name": "Id",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": true,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "ReferenceId",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": true,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "UserId",
|
||||
"type": "Edm.String",
|
||||
"facetable": true,
|
||||
"filterable": true,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "EventType",
|
||||
"type": "Edm.String",
|
||||
"facetable": true,
|
||||
"filterable": true,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "CustomProperties",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "EventTime",
|
||||
"type": "Edm.DateTimeOffset",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"retrievable": true,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_content_type",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": false,
|
||||
"searchable": false,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_size",
|
||||
"type": "Edm.Int64",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"retrievable": false,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_last_modified",
|
||||
"type": "Edm.DateTimeOffset",
|
||||
"facetable": false,
|
||||
"filterable": true,
|
||||
"retrievable": true,
|
||||
"sortable": true,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_content_md5",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": false,
|
||||
"searchable": false,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_name",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": false,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_path",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": true,
|
||||
"retrievable": true,
|
||||
"searchable": false,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "metadata_content_encoding",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": false,
|
||||
"searchable": false,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "metadata_content_type",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": false,
|
||||
"searchable": false,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "metadata_language",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": false,
|
||||
"searchable": false,
|
||||
"sortable": false,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "keyphrases",
|
||||
"type": "Collection(Edm.String)",
|
||||
"facetable": true,
|
||||
"filterable": true,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"analyzer": "standard.lucene",
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "language",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": "standard.lucene",
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "translated_text",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": "en.lucene",
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "merged_content",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": "standard.lucene",
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "merged_content_user",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": "standard.lucene",
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "full_conversation",
|
||||
"type": "Edm.String",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"key": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"sortable": false,
|
||||
"analyzer": "standard.lucene",
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "text",
|
||||
"type": "Collection(Edm.String)",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"analyzer": "standard.lucene",
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "layoutText",
|
||||
"type": "Collection(Edm.String)",
|
||||
"facetable": false,
|
||||
"filterable": false,
|
||||
"retrievable": true,
|
||||
"searchable": true,
|
||||
"analyzer": "standard.lucene",
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "StartTime",
|
||||
"type": "Edm.DateTimeOffset",
|
||||
"facetable": false,
|
||||
"filterable": true,
|
||||
"retrievable": true,
|
||||
"sortable": true,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
},
|
||||
{
|
||||
"name": "EndTime",
|
||||
"type": "Edm.DateTimeOffset",
|
||||
"facetable": false,
|
||||
"filterable": true,
|
||||
"retrievable": true,
|
||||
"sortable": true,
|
||||
"analyzer": null,
|
||||
"indexAnalyzer": null,
|
||||
"searchAnalyzer": null,
|
||||
"synonymMaps": [],
|
||||
"fields": []
|
||||
}
|
||||
],
|
||||
"suggesters": [],
|
||||
"scoringProfiles": [],
|
||||
"defaultScoringProfile": "",
|
||||
"corsOptions": null,
|
||||
"analyzers": [],
|
||||
"charFilters": [],
|
||||
"tokenFilters": [],
|
||||
"tokenizers": []
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
"name": "YOUR_INDEXER_NAME",
|
||||
"description": "",
|
||||
"dataSourceName": "YOUR_DATASOURCE_NAME",
|
||||
"skillsetName": "YOUR_SKILLSET_NAME",
|
||||
"targetIndexName": "YOUR_INDEX_NAME",
|
||||
"disabled": null,
|
||||
"schedule": {
|
||||
"interval": "PT5M"
|
||||
},
|
||||
"parameters": {
|
||||
"batchSize": null,
|
||||
"maxFailedItems": 0,
|
||||
"maxFailedItemsPerBatch": 0,
|
||||
"base64EncodeKeys": null,
|
||||
"configuration": {
|
||||
"dataToExtract": "contentAndMetadata",
|
||||
"parsingMode": "json"
|
||||
}
|
||||
},
|
||||
"fieldMappings": [
|
||||
{
|
||||
"sourceFieldName": "metadata_storage_path",
|
||||
"targetFieldName": "metadata_storage_path",
|
||||
"mappingFunction": {
|
||||
"name": "base64Encode"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputFieldMappings": [
|
||||
{
|
||||
"sourceFieldName": "/document/merged_content_user/keyphrases",
|
||||
"targetFieldName": "keyphrases"
|
||||
},
|
||||
{
|
||||
"sourceFieldName": "/document/language",
|
||||
"targetFieldName": "language"
|
||||
},
|
||||
{
|
||||
"sourceFieldName": "/document/merged_content/translated_text",
|
||||
"targetFieldName": "translated_text"
|
||||
},
|
||||
{
|
||||
"sourceFieldName": "/document/merged_content",
|
||||
"targetFieldName": "merged_content"
|
||||
},
|
||||
{
|
||||
"sourceFieldName": "/document/merged_content_user",
|
||||
"targetFieldName": "merged_content_user"
|
||||
},
|
||||
{
|
||||
"sourceFieldName": "/document/StartTime",
|
||||
"targetFieldName": "StartTime"
|
||||
},
|
||||
{
|
||||
"sourceFieldName": "/document/EndTime",
|
||||
"targetFieldName": "EndTime"
|
||||
},
|
||||
{
|
||||
"sourceFieldName": "/document/full_conversation",
|
||||
"targetFieldName": "full_conversation"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,406 @@
|
|||
{
|
||||
"name": "YOUR_SKILLSET",
|
||||
"description": "",
|
||||
"skills": [
|
||||
{
|
||||
"@odata.type": "#Microsoft.Skills.Text.KeyPhraseExtractionSkill",
|
||||
"name": "KeyPhraseExtractionSkill",
|
||||
"description": null,
|
||||
"context": "/document/merged_content_user",
|
||||
"defaultLanguageCode": "en",
|
||||
"maxKeyPhraseCount": null,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "text",
|
||||
"source": "/document/merged_content_user"
|
||||
},
|
||||
{
|
||||
"name": "languageCode",
|
||||
"source": "/document/language"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "keyPhrases",
|
||||
"targetName": "keyphrases"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@odata.type": "#Microsoft.Skills.Text.LanguageDetectionSkill",
|
||||
"name": "LanguageDetectionSkill",
|
||||
"description": null,
|
||||
"context": "/document",
|
||||
"inputs": [
|
||||
{
|
||||
"name": "text",
|
||||
"source": "/document/merged_content"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "languageCode",
|
||||
"targetName": "language"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@odata.type": "#Microsoft.Skills.Text.TranslationSkill",
|
||||
"name": "TranslationSkill",
|
||||
"description": null,
|
||||
"context": "/document/merged_content",
|
||||
"defaultFromLanguageCode": null,
|
||||
"defaultToLanguageCode": "en",
|
||||
"suggestedFrom": "en",
|
||||
"inputs": [
|
||||
{
|
||||
"name": "text",
|
||||
"source": "/document/merged_content"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "translatedText",
|
||||
"targetName": "translated_text"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@odata.type": "#Microsoft.Skills.Util.ShaperSkill",
|
||||
"name": "ShaperSkillObjects",
|
||||
"description": null,
|
||||
"context": "/document",
|
||||
"inputs": [
|
||||
{
|
||||
"name": "metadata_storage_content_type",
|
||||
"source": "/document/metadata_storage_content_type"
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_size",
|
||||
"source": "/document/metadata_storage_size"
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_last_modified",
|
||||
"source": "/document/metadata_storage_last_modified"
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_content_md5",
|
||||
"source": "/document/metadata_storage_content_md5"
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_name",
|
||||
"source": "/document/metadata_storage_name"
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_path",
|
||||
"source": "/document/metadata_storage_path"
|
||||
},
|
||||
{
|
||||
"name": "metadata_content_encoding",
|
||||
"source": "/document/metadata_content_encoding"
|
||||
},
|
||||
{
|
||||
"name": "metadata_content_type",
|
||||
"source": "/document/metadata_content_type"
|
||||
},
|
||||
{
|
||||
"name": "metadata_language",
|
||||
"source": "/document/metadata_language"
|
||||
},
|
||||
{
|
||||
"name": "merged_content",
|
||||
"source": "/document/merged_content"
|
||||
},
|
||||
{
|
||||
"name": "merged_content_user",
|
||||
"source": "/document/merged_content_user"
|
||||
},
|
||||
{
|
||||
"name": "keyPhrases",
|
||||
"source": "/document/merged_content_user/keyphrases/*"
|
||||
},
|
||||
{
|
||||
"name": "languageCode",
|
||||
"source": "/document/language"
|
||||
},
|
||||
{
|
||||
"name": "translatedText",
|
||||
"source": "/document/merged_content/translated_text"
|
||||
},
|
||||
{
|
||||
"name": "Messages",
|
||||
"sourceContext": "/document/Messages/*",
|
||||
"inputs": [
|
||||
{
|
||||
"name": "Id",
|
||||
"source": "/document/Messages/*/Id"
|
||||
},
|
||||
{
|
||||
"name": "ReferenceId",
|
||||
"source": "/document/Messages/*/ReferenceId"
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"source": "/document/Messages/*/Value"
|
||||
},
|
||||
{
|
||||
"name": "UserId",
|
||||
"source": "/document/Messages/*/UserId"
|
||||
},
|
||||
{
|
||||
"name": "EventType",
|
||||
"source": "/document/Messages/*/EventType"
|
||||
},
|
||||
{
|
||||
"name": "CustomProperties",
|
||||
"source": "/document/Messages/*/CustomProperties"
|
||||
},
|
||||
{
|
||||
"name": "EventTime",
|
||||
"source": "/document/Messages/*/EventTime"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ConversationId",
|
||||
"source": "/document/ConversationId"
|
||||
},
|
||||
{
|
||||
"name": "StartTime",
|
||||
"source": "/document/StartTime"
|
||||
},
|
||||
{
|
||||
"name": "EndTime",
|
||||
"source": "/document/EndTime"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"targetName": "objectprojection"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@odata.type": "#Microsoft.Skills.Util.ShaperSkill",
|
||||
"name": "ShaperSkillTable",
|
||||
"description": null,
|
||||
"context": "/document",
|
||||
"inputs": [
|
||||
{
|
||||
"name": "metadata_storage_content_type",
|
||||
"source": "/document/metadata_storage_content_type"
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_size",
|
||||
"source": "/document/metadata_storage_size"
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_last_modified",
|
||||
"source": "/document/metadata_storage_last_modified"
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_content_md5",
|
||||
"source": "/document/metadata_storage_content_md5"
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_name",
|
||||
"source": "/document/metadata_storage_name"
|
||||
},
|
||||
{
|
||||
"name": "metadata_storage_path",
|
||||
"source": "/document/metadata_storage_path"
|
||||
},
|
||||
{
|
||||
"name": "metadata_content_encoding",
|
||||
"source": "/document/metadata_content_encoding"
|
||||
},
|
||||
{
|
||||
"name": "metadata_content_type",
|
||||
"source": "/document/metadata_content_type"
|
||||
},
|
||||
{
|
||||
"name": "metadata_language",
|
||||
"source": "/document/metadata_language"
|
||||
},
|
||||
{
|
||||
"name": "merged_content",
|
||||
"source": "/document/merged_content"
|
||||
},
|
||||
{
|
||||
"name": "merged_content_user",
|
||||
"source": "/document/merged_content_user"
|
||||
},
|
||||
{
|
||||
"name": "keyPhrases",
|
||||
"source": "/document/merged_content_user/keyphrases/*"
|
||||
},
|
||||
{
|
||||
"name": "languageCode",
|
||||
"source": "/document/language"
|
||||
},
|
||||
{
|
||||
"name": "translatedText",
|
||||
"source": "/document/merged_content/translated_text"
|
||||
},
|
||||
{
|
||||
"name": "ConversationId",
|
||||
"source": "/document/ConversationId"
|
||||
},
|
||||
{
|
||||
"name": "StartTime",
|
||||
"source": "/document/StartTime"
|
||||
},
|
||||
{
|
||||
"name": "EndTime",
|
||||
"source": "/document/EndTime"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "output",
|
||||
"targetName": "tableprojection"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"@odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
|
||||
"name": "MessagesMerge",
|
||||
"description": "Collapse meessages from bot and users in merged_content",
|
||||
"context": "/document",
|
||||
"uri": "https://{function_name}.azurewebsites.net/api/MessagesMerge?code={code}",
|
||||
"httpMethod": "POST",
|
||||
"timeout": "PT30S",
|
||||
"batchSize": 1,
|
||||
"degreeOfParallelism": 1,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "Messages",
|
||||
"source": "/document/Messages"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "merged_content",
|
||||
"targetName": "merged_content"
|
||||
},
|
||||
{
|
||||
"name": "merged_content_user",
|
||||
"targetName": "merged_content_user"
|
||||
},
|
||||
{
|
||||
"name": "full_conversation",
|
||||
"targetName": "full_conversation"
|
||||
},
|
||||
{
|
||||
"name": "StartTime",
|
||||
"targetName": "StartTime"
|
||||
},
|
||||
{
|
||||
"name": "EndTime",
|
||||
"targetName": "EndTime"
|
||||
}
|
||||
],
|
||||
"httpHeaders": {}
|
||||
},
|
||||
{
|
||||
"@odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
|
||||
"name": "OpenAI Enricher",
|
||||
"description": "Send data to OpenAI for enrichment",
|
||||
"context": "/document",
|
||||
"uri": "https://{openai_function_name}.azurewebsites.net/api/StartProcessing?code={openai_function_key}",
|
||||
"httpMethod": "POST",
|
||||
"timeout": "PT30S",
|
||||
"batchSize": 1,
|
||||
"degreeOfParallelism": 1,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "metadata_storage_path",
|
||||
"source": "/document/metadata_storage_path"
|
||||
},
|
||||
{
|
||||
"name": "text",
|
||||
"source": "/document/full_conversation"
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
],
|
||||
"httpHeaders": {}
|
||||
}
|
||||
],
|
||||
"cognitiveServices": {
|
||||
"@odata.type": "#Microsoft.Azure.Search.CognitiveServicesByKey",
|
||||
"description": "",
|
||||
"key": "YOUR_COGNITIVE_SERVICES_KEY"
|
||||
},
|
||||
"knowledgeStore": {
|
||||
"storageConnectionString": "YOUR_STORAGE_ACCOUNT_CONNECTION_STRING",
|
||||
"projections": [
|
||||
{
|
||||
"tables": [
|
||||
{
|
||||
"tableName": "YOUR_DOCUMENTS_TABLE",
|
||||
"referenceKeyName": null,
|
||||
"generatedKeyName": "Documentid",
|
||||
"source": "/document/tableprojection",
|
||||
"sourceContext": null,
|
||||
"inputs": []
|
||||
},
|
||||
{
|
||||
"tableName": "YOUR_KEYPHRASES_TABLE",
|
||||
"referenceKeyName": null,
|
||||
"generatedKeyName": "KeyPhrasesid",
|
||||
"source": null,
|
||||
"sourceContext": "/document/tableprojection/keyPhrases/*",
|
||||
"inputs": [
|
||||
{
|
||||
"name": "keyphrases",
|
||||
"source": "/document/tableprojection/keyPhrases/*",
|
||||
"sourceContext": null,
|
||||
"inputs": []
|
||||
},
|
||||
{
|
||||
"name": "ConversationId",
|
||||
"source": "/document/ConversationId",
|
||||
"sourceContext": null,
|
||||
"inputs": []
|
||||
},
|
||||
{
|
||||
"name": "StartTime",
|
||||
"source": "/document/StartTime",
|
||||
"sourceContext": null,
|
||||
"inputs": []
|
||||
},
|
||||
{
|
||||
"name": "EndTime",
|
||||
"source": "/document/EndTime",
|
||||
"sourceContext": null,
|
||||
"inputs": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"objects": [
|
||||
{
|
||||
"storageContainer": "YOUR_CONTAINER",
|
||||
"referenceKeyName": null,
|
||||
"generatedKeyName": null,
|
||||
"source": "/document/objectprojection",
|
||||
"sourceContext": null,
|
||||
"inputs": []
|
||||
}
|
||||
],
|
||||
"files": [
|
||||
{
|
||||
"storageContainer": "YOUR_CONTAINER_FILES",
|
||||
"referenceKeyName": null,
|
||||
"generatedKeyName": "imagepath",
|
||||
"source": "/document/tableprojection/Images/*/imgdata",
|
||||
"sourceContext": null,
|
||||
"inputs": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
97
README.md
97
README.md
|
@ -1,4 +1,4 @@
|
|||
# Customer Service Conversational Insights
|
||||
# Customer Service Conversational Insights with Azure OpenAI
|
||||
|
||||
## Knowledge Mining applied to Conversations
|
||||
|
||||
|
@ -6,12 +6,19 @@ Every day a large amount of data is generated by Customer Services in the form o
|
|||
|
||||
This is typically unstructured data that, if processed, can result in a great amount of insights for Contact Centers, add additional data to NBA models and provide a better view of the customer.
|
||||
|
||||
The Customer Service Conversational Insights is a solution accelerator built on top of Azure Cognitive Search, Bot Framework, Azure Speech Services and Text Analytics that allows customers to quickly deploy an integrated platform and immediately start extracting insights from customer conversations.
|
||||
The Customer Service Conversational Insights is a solution accelerator built on top of Azure Cognitive Search, Bot Framework, Azure Speech Services and Azure OpenAI that allows customers to quickly deploy an integrated platform and immediately start extracting insights from customer conversations.
|
||||
|
||||
## [Navigate demo site [Click here]](https://conversational-knowledge-mining.azurewebsites.net/)
|
||||
Demo site is build on hotel and travel booking conversations. Search for city name to get started (e.g. seattle, milan, etc...)
|
||||
The demo site is built on hotel and travel booking conversations. Search for a city name to get started (e.g. seattle, milan, etc...)
|
||||
|
||||
# Getting started with Azure One Click deployment for multiple scenarios:
|
||||
- [Audio data](#audio-data)
|
||||
- [Text based conversation](#text-based-conversations)
|
||||
- [Bot framework data](#bot-telemetry-with-sample-data)
|
||||
|
||||
## IMPORTANT PRE-REQUISITES:
|
||||
Please note that you need to have access to an Azure OpenAI resource and have already deployed a text-davinci-003 model in your resource if you want to enrich your data with Azure OpenAI.
|
||||
|
||||
# One click Azure Deployment
|
||||
## Audio data
|
||||
To deploy the full solution with audio files transcription and the Web Application, select the following button:
|
||||
<br>
|
||||
|
@ -20,16 +27,94 @@ To deploy the full solution with audio files transcription and the Web Applicati
|
|||
|
||||
The Azure portal displays a pane that allows you to easily provide parameter values. The parameters are pre-filled with the default values from the template.
|
||||
|
||||
Once the deployment is completed, start processing your audio files by adding them in the "audio-input" container in the "storage account" in your "Resource Group".
|
||||
Once the deployment is completed, start processing your audio files by adding them to the "audio-input" container in the "storage account" in your "Resource Group".
|
||||
To navigate the Web Ui, check the "App Service" resource in your "Resource Group".
|
||||
|
||||
|
||||
The template builds on top of the [Ingestion Client for Speech service](https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/ingestion-client).
|
||||
Please check here for detailed parameters explainations: [Getting started with the Ingestion Client](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/ingestion/ingestion-client/Setup/guide.md)
|
||||
Please check here for detailed parameters explanations: [Getting started with the Ingestion Client](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/ingestion/ingestion-client/Setup/guide.md)
|
||||
|
||||
Learn more on how to configure your [Azure OpenAI prompt here](#integrate-your-openai-prompt)
|
||||
|
||||
### Architecture
|
||||
![alt text](images/audio-architecture.png "Conversational Knowledge Mining Architecture")
|
||||
|
||||
## Text based Conversations
|
||||
To deploy the full solution for Text based Conversations and the Web Application, select the following button:
|
||||
<br>
|
||||
<br>
|
||||
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FCustomer-Service-Conversational-Insights%2Fmaster%2Finfrastructure%2FARM%2Fbot-template.json)
|
||||
|
||||
|
||||
The Azure portal displays a pane that allows you to easily provide parameter values. The parameters are pre-filled with the default values from the template.
|
||||
|
||||
Once the deployment is completed, start processing your text conversation files by adding them to the "conversationkm-full" container in the "storage account" in your "Resource Group". Please refer to [Conversational data format](#conversational-data-format) for the JSON structure. Each conversation has to be stored in a different JSON file.
|
||||
To navigate the Web Ui, check the "App Service" resource in your "Resource Group".
|
||||
|
||||
|
||||
### Architecture
|
||||
![alt text](images/text-based-architecture.png "Conversational Knowledge Mining Architecture")
|
||||
|
||||
|
||||
### Conversational data format
|
||||
```json
|
||||
{
|
||||
"ConversationId": "1f47eacf-c780-4ae2-ab2d-7b2e1386617f",
|
||||
"Messages": [
|
||||
{
|
||||
"Id": "2e1804ad-c856-4475-abc1-c831dc904935",
|
||||
"EventType": "MessageFromUser",
|
||||
"EventTime": "2016-08-17 20:42:03.592000",
|
||||
"ConversationId": "1f47eacf-c780-4ae2-ab2d-7b2e1386617f",
|
||||
"Value": "I need to book a flight to find my last Pokemon. I would need to leave from Montreal and go to Hiroshima. I will also need to leave on August 19th. Im with 4 other adults as well.",
|
||||
"UserId": "U2709166N",
|
||||
"CustomProperties": {
|
||||
"any_property" : "any_value"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": "5b6284b5-a005-440e-9c4c-87c0c1b01333",
|
||||
"EventType": "MessageFromBotOrAgent",
|
||||
"EventTime": "2016-08-17 20:43:04.970000",
|
||||
"ConversationId": "1f47eacf-c780-4ae2-ab2d-7b2e1386617f",
|
||||
"Value": "Is there a budget for your trip?",
|
||||
"UserId": "U22HTHYNP",
|
||||
"CustomProperties": {
|
||||
"any_property" : "any_value"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": "a13fb656-b6df-4d40-9458-93869af21e20",
|
||||
"EventType": "MessageFromUser",
|
||||
"EventTime": "2016-08-17 20:43:40.239000",
|
||||
"ConversationId": "1f47eacf-c780-4ae2-ab2d-7b2e1386617f",
|
||||
"Value": "Yes, $16600.",
|
||||
"UserId": "U2709166N",
|
||||
"CustomProperties": {
|
||||
"any_property" : "any_value"
|
||||
}
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Integrate your OpenAI Prompt
|
||||
You can add your Azure OpenAI prompt to extract specific entities in the template parameter OPENAI_PROMPT.
|
||||
<br>
|
||||
The defined keys have to be added in the OPENAI_PROMPT_KEYS parameter as well, to enable the data Push to the Azure Cognitive Search index.
|
||||
<br>
|
||||
Please be sure to set up both parameters accordingly to your entities name.
|
||||
|
||||
| Environment variable | Default value | Note |
|
||||
|--|--|--|
|
||||
|OPENAI_PROMPT | Execute these tasks:<br>- Summarize the conversation, key: summary<br>- Is the customer satisfied with the interaction with the agent, key: satisfied<br> Answer in JSON machine-readable format, using the keys from above.<br> Format the ouput as JSON object called 'results'. Pretty print the JSON and make sure that is properly closed at the end.<br>| The prompt to be used with OpenAI, please define the keys in the setting below as well |
|
||||
|OPENAI_PROMPT_KEYS | summary:Edm.String:False,satisfied:Edm.String:True|The prompt keys to use for the OpenAI API. Format: key,SearchType,Facetable e.g. key1:Edm.String:False,key2:Edm.String:True,key3:Edm.String:True |
|
||||
|
||||
### Modify the prompt after deployment
|
||||
|
||||
You can modify the Azure OpenAI prompt after the deployment by modifying the Azure Function application settings ("OPENAI_PROMPT", "OPENAI_PROMPT_KEYS") and creating the required field in the Azure Cognitive Search index.
|
||||
|
||||
## Bot Telemetry with sample data
|
||||
To deploy the full solution with Bot sample data and the Web Application, select the following button:
|
||||
<br>
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 123 KiB |
|
@ -0,0 +1,669 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"resourceGroupName": {
|
||||
"defaultValue": "[resourceGroup().name]",
|
||||
"type": "string"
|
||||
},
|
||||
"location": {
|
||||
"defaultValue": "[resourceGroup().location]",
|
||||
"type": "string"
|
||||
},
|
||||
"storageAccountName": {
|
||||
"defaultValue": "[concat('csci', substring(uniqueString(resourceGroup().id),0,6))]",
|
||||
"type": "String"
|
||||
},
|
||||
"functionName": {
|
||||
"defaultValue": "[concat('csci', substring(uniqueString(resourceGroup().id),0,6))]",
|
||||
"type": "String"
|
||||
},
|
||||
"searchServicesName": {
|
||||
"defaultValue": "[concat('csci', substring(uniqueString(resourceGroup().id),0,6))]",
|
||||
"type": "String"
|
||||
},
|
||||
"applicationInsightsName": {
|
||||
"defaultValue": "[concat('csci', substring(uniqueString(resourceGroup().id),0,6))]",
|
||||
"type": "String"
|
||||
},
|
||||
"webUiName": {
|
||||
"type": "string",
|
||||
"defaultValue": "[concat('csci', substring(uniqueString(resourceGroup().id),0,6), '-ui')]"
|
||||
},
|
||||
"hostingPlanName": {
|
||||
"type": "string",
|
||||
"defaultValue": "[concat('csci', substring(uniqueString(resourceGroup().id),0,6), '-asp')]"
|
||||
},
|
||||
"cognitiveServiceName": {
|
||||
"type": "string",
|
||||
"defaultValue": "[concat('csci', substring(uniqueString(resourceGroup().id),0,6))]"
|
||||
},
|
||||
"serviceBusName": {
|
||||
"type": "string",
|
||||
"defaultValue": "[concat('csci', substring(uniqueString(resourceGroup().id),0,6))]",
|
||||
"metadata": {
|
||||
"description": "The name of the Service Bus namespace to use."
|
||||
}
|
||||
},
|
||||
"OPENAI_API_BASE": {
|
||||
"type": "string",
|
||||
"defaultValue": "https://YOUR_OPENAI_RESOURCE_NAME.openai.azure.com/",
|
||||
"metadata": {
|
||||
"description": "The base URL for the OpenAI API"
|
||||
}
|
||||
},
|
||||
"OPENAI_API_KEY": {
|
||||
"type": "securestring",
|
||||
"defaultValue": "",
|
||||
"metadata": {
|
||||
"description": "The API key for the OpenAI API"
|
||||
}
|
||||
},
|
||||
"OPENAI_DEPLOYMENT_NAME": {
|
||||
"type": "string",
|
||||
"defaultValue": "text-davinci-003",
|
||||
"metadata": {
|
||||
"description": "The name of the OpenAI deployment to use"
|
||||
}
|
||||
},
|
||||
"OPENAI_TEMPERATURE": {
|
||||
"type": "string",
|
||||
"defaultValue": "0",
|
||||
"metadata": {
|
||||
"description": "The temperature to use for the OpenAI API"
|
||||
}
|
||||
},
|
||||
"OPENAI_MAX_TOKENS": {
|
||||
"type": "string",
|
||||
"defaultValue": "800",
|
||||
"metadata": {
|
||||
"description": "The maximum number of tokens to use for the OpenAI API response"
|
||||
}
|
||||
},
|
||||
"OPENAI_TOP_P": {
|
||||
"type": "string",
|
||||
"defaultValue": "1",
|
||||
"metadata": {
|
||||
"description": "The top_p to use for the OpenAI API"
|
||||
}
|
||||
},
|
||||
"OPENAI_FREQUENCY_PENALTY": {
|
||||
"type": "string",
|
||||
"defaultValue": "0",
|
||||
"metadata": {
|
||||
"description": "The frequency penalty to use for the OpenAI API"
|
||||
}
|
||||
},
|
||||
"OPENAI_PRESENCE_PENALTY": {
|
||||
"type": "string",
|
||||
"defaultValue": "0",
|
||||
"metadata": {
|
||||
"description": "The presence penalty to use for the OpenAI API"
|
||||
}
|
||||
},
|
||||
"OPENAI_PROMPT": {
|
||||
"type": "string",
|
||||
"defaultValue": "Execute these tasks:\n- Summarize the conversation, key: summary\n- Is the customer satisfied with the interaction with the agent, key: satisfied\n Answer in JSON machine-readable format, using the keys from above.\n Format the ouput as JSON object called 'results'. Pretty print the JSON and make sure that is properly closed at the end.\n",
|
||||
"metadata": {
|
||||
"description": "The prompt to use for the OpenAI API"
|
||||
}
|
||||
},
|
||||
"OPENAI_PROMPT_KEYS": {
|
||||
"type": "string",
|
||||
"defaultValue": "summary:Edm.String:False,satisfied:Edm.String:True",
|
||||
"metadata": {
|
||||
"description": "The prompt keys to use for the OpenAI API. Format: key,SearchType,Facetable e.g. key1:Edm.String:False,key2:Edm.String:True,key3:Edm.String:True"
|
||||
}
|
||||
},
|
||||
"newGuid": {
|
||||
"type": "string",
|
||||
"defaultValue": "[newGuid()]"
|
||||
}
|
||||
},
|
||||
"variables": {
|
||||
"openAIFunctionName": "[concat(parameters('functionName'),'-openai')]",
|
||||
"clientKey": "[concat(uniqueString(guid(resourceGroup().id, deployment().name)), parameters('newGuid'), 'Tg2%')]"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"type": "Microsoft.Search/searchServices",
|
||||
"apiVersion": "2021-04-01-preview",
|
||||
"name": "[parameters('searchServicesName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"sku": {
|
||||
"name": "standard"
|
||||
},
|
||||
"properties": {
|
||||
"replicaCount": 1,
|
||||
"partitionCount": 1,
|
||||
"hostingMode": "Default",
|
||||
"publicNetworkAccess": "Enabled",
|
||||
"networkRuleSet": {
|
||||
"ipRules": [],
|
||||
"bypass": "None"
|
||||
},
|
||||
"encryptionWithCmk": {
|
||||
"enforcement": "Unspecified"
|
||||
},
|
||||
"disableLocalAuth": false,
|
||||
"authOptions": {
|
||||
"apiKeyOnly": {}
|
||||
},
|
||||
"disabledDataExfiltrationOptions": [],
|
||||
"semanticSearch": "disabled"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Storage/storageAccounts",
|
||||
"apiVersion": "2021-08-01",
|
||||
"name": "[parameters('storageAccountName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"sku": {
|
||||
"name": "Standard_RAGRS",
|
||||
"tier": "Standard"
|
||||
},
|
||||
"kind": "StorageV2",
|
||||
"properties": {
|
||||
"defaultToOAuthAuthentication": false,
|
||||
"allowCrossTenantReplication": true,
|
||||
"minimumTlsVersion": "TLS1_2",
|
||||
"allowBlobPublicAccess": true,
|
||||
"allowSharedKeyAccess": true,
|
||||
"networkAcls": {
|
||||
"bypass": "AzureServices",
|
||||
"virtualNetworkRules": [],
|
||||
"ipRules": [],
|
||||
"defaultAction": "Allow"
|
||||
},
|
||||
"supportsHttpsTrafficOnly": true,
|
||||
"encryption": {
|
||||
"requireInfrastructureEncryption": false,
|
||||
"services": {
|
||||
"file": {
|
||||
"keyType": "Account",
|
||||
"enabled": true
|
||||
},
|
||||
"blob": {
|
||||
"keyType": "Account",
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"keySource": "Microsoft.Storage"
|
||||
},
|
||||
"accessTier": "Hot"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Storage/storageAccounts/blobServices",
|
||||
"apiVersion": "2021-08-01",
|
||||
"name": "[concat(parameters('storageAccountName'), '/default')]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
|
||||
],
|
||||
"sku": {
|
||||
"name": "Standard_RAGRS",
|
||||
"tier": "Standard"
|
||||
},
|
||||
"properties": {
|
||||
"changeFeed": {
|
||||
"enabled": false
|
||||
},
|
||||
"restorePolicy": {
|
||||
"enabled": false
|
||||
},
|
||||
"containerDeleteRetentionPolicy": {
|
||||
"enabled": true,
|
||||
"days": 7
|
||||
},
|
||||
"cors": {
|
||||
"corsRules": []
|
||||
},
|
||||
"deleteRetentionPolicy": {
|
||||
"enabled": true,
|
||||
"days": 7
|
||||
},
|
||||
"isVersioningEnabled": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
|
||||
"apiVersion": "2021-08-01",
|
||||
"name": "[concat(parameters('storageAccountName'), '/default/scm-releases')]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Storage/storageAccounts/blobServices', parameters('storageAccountName'), 'default')]",
|
||||
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"immutableStorageWithVersioning": {
|
||||
"enabled": false
|
||||
},
|
||||
"defaultEncryptionScope": "$account-encryption-key",
|
||||
"denyEncryptionScopeOverride": false,
|
||||
"publicAccess": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
|
||||
"apiVersion": "2021-08-01",
|
||||
"name": "[concat(parameters('storageAccountName'), '/default/conversationkm-full')]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Storage/storageAccounts/blobServices', parameters('storageAccountName'), 'default')]",
|
||||
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"immutableStorageWithVersioning": {
|
||||
"enabled": false
|
||||
},
|
||||
"defaultEncryptionScope": "$account-encryption-key",
|
||||
"denyEncryptionScopeOverride": false,
|
||||
"publicAccess": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
|
||||
"apiVersion": "2021-08-01",
|
||||
"name": "[concat(parameters('storageAccountName'), '/default/conversationkm-raw')]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Storage/storageAccounts/blobServices', parameters('storageAccountName'), 'default')]",
|
||||
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"immutableStorageWithVersioning": {
|
||||
"enabled": false
|
||||
},
|
||||
"defaultEncryptionScope": "$account-encryption-key",
|
||||
"denyEncryptionScopeOverride": false,
|
||||
"publicAccess": "None"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Insights/components",
|
||||
"apiVersion": "2020-02-02",
|
||||
"name": "[parameters('applicationInsightsName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"tags": {
|
||||
"[concat('hidden-link:', resourceId('Microsoft.Web/sites', parameters('applicationInsightsName')))]": "Resource"
|
||||
},
|
||||
"properties": {
|
||||
"Application_Type": "web"
|
||||
},
|
||||
"kind": "web"
|
||||
},
|
||||
{
|
||||
"apiVersion": "2020-06-01",
|
||||
"name": "[parameters('hostingPlanName')]",
|
||||
"type": "Microsoft.Web/serverfarms",
|
||||
"location": "[parameters('location')]",
|
||||
"properties": {
|
||||
"name": "[parameters('hostingPlanName')]",
|
||||
"workerSizeId": "1",
|
||||
"reserved": true,
|
||||
"numberOfWorkers": "1"
|
||||
},
|
||||
"sku": {
|
||||
"Tier": "Standard",
|
||||
"Name": "S1"
|
||||
},
|
||||
"kind": "linux"
|
||||
},
|
||||
{
|
||||
"apiVersion": "2018-11-01",
|
||||
"name": "[parameters('functionName')]",
|
||||
"type": "Microsoft.Web/sites",
|
||||
"kind": "functionapp,linux",
|
||||
"location": "[resourceGroup().location]",
|
||||
"tags": {
|
||||
|
||||
},
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]",
|
||||
"[resourceId('Microsoft.Insights/components', parameters('applicationInsightsName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"name": "[parameters('functionName')]",
|
||||
"siteConfig": {
|
||||
"appSettings": [
|
||||
{
|
||||
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
|
||||
"value": "[reference(resourceId('Microsoft.Insights/components', parameters('applicationInsightsName')), '2015-05-01').InstrumentationKey]"
|
||||
},
|
||||
{
|
||||
"name": "FUNCTIONS_EXTENSION_VERSION",
|
||||
"value": "~4"
|
||||
},
|
||||
{
|
||||
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
|
||||
"value": "false"
|
||||
},
|
||||
{
|
||||
"name": "AzureWebJobsStorage",
|
||||
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageAccountName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-06-01').keys[0].value,';EndpointSuffix=','core.windows.net')]"
|
||||
}
|
||||
],
|
||||
"cors": {
|
||||
"allowedOrigins": [
|
||||
"https://portal.azure.com"
|
||||
]
|
||||
},
|
||||
"use32BitWorkerProcess": false,
|
||||
"ftpsState": "FtpsOnly",
|
||||
"linuxFxVersion": "DOCKER|fruocco/csci-python-func:latest",
|
||||
"appCommandLine": "",
|
||||
"alwaysOn": true
|
||||
},
|
||||
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]",
|
||||
"clientAffinityEnabled": false,
|
||||
"virtualNetworkSubnetId": null,
|
||||
"httpsOnly": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.CognitiveServices/accounts",
|
||||
"apiVersion": "2017-04-18",
|
||||
"name": "[parameters('cognitiveServiceName')]",
|
||||
"location": "[parameters('location')]",
|
||||
"sku": {
|
||||
"name": "S0"
|
||||
},
|
||||
"kind": "CognitiveServices",
|
||||
"properties": {
|
||||
"statisticsEnabled": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Web/sites/config",
|
||||
"apiVersion": "2021-03-01",
|
||||
"name": "[format('{0}/{1}', parameters('functionName'), 'appsettings')]",
|
||||
"kind": "string",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Web/sites', parameters('functionName'))]",
|
||||
"[resourceId('Microsoft.Resources/deploymentScripts', 'WaitFunctionDeploymentSection')]"
|
||||
],
|
||||
"properties": {
|
||||
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('Microsoft.Insights/components', parameters('applicationInsightsName')), '2015-05-01').InstrumentationKey]",
|
||||
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(resourceId(parameters('resourceGroupName'),'Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-04-01').keys[0].value,';EndpointSuffix=core.windows.net')]",
|
||||
"dimensions": "scenario,channelId,entities.intent,entities.dst_city,entities.or_city,entities.n_adults,entities.NO_RESULT,entities.seat,entities.downtown,entities.breakfast,entities.category",
|
||||
"defined_events": "IntentRecognized",
|
||||
"conversationalkm_STORAGE": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(resourceId(parameters('resourceGroupName'),'Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-04-01').keys[0].value,';EndpointSuffix=core.windows.net')]",
|
||||
"telemetry_processed": "conversationkm-full",
|
||||
"profanity_lang": "eng",
|
||||
"cognitive_services_region": "[parameters('location')]",
|
||||
"table_sample_data": "botconvevals",
|
||||
"cognitive_services_key": "[listKeys(resourceId(parameters('resourceGroupName'),'Microsoft.CognitiveServices/accounts', parameters('cognitiveServiceName')), '2017-04-18').key1]",
|
||||
"search_account": "[parameters('searchServicesName')]",
|
||||
"search_api_key": "[listAdminKeys(concat('Microsoft.Search/searchServices/', parameters('searchServicesName')), '2021-04-01-preview').primaryKey]",
|
||||
"search_api_version": "2021-04-30-preview",
|
||||
"search_data_source": "[parameters('storageAccountName')]",
|
||||
"search_index": "conversational-index",
|
||||
"search_skillset": "conversational-skillset",
|
||||
"search_indexer": "conversational-km-indexer",
|
||||
"connection_string": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(resourceId(parameters('resourceGroupName'),'Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-04-01').keys[0].value,';EndpointSuffix=core.windows.net')]",
|
||||
"cognitive_search_data_source_container": "conversationkm-full",
|
||||
"cognitive_search_knowledge_store_container_object": "knowledge-store",
|
||||
"cognitive_search_knowledge_store_container_files": "knowledge-store-images",
|
||||
"cognitive_search_knowledge_store_table_document": "documentstable",
|
||||
"cognitive_search_knowledge_store_table_keyphrases": "keyphrasestable",
|
||||
"FUNCTIONS_EXTENSION_VERSION": "~4",
|
||||
"WEBSITES_ENABLE_APP_SERVICE_STORAGE": "false",
|
||||
"function_name": "[parameters('functionName')]",
|
||||
"function_key": "[variables('clientKey')]",
|
||||
"openai_function_name": "[variables('openAIFunctionName')]",
|
||||
"openai_function_key": "[variables('clientKey')]",
|
||||
"deployment_type": "bot"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Web/sites",
|
||||
"name": "[parameters('webUiName')]",
|
||||
"apiVersion": "2020-06-01",
|
||||
"location": "[parameters('location')]",
|
||||
"identity": {
|
||||
"type": "SystemAssigned"
|
||||
},
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"siteConfig": {
|
||||
"linuxFxVersion": "DOCKER|videokm.azurecr.io/csci-ui:latest"
|
||||
},
|
||||
"name": "[parameters('webUiName')]",
|
||||
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Web/sites/config",
|
||||
"apiVersion": "2021-03-01",
|
||||
"name": "[format('{0}/{1}', parameters('webUiName'), 'appsettings')]",
|
||||
"kind": "string",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Web/sites', parameters('webUiName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"SearchServiceName": "[parameters('searchServicesName')]",
|
||||
"SearchApiKey": "[listAdminKeys(concat('Microsoft.Search/searchServices/', parameters('searchServicesName')), '2021-04-01-preview').primaryKey]",
|
||||
"SearchIndexName": "conversational-index",
|
||||
"StorageAccountName": "[parameters('storageAccountName')]",
|
||||
"StorageAccountKey": "[listKeys(resourceId(parameters('resourceGroupName'),'Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-04-01').keys[0].value]",
|
||||
"StorageContainerAddress": "[concat('https://', parameters('storageAccountName') ,'.blob.core.windows.net/video-knowledge-mining')]",
|
||||
"KeyField": "metadata_storage_path",
|
||||
"IsPathBase64Encoded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.ServiceBus/namespaces",
|
||||
"apiVersion": "2018-01-01-preview",
|
||||
"name": "[parameters('ServiceBusName')]",
|
||||
"location": "[resourceGroup().location]",
|
||||
"sku": {
|
||||
"name": "Standard",
|
||||
"tier": "Standard"
|
||||
},
|
||||
"properties": {
|
||||
"zoneRedundant": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.ServiceBus/namespaces/queues",
|
||||
"apiVersion": "2017-04-01",
|
||||
"name": "[concat(parameters('ServiceBusName'), '/openai_queue')]",
|
||||
"location": "[resourceGroup().location]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.ServiceBus/namespaces', parameters('ServiceBusName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"lockDuration": "PT4M",
|
||||
"maxSizeInMegabytes": 5120,
|
||||
"requiresDuplicateDetection": false,
|
||||
"requiresSession": false,
|
||||
"defaultMessageTimeToLive": "P10675199DT2H48M5.4775807S",
|
||||
"deadLetteringOnMessageExpiration": false,
|
||||
"enableBatchedOperations": false,
|
||||
"duplicateDetectionHistoryTimeWindow": "PT10M",
|
||||
"maxDeliveryCount": 1,
|
||||
"status": "Active",
|
||||
"autoDeleteOnIdle": "P10675199DT2H48M5.4775807S",
|
||||
"enablePartitioning": false,
|
||||
"enableExpress": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.ServiceBus/namespaces/queues",
|
||||
"apiVersion": "2017-04-01",
|
||||
"name": "[concat(parameters('ServiceBusName'), '/openai_results_queue')]",
|
||||
"location": "[resourceGroup().location]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.ServiceBus/namespaces', parameters('ServiceBusName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"lockDuration": "PT4M",
|
||||
"maxSizeInMegabytes": 5120,
|
||||
"requiresDuplicateDetection": false,
|
||||
"requiresSession": false,
|
||||
"defaultMessageTimeToLive": "P10675199DT2H48M5.4775807S",
|
||||
"deadLetteringOnMessageExpiration": false,
|
||||
"enableBatchedOperations": false,
|
||||
"duplicateDetectionHistoryTimeWindow": "PT10M",
|
||||
"maxDeliveryCount": 1,
|
||||
"status": "Active",
|
||||
"autoDeleteOnIdle": "P10675199DT2H48M5.4775807S",
|
||||
"enablePartitioning": false,
|
||||
"enableExpress": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Web/sites/host/functionKeys",
|
||||
"apiVersion": "2018-11-01",
|
||||
"name": "[concat(parameters('functionName'), '/default/clientKey')]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Web/sites', parameters('functionName'))]",
|
||||
"WaitFunctionDeploymentSection"
|
||||
],
|
||||
"properties": {
|
||||
"name": "clientKey",
|
||||
"value": "[variables('clientKey')]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Web/sites/host/functionKeys",
|
||||
"apiVersion": "2018-11-01",
|
||||
"name": "[concat(variables('openAIFunctionName'), '/default/clientKey')]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Web/sites', variables('openAIFunctionName'))]",
|
||||
"WaitFunctionDeploymentSection"
|
||||
],
|
||||
"properties": {
|
||||
"name": "clientKey",
|
||||
"value": "[variables('clientKey')]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2018-11-01",
|
||||
"name": "[variables('openAIFunctionName')]",
|
||||
"type": "Microsoft.Web/sites",
|
||||
"kind": "functionapp,linux",
|
||||
"location": "[resourceGroup().location]",
|
||||
"tags": {
|
||||
|
||||
},
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]",
|
||||
"[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]",
|
||||
"[concat('Microsoft.ServiceBus/namespaces/', parameters('serviceBusName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"name": "[variables('openAIFunctionName')]",
|
||||
"siteConfig": {
|
||||
"appSettings": [
|
||||
{
|
||||
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
|
||||
"value": "[reference(resourceId('Microsoft.Insights/components', parameters('applicationInsightsName')), '2015-05-01').InstrumentationKey]"
|
||||
},
|
||||
{
|
||||
"name": "FUNCTIONS_EXTENSION_VERSION",
|
||||
"value": "~4"
|
||||
},
|
||||
{
|
||||
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
|
||||
"value": "false"
|
||||
},
|
||||
{
|
||||
"name": "AzureWebJobsStorage",
|
||||
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',parameters('storageAccountName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2019-06-01').keys[0].value,';EndpointSuffix=','core.windows.net')]"
|
||||
},
|
||||
{
|
||||
"name": "AzureServiceBusConnectionString",
|
||||
"value": "[listKeys(resourceId('Microsoft.ServiceBus/namespaces/AuthorizationRules', parameters('serviceBusName'),'RootManageSharedAccessKey'),'2015-08-01').primaryConnectionString]"
|
||||
},
|
||||
{
|
||||
"name": "OPENAI_API_BASE",
|
||||
"value": "[parameters('OPENAI_API_BASE')]"
|
||||
},
|
||||
{
|
||||
"name": "OPENAI_API_KEY",
|
||||
"value": "[parameters('OPENAI_API_KEY')]"
|
||||
},
|
||||
{
|
||||
"name": "OPENAI_DEPLOYMENT_NAME",
|
||||
"value": "[parameters('OPENAI_DEPLOYMENT_NAME')]"
|
||||
},
|
||||
{
|
||||
"name": "OPENAI_TEMPERATURE",
|
||||
"value": "[parameters('OPENAI_TEMPERATURE')]"
|
||||
},
|
||||
{
|
||||
"name": "OPENAI_MAX_TOKENS",
|
||||
"value": "[parameters('OPENAI_MAX_TOKENS')]"
|
||||
},
|
||||
{
|
||||
"name": "OPENAI_TOP_P",
|
||||
"value": "[parameters('OPENAI_TOP_P')]"
|
||||
},
|
||||
{
|
||||
"name": "OPENAI_FREQUENCY_PENALTY",
|
||||
"value": "[parameters('OPENAI_FREQUENCY_PENALTY')]"
|
||||
},
|
||||
{
|
||||
"name": "OPENAI_PRESENCE_PENALTY",
|
||||
"value": "[parameters('OPENAI_PRESENCE_PENALTY')]"
|
||||
},
|
||||
{
|
||||
"name": "OPENAI_PROMPT",
|
||||
"value": "[parameters('OPENAI_PROMPT')]"
|
||||
},
|
||||
{
|
||||
"name": "OPENAI_PROMPT_KEYS",
|
||||
"value": "[parameters('OPENAI_PROMPT_KEYS')]"
|
||||
},
|
||||
{
|
||||
"name": "AZURE_SEARCH_SERVICE_NAME",
|
||||
"value": "[parameters('searchServicesName')]"
|
||||
},
|
||||
{
|
||||
"name": "AZURE_SEARCH_INDEX_NAME",
|
||||
"value": "conversational-index"
|
||||
},
|
||||
{
|
||||
"name": "AZURE_SEARCH_API_KEY",
|
||||
"value": "[listAdminKeys(concat('Microsoft.Search/searchServices/', parameters('searchServicesName')), '2021-04-01-preview').primaryKey]"
|
||||
},
|
||||
{
|
||||
"name": "AZURE_SEARCH_API_VERSION",
|
||||
"value": "2020-06-30-Preview"
|
||||
}
|
||||
],
|
||||
"cors": {
|
||||
"allowedOrigins": [
|
||||
"https://portal.azure.com"
|
||||
]
|
||||
},
|
||||
"use32BitWorkerProcess": false,
|
||||
"ftpsState": "FtpsOnly",
|
||||
"linuxFxVersion": "DOCKER|fruocco/acs-oai-async:preview",
|
||||
"appCommandLine": "",
|
||||
"alwaysOn": true
|
||||
},
|
||||
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]",
|
||||
"clientAffinityEnabled": false,
|
||||
"virtualNetworkSubnetId": null,
|
||||
"httpsOnly": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Resources/deploymentScripts",
|
||||
"apiVersion": "2020-10-01",
|
||||
"kind": "AzurePowerShell",
|
||||
"name": "WaitFunctionDeploymentSection",
|
||||
"location": "[resourceGroup().location]",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Web/sites', variables('openAIFunctionName'))]"
|
||||
],
|
||||
"properties": {
|
||||
"azPowerShellVersion": "3.0",
|
||||
"scriptContent": "start-sleep -Seconds 300",
|
||||
"cleanupPreference": "Always",
|
||||
"retentionInterval": "PT1H"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Загрузка…
Ссылка в новой задаче