Giter VIP home page Giter VIP logo

langchain-contrib's People

Contributors

amosjyng avatar dependabot[bot] avatar markyfsun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

markyfsun nixent

langchain-contrib's Issues

Replace `pexpect` with `subprocess`

my platform: macOS (Intel)

When I was running zamm and approving a terminal process, it stuck for several seconds then raised

│ /Users/markyfsun/.conda/envs/auto_weekly/lib/python3.10/site-packages/langchain_contrib/tools/te │
│ rminal/terminal.py:84 in _get_raw_shell_update_uncached                                          │
│                                                                                                  │
│    81 │   │   │   │   results += latest_output                                                   │
│    82 │   │   │   │   time.sleep(0.1)                                                            │
│    83 │   │   except pexpect.TIMEOUT as e:                                                       │
│ ❱  84 │   │   │   raise UnknownResult(                                                           │
│    85 │   │   │   │   "Terminal output does not have initial prompt of: "                        │
│    86 │   │   │   │   f"'{self.bash_prompt}':\n\n{results}"                                      │
│    87 │   │   │   ) from e                                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
UnknownResult: Terminal output does not have initial prompt of: '
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
[1m[?1034hzamm$ ':

python3 hello.py
Hello world
Bye
zamm$ 

I assume that pexpect here expects $ as the start flag and the EOF flag, however my terminal wrote something else to the output, so the match could not be found.

I wonder if you can use subprocess.getoutput here to execute bash command, since you only need to get the output of the command?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.