Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling in getting LLM-based summary #1567

Merged
merged 5 commits into from
Feb 7, 2024
Merged

Error handling in getting LLM-based summary #1567

merged 5 commits into from
Feb 7, 2024

Conversation

qingyun-wu
Copy link
Contributor

@qingyun-wu qingyun-wu commented Feb 6, 2024

Why are these changes needed?

The llm-based summary method (introduced in #1402) is not robust. Handling errors so that the code fails gracefully.

A quick fix to some of the known failure cases is added at #1564. But it is not necessarily sufficient and it may take some time to sort out a good one.

Related issue number

Checks

@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (3e33a2c) 35.28% compared to head (8c79294) 42.33%.
Report is 1 commits behind head on main.

Files Patch % Lines
autogen/agentchat/conversable_agent.py 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1567      +/-   ##
==========================================
+ Coverage   35.28%   42.33%   +7.04%     
==========================================
  Files          44       44              
  Lines        5311     5315       +4     
  Branches     1231     1300      +69     
==========================================
+ Hits         1874     2250     +376     
+ Misses       3283     2863     -420     
- Partials      154      202      +48     
Flag Coverage Δ
unittests 42.31% <20.00%> (+7.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@afourney
Copy link
Member

afourney commented Feb 6, 2024

GroupChat has/had the same problem and resolved it this way:

selected_agent = None
select_speaker_messages = self.messages.copy()
# If last message is a tool call or function call, blank the call so the api doesn't throw
if select_speaker_messages[-1].get("function_call", False):
select_speaker_messages[-1] = dict(select_speaker_messages[-1], function_call=None)
if select_speaker_messages[-1].get("tool_calls", False):
select_speaker_messages[-1] = dict(select_speaker_messages[-1], tool_calls=None)
select_speaker_messages = select_speaker_messages + [
{"role": "system", "content": self.select_speaker_prompt(graph_eligible_agents)}

@qingyun-wu qingyun-wu added this pull request to the merge queue Feb 7, 2024
@qingyun-wu qingyun-wu removed this pull request from the merge queue due to a manual request Feb 7, 2024
@qingyun-wu qingyun-wu added this pull request to the merge queue Feb 7, 2024
Merged via the queue into main with commit deb5f94 Feb 7, 2024
50 of 56 checks passed
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
* summary exception

* badrequest error

* test

* skip reason

* error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants