actor
This commit is contained in:
@@ -15,7 +15,7 @@ class ChatConnectorTest {
|
||||
|
||||
@Bean
|
||||
ChatClient client(OpenAiChatConnector openAiChatConnector) {
|
||||
return ChatClient.builder(openAiChatConnector).defaultSystemPrompt("""
|
||||
return ChatClient.builder(openAiChatConnector).defaultSystem("""
|
||||
you are customer service agent designed to answer questions
|
||||
about a the user, {userName}'s, orders. Here are their outstanding orders.
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ public class ChatClient {
|
||||
this.defaultFunctions, this.defaultMedia);
|
||||
}
|
||||
|
||||
public ChatClientBuilder defaultSystemPrompt(String systemPrompt) {
|
||||
public ChatClientBuilder defaultSystem(String systemPrompt) {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
package org.springframework.ai.chat;
|
||||
|
||||
|
||||
import org.springframework.ai.chat.connector.ChatConnector;
|
||||
import org.springframework.ai.chat.messages.Media;
|
||||
import org.springframework.ai.chat.prompt.Prompt;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class DefaultChatClient implements ChatClient {
|
||||
|
||||
private final ChatConnector connector;
|
||||
|
||||
private final String userPrompt, systemPrompt;
|
||||
|
||||
private final List<String> functions;
|
||||
|
||||
private final List<Media> media;
|
||||
|
||||
public DefaultChatClient(ChatConnector connector, String defaultSystemPrompt, String defaultUserPrompt,
|
||||
List<String> defaultFunctions, List<Media> defaultMedia) {
|
||||
this.connector = connector;
|
||||
this.userPrompt = defaultUserPrompt;
|
||||
this.systemPrompt = defaultSystemPrompt;
|
||||
this.functions = defaultFunctions;
|
||||
this.media = defaultMedia;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatClientRequest build() {
|
||||
return new ChatClientRequest(this.userPrompt, this.systemPrompt, this.functions, this.media);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatResponse call(Prompt prompt) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatResponseSpec chat() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public ChatClientRequest user(Consumer<UserSpec> consumer) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ChatClientBuilder builder(ChatConnector connector) {
|
||||
return new ChatClientBuilder(connector);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user