feat: merge question_confirm and summary_task into single LLM call#1440
feat: merge question_confirm and summary_task into single LLM call#1440Desel72 wants to merge 3 commits intoeigent-ai:mainfrom
Conversation
|
@Wendong-Fan @bytecii Could you please review this PR and share any feedback? |
| summary: str | None = Field( | ||
| default=None, | ||
| description="Concise task summary. Only when is_complex=True.", | ||
| ) |
There was a problem hiding this comment.
Maybe we can add some post validation or postprocess that when is_complex=True task_name and summary need to be None.
Also cc @Wendong-Fan IMO we should still have a task_name when it's a non complex chat?
| and analysis.summary | ||
| ): | ||
| task_lock._prefetched_summary = ( | ||
| f"{analysis.task_name}|{analysis.summary}" |
There was a problem hiding this comment.
Seems that different from the original one?
f"Task|{summary_task_content}" though I am not sure why we used the fixed Task before cc @Wendong-Fan
backend/app/service/chat_service.py
Outdated
| ) -> TaskAnalysisResult: | ||
| """Analyze user query in one LLM call: complexity + task name/summary. | ||
|
|
||
| Merges question_confirm and summary_task into a single request (issue #1427). |
|
Hi @bytecii thank you for your feedback and I addressed all. Please review again. |
|
Hi @bytecii @Wendong-Fan, sorry for tagging you. Could you please review it again when you have a moment and share your feedback? |
|
@Wendong-Fan @4pmtong @fengju0213 Do you have any feedback on my PR? If there are any issues, please feel free to let me know and I’ll address them. |
|
Hi @bytecii @Wendong-Fan @4pmtong @fengju0213, just following up on this PR. I addressed the previous feedback last week, but haven’t heard back yet. Could someone please take another look and let me know if there are any remaining issues? I’d really appreciate your review so we can move this forward. Thanks! |
|
Hi @bytecii @Wendong-Fan @4pmtong @fengju0213 why still no answer? please review this and if no issues on this, please feel free to merge it. |
Related Issue
Closes #1427
Description
Merges the two meta LLM calls made before task execution into a single request:
question_confirm– classifies the task as complex or simplesummary_task– generates task name and summaryBoth were analyzing the same user intent, so they are combined into one
analyze_taskcall that returns structured output (is_complex,task_name,summary). This reduces cost and latency for complex tasks.Changes:
TaskAnalysisResultmodel inbackend/app/model/chat.pyanalyze_task()inbackend/app/service/chat_service.pywith fallback toquestion_confirmwhen parsing failsstep_solveto useanalyze_taskand reuse prefetched summary in decompositionanalyze_task(structured output, JSON parsing, fallback)Scope:
summary_tasksummary_taskfor new follow-up tasksTesting Evidence (REQUIRED)
What is the purpose of this pull request?
Contribution Guidelines Acknowledgement