Billionmail/BillionMail · error
Supplier not found
Error message
Supplier not found
What it means
Chat looks up the named AI supplier configuration via GetSupplierConfig and returns this error when the lookup fails. It means no supplier with that name is registered/configured, so no API key or base URL is available to build the client.
Source
Thrown at core/internal/service/askai/chat.go:251
// This function should handle the logic for loading the chat information and return the ChatInfo struct and any error encountered
func GetChatInfo(chatId string) (*ChatInfo, error) {
chatInfo, err := GetChat(chatId)
if err != nil {
return nil, err
}
chatInfo.Messages = GetMessages(chatId)
return chatInfo, nil
}
func Chat(ctx context.Context, chatId string, supplierName string, modelId string, content string, isText bool) error {
content = strings.TrimSpace(content)
if content == "" {
return errors.New("Content cannot be empty")
}
supplierInfo, err := GetSupplierConfig(supplierName)
if err != nil {
return errors.New("Supplier not found")
}
modelInfo := GetModelInfo(supplierName, modelId)
if modelInfo == nil {
return errors.New("Model not found")
}
// Check if the chat is already active
chatInfo, err := GetChat(chatId)
if err != nil {
return errors.New("Chat not found")
}
// set the chat information
chatInfo.SupplierName = supplierName
chatInfo.ModelId = modelId
err = SaveChat(chatId, chatInfo)
if err != nil {
return errors.New("Failed to save chat")View on GitHub (pinned to fc36c76c05)
Solutions
- List configured suppliers and confirm the exact supplierName spelling
- Add/configure the supplier (API key, base URL) in the askai settings
- Update saved chats/records that reference a renamed or removed supplier
Example fix
// before err := askai.Chat(ctx, chatId, "openAi", modelId, content, true) // after suppliers, _ := askai.GetSupplierList() // verify exact name first err := askai.Chat(ctx, chatId, "openai", modelId, content, true)
Defensive patterns
Strategy: validation
Validate before calling
if _, err := askai.GetSupplierConfig(supplierName); err != nil {
return fmt.Errorf("supplier %q is not configured", supplierName)
} Prevention
- Store supplier names from a fetched list rather than hardcoding strings
- Seed supplier config in deployment automation
- Validate supplier name against config on chat creation, not just at send time
When it happens
Trigger: Calling Chat with supplierName that is not among configured suppliers (typo, supplier not added in settings, config not loaded, case mismatch).
Common situations: Renaming or deleting a supplier in admin settings while saved chats still reference the old name; spelling mismatch like "openai" vs "OpenAI"; fresh deployment where supplier credentials were never configured.
Related errors
- Model not found
- failed to initialize AI client
- supplier configuration not found
- Failed to get configuration
- configuration file does not exist: %s
AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05).
Data as JSON: /api/errors/cbe99f4be13afd07.
Report an issue: GitHub.