Skip to content

Resolved Merge Conflicts for PR #712: Remove Hyphen in co-workers#786

Merged
joaomdmoura merged 7 commits into
crewAIInc:mainfrom
bhancockio:pr-712
Jun 18, 2024
Merged

Resolved Merge Conflicts for PR #712: Remove Hyphen in co-workers#786
joaomdmoura merged 7 commits into
crewAIInc:mainfrom
bhancockio:pr-712

Conversation

@bhancockio
Copy link
Copy Markdown
Contributor

@bhancockio bhancockio commented Jun 18, 2024

This pull request resolves the merge conflicts present in the original PR #712 submitted by @madmag77, which aimed to remove the hyphen from "co-worker" to "coworker" in the codebase. This change was necessary to ensure compatibility with open source language models that do not handle hyphens correctly in prompt processing.

Additionally, I fixed a string comparison issue which prevent AgentTools from selecting the appropriate agent. The underlying issue for this issue is that weaker LLM's struggle to produce valid JSON. Quite often, these weaker LLM's truncate the final part of their response. In the case of AgentTools, these weaker LLM's would produce responses like {"coworker": "reasearcher when it should have produced JSON like {"coworker": "reasearcher"}.

Original PR Details:

  • Purpose: Fix issues with open source LLMs by renaming "co-worker" to "coworker".
  • Original Author: @madmag77
  • Original Description:
    • Addressed problems with LLMs such as Mistral 0.3 and Phi Medium that could not correctly parse prompts containing "co-worker".
    • Updated the code to use "coworker" consistently to avoid issues with schema validation in Langchain StructuredTool.
    • The changes prevent errors related to agent name handling in AI applications.

Changes in This PR:

  • Resolved Merge Conflicts: Addressed conflicts between the original PR and the current main branch.
  • Maintained Original Intent: Ensured the removal of hyphens as intended by the original author.
  • Verified Functionality: Ran tests to confirm that the updates work correctly with the latest codebase.
  • AgentTool Selection Issue: Additionally, I added a quick fix around agent selection within AgentTool. For some reason, weaker LLM's do not reliably produce valid JSON. Instead, these weaker LLM's truncate their response. These truncated responses broke our comparison of agents.

Acknowledgments:

Special thanks to @madmag77 for the initial implementation and efforts to fix the LLM compatibility issue.

References:

@joaomdmoura joaomdmoura merged commit 377f919 into crewAIInc:main Jun 18, 2024
bhancockio added a commit that referenced this pull request Jan 2, 2025
* removed hyphen in co-workers

* Fix issue with AgentTool agent selection. The LLM included double quotes in the agent name which messed up the string comparison. Added additional types. Cleaned up error messaging.

* Remove duplicate import

* Improve explanation

* Revert poetry.lock changes

* Fix missing line in poetry.lock

---------

Co-authored-by: madmag77 <goncharov.artemv@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants