mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-05 17:35:28 +03:00
1.9 KiB
1.9 KiB
In [2]:
from langchain.chains import LLMBashChain
from langchain.llms import OpenAI
llm = OpenAI(temperature=0)
text = "Please write a bash script that prints 'Hello World' to the console."
bash_chain = LLMBashChain(llm=llm, verbose=True)
bash_chain.run(text)Out [2]:
[1m> Entering new LLMBashChain chain...[0m Please write a bash script that prints 'Hello World' to the console.[32;1m[1;3m ```bash echo "Hello World" ```[0m['```bash', 'echo "Hello World"', '```'] Answer: [33;1m[1;3mHello World [0m [1m> Finished LLMBashChain chain.[0m
'Hello World\n'
In [ ]: