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

Improved query, print & exception handling in REPL Tool #3215

Closed
wants to merge 3 commits into from

Commits on Apr 20, 2023

  1. Improved query, print & exception handling in REPL Tool

    The following improvements are made to the Python REPL Tool:
    1) Improved the sanitization of query (using regex), by removing python command (since gpt-3.5-turbo sometimes assumes python console as a terminal, and runs python command first which causes error). Also sometimes 1 line python codes contain single backticks.
    (i) Eg of python in query:
    > Entering new LLMMathChain chain...
    1291.25 * 6
    ```python
    print(1291.25 * 6)
    
    ```
    (ii) Eg of 1 line query with single backtick:
    Thought:I have the number of unique Account IDs, but I need to count the number of active accounts
    Action: python_repl_ast
    Action Input: `len(df[df['Status'] == 'Active'])`
    
    2) Improved the capturing of print by redirecting stdout to output of Python REPL Tool (without cluttering the actual stdout).
    
    3) Made sure the exception format type is returned in all cases, when the exec() function throws an exception.
    svdeepak99 committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    98779c0 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2023

  1. Update tool.py

    Updated formatting by running the "poetry run black ." command.
    svdeepak99 committed Apr 22, 2023
    Configuration menu
    Copy the full SHA
    ded79d7 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2023

  1. Configuration menu
    Copy the full SHA
    bd28161 View commit details
    Browse the repository at this point in the history