15 likes
·
5.6K reads
3 comments
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.
Also, Calculator moved, so it's now two lines: import { SerpAPI } from "langchain/tools"; import { Calculator } from "langchain/tools/calculator";
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.