# shellcheck shell=dash

___x_cmd log init doubao
xrc:mod:lib     doubao   cfg chat/_index model

___X_CMD_DOUBAO_DEFAULT_ENDPOINT="https://ark.cn-beijing.volces.com/api/v3"
___X_CMD_DOUBAO_DEFAULT_FIRST_MODEL="doubao-seed-1-6-251015"

___x_cmd_doubao___main(){
    [ "$#" -gt 0 ] ||   set -- --help

    local op="$1";      shift
    case "$op" in
        chat)           ___x_cmd_doubao_chat              "$@"   ;;
        init|--init)    ___x_cmd_doubao_init              "$@"   ;;
        --cur|--cfg)    ___x_cmd_doubao_"${op#--}"        "$@"   ;;
        --has-apikey)   ___x_cmd_doubao_has_apikey        "$@"   ;;
        model)          ___x_cmd_doubao_model             "$@"   ;;
        -h|--help)      ___x_cmd help -m doubao "$@";     return 0     ;;
        *)              ___x_cmd help -m doubao "$@";     return 64    ;;
    esac
}
