Skip to content

Is it possible to show output the generated code used/executed to the user (Without using the log)? #1423

Answered by dosubot bot
ramzyizza asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ramzyizza! 👋 I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer.

Yes, it is possible to show the generated code used for a query to the user without using the log. In the pandas-ai codebase, the ChatController class includes a method chat that handles chat interactions. After the agent processes the query, the generated code is stored in agent.last_code_executed. This code can be included in the response to the user.

Here's a relevant snippet of how this is implemented:

conversation_message = await self.conversation_repository.add_conversation_message(
    conversation_id=conversation_id,
    query=chat_request.query,
    response=r…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ramzyizza
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant