Skip to content

Commit

Permalink
Doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
docwho2 committed Nov 30, 2023
1 parent 02ddd94 commit a0ea283
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package cloud.cleo.squareup.functions;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.function.Function;

/**
* Schedule a Private Shopping Event (just testing for now)
*
* @author sjensen
* @param <Request>
*/
public class SchedulePrivateShopping<Request> extends AbstractFunction {

@Override
public String getName() {
return "schedule_private_shoping";
}

@Override
public String getDescription() {
return "Schedule a private Shopping session for 4 of more people at the store";
}

@Override
public Class getRequestClass() {
return Request.class;
}

/**
*
* @return
*/
@Override
public Function<Request, Object> getExecutor() {
return (var r) -> {
try {
// TODO . call Sqauare API to schedule
return mapper.createObjectNode().put("status", "SUCCESS").put("message", "The event has been scheduled.");
} catch (Exception e) {
log.error("Unhandled Error", e);
return mapper.createObjectNode().put("status", "FAILED").put("message", "An error has occurred, the event could not be scheduled.");
}
};
}

private static class Request {

@JsonPropertyDescription("Name of the customer who would like to schedule the shopping event")
@JsonProperty(required = true)
public String customer_name;

@JsonPropertyDescription("The date in ISO format for the private shopping event")
@JsonProperty(required = true)
public LocalDate date;

@JsonPropertyDescription("The time for the private shopping event")
@JsonProperty(required = true)
public LocalTime time;

@JsonPropertyDescription("Optional name of the employee requested to provide the event, must be a valid employee first name")
@JsonProperty(required = false)
public String employee_first_name;
}

/**
* Square must be enabled or their won't be a way to get email addresses
*
* @return
*/
@Override
protected boolean isEnabled() {
return squareEnabled;
}

}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The goal is to introduce a "Store Virtual Assistant" powered by [OpenAI ChatGPT]
- If the caller simply wishes to speak to a representative, the model is preloaded with a default number to redirect the call.
- During transfers to the main line, this process is optimized to use SIP directly connecting to the store's [Asterisk PBX](https://www.asterisk.org).
- Directions to the store can be requested and Google directions URL can be sent to the callers mobile device if requested.
- When interacting with Text the link is just returned, when using voice, the link is sent to the caller.
- Messages can be sent to via Email to any of the employees.
- ChatGPT can compose some interesting emails, quite entertaining.
- The calling number is included in the subject of the email to lend context.
Expand Down

0 comments on commit a0ea283

Please sign in to comment.