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

How to capture CodeAgent's full thinking including the code, not just the final response into a variable #322

Open
KannamSridharKumar opened this issue Jan 23, 2025 · 5 comments

Comments

@KannamSridharKumar
Copy link

When we run a CodeAgent in a notebook, it print the question/task, the LLM model used, code (Executing this code, Execution logs) and the Final answer.

The return value from agent.run contrains only the final response.

I'm working on some demos for which I wanted to run a number of tasks, capture all the output (not just the final answer) and write them to an md or html file, so that I can show everything including the code generated by the agent without running the agents live in the demo.

I tried logging, stdout, from contextlib import redirect_stdout, etc but couldn't capture the full output to a variable.

Thanks,

@KannamSridharKumar KannamSridharKumar changed the title How to capture CodeAgent's full thinking including the code, not just the final response into a variable or file How to capture CodeAgent's full thinking including the code, not just the final response into a variable Jan 23, 2025
@Deng-Xian-Sheng
Copy link
Contributor

I think you may need to intercept the http request and then output both the content sent to the model and the content returned by the model to a file.

@Deng-Xian-Sheng
Copy link
Contributor

@matthewcarbone
Copy link

matthewcarbone commented Jan 23, 2025

#284 Related!
(Though I think some of this information is already stored in the logs).

@Deng-Xian-Sheng
Copy link
Contributor

What do you think of this display?
Image

@Deng-Xian-Sheng
Copy link
Contributor

Give me $1 and I'll tell you how to do 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

3 participants