Sign in
Log inSign up
LangChainers

15 likes

·

5.6K reads

3 comments

Jefe Blaize
Jefe Blaize
Apr 17, 2023

Great article. 1) langchain/llms is now langchain/llms/openai 2) The 2nd example when introducing the prompt templates, there's a missing "await" on "const res = await prompt.format..." — without which Open AI returns {res: Promise {<pending>}} as the returned value.

·
Jefe Blaize
Jefe Blaize
Apr 18, 2023

Also, Calculator moved, so it's now two lines: import { SerpAPI } from "langchain/tools"; import { Calculator } from "langchain/tools/calculator";

·
Joseph Turbin
Joseph Turbin
Apr 24, 2023

Thanks for this. Very concise and to the point.

Jefe Blaize - Thanks for the help on the calculator. I couldn't find that one.

Also, there is a change to the initializeAgentExecutor. Replace it with initializeAgentExecutorWithOptions. The full line should be: const executor = await initializeAgentExecutorWithOptions(tools, model, { agentType: "zero-shot-react-description", }); because of the way the agentType needs to be passed now.

Hope this helps someone.

·