[FR] Add the tools of CrewAI to the mlflow UI#19160
Conversation
|
@Killian-fal Thank you for the contribution! Could you fix the following issue(s)? ⚠ DCO checkThe DCO check failed. Please sign off your commit(s) by following the instructions here. See https://github.com/mlflow/mlflow/blob/master/CONTRIBUTING.md#sign-your-work for more details. |
ff6a6c0 to
0a5969d
Compare
|
I fixed a bug with "config.log_traces". If false, the original function was never called. I added 2 tests to cover these cases |
|
Documentation preview for ba67326 is available at: More info
|
0a5969d to
86f6960
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds tool calling support to the MLflow UI for CrewAI agents, enabling display of tool execution steps in the tracing section. The implementation introduces patching for standalone module functions to capture tool execution traces.
Key changes:
- Added
patched_standalone_callfunction to handle tracing for standalone module functions (specificallyexecute_tool_and_check_finality) - Refactored patch application logic in
autolog()to use helper functions_apply_patches,_import_module, and_import_classfor better code organization - Updated tests to verify tool execution traces and behavior when tracing is disabled
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
mlflow/crewai/__init__.py |
Refactored patch application logic and added standalone method patching for CrewAI >= 0.114.0 tool support |
mlflow/crewai/autolog.py |
Implemented patched_standalone_call and _resolve_standalone_span functions for tool tracing, refactored patched_class_call indentation |
tests/crewai/test_crewai_autolog.py |
Updated tool calling test expectations (7 spans instead of 6) and added tests for disabled trace scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Killian <killian.falguiere@gmail.com>
Co-authored-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com> Signed-off-by: Killian <31043822+Killian-fal@users.noreply.github.com>
Co-authored-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com> Signed-off-by: Killian <31043822+Killian-fal@users.noreply.github.com>
24c75a4 to
ea47cf3
Compare
ea47cf3 to
ba67326
Compare
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
Related Issues/PRs
Resolve #19159
What changes are proposed in this pull request?
How is this PR tested?
Here a result of the feature :




Does this PR require documentation update?
Release Notes
Is this a user-facing change?
Now, when using CrewAI, the tools are displayed in the steps of the tracing section.
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/tracking: Tracking Service, tracking client APIs, autologgingarea/models: MLmodel format, model serialization/deserialization, flavorsarea/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registryarea/scoring: MLflow Model server, model deployment tools, Spark UDFsarea/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflowsarea/gateway: MLflow AI Gateway client APIs, server, and third-party integrationsarea/prompts: MLflow prompt engineering features, prompt templates, and prompt managementarea/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionalityarea/projects: MLproject format, project running backendsarea/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/build: Build and test infrastructure for MLflowarea/docs: MLflow documentation pagesHow should the PR be classified in the release notes? Choose one:
rn/none- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/breaking-change- The PR will be mentioned in the "Breaking Changes" sectionrn/feature- A new user-facing feature worth mentioning in the release notesrn/bug-fix- A user-facing bug fix worth mentioning in the release notesrn/documentation- A user-facing documentation change worth mentioning in the release notesShould this PR be included in the next patch release?
Yesshould be selected for bug fixes, documentation updates, and other small changes.Noshould be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.What is a minor/patch release?
Bug fixes, doc updates and new features usually go into minor releases.
Bug fixes and doc updates usually go into patch releases.