juji.func.user
User related built-in functions
+persona-draw-resolution+
current-num-words-by-user
(current-num-words-by-user rep)
Return total number of words the user has typed in Juji so far.
first-time-chat?
(first-time-chat? rep)
If the current user is from facebook messenger, check if this is his/her first time chatting with current engagement on the facebook page using her/her psid as identifier. If the current user is from web chat, check if this is his/her first time chatting with the current engagement using his/her email as identifier.
get-achiever-desc
get-agreeableness-score
(get-agreeableness-score rep)
Return the user’s agreeableness score (if exists), which is an integer between 0 and 100, based on analysis on his/her historical chat input. Return nil if the user has not yet entered anything.
get-aspirer-desc
get-conscientiousness-score
(get-conscientiousness-score rep)
Return the user’s conscientiousness score (if exists), which is an integer between 0 and 100, based on analysis on his/her historical chat input. Return nil if the user has not yet entered anything.
get-creator-desc
get-diyer-desc
get-explorer-desc
get-extroversion-score
(get-extroversion-score rep)
Return the user’s extroversion score (if exists), which is an integer between 0 and 100, based on analysis on his/her historical chat input. Return nil if the user has not yet entered anything.
get-helper-desc
get-maker-desc
get-mover-and-shaker-desc
get-neuroticism-score
(get-neuroticism-score rep)
Return the user’s neuroticism score (if exists), which is an integer between 0 and 100, based on analysis on his/her historical chat input. Return nil if the user has not yet entered anything.
get-new-readerdna-from-text-embedding
(get-new-readerdna-from-text-embedding rep)
(get-new-readerdna-from-text-embedding rep k)
Rank user’s readerdna queried from his/her input text analytsis. Return the top k
ranking readerdna info.
If k
is not provided, return the top one.
get-openness-score
(get-openness-score rep)
Return the user’s openness score (if exists), which is an integer between 0 and 100, based on analysis on his/her historical chat input. Return nil if the user has not yet entered anything.
get-organizer-desc
get-recommended-books
(get-recommended-books rep)
(get-recommended-books rep {:keys [fav-genre-text last-genre-text age-group gender]})
Perform book recommendation analysis. Return information on the top recommended book.
get-smart-shopper-desc
get-sophisticated-shopper-desc
get-thinker-desc
get-top-consumerdna-desc
get-top-consumerdna-likes
get-top-consumerdna-motivators
get-top-consumerdna-name
get-top-k-traits
(get-top-k-traits rep aspect k)
Get top k traits of the given aspect
of the current user.
aspect
can be one of the following: “fooddna”, “consumerdna”, “styledna”, “gamerdna”, “persona”, “strength”, “weakness”, “big5”, “positive big5”, “entertainmentdna”.
get-top-persona-desc
get-top-persona-likes
get-top-persona-motivators
get-top-persona-name
get-top-three-personalities
(get-top-three-personalities rep)
Return a string of three positive adjectives of the form “adj1, adj2 and adj3”. The adjectives describe the three highest ranking personalities from Juji’s personality analysis based on the user’s historical chat input. Return nil if the user has no existing chat data.
get-top-trait
(get-top-trait rep dna-aspect)
Get top trait of the given aspect
. of the current user.
aspect
can be one of the following: “fooddna”, “consumerdna”, “styledna”, “gamerdna”, “persona”, “strength”, “weakness”, “big5”, “positive big5”, “entertainmentdna”.
get-trait-score-by-name
(get-trait-score-by-name rep name)
Get score and other trait info of the given characteristic name of the current user.
get-user-attribute
(get-user-attribute rep attr-name)
Retrieve user attribute value of the given attribute name in it’s own type.
get-user-attribute-as-string
(get-user-attribute-as-string rep attr)
Retrieve user attribute value (if exists) of the given attr
and present as string.
get-user-browser-type
(get-user-browser-type rep)
Get user browser type from user-agent info. Currently recognize Chromium, Seamonkey, Opera, Internet Explorer, Chrome, Firefox, Safari.
get-user-location
(get-user-location rep)
Get user location according to ip address. Address will be present in string in the form of “City, Region, Country”.
get-value-shopper-desc
is-achiever?
is-aspirer?
is-creator?
is-diyer?
is-explorer?
is-helper?
is-maker?
is-mover-and-shaker?
is-organizer?
is-smart-shopper?
is-sophisticated-shopper?
is-thinker?
is-value-shopper?
personality-bar-chart
(personality-bar-chart rep)
Return the bar chart of the current user’s Big5 personality as a HTML string. Return nil if the user does not have sufficient amount of data
present-consumerdna
(present-consumerdna rep)
present-consumerdna-new
(present-consumerdna-new rep)
present-entertainment-dna
(present-entertainment-dna rep)
Present the user’s entertainment-dna in a sentence.
present-persona
(present-persona rep)
present-three-random
(present-three-random adjs)
store-unanswered-user-question
(store-unanswered-user-question rep)
(store-unanswered-user-question rep unanswered-question)
Store user question as unanswered question. Such questions will be available in results and analytics.
If unanswered-question
is provided, it is stored. Otherwise, store the current user input.
store-user-attribute
(store-user-attribute rep attr value)
(store-user-attribute rep attr value value-type)
Store the given user attribute with value.
attr
and value-type
are strings. value
can be a string, a integer or a boolean. If value-type
is not provided, the type will be inferred from value
.
store-user-faq
(store-user-faq rep)
(store-user-faq rep faq)
Store question asked by the user as faq. Such questions will be available in results and analytics.
If faq
is provided, it is stored. Otherwise, store the current user input.
trait-score-value-by-name
(trait-score-value-by-name rep trait-name)
Given a trait name, return the user’s score value (if exists), which is an integer between 0 and 100, based on analysis on his/her historical chat input. Return nil if the user has not yet entered anything.
user-email
(user-email rep)
Return email address of the user if known, otherwise return nil.
user-first-name
(user-first-name rep)
Return the first name of the user, which the user entered to start the chat.
user-has-attribute?
(user-has-attribute? rep attr)
Check if the given attribute exists for the current user.
user-last-name
(user-last-name rep)
visitor-seem-familiar?
(visitor-seem-familiar? rep)
Check if the name of the user has been seen by the REP in the same release.