|
|
|
|
|
|
|
|
if "questions" in req: |
|
|
if "questions" in req: |
|
|
if not isinstance(req["questions"], list): |
|
|
if not isinstance(req["questions"], list): |
|
|
return get_error_data_result("`questions` should be a list") |
|
|
return get_error_data_result("`questions` should be a list") |
|
|
d["question_kwd"] = req.get("questions") |
|
|
|
|
|
|
|
|
d["question_kwd"] = [str(q).strip() for q in req.get("questions", []) if str(q).strip()] |
|
|
d["question_tks"] = rag_tokenizer.tokenize("\n".join(req["questions"])) |
|
|
d["question_tks"] = rag_tokenizer.tokenize("\n".join(req["questions"])) |
|
|
if "available" in req: |
|
|
if "available" in req: |
|
|
d["available_int"] = int(req["available"]) |
|
|
d["available_int"] = int(req["available"]) |