Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable persona #472

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions client/vocabcompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,15 @@ def get_keyword_phrases():
if phrase:
phrases.append(phrase)

profile_path = jasperpath.config('profile.yml')
if os.path.exists(profile_path):
with open(profile_path, 'r') as f:
profile = yaml.safe_load(f)
persona = profile.get('persona', 'JASPER').upper()
else:
persona = 'JASPER'

phrases.append(persona)
return phrases


Expand Down
3 changes: 1 addition & 2 deletions static/keyword_phrases
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ FIRST
IN
IS
IT
JASPER
NOW
OF
ON
Expand All @@ -15,4 +14,4 @@ SAY
WHAT
WHICH
WITH
WORK
WORKs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this extra s looks like a missed ctrl+s ?

2 changes: 1 addition & 1 deletion tests/test_vocabcompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def testPhraseExtraction(self):
self.assertEqual(expected_phrases, extracted_phrases)

def testKeywordPhraseExtraction(self):
expected_phrases = ['MOCK']
expected_phrases = ['MOCK', 'JASPER']

with tempfile.TemporaryFile() as f:
# We can't use mock_open here, because it doesn't seem to work
Expand Down