Small RC Fixes (#608)

* mentioning ollama on the docs as embedder

* lowering barrier to match tool with simialr name

* Fixing agent tools to support co_worker

* Adding new tests

* Fixing type"

* updating tests

* fixing conflict
This commit is contained in:
João Moura
2024-05-13 02:29:04 -03:00
committed by GitHub
parent 7a4d3dd496
commit 7fd8850ddb
21 changed files with 204252 additions and 3737 deletions

View File

@@ -1,4 +1,4 @@
from typing import List
from typing import List, Union
from langchain.tools import StructuredTool
from pydantic import BaseModel, Field
@@ -33,12 +33,14 @@ class AgentTools(BaseModel):
]
return tools
def delegate_work(self, coworker: str, task: str, context: str):
def delegate_work(self, task: str, context: str, coworker: Union[str, None] = None, **kwargs):
"""Useful to delegate a specific task to a co-worker passing all necessary context and names."""
coworker = coworker or kwargs.get("co_worker")
return self._execute(coworker, task, context)
def ask_question(self, coworker: str, question: str, context: str):
def ask_question(self, question: str, context: str, coworker: Union[str, None] = None, **kwargs):
"""Useful to ask a question, opinion or take from a co-worker passing all necessary context and names."""
coworker = coworker or kwargs.get("co_worker")
return self._execute(coworker, question, context)
def _execute(self, agent, task, context):