Class DecisionModel
java.lang.Object
com.alibaba.dashscope.legacy_2x.decision.DecisionModel
Deprecated.
Unofficial Java binding for the Bailian Decision Model API ("TypeSafe System One").
The upstream doc currently ships only cURL and Python (typesafe-sdk) examples; the
Java surface here may evolve as the official spec matures.
Document: https://docs.bailian.console.aliyun.com/zh/model-studio/decision-model-api
The endpoint is workspace-scoped:
https://{WorkspaceId}.{region}.maas.aliyuncs.com/compatible-mode/v1/systemone. A workspace id
must be supplied either via the constructor or the "DASHSCOPE_WORKSPACE" environment variable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDeprecated.Documented Bailian regions that host the decision model gateway. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Hostname template for the workspace-scoped decision model gateway.static final StringDeprecated.Region used when neither the constructor nor "DASHSCOPE_API_REGION" provides one.static final StringDeprecated.Dedicated environment variable that fully overrides the base URL.static final StringDeprecated.Environment variable holding the region.static final StringDeprecated.Environment variable holding the Bailian workspace id. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Resolve workspace and region from the environment.DecisionModel(String workspace) Deprecated.Use the given workspace with the region resolved from the environment.DecisionModel(String workspace, String region) Deprecated.Use the given workspace and region.DecisionModel(String workspace, String region, ConnectionOptions connectionOptions) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptioncall(DecisionModelParam param) Deprecated.Call the server to get the whole result.voidcall(DecisionModelParam param, ResultCallback<DecisionModelResult> callback) Deprecated.Call the server and deliver the result throughcallback.static StringresolveBaseUrl(String workspace, String region) Deprecated.Compose the workspace-scoped base URL.static DecisionModelwithBaseUrl(String baseUrl) Deprecated.Build a client that targets an explicit base URL, bypassing workspace/region resolution.static DecisionModelwithBaseUrl(String baseUrl, ConnectionOptions connectionOptions) Deprecated.
-
Field Details
-
BASE_URL_TEMPLATE
Deprecated.Hostname template for the workspace-scoped decision model gateway.- See Also:
-
DEFAULT_REGION
Deprecated.Region used when neither the constructor nor "DASHSCOPE_API_REGION" provides one.- See Also:
-
ENV_WORKSPACE
Deprecated.Environment variable holding the Bailian workspace id.- See Also:
-
ENV_REGION
Deprecated.Environment variable holding the region.- See Also:
-
ENV_BASE_URL
Deprecated.Dedicated environment variable that fully overrides the base URL. Do not reuseConstants.DASHSCOPE_HTTP_BASE_URL_ENVhere — that variable is bound to thedashscope.aliyuncs.com/api/v1shape used by the rest of the SDK.- See Also:
-
-
Constructor Details
-
DecisionModel
public DecisionModel()Deprecated.Resolve workspace and region from the environment. -
DecisionModel
Deprecated.Use the given workspace with the region resolved from the environment. -
DecisionModel
Deprecated.Use the given workspace and region. -
DecisionModel
Deprecated.
-
-
Method Details
-
resolveBaseUrl
Deprecated.Compose the workspace-scoped base URL. HonorsENV_BASE_URLfirst; otherwise both arguments may be null/empty, in which case the corresponding environment variable (and finallyDEFAULT_REGION) is consulted.- Throws:
IllegalArgumentException- if neither a workspace id nor an explicit base URL override can be resolved.
-
withBaseUrl
Deprecated.Build a client that targets an explicit base URL, bypassing workspace/region resolution. Intended for tests, self-hosted gateways, and the Token Plan endpoint (https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1). -
withBaseUrl
Deprecated. -
call
public DecisionModelResult call(DecisionModelParam param) throws ApiException, NoApiKeyException, InputRequiredException Deprecated.Call the server to get the whole result. The decision model does not stream — this is a single request/response round trip.- Parameters:
param- The input param of class `DecisionModelParam`.- Returns:
- The output structure of `DecisionModelResult`.
- Throws:
NoApiKeyException- Can not find api keyApiException- The request failed, possibly due to a network or data error.InputRequiredException- Missing required input fields.
-
call
public void call(DecisionModelParam param, ResultCallback<DecisionModelResult> callback) throws ApiException, NoApiKeyException, InputRequiredException Deprecated.Call the server and deliver the result throughcallback. The decision model returns a single response body, so the callback receives exactly oneResultCallback.onEvent(Object)beforeResultCallback.onComplete().- Parameters:
param- The input param of class `DecisionModelParam`.callback- The callback to receive the result of `DecisionModelResult`.- Throws:
NoApiKeyException- Can not find api keyApiException- The request failed, possibly due to a network or data error.InputRequiredException- Missing required input fields.
-