PierreBrunelle commited on
Commit
d5e201f
·
verified ·
1 Parent(s): 2861629

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -80,24 +80,24 @@ interactions = pxt.create_table(
80
  )
81
 
82
  # Add computed columns for AI responses
83
- interactions['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['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['full_response'] = interactions.ai_response.choices[0].message.content
99
- interactions['story_text'] = get_story(interactions.full_response)
100
- interactions['options'] = get_options(interactions.full_response)
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):