sguertl commited on
Commit
b0c020a
·
verified ·
1 Parent(s): 6c7b057

Use Prompt class as parameter type

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -19,14 +19,14 @@ async def test():
19
  return {"Test"}
20
 
21
  @app.post("/chat")
22
- async def chat(message):
23
  print("Received POST request")
24
- print("Message:", message)
25
  system_prompt = (
26
  "You are a beginner programming student helping a peer. "
27
  "Offer hints, ask questions, and support understanding—don’t give full solutions."
28
  )
29
- full_prompt = f"<s>[INST] <<SYS>>{system_prompt}<</SYS>>\n{message} [/INST]"
30
 
31
  print("Full Prompt:", full_prompt)
32
 
 
19
  return {"Test"}
20
 
21
  @app.post("/chat")
22
+ async def chat(prompt: Prompt):
23
  print("Received POST request")
24
+ print("Message:", prompt.message)
25
  system_prompt = (
26
  "You are a beginner programming student helping a peer. "
27
  "Offer hints, ask questions, and support understanding—don’t give full solutions."
28
  )
29
+ full_prompt = f"<s>[INST] <<SYS>>{system_prompt}<</SYS>>\n{prompt.message} [/INST]"
30
 
31
  print("Full Prompt:", full_prompt)
32