Class RequestExecutor<Request,Response,ResponseContent>
java.lang.Object
dev.langchain4j.model.qianfan.client.RequestExecutor<Request,Response,ResponseContent>
- All Implemented Interfaces:
SyncOrAsync<ResponseContent>
,SyncOrAsyncOrStreaming<ResponseContent>
public class RequestExecutor<Request,Response,ResponseContent>
extends Object
implements SyncOrAsyncOrStreaming<ResponseContent>
-
Constructor Summary
ConstructorDescriptionRequestExecutor
(retrofit2.Call<Response> call, Function<Response, ResponseContent> responseContentExtractor) RequestExecutor
(retrofit2.Call<Response> call, Function<Response, ResponseContent> responseContentExtractor, Supplier<Request> requestWithStreamSupplier, Class<Response> responseClass, Function<Response, ResponseContent> streamEventContentExtractor) RequestExecutor
(retrofit2.Call<Response> call, Function<Response, ResponseContent> responseContentExtractor, okhttp3.OkHttpClient okHttpClient, String endpointUrl, Supplier<Request> requestWithStreamSupplier, Class<Response> responseClass, Function<Response, ResponseContent> streamEventContentExtractor, boolean logStreamingResponses) -
Method Summary
Modifier and TypeMethodDescriptionexecute()
onPartialResponse
(Consumer<ResponseContent> partialResponseHandler) onResponse
(Consumer<ResponseContent> responseHandler)
-
Constructor Details
-
RequestExecutor
public RequestExecutor(retrofit2.Call<Response> call, Function<Response, ResponseContent> responseContentExtractor, okhttp3.OkHttpClient okHttpClient, String endpointUrl, Supplier<Request> requestWithStreamSupplier, Class<Response> responseClass, Function<Response, ResponseContent> streamEventContentExtractor, boolean logStreamingResponses) -
RequestExecutor
-
RequestExecutor
public RequestExecutor(retrofit2.Call<Response> call, Function<Response, ResponseContent> responseContentExtractor)
-
-
Method Details
-
execute
- Specified by:
execute
in interfaceSyncOrAsync<Request>
-
onResponse
- Specified by:
onResponse
in interfaceSyncOrAsync<Request>
-
onPartialResponse
public StreamingResponseHandling onPartialResponse(Consumer<ResponseContent> partialResponseHandler) - Specified by:
onPartialResponse
in interfaceSyncOrAsyncOrStreaming<Request>
-