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

[Feature Request]: partial error message from code executor #2060

Closed
Tracked by #1421
Repomano opened this issue Mar 18, 2024 · 5 comments
Closed
Tracked by #1421

[Feature Request]: partial error message from code executor #2060

Repomano opened this issue Mar 18, 2024 · 5 comments
Labels
0.2 Issues which are related to the pre 0.4 codebase code-execution execute generated code needs-triage

Comments

@Repomano
Copy link

Repomano commented Mar 18, 2024

Feature Request

Is it possible to include just a part of the error when a code is executed? For example if I have in a roleplay one of the two agents that executing the code finds:
Traceback (most recent call last):
File "/home/matt/anaconda3/envs/coder/lib/python3.11/site-packages/autogen/oai/completion.py", line 224, in _get_response
response = openai_completion.create(request_timeout=request_timeout, **config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/matt/anaconda3/envs/coder/lib/python3.11/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/matt/anaconda3/envs/coder/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
^^^^^^^^^^^^^^^^^^
File "/home/matt/anaconda3/envs/coder/lib/python3.11/site-packages/openai/api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)

Can I decide to send to the other agent just the last line? In this case:
File "/home/matt/anaconda3/envs/coder/lib/python3.11/site-packages/openai/api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)

@ekzhu ekzhu changed the title [Feature Request]: [Feature Request]: partial error message from code executor Mar 18, 2024
@ekzhu ekzhu added the code-execution execute generated code label Mar 18, 2024
@ekzhu
Copy link
Collaborator

ekzhu commented Mar 18, 2024

Just to clarify, do you mean you want the code executors to only return specific part of the call stack in error message? If that's the case, you can take a look at the code executors' implementations in autogen.coding and see if you can add a parameter to customize the error message format.

Let @jackgerrits and me know if you are stuck. We can also discuss if we should add this to our code executor roadmap #1421

@Repomano
Copy link
Author

Repomano commented Mar 18, 2024

Yes, thanks, that's exactly what I was interested in, I think it's useful because in some cases when there are errors, for example when loading very large csv files, the error is in the column format "AcolumnBcolumnCcolumnD....ColumnZ is not considered intger " so even if you use a timeout you could run out of all your available per minute tokens with just one error message.

@ekzhu
Copy link
Collaborator

ekzhu commented Mar 19, 2024

Thanks for confirming. Would you like to give it a try? A good place to start is LocalCommandLineExecutor inside autogen.coding.

@Repomano
Copy link
Author

Yes I will try

@rysweet rysweet added 0.2 Issues which are related to the pre 0.4 codebase needs-triage labels Oct 2, 2024
@fniedtner fniedtner removed the feature label Oct 24, 2024
@jackgerrits
Copy link
Member

Can you please try reproing your issues in 0.4 and create a new issue if it is still a problem for you. Thanks!

@jackgerrits jackgerrits closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.2 Issues which are related to the pre 0.4 codebase code-execution execute generated code needs-triage
Projects
None yet
Development

No branches or pull requests

5 participants