mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 15:44:02 +00:00
feat(bot): add conversational DM assistant flow
This commit is contained in:
@@ -13,6 +13,10 @@ function parsePendingActionType(raw: string): TelegramPendingActionType {
|
||||
return raw
|
||||
}
|
||||
|
||||
if (raw === 'assistant_payment_confirmation') {
|
||||
return raw
|
||||
}
|
||||
|
||||
throw new Error(`Unexpected telegram pending action type: ${raw}`)
|
||||
}
|
||||
|
||||
|
||||
@@ -36,3 +36,7 @@ export {
|
||||
type PaymentConfirmationService,
|
||||
type PaymentConfirmationSubmitResult
|
||||
} from './payment-confirmation-service'
|
||||
export {
|
||||
parsePaymentConfirmationMessage,
|
||||
type ParsedPaymentConfirmation
|
||||
} from './payment-confirmation-parser'
|
||||
|
||||
@@ -33,6 +33,13 @@ const server = {
|
||||
OPENAI_API_KEY: z.string().min(1).optional(),
|
||||
PARSER_MODEL: z.string().min(1).default('gpt-4.1-mini'),
|
||||
PURCHASE_PARSER_MODEL: z.string().min(1).default('gpt-5-mini'),
|
||||
ASSISTANT_MODEL: z.string().min(1).default('gpt-5-mini'),
|
||||
ASSISTANT_TIMEOUT_MS: z.coerce.number().int().positive().default(15000),
|
||||
ASSISTANT_MEMORY_MAX_TURNS: z.coerce.number().int().positive().default(12),
|
||||
ASSISTANT_RATE_LIMIT_BURST: z.coerce.number().int().positive().default(5),
|
||||
ASSISTANT_RATE_LIMIT_BURST_WINDOW_MS: z.coerce.number().int().positive().default(60000),
|
||||
ASSISTANT_RATE_LIMIT_ROLLING: z.coerce.number().int().positive().default(50),
|
||||
ASSISTANT_RATE_LIMIT_ROLLING_WINDOW_MS: z.coerce.number().int().positive().default(86400000),
|
||||
SCHEDULER_SHARED_SECRET: z.string().min(1).optional()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import type { Instant } from '@household/domain'
|
||||
|
||||
export const TELEGRAM_PENDING_ACTION_TYPES = ['anonymous_feedback'] as const
|
||||
export const TELEGRAM_PENDING_ACTION_TYPES = [
|
||||
'anonymous_feedback',
|
||||
'assistant_payment_confirmation'
|
||||
] as const
|
||||
|
||||
export type TelegramPendingActionType = (typeof TELEGRAM_PENDING_ACTION_TYPES)[number]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user