akhaliq HF Staff commited on
Commit
621875e
·
1 Parent(s): e52ddb2

feat: specify text output format in chat api decorator

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -13,7 +13,7 @@ client = OpenAI(
13
  }
14
  )
15
 
16
- @app.api()
17
  def chat(message: str, history_json: list):
18
  # history_json should be a list of dictionaries like [{"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}]
19
  messages = history_json + [{"role": "user", "content": message}]
 
13
  }
14
  )
15
 
16
+ @app.api(outputs=["text"])
17
  def chat(message: str, history_json: list):
18
  # history_json should be a list of dictionaries like [{"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}]
19
  messages = history_json + [{"role": "user", "content": message}]