Jofthomas HF staff commited on
Commit
1b5ca84
·
1 Parent(s): 67356f2

Update TextGen/router.py

Browse files
Files changed (1) hide show
  1. TextGen/router.py +12 -0
TextGen/router.py CHANGED
@@ -62,6 +62,10 @@ class VoiceMessage(BaseModel):
62
  input: str | None = None
63
  language: str | None = "en"
64
  genre:str | None = "Male"
 
 
 
 
65
 
66
  song_base_api=os.environ["VERCEL_API"]
67
 
@@ -188,6 +192,14 @@ def placement(input: Rooms):
188
  placements=place_objects(input.possible_entities,story,markdown_map)
189
  print(placements)
190
  return placements
 
 
 
 
 
 
 
 
191
 
192
  #Dummy function for now
193
  def determine_vocie_from_npc(npc,genre):
 
62
  input: str | None = None
63
  language: str | None = "en"
64
  genre:str | None = "Male"
65
+
66
+ class Logs(BaseModel):
67
+ objective:str
68
+ logs: List
69
 
70
  song_base_api=os.environ["VERCEL_API"]
71
 
 
192
  placements=place_objects(input.possible_entities,story,markdown_map)
193
  print(placements)
194
  return placements
195
+
196
+ @app.post("/check_right_to_pass")
197
+ def check(input: Logs):
198
+ print(input.logs)
199
+ system_prompt="You are a game master in a roguelike. You previously decided of an objective for the player. You have to answer with YES or NO on wether the objective as been sucessfully completed. Be kind and flexible as the content of the game is AI generated and might not be feasible."
200
+ user_message=f"The objective was : {input.objective} and the player did the following actions : {input.logs}. Do you grant acess ? ONLY answer YES or NO"
201
+ answer=inference_model(system_prompt,user_message)
202
+ return answer
203
 
204
  #Dummy function for now
205
  def determine_vocie_from_npc(npc,genre):