MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / execute_task

Function execute_task

bmtools/agent/BabyagiTools.py:137–140  ·  view source on GitHub ↗

Execute a task.

(vectorstore, execution_chain: LLMChain, objective: str, task: str, k: int = 5)

Source from the content-addressed store, hash-verified

135 return [str(item.metadata['task']) for item in sorted_results]
136
137def execute_task(vectorstore, execution_chain: LLMChain, objective: str, task: str, k: int = 5) -> str:
138 """Execute a task."""
139 context = _get_top_tasks(vectorstore, query=objective, k=k)
140 return execution_chain.run(objective=objective, context=context, task=task)
141
142class BabyAGI(Chain, BaseModel):
143 """Controller model for the BabyAGI agent."""

Callers 1

_callMethod · 0.85

Calls 2

_get_top_tasksFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected