public String eval(String url, String input, String model) {
        // url and input is not null
        if (Strings.isNullOrEmpty(url) || Strings.isNullOrEmpty(input)) {
            logger.error("Failed to embedding, both url and input can't be empty or null, url: {}, input: {}",
                    url, input);
            return null;
        }

        if (Strings.isNullOrEmpty(model)) {
            model = DEFAULT_MODEL;
            logger.info("model is null, use default model: {}", model);
        }

        if (!LanguageModel.isLanguageModelSupported(model)) {
            logger.error("Failed to embedding, language model {} not supported(only {} are supported right now)",
                    model, LanguageModel.getAllSupportedLanguageModels());
            return null;
        }

        // initialize httpClient
        if (httpClient == null) {
            RequestConfig requestConfig = RequestConfig.custom()
                    .setConnectTimeout(DEFAULT_CONNECT_TIMEOUT)
                    .setSocketTimeout(DEFAULT_SOCKET_TIMEOUT)
                    .build();
            httpClient = HttpClientBuilder.create().setDefaultRequestConfig(requestConfig).build();
        }

        try {
            HttpPost httpPost = new HttpPost(url);
            httpPost.setHeader(HttpHeaders.CONTENT_TYPE, "application/json");
            EmbeddingInput embeddingInput = new EmbeddingInput(input, model);
            String encodedContents = mapper.writeValueAsString(embeddingInput);
            httpPost.setEntity(new StringEntity(encodedContents));
            HttpResponse response = httpClient.execute(httpPost);

            String returnStr = EntityUtils.toString(response.getEntity());
            int returnCode = response.getStatusLine().getStatusCode();
            if (Strings.isNullOrEmpty(returnStr) || HttpStatus.SC_OK != returnCode) {
                throw new Exception("Failed to embedding, result: " + returnStr + ", code: " + returnCode);
            }
            return returnStr;
        } catch (Exception e) {
            logger.error("Failed to embedding, url: {}, input: {}", url, input, e);
            return null;
        }
    }
Embedding a LLM document(a String object for now) via http protocol
@param url the service url for embedding service
@param input the source data for embedding
@param model the language model supported in the embedding service
inlong-sort/sort-core/src/main/java/org/apache/inlong/sort/function/EmbeddingFunction.java