iflytek/astron-agent · error · BusinessException

PERSONALITY_AI_GENERATE_ERROR

PERSONALITY_AI_GENERATE_ERROR

Error message

ResponseEnum.PERSONALITY_AI_GENERATE_ERROR

What it means

PERSONALITY_AI_GENERATE_ERROR is thrown from aiGeneratedPersonality when the downstream LLM call (openAiModelProcessService.processNonStreaming) raises any exception. It wraps model-call failures — network problems, auth errors, timeouts — behind a single business error.

Solutions

  1. Check hub logs for the 'aiGeneratedPersonality error' entry with the full stack trace to see the underlying cause.
  2. Verify the OpenAI/model process service credentials and endpoint configuration.
  3. Confirm the i18n key 'personality.ai.generated' exists for the active locale.
  4. Retry after confirming the model service is healthy; if the provider is down, wait for recovery.
Defensive patterns

Strategy: try-catch

Validate before calling

// verify model service reachability/credentials before calling
Objects.requireNonNull(openAiModelProcessService, "model process service not configured");

Try / catch

try {
    String answer = openAiModelProcessService.processNonStreaming(prompt);
} catch (BusinessException e) {
    throw e;
} catch (Exception e) {
    log.error("personality AI generation failed", e);
    throw new BusinessException(ResponseEnum.PERSONALITY_AI_GENERATE_ERROR, e.getMessage());
}

Prevention

When it happens

Trigger: openAiModelProcessService.processNonStreaming(format) throws: model service unreachable, invalid/expired API credentials, request timeout, or the i18n message 'personality.ai.generated' missing causing template formatting failure.

Common situations: Model API key not configured or rotated; LLM provider outage; network egress blocked from the hub service; missing i18n resource bundle key in a locale.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/46d197f36f7366ce. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/bot/impl/PersonalityConfigServiceImpl.java:55

    private final PersonalityCategoryMapper personalityCategoryMapper;

    private final PersonalityRoleMapper personalityRoleMapper;

    private final OpenAiModelProcessService openAiModelProcessService;

    @Override
    public String aiGeneratedPersonality(String botName, String category, String info, String prompt) {
        if (StringUtils.isBlank(botName) || StringUtils.isBlank(category) || StringUtils.isBlank(info)
                || StringUtils.isBlank(prompt)) {
            throw new BusinessException(ResponseEnum.PERSONALITY_AI_GENERATE_PARAM_EMPTY);
        }
        String answer;
        try {
            String format = smartFormat(I18nUtil.getMessage("personality.ai.generated"), botName, category, info, prompt);
            answer = openAiModelProcessService.processNonStreaming(format);
        } catch (Exception e) {
            log.error("aiGeneratedPersonality error, botName: {}, category: {}, info: {}, prompt: {}", botName, category, info, prompt, e);
            throw new BusinessException(ResponseEnum.PERSONALITY_AI_GENERATE_ERROR);
        }
        if (StringUtils.isBlank(answer)) {
            throw new BusinessException(ResponseEnum.PERSONALITY_AI_GENERATE_ERROR);
        }
        return answer;
    }

    @Override
    public String aiPolishing(String botName, String category, String info, String prompt, String personality) {
        if (StringUtils.isBlank(botName) || StringUtils.isBlank(category) || StringUtils.isBlank(info)
                || StringUtils.isBlank(prompt)) {
            throw new BusinessException(ResponseEnum.PERSONALITY_AI_GENERATE_PARAM_EMPTY);
        }
        String answer;
        try {
            String format = smartFormat(I18nUtil.getMessage("personality.ai.polishing"), botName, category, info, prompt, personality);
            answer = openAiModelProcessService.processNonStreaming(format);
        } catch (Exception e) {

View on GitHub (pinned to 5e758547a8)