class Builder<T extends AnthropicClient, B extends Builder<T, B>> {

        public String baseUrl;
        public String apiKey;
        public String version;
        public String beta;
        public Duration timeout;
        public Boolean logRequests;
        public Boolean logResponses;

        public abstract T build();

        public B baseUrl(String baseUrl) {
            if ((baseUrl == null) || baseUrl.trim().isEmpty()) {
                throw new IllegalArgumentException("baseUrl cannot be null or empty");
            }
            this.baseUrl = baseUrl;
            return (B) this;
        }

        public B apiKey(String apiKey) {<FILL_FUNCTION_BODY>}

        public B version(String version) {
            if (version == null) {
                throw new IllegalArgumentException("version cannot be null or empty");
            }
            this.version = version;
            return (B) this;
        }

        public B beta(String beta) {
            if (beta == null) {
                throw new IllegalArgumentException("beta cannot be null or empty");
            }
            this.beta = beta;
            return (B) this;
        }

        public B timeout(Duration timeout) {
            if (timeout == null) {
                throw new IllegalArgumentException("timeout cannot be null");
            }
            this.timeout = timeout;
            return (B) this;
        }

        public B logRequests() {
            return logRequests(true);
        }

        public B logRequests(Boolean logRequests) {
            if (logRequests == null) {
                logRequests = false;
            }
            this.logRequests = logRequests;
            return (B) this;
        }

        public B logResponses() {
            return logResponses(true);
        }

        public B logResponses(Boolean logResponses) {
            if (logResponses == null) {
                logResponses = false;
            }
            this.logResponses = logResponses;
            return (B) this;
        }
    }

            if (apiKey == null || apiKey.trim().isEmpty()) {
                throw new IllegalArgumentException("Anthropic API key must be defined. " +
                        "It can be generated here: https://console.anthropic.com/settings/keys");
            }
            this.apiKey = apiKey;
            return (B) this;
        
<no_super_class>