Skip to content

Commit

Permalink
Update PetStoreAssistantBot.java
Browse files Browse the repository at this point in the history
  • Loading branch information
chtrembl committed Jan 4, 2024
1 parent 0a121ac commit f730273
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ protected CompletableFuture<Void> onMessageActivity(TurnContext turnContext) {
MessageFactory.attachment(attachment, "I have something nice to show @showcards(content-card) you."))
.thenApply(sendResult -> null);
}

if (text.contains("ball"))
{
String jsonString = "{\"type\":\"image\",\"id\":\"image-ball\",\"data\":{\"url\": \"https://raw.githubusercontent.com/chtrembl/staticcontent/master/dog-toys/ball.jpg?raw=true\",\"alt\": \"This is a ball\"}}";
Attachment attachment = new Attachment();
attachment.setContentType("application/json");

attachment.setContent(new Gson().fromJson(jsonString, JsonObject.class));
attachment.setName("public-image-ball");

return turnContext.sendActivity(
MessageFactory.attachment(attachment, "I have something nice to show @showcards(image-ball) you."))
.thenApply(sendResult -> null);
}
//END DEBUG

DPResponse dpResponse = this.azureOpenAI.classification(text);
Expand Down

0 comments on commit f730273

Please sign in to comment.