(self)
| 1479 | self.chunk_list.append(chunk) |
| 1480 | |
| 1481 | def run_recommend_questions_task(self): |
| 1482 | try: |
| 1483 | _session = session_maker() |
| 1484 | res = self.generate_recommend_questions_task(_session) |
| 1485 | |
| 1486 | for chunk in res: |
| 1487 | if chunk.get('recommended_question'): |
| 1488 | yield 'data:' + orjson.dumps( |
| 1489 | {'content': chunk.get('recommended_question'), |
| 1490 | 'type': 'recommended_question'}).decode() + '\n\n' |
| 1491 | else: |
| 1492 | yield 'data:' + orjson.dumps( |
| 1493 | {'content': chunk.get('content'), 'reasoning_content': chunk.get('reasoning_content'), |
| 1494 | 'type': 'recommended_question_result'}).decode() + '\n\n' |
| 1495 | except Exception: |
| 1496 | traceback.print_exc() |
| 1497 | finally: |
| 1498 | session_maker.remove() |
| 1499 | |
| 1500 | def run_analysis_or_predict_task_async(self, session: Session, action_type: str, base_record: ChatRecord, |
| 1501 | in_chat: bool = True, stream: bool = True): |
no test coverage detected