Execute a task.
(vectorstore, execution_chain: LLMChain, objective: str, task: str, k: int = 5)
| 135 | return [str(item.metadata['task']) for item in sorted_results] |
| 136 | |
| 137 | def 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 | |
| 142 | class BabyAGI(Chain, BaseModel): |
| 143 | """Controller model for the BabyAGI agent.""" |
no test coverage detected