Skip to content

Improve AI provider error messages#149

Open
hawkingrei wants to merge 7 commits intooceanbase:developfrom
hawkingrei:feat-ai-error-message-clean
Open

Improve AI provider error messages#149
hawkingrei wants to merge 7 commits intooceanbase:developfrom
hawkingrei:feat-ai-error-message-clean

Conversation

@hawkingrei
Copy link
Contributor

Summary

  • improve AI provider-not-supported errors with provider value and supported list
  • centralize provider error formatting for ai_complete/ai_embed/ai_rerank

Testing

  • not run (not requested)

Refs #103

LOG_USER_ERROR(OB_NOT_SUPPORTED, "this provider current is");
log_provider_not_supported("ai_complete",
provider,
"openai, aliyun, deepseek, siliconflow, hunyuan, dashscope");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use variables such as ObAIFuncProviderUtils::ALIYUN

Copy link
Member

@LINxiansheng LINxiansheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use variables

@hawkingrei
Copy link
Contributor Author

Aligned with repo style: replaced ObSqlString with databuff_printf + fixed buffer in provider error message helper. This keeps error clarity while reducing deps.

@hawkingrei
Copy link
Contributor Author

Addressed review: extracted supported provider lists into constants (COMPLETE/EMBED/RERANK_SUPPORTED_PROVIDERS) and reused in error helper.

@hawkingrei
Copy link
Contributor Author

Refactored provider checks to reuse helper functions and avoid repeating ob_provider_check chains, per suggestion. Kept behavior same; dashscope still routes to Dashscope impl.

}

static const char *const COMPLETE_SUPPORTED_PROVIDERS =
"openai, aliyun, deepseek, siliconflow, hunyuan, dashscope";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ObAIFuncProviderUtils::OPENAI

@hawkingrei
Copy link
Contributor Author

Updated supported provider list strings to use ObAIFuncProviderUtils names (e.g., OPENAI, ALIYUN-OPENAI, ALIYUN-DASHSCOPE) for clarity and consistency with allowed values.

@hawkingrei
Copy link
Contributor Author

Updated supported provider list to build from ObAIFuncProviderUtils constants (no hand-written strings). Added helper to join list into message with databuff_printf.

@hawkingrei
Copy link
Contributor Author

Fixed CI error: qualified ob_provider_check with ObAIFuncUtils in helper functions. Pushed commit 4255f47.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants