@holly_cummins #Quarkus #IBM #RedHat
@RegisterAiService(tools = EmailService.class)
public interface MyAiService {
@SystemMessage("You are a professional poet")
@UserMessage("Write a poem about {topic}. Then send this poem by email.")
String writeAPoem(String topic);
public class EmailService {
@Inject
Mailer mailer;
@Tool("send the given content by email")
public void sendAnEmail(String content) {
mailer.send(Mail.withText("
[email protected]", "A poem", content));
}
}
tools,
functions,
agents
describe when to use the tool
register the tool
ties it back to the tool description