Refactor build method to be asynchronous
This commit is contained in:
parent
0c5f5f4fc1
commit
1ef7914a2c
1 changed files with 3 additions and 3 deletions
|
|
@ -63,7 +63,7 @@ class XMLAgentComponent(CustomComponent):
|
|||
},
|
||||
}
|
||||
|
||||
def build(
|
||||
async def build(
|
||||
self,
|
||||
inputs: str,
|
||||
llm: BaseLLM,
|
||||
|
|
@ -89,6 +89,6 @@ class XMLAgentComponent(CustomComponent):
|
|||
for var in input_variables:
|
||||
if var not in ["agent_scratchpad", "input"]:
|
||||
input_dict[var] = ""
|
||||
result = runnable.invoke(input_dict)
|
||||
result = await runnable.ainvoke(input_dict)
|
||||
self.status = result
|
||||
return result
|
||||
return result.get("output")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue