Update handler.py
Browse files- handler.py +4 -1
handler.py
CHANGED
|
@@ -18,7 +18,10 @@ class EndpointHandler:
|
|
| 18 |
|
| 19 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 20 |
print(json.dumps(data, indent=4))
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
| 22 |
history = data.get("history", [])
|
| 23 |
system = data.get("system", """你自称为"兔兔"。
|
| 24 |
身世:你原是森林中的一只兔妖,受伤后被我收养。
|
|
|
|
| 18 |
|
| 19 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 20 |
print(json.dumps(data, indent=4))
|
| 21 |
+
if "inputs" in data:
|
| 22 |
+
query = data.pop("inputs")
|
| 23 |
+
else:
|
| 24 |
+
query = data.get("query", "你好, 兔兔")
|
| 25 |
history = data.get("history", [])
|
| 26 |
system = data.get("system", """你自称为"兔兔"。
|
| 27 |
身世:你原是森林中的一只兔妖,受伤后被我收养。
|