Feature/use converter instead of manually trimming (#894)

* Exploring output being passed to tool selector to see if we can better format data

* WIP. Adding JSON repair functionality

* Almost done implementing JSON repair. Testing fixes vs current base case.

* More action cleanup with additional tests

* WIP. Trying to figure out what is going on with tool descriptions

* Update tool description generation

* WIP. Trying to find out what is causing the tools to duplicate

* Replacing tools properly instead of duplicating them accidentally

* Fixing issues for MR

* Update dependencies for JSON_REPAIR

* More cleaning up pull request

* preppering for call

* Fix type-checking issues

---------

Co-authored-by: João Moura <joaomdmoura@gmail.com>
This commit is contained in:
Brandon Hancock (bhancock_ai)
2024-07-15 07:53:41 -04:00
committed by GitHub
parent 4eb4073661
commit 7acf0b2107
13 changed files with 552 additions and 68 deletions

View File

@@ -1238,10 +1238,10 @@ def test_agent_usage_metrics_are_captured_for_hierarchical_process():
print(crew.usage_metrics)
assert crew.usage_metrics == {
"total_tokens": 311,
"prompt_tokens": 224,
"completion_tokens": 87,
"successful_requests": 1,
"total_tokens": 2217,
"prompt_tokens": 1847,
"completion_tokens": 370,
"successful_requests": 4,
}
@@ -1271,7 +1271,7 @@ def test_hierarchical_crew_creation_tasks_with_agents():
assert crew.manager_agent.tools is not None
print("TOOL DESCRIPTION", crew.manager_agent.tools[0].description)
assert crew.manager_agent.tools[0].description.startswith(
"Delegate a specific task to one of the following coworkers: [Senior Writer, Researcher]"
"Delegate a specific task to one of the following coworkers: Senior Writer"
)