feat(bot): add shared topic router

This commit is contained in:
2026-03-12 17:12:26 +04:00
parent 014d791bdc
commit 8374d18189
18 changed files with 1692 additions and 292 deletions

View File

@@ -72,9 +72,9 @@ Recommended approach:
- Use `terraform.tfvars` per environment (`dev.tfvars`, `prod.tfvars`)
- Keep `project_id` separate for dev/prod when possible
- Keep non-secret bot config in `*.tfvars`:
- optional `bot_parser_model`
- optional `bot_purchase_parser_model`
- optional `bot_assistant_model`
- optional `bot_assistant_router_model`
- optional assistant runtime knobs:
`bot_assistant_timeout_ms`,
`bot_assistant_memory_max_turns`,

View File

@@ -90,15 +90,15 @@ module "bot_api_service" {
{
NODE_ENV = var.environment
},
var.bot_parser_model == null ? {} : {
PARSER_MODEL = var.bot_parser_model
},
var.bot_purchase_parser_model == null ? {} : {
PURCHASE_PARSER_MODEL = var.bot_purchase_parser_model
},
var.bot_assistant_model == null ? {} : {
ASSISTANT_MODEL = var.bot_assistant_model
},
var.bot_assistant_router_model == null ? {} : {
ASSISTANT_ROUTER_MODEL = var.bot_assistant_router_model
},
var.bot_assistant_timeout_ms == null ? {} : {
ASSISTANT_TIMEOUT_MS = tostring(var.bot_assistant_timeout_ms)
},

View File

@@ -11,9 +11,9 @@ mini_app_image = "europe-west1-docker.pkg.dev/my-gcp-project/household-bot/mini
database_url_secret_id = "database-url"
telegram_bot_token_secret_id = "telegram-bot-token"
openai_api_key_secret_id = "openai-api-key"
bot_parser_model = "gpt-4o-mini"
bot_purchase_parser_model = "gpt-4o-mini"
bot_assistant_model = "gpt-4o-mini"
bot_assistant_router_model = "gpt-5-nano"
bot_assistant_timeout_ms = 20000
bot_assistant_memory_max_turns = 12
bot_assistant_rate_limit_burst = 5

View File

@@ -69,13 +69,6 @@ variable "telegram_bot_token_secret_id" {
default = "telegram-bot-token"
}
variable "bot_parser_model" {
description = "Optional PARSER_MODEL override for bot runtime"
type = string
default = null
nullable = true
}
variable "bot_purchase_parser_model" {
description = "Optional PURCHASE_PARSER_MODEL override for bot runtime"
type = string
@@ -90,6 +83,13 @@ variable "bot_assistant_model" {
nullable = true
}
variable "bot_assistant_router_model" {
description = "Optional ASSISTANT_ROUTER_MODEL override for bot runtime"
type = string
default = null
nullable = true
}
variable "bot_assistant_timeout_ms" {
description = "Optional ASSISTANT_TIMEOUT_MS override for bot runtime"
type = number