feat(operators): Add v1 support for tool calling with sem_map #220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Adds tool calling support for sem_map operator. We add a new class definition of LMWithTools which needs to be configured in the settings to be used by sem_map.
The implementation used crewai as the base framework to build upon for agentic operators.
Once configured, users can paas any crew ai compatible tools with sem_map, they can also define custom tools using pydantic (as shown in the test example below).
Test Plan
Added some basic UTs. Did a manual test using a custom script to test the e2e workflow to test that tool calling is working with the new sem_map operator flow. (Was planning to add this as a pytest, but pytest has issues when the function being tested uses asyncio internally)
Test Results
Script used for testing
Output:
(Optional) Documentation Update
TODO: (Add documentation changes to sem_map, add new doc for how to use tools with sem ops)
Type of Change
Checklist
BEFORE SUBMITTING, PLEASE READ https://github.com/lotus-data/lotus/blob/main/CONTRIBUTING.md
anything written below this line will be removed by GitHub Actions