This commit is contained in:
Johnny Lim
2024-08-15 23:27:12 +09:00
committed by GitHub
parent a051978600
commit 2d6117b796
8 changed files with 16 additions and 16 deletions

View File

@@ -882,7 +882,7 @@ public class AnthropicApi {
public ResponseEntity<ChatCompletionResponse> chatCompletionEntity(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(!chatRequest.stream(), "Request must set the steam property to false.");
Assert.isTrue(!chatRequest.stream(), "Request must set the stream property to false.");
return this.restClient.post()
.uri("/v1/messages")
@@ -902,7 +902,7 @@ public class AnthropicApi {
public Flux<ChatCompletionResponse> chatCompletionStream(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(chatRequest.stream(), "Request must set the steam property to true.");
Assert.isTrue(chatRequest.stream(), "Request must set the stream property to true.");
AtomicBoolean isInsideTool = new AtomicBoolean(false);

View File

@@ -678,7 +678,7 @@ public class MiniMaxApi {
public ResponseEntity<ChatCompletion> chatCompletionEntity(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(!chatRequest.stream(), "Request must set the steam property to false.");
Assert.isTrue(!chatRequest.stream(), "Request must set the stream property to false.");
return this.restClient.post()
.uri("/v1/text/chatcompletion_v2")
@@ -698,7 +698,7 @@ public class MiniMaxApi {
public Flux<ChatCompletionChunk> chatCompletionStream(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(chatRequest.stream(), "Request must set the steam property to true.");
Assert.isTrue(chatRequest.stream(), "Request must set the stream property to true.");
AtomicBoolean isInsideTool = new AtomicBoolean(false);

View File

@@ -765,7 +765,7 @@ public class MistralAiApi {
public ResponseEntity<ChatCompletion> chatCompletionEntity(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(!chatRequest.stream(), "Request must set the steam property to false.");
Assert.isTrue(!chatRequest.stream(), "Request must set the stream property to false.");
return this.restClient.post()
.uri("/v1/chat/completions")
@@ -785,7 +785,7 @@ public class MistralAiApi {
public Flux<ChatCompletionChunk> chatCompletionStream(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(chatRequest.stream(), "Request must set the steam property to true.");
Assert.isTrue(chatRequest.stream(), "Request must set the stream property to true.");
AtomicBoolean isInsideTool = new AtomicBoolean(false);

View File

@@ -572,7 +572,7 @@ public class MoonshotApi {
public ResponseEntity<ChatCompletion> chatCompletionEntity(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(!chatRequest.stream(), "Request must set the steam property to false.");
Assert.isTrue(!chatRequest.stream(), "Request must set the stream property to false.");
return this.restClient.post()
.uri("/v1/chat/completions")
@@ -589,7 +589,7 @@ public class MoonshotApi {
*/
public Flux<ChatCompletionChunk> chatCompletionStream(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(chatRequest.stream(), "Request must set the steam property to true.");
Assert.isTrue(chatRequest.stream(), "Request must set the stream property to true.");
return this.webClient.post()
.uri("/v1/chat/completions")

View File

@@ -336,7 +336,7 @@ public class OllamaApi {
@Deprecated(since = "1.0.0-M2", forRemoval = true)
public Flux<GenerateResponse> generateStreaming(GenerateRequest completionRequest) {
Assert.notNull(completionRequest, REQUEST_BODY_NULL_ERROR);
Assert.isTrue(completionRequest.stream(), "Request must set the steam property to true.");
Assert.isTrue(completionRequest.stream(), "Request must set the stream property to true.");
return webClient.post()
.uri("/api/generate")
@@ -669,7 +669,7 @@ public class OllamaApi {
*/
public Flux<ChatResponse> streamingChat(ChatRequest chatRequest) {
Assert.notNull(chatRequest, REQUEST_BODY_NULL_ERROR);
Assert.isTrue(chatRequest.stream(), "Request must set the steam property to true.");
Assert.isTrue(chatRequest.stream(), "Request must set the stream property to true.");
return webClient.post()
.uri("/api/chat")

View File

@@ -974,7 +974,7 @@ public class OpenAiApi {
MultiValueMap<String, String> additionalHttpHeader) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(!chatRequest.stream(), "Request must set the steam property to false.");
Assert.isTrue(!chatRequest.stream(), "Request must set the stream property to false.");
Assert.notNull(additionalHttpHeader, "The additional HTTP headers can not be null.");
return this.restClient.post()
@@ -1009,7 +1009,7 @@ public class OpenAiApi {
MultiValueMap<String, String> additionalHttpHeader) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(chatRequest.stream(), "Request must set the steam property to true.");
Assert.isTrue(chatRequest.stream(), "Request must set the stream property to true.");
AtomicBoolean isInsideTool = new AtomicBoolean(false);

View File

@@ -353,7 +353,7 @@ public class QianFanApi extends AuthApi {
public ResponseEntity<ChatCompletion> chatCompletionEntity(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(!chatRequest.stream(), "Request must set the steam property to false.");
Assert.isTrue(!chatRequest.stream(), "Request must set the stream property to false.");
return this.restClient.post()
.uri("/v1/wenxinworkshop/chat/{model}?access_token={token}",chatRequest.model, getAccessToken())
@@ -370,7 +370,7 @@ public class QianFanApi extends AuthApi {
*/
public Flux<ChatCompletionChunk> chatCompletionStream(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(chatRequest.stream(), "Request must set the steam property to true.");
Assert.isTrue(chatRequest.stream(), "Request must set the stream property to true.");
return this.webClient.post()
.uri("/v1/wenxinworkshop/chat/{model}?access_token={token}",chatRequest.model, getAccessToken())

View File

@@ -652,7 +652,7 @@ public class ZhiPuAiApi {
public ResponseEntity<ChatCompletion> chatCompletionEntity(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(!chatRequest.stream(), "Request must set the steam property to false.");
Assert.isTrue(!chatRequest.stream(), "Request must set the stream property to false.");
return this.restClient.post()
.uri("/v4/chat/completions")
@@ -672,7 +672,7 @@ public class ZhiPuAiApi {
public Flux<ChatCompletionChunk> chatCompletionStream(ChatCompletionRequest chatRequest) {
Assert.notNull(chatRequest, "The request body can not be null.");
Assert.isTrue(chatRequest.stream(), "Request must set the steam property to true.");
Assert.isTrue(chatRequest.stream(), "Request must set the stream property to true.");
AtomicBoolean isInsideTool = new AtomicBoolean(false);