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 #1732

Open
PKQ1688 opened this issue Jan 9, 2025 · 3 comments
Open

Feature Request #1732

PKQ1688 opened this issue Jan 9, 2025 · 3 comments

Comments

@PKQ1688
Copy link

PKQ1688 commented Jan 9, 2025

When I run an agent, the tool is a python function written by myself. If an error is reported inside, I hope to be able to obtain the error content outside, and then handle it in different ways. I How to implement it through code.

@dirkbrnd
Copy link
Contributor

@PKQ1688 I made a note to work on this.
Can you possibly give me a code sample of what you are trying to do? Just so I can make sure I find the best solution.

@PKQ1688
Copy link
Author

PKQ1688 commented Jan 10, 2025

try:
     answer_id_res = self.exec_agent.run(question)
 except Exception as e:
     logger.error(f'Error in exec_agent, {e}')
     logger.error(f'Error in exec_agent: {question}')
     pass

maybe like this? I'm not sure either.
The main reason is that when calling the API in the tool, there may be some problems with the API itself, and the current agent is easy to keep retrying. I hope to get the error and then execute my workflow without being affected by a certain agent.

@dirkbrnd
Copy link
Contributor

Yes that makes sense. Thanks, I'll look into it.

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

No branches or pull requests

2 participants