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

  1. List configured suppliers and confirm the exact supplierName spelling
  2. Add/configure the supplier (API key, base URL) in the askai settings
  3. 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

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


AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05). Data as JSON: /api/errors/cbe99f4be13afd07. Report an issue: GitHub.