File tree Expand file tree Collapse file tree 5 files changed +32
-13
lines changed Expand file tree Collapse file tree 5 files changed +32
-13
lines changed Original file line number Diff line number Diff line change 27
27
OPENAI_API_TYPE=azuread
28
28
OPENAI_API_VERSION=2023-05-15
29
29
OPENAI_API_BASE=${endpoint}
30
+ CHAT_MODEL_NAME=${chat_model_name}
30
31
---
31
32
apiVersion: v1
32
33
kind: Pod
Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ module "openai" {
17
17
}
18
18
deployment = {
19
19
" chat_model" = {
20
- name = " gpt-35-turbo "
20
+ name = var.chat_model_name
21
21
model_format = " OpenAI"
22
- model_name = " gpt-35-turbo "
23
- model_version = " 0301 "
24
- scale_type = " Standard "
25
- capacity = 120
22
+ model_name = var.chat_model_name
23
+ model_version = var.chat_model_version
24
+ scale_type = var.scale_type
25
+ capacity = 30
26
26
},
27
27
" embedding_model" = {
28
28
name = " text-embedding-ada-002"
Original file line number Diff line number Diff line change 1
1
output "installation-script" {
2
2
value = templatefile (" installation_script.tftpl" ,
3
- { resourceGroup = azurerm_resource_group.this.name,
4
- aksName = module.aks.aks_name,
5
- registry = azurerm_container_registry.acr.name,
6
- endpoint = module.openai.openai_endpoint,
7
- clientid = azurerm_user_assigned_identity.chatbot.client_id,
8
- oidc_url = module.aks.oidc_issuer_url,
3
+ { resourceGroup = azurerm_resource_group.this.name,
4
+ aksName = module.aks.aks_name,
5
+ registry = azurerm_container_registry.acr.name,
6
+ endpoint = module.openai.openai_endpoint,
7
+ clientid = azurerm_user_assigned_identity.chatbot.client_id,
8
+ oidc_url = module.aks.oidc_issuer_url,
9
+ chat_model_name = var.chat_model_name
9
10
}
10
11
)
11
12
}
Original file line number Diff line number Diff line change 1
1
variable "region" {
2
2
type = string
3
3
default = " eastus"
4
- }
4
+ }
5
+
6
+ variable "chat_model_name" {
7
+ type = string
8
+ default = " gpt-4o"
9
+ }
10
+
11
+ variable "chat_model_version" {
12
+ type = string
13
+ default = " 2024-08-06"
14
+ }
15
+
16
+ variable "scale_type" {
17
+ type = string
18
+ description = " values: GlobalStandard, Standard"
19
+ default = " GlobalStandard"
20
+ }
Original file line number Diff line number Diff line change 8
8
OPENAI_API_VERSION = 2023-05-15
9
9
OPENAI_API_BASE = 'https://eastus.api.cognitive.microsoft.com/' # Replace with the URL of an Azure OpenAI
10
10
OPENAI_API_KEY = '' # Replace with the corresponding API key
11
+ CHAT_MODEL_NAME = gpt-4o
11
12
12
13
To run the application, use the following command:
13
14
streamlit run chatbot.py
@@ -81,7 +82,7 @@ def send_click():
81
82
Settings .context_window = 4096
82
83
# Create the chat llm
83
84
Settings .llm = AzureChatOpenAI (
84
- deployment_name = "gpt-35-turbo" ,
85
+ deployment_name = st . session_state . config [ "CHAT_MODEL_NAME" ] ,
85
86
openai_api_key = st .session_state .config ["OPENAI_API_KEY" ],
86
87
openai_api_base = st .session_state .config ["OPENAI_API_BASE" ],
87
88
openai_api_type = st .session_state .config ["OPENAI_API_TYPE" ],
You can’t perform that action at this time.
0 commit comments