Add deprecated tools(String...) method for backwards compat on ChatClient
This commit is contained in:
@@ -222,6 +222,12 @@ public interface ChatClient {
|
||||
|
||||
ChatClientRequestSpec toolNames(String... toolNames);
|
||||
|
||||
/**
|
||||
* Use toolNames instead
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.0.0-m8")
|
||||
ChatClientRequestSpec tools(String... toolNames);
|
||||
|
||||
ChatClientRequestSpec tools(Object... toolObjects);
|
||||
|
||||
ChatClientRequestSpec toolCallbacks(ToolCallback... toolCallbacks);
|
||||
@@ -289,6 +295,9 @@ public interface ChatClient {
|
||||
|
||||
Builder defaultToolNames(String... toolNames);
|
||||
|
||||
@Deprecated
|
||||
Builder defaultTools(String... tools);
|
||||
|
||||
Builder defaultTools(Object... toolObjects);
|
||||
|
||||
Builder defaultToolCallbacks(ToolCallback... toolCallbacks);
|
||||
|
||||
@@ -833,6 +833,11 @@ public class DefaultChatClient implements ChatClient {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatClientRequestSpec tools(String... toolNames) {
|
||||
return this.toolNames(toolNames);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChatClientRequestSpec toolNames(String... toolNames) {
|
||||
Assert.notNull(toolNames, "toolNames cannot be null");
|
||||
|
||||
@@ -150,6 +150,11 @@ public class DefaultChatClientBuilder implements Builder {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Builder defaultTools(String... toolNames) {
|
||||
return defaultToolNames(toolNames);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Builder defaultToolNames(String... toolNames) {
|
||||
this.defaultRequest.toolNames(toolNames);
|
||||
|
||||
Reference in New Issue
Block a user