Class OkHttpHttpClient
java.lang.Object
com.alibaba.dashscope.applications.agentstudio.protocol.okhttp.OkHttpHttpClient
- All Implemented Interfaces:
HalfDuplexClient
OkHttp-based half-duplex HTTP client for AgentStudio.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsend(HalfDuplexRequest req) Blocking send http request and get the response body.voidsend(HalfDuplexRequest req, ResultCallback<DashScopeResult> callback)
-
Constructor Details
-
OkHttpHttpClient
public OkHttpHttpClient(okhttp3.OkHttpClient client)
-
-
Method Details
-
send
Description copied from interface:HalfDuplexClientBlocking send http request and get the response body.- Specified by:
sendin interfaceHalfDuplexClient- Parameters:
req- the user input data and parameters.- Returns:
- The the `DashScopeResult`.
- Throws:
NoApiKeyException- Can not find api keyApiException- The request failed, possibly due to a network or data error.
-
send
public void send(HalfDuplexRequest req, ResultCallback<DashScopeResult> callback) throws NoApiKeyException, ApiException - Specified by:
sendin interfaceHalfDuplexClient- Throws:
NoApiKeyExceptionApiException
-