Replies: 1 comment 1 reply
-
Hello, As you mentioned, both Prompt prompt = new Prompt(userText, ToolCallingChatOptions.builder().toolCallbacks(functionCallbacks).build()); and ChatClient client = ...;
client.prompt(text).tools(tools).call(); work similarly. However, in @Override
public ChatClientRequestSpec prompt(Prompt prompt) {
Assert.notNull(prompt, "prompt cannot be null");
DefaultChatClientRequestSpec spec = new DefaultChatClientRequestSpec(this.defaultChatClientRequest);
// Options
if (prompt.getOptions() != null) {
spec.options(prompt.getOptions());
}
// Messages
if (prompt.getInstructions() != null) {
spec.messages(prompt.getInstructions());
}
return spec;
} Since This means that:
You can also check this behavior in the AdvisedRequest.java (Lines 176-189) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One can create a Prompt with tools e.g
Prompt prompt = new Prompt(userText, ToolCallingChatOptions.builder().toolCallbacks(functionCallbacks).build());
or one can pass tools to the ChatClient e.g.
Is it correct to assume that if tools are passed into the prompt then one can have prompt specific tools and you don't have to pass them separately whereas tools passed to the client directly might be more suitable for prompt independent tools?
Beta Was this translation helpful? Give feedback.
All reactions