# shellcheck shell=dash disable=SC2034

___x_cmd log init zhipu
xrc:mod:lib     zhipu      cfg chat/_index

___X_CMD_ZHIPU_DEFAULT_ENDPOINT="https://open.bigmodel.cn/api/paas/v4"
___X_CMD_ZHIPU_DEFAULT_FIRST_MODEL="glm-4.5-flash"

___x_cmd_zhipu___main(){
    [ "$#" -gt 0 ] || set -- --help
    local op="$1"; shift
    case "$op" in
        chat)           ___x_cmd_zhipu_chat "$@"         ;;
        init|--init)    ___x_cmd_zhipu_init "$@"         ;;
        --cur|--cfg)    ___x_cmd_zhipu_"${op#--}" "$@"   ;;
        --has-apikey)   ___x_cmd_zhipu_has_apikey "$@"   ;;
        -h|--help)      ___x_cmd help -m zhipu "$@";    return 0     ;;
        *)              ___x_cmd help -m zhipu "$@";    return 64    ;;
    esac
}

