Skip to content

Commit

Permalink
refactor: make toolkits pass in runnables
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Oct 16, 2023
1 parent 319c24f commit 80ed3c5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion langchain/src/agents/toolkits/json/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function createJsonAgent(
});
const chain = new LLMChain({ prompt, llm });
const agent = new ZeroShotAgent({
llmChain: chain,
runnable: chain,
allowedTools: tools.map((t) => t.name),
});
return AgentExecutor.fromAgentAndTools({
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/agents/toolkits/openapi/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function createOpenApiAgent(
llm,
});
const toolNames = tools.map((tool) => tool.name);
const agent = new ZeroShotAgent({ llmChain: chain, allowedTools: toolNames });
const agent = new ZeroShotAgent({ runnable: chain, allowedTools: toolNames });
return AgentExecutor.fromAgentAndTools({
agent,
tools,
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/agents/toolkits/sql/sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function createSqlAgent(
});
const chain = new LLMChain({ prompt, llm });
const agent = new ZeroShotAgent({
llmChain: chain,
runnable: chain,
allowedTools: tools.map((t) => t.name),
});
return AgentExecutor.fromAgentAndTools({
Expand Down
4 changes: 2 additions & 2 deletions langchain/src/agents/toolkits/vectorstore/vectorstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function createVectorStoreAgent(
});
const chain = new LLMChain({ prompt, llm });
const agent = new ZeroShotAgent({
llmChain: chain,
runnable: chain,
allowedTools: tools.map((t) => t.name),
});
return AgentExecutor.fromAgentAndTools({
Expand Down Expand Up @@ -120,7 +120,7 @@ export function createVectorStoreRouterAgent(
});
const chain = new LLMChain({ prompt, llm });
const agent = new ZeroShotAgent({
llmChain: chain,
runnable: chain,
allowedTools: tools.map((t) => t.name),
});
return AgentExecutor.fromAgentAndTools({
Expand Down

0 comments on commit 80ed3c5

Please sign in to comment.