Spaces:
Running
Running
feat: specify text output format in chat api decorator
Browse files
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}]
|