Skip to content

Commit

Permalink
update var name to a better suggestion from CHAT_CONVERSATION_TYPE to…
Browse files Browse the repository at this point in the history
… CONVERSATION_FLOW
  • Loading branch information
gaurarpit committed May 16, 2024
1 parent 629339c commit 5b4221e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ AZURE_AUTH_TYPE=keys
USE_KEY_VAULT=true
AZURE_KEY_VAULT_ENDPOINT=
# Chat conversation type to decide between custom or byod (bring your own data) conversation type
CHAT_CONVERSATION_TYPE=
CONVERSATION_FLOW=
4 changes: 2 additions & 2 deletions code/backend/batch/utilities/helpers/env_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def __load_config(self, **kwargs) -> None:
"ORCHESTRATION_STRATEGY", "openai_function"
)
# Conversation Type - which chooses between custom or byod
self.CHAT_CONVERSATION_TYPE = os.getenv(
"CHAT_CONVERSATION_TYPE", "custom"
self.CONVERSATION_FLOW = os.getenv(
"CONVERSATION_FLOW", "custom"
)
# Speech Service
self.AZURE_SPEECH_SERVICE_NAME = os.getenv("AZURE_SPEECH_SERVICE_NAME", "")
Expand Down
4 changes: 2 additions & 2 deletions code/create_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ async def conversation_custom():

@app.route("/api/conversation", methods=["POST"])
async def conversation():
conversation_type = env_helper.CHAT_CONVERSATION_TYPE
if conversation_type == 'custom':
conversation_flow = env_helper.CONVERSATION_FLOW
if conversation_flow == 'custom':
return conversation_custom()
else:
return conversation_azure_byod()
Expand Down
2 changes: 1 addition & 1 deletion code/tests/functional/app_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class AppConfig:
"LOAD_CONFIG_FROM_BLOB_STORAGE": "True",
"LOGLEVEL": "DEBUG",
"ORCHESTRATION_STRATEGY": "openai_function",
"CHAT_CONVERSATION_TYPE": "custom",
"CONVERSATION_FLOW": "custom",
"AZURE_SPEECH_RECOGNIZER_LANGUAGES": "en-US,es-ES",
"TIKTOKEN_CACHE_DIR": f"{os.path.dirname(os.path.realpath(__file__))}/resources",
"USE_ADVANCED_IMAGE_PROCESSING": "False",
Expand Down
8 changes: 4 additions & 4 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ param orchestrationStrategy string = 'openai_function'
'custom'
'byod'
])
param chatConversationType string = 'custom'
param conversationFlow string = 'custom'

@description('Azure OpenAI Temperature')
param azureOpenAITemperature string = '0'
Expand Down Expand Up @@ -544,7 +544,7 @@ module web './app/web.bicep' = if (hostingModel == 'code') {
AZURE_SPEECH_SERVICE_REGION: location
AZURE_SPEECH_RECOGNIZER_LANGUAGES: recognizedLanguages
ORCHESTRATION_STRATEGY: orchestrationStrategy
CHAT_CONVERSATION_TYPE: chatConversationType
CONVERSATION_FLOW: conversationFlow
LOGLEVEL: logLevel
}
}
Expand Down Expand Up @@ -610,7 +610,7 @@ module web_docker './app/web.bicep' = if (hostingModel == 'container') {
AZURE_SPEECH_SERVICE_REGION: location
AZURE_SPEECH_RECOGNIZER_LANGUAGES: recognizedLanguages
ORCHESTRATION_STRATEGY: orchestrationStrategy
CHAT_CONVERSATION_TYPE: chatConversationType
CONVERSATION_FLOW: conversationFlow
LOGLEVEL: logLevel
}
}
Expand Down Expand Up @@ -1065,4 +1065,4 @@ output ADMIN_WEBSITE_NAME string = hostingModel == 'code'
? adminweb.outputs.WEBSITE_ADMIN_URI
: adminweb_docker.outputs.WEBSITE_ADMIN_URI
output LOGLEVEL string = logLevel
output CHAT_CONVERSATION_TYPE string = chatConversationType
output CONVERSATION_FLOW string = conversationFlow
2 changes: 1 addition & 1 deletion infra/main.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ param azureSearchUseSemanticSearch = readEnvironmentVariable('AZURE_SEARCH_USE_S
param orchestrationStrategy = readEnvironmentVariable('ORCHESTRATION_STRATEGY', 'openai_function')
param logLevel = readEnvironmentVariable('LOGLEVEL', 'INFO')
param recognizedLanguages = readEnvironmentVariable('AZURE_SPEECH_RECOGNIZER_LANGUAGES', 'en-US,fr-FR,de-DE,it-IT')
param chatConversationType = readEnvironmentVariable('CHAT_CONVERSATION_TYPE', 'custom')
param conversationFlow = readEnvironmentVariable('CONVERSATION_FLOW', 'custom')

// OpenAI parameters
param azureOpenAIApiVersion = readEnvironmentVariable('AZURE_OPENAI_API_VERSION', '2024-02-01')
Expand Down
12 changes: 6 additions & 6 deletions infra/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.27.1.19265",
"templateHash": "5791753286587875393"
"templateHash": "13931349907077082505"
}
},
"parameters": {
Expand Down Expand Up @@ -262,7 +262,7 @@
"description": "Orchestration strategy: openai_function or semantic_kernel or langchain str. If you use a old version of turbo (0301), please select langchain"
}
},
"chatConversationType": {
"conversationFlow": {
"type": "string",
"defaultValue": "custom",
"allowedValues": [
Expand Down Expand Up @@ -2017,7 +2017,7 @@
"AZURE_SPEECH_SERVICE_REGION": "[parameters('location')]",
"AZURE_SPEECH_RECOGNIZER_LANGUAGES": "[parameters('recognizedLanguages')]",
"ORCHESTRATION_STRATEGY": "[parameters('orchestrationStrategy')]",
"CHAT_CONVERSATION_TYPE": "[parameters('chatConversationType')]",
"CONVERSATION_FLOW": "[parameters('conversationFlow')]",
"LOGLEVEL": "[parameters('logLevel')]"
}
}
Expand Down Expand Up @@ -2954,7 +2954,7 @@
"AZURE_SPEECH_SERVICE_REGION": "[parameters('location')]",
"AZURE_SPEECH_RECOGNIZER_LANGUAGES": "[parameters('recognizedLanguages')]",
"ORCHESTRATION_STRATEGY": "[parameters('orchestrationStrategy')]",
"CHAT_CONVERSATION_TYPE": "[parameters('chatConversationType')]",
"CONVERSATION_FLOW": "[parameters('conversationFlow')]",
"LOGLEVEL": "[parameters('logLevel')]"
}
}
Expand Down Expand Up @@ -11025,9 +11025,9 @@
"type": "string",
"value": "[parameters('logLevel')]"
},
"CHAT_CONVERSATION_TYPE": {
"CONVERSATION_FLOW": {
"type": "string",
"value": "[parameters('chatConversationType')]"
"value": "[parameters('conversationFlow')]"
}
}
}

0 comments on commit 5b4221e

Please sign in to comment.