Skip to content

Commit

Permalink
Update ca_aihub module with new chat_gpt4 and chat_gpt4_vision config…
Browse files Browse the repository at this point in the history
…urations
  • Loading branch information
heblasco committed Mar 6, 2024
1 parent 8c1c0b0 commit 0e49d93
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 27 deletions.
50 changes: 27 additions & 23 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -191,29 +191,33 @@ module "ca_prep_docs" {
}

module "ca_aihub" {
source = "./modules/ca-aihub"
location = azurerm_resource_group.rg.location
resource_group_id = azurerm_resource_group.rg.id
ca_name = local.ca_aihub_name
cae_id = module.cae.cae_id
managed_identity_id = module.mi.mi_id
chat_gpt_deployment = module.openai.gpt_deployment_name
chat_gpt_model = module.openai.gpt_deployment_model_name
embeddings_deployment = module.openai.embedding_deployment_name
embeddings_model = module.openai.embedding_deployment_name
storage_account_name = module.st.storage_account_name
storage_account_key = module.st.key
storage_container_name = module.st.storage_container_name
search_service_name = module.search.search_service_name
search_index_name = module.search.search_index_name
openai_endpoint = var.enable_apim ? module.apim.gateway_url : module.openai.openai_endpoint
chat_fqdn = module.ca_chat.fqdn
pbi_report_link = var.pbi_report_link
content_safety_endpoint = module.cog.content_safety_endpoint
content_safety_key = module.cog.content_safety_key
cognitive_service_endpoint = module.cog.cognitive_service_endpoint
cognitive_service_key = module.cog.cognitive_service_key
speech_key = module.cog.speech_key
source = "./modules/ca-aihub"
location = azurerm_resource_group.rg.location
resource_group_id = azurerm_resource_group.rg.id
ca_name = local.ca_aihub_name
cae_id = module.cae.cae_id
managed_identity_id = module.mi.mi_id
chat_gpt_deployment = module.openai.gpt_deployment_name
chat_gpt_model = module.openai.gpt_deployment_model_name
chat_gpt4_deployment = module.openai.gpt4_deployment_name
chat_gpt4_model = module.openai.gpt4_deployment_model_name
chat_gpt4_vision_deployment = module.openai.gpt4_vision_deployment_name
chat_gpt4_vision_model = module.openai.gpt4_vision_deployment_model_name
embeddings_deployment = module.openai.embedding_deployment_name
embeddings_model = module.openai.embedding_deployment_name
storage_account_name = module.st.storage_account_name
storage_account_key = module.st.key
storage_container_name = module.st.storage_container_name
search_service_name = module.search.search_service_name
search_index_name = module.search.search_index_name
openai_endpoint = var.enable_apim ? module.apim.gateway_url : module.openai.openai_endpoint
chat_fqdn = module.ca_chat.fqdn
pbi_report_link = var.pbi_report_link
content_safety_endpoint = module.cog.content_safety_endpoint
content_safety_key = module.cog.content_safety_key
cognitive_service_endpoint = module.cog.cognitive_service_endpoint
cognitive_service_key = module.cog.cognitive_service_key
speech_key = module.cog.speech_key

storage_connection_string = module.st.connection_string
bing_key = var.bing_key
Expand Down
4 changes: 4 additions & 0 deletions infra/modules/ca-aihub/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ variable "search_service_name" {}
variable "search_index_name" {}
variable "chat_gpt_deployment" {}
variable "chat_gpt_model" {}
variable "chat_gpt4_deployment" {}
variable "chat_gpt4_model" {}
variable "chat_gpt4_vision_deployment" {}
variable "chat_gpt4_vision_model" {}
variable "embeddings_deployment" {}
variable "embeddings_model" {}
variable "openai_endpoint" {}
Expand Down
4 changes: 2 additions & 2 deletions infra/modules/openai/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "azurerm_cognitive_account" "openai" {
custom_subdomain_name = var.azopenai_name
}

resource "azurerm_cognitive_deployment" "gpt-35-turbo" {
resource "azurerm_cognitive_deployment" "gpt_35_turbo" {
name = "DemoBuild"
cognitive_account_id = azurerm_cognitive_account.openai.id
rai_policy_name = "Microsoft.Default"
Expand Down Expand Up @@ -56,7 +56,7 @@ resource "azurerm_cognitive_deployment" "gpt4" {
}
}

resource "azurerm_cognitive_deployment" "gpt4-vision" {
resource "azurerm_cognitive_deployment" "gpt4_vision" {
name = "gpt4-vision"
cognitive_account_id = azurerm_cognitive_account.openai.id
rai_policy_name = "Microsoft.Default"
Expand Down
20 changes: 18 additions & 2 deletions infra/modules/openai/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,27 @@ output "openai_endpoint" {
}

output "gpt_deployment_name" {
value = azurerm_cognitive_deployment.this.name
value = azurerm_cognitive_deployment.gpt_35_turbo.name
}

output "gpt_deployment_model_name" {
value = azurerm_cognitive_deployment.this.model[0].name
value = azurerm_cognitive_deployment.gpt_35_turbo.model[0].name
}

output "gpt4_vision_deployment_name" {
value = azurerm_cognitive_deployment.gpt4_vision.name
}

output "gpt4_vision_deployment_model_name" {
value = azurerm_cognitive_deployment.gpt4_vision.model[0].name
}

output "gpt4_deployment_name" {
value = azurerm_cognitive_deployment.gpt4.name
}

output "gpt4_deployment_model_name" {
value = azurerm_cognitive_deployment.gpt4.model[0].name
}

output "embedding_deployment_name" {
Expand Down

0 comments on commit 0e49d93

Please sign in to comment.