-
Notifications
You must be signed in to change notification settings - Fork 71
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
Solution with gemini #2
base: solution
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realized I never left any indication I looked at this 😬 Thank you so much for getting these updates done, it's looking great!
The only thing that caught my eye is extremely minor around ordering that already existed in add_greetings
where we call generate_greetings
before checking if character_obj.greetings
already has values.
app/routes/character_routes.py
Outdated
@@ -83,15 +77,12 @@ def add_greetings(char_id): | |||
return make_response(jsonify(f"Greetings successfully added to {character_obj.name}"), 201) | |||
|
|||
def generate_greetings(character): | |||
model = genai.GenerativeModel("gemini-1.5-flash") | |||
input_message = f"I am writing a rantasy RPG video game. I have an npc named {character.name} who is {character.age} years old. They are a {character.occupation} who has a {character.personality} personality. Please generate a python style list of 10 stock phrases they might use when the main character talks to them. Please Return just the list without a variable name and square brackets." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input_message = f"I am writing a rantasy RPG video game. I have an npc named {character.name} who is {character.age} years old. They are a {character.occupation} who has a {character.personality} personality. Please generate a python style list of 10 stock phrases they might use when the main character talks to them. Please Return just the list without a variable name and square brackets." | |
input_message = f"I am writing a fantasy RPG video game. I have an npc named {character.name} who is {character.age} years old. They are a {character.occupation} who has a {character.personality} personality. Please generate a Python style list of 10 stock phrases they might use when the main character talks to them. Please return just the list without a variable name and square brackets." |
app/routes/character_routes.py
Outdated
@@ -83,15 +77,12 @@ def add_greetings(char_id): | |||
return make_response(jsonify(f"Greetings successfully added to {character_obj.name}"), 201) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could remove jsonify
through the project
Solution: remove jsonify and directly return data structures following Unit 2 Patterns
No description provided.