Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -80,24 +80,24 @@ interactions = pxt.create_table(
|
|
80 |
)
|
81 |
|
82 |
# Add computed columns for AI responses
|
83 |
-
interactions
|
84 |
interactions.genre,
|
85 |
interactions.player_name,
|
86 |
interactions.initial_scenario,
|
87 |
interactions.player_input,
|
88 |
interactions.turn_number
|
89 |
-
)
|
90 |
|
91 |
-
interactions
|
92 |
messages=interactions.messages,
|
93 |
model='gpt-4o-mini-2024-07-18',
|
94 |
max_tokens=500,
|
95 |
temperature=0.8
|
96 |
-
)
|
97 |
|
98 |
-
interactions
|
99 |
-
interactions
|
100 |
-
interactions
|
101 |
|
102 |
class RPGGame:
|
103 |
def __init__(self):
|
|
|
80 |
)
|
81 |
|
82 |
# Add computed columns for AI responses
|
83 |
+
interactions.add_computed_column(messages=generate_messages(
|
84 |
interactions.genre,
|
85 |
interactions.player_name,
|
86 |
interactions.initial_scenario,
|
87 |
interactions.player_input,
|
88 |
interactions.turn_number
|
89 |
+
))
|
90 |
|
91 |
+
interactions.add_computed_column(ai_response=openai.chat_completions(
|
92 |
messages=interactions.messages,
|
93 |
model='gpt-4o-mini-2024-07-18',
|
94 |
max_tokens=500,
|
95 |
temperature=0.8
|
96 |
+
))
|
97 |
|
98 |
+
interactions.add_computed_column(full_response=interactions.ai_response.choices[0].message.content)
|
99 |
+
interactions.add_computed_column(story_text=get_story(interactions.full_response))
|
100 |
+
interactions.add_computed_column(options=get_options(interactions.full_response))
|
101 |
|
102 |
class RPGGame:
|
103 |
def __init__(self):
|