Update tool call correctness judge to accept expected tool calls#19613
Update tool call correctness judge to accept expected tool calls#19613smoorjani merged 8 commits intomlflow:masterfrom
Conversation
Signed-off-by: Samraj Moorjani <samraj.moorjani@databricks.com>
Signed-off-by: Samraj Moorjani <samraj.moorjani@databricks.com>
Signed-off-by: Samraj Moorjani <samraj.moorjani@databricks.com>
Signed-off-by: Samraj Moorjani <samraj.moorjani@databricks.com>
Signed-off-by: Samraj Moorjani <samraj.moorjani@databricks.com>
AveshCSingh
left a comment
There was a problem hiding this comment.
Overall, this looks good. Thanks for sharing the thorough validation script in addition to your unit tests.
I've left a few requests inline
| available_tools: list["ChatTool"], | ||
| expected_tool_calls: list["FunctionCall"] | None = None, | ||
| include_arguments: bool = True, | ||
| check_order: bool = False, |
There was a problem hiding this comment.
Is this interface expected to be called by users? Asking since it does not include should_exact_match, whereas the Scorer interface does.
There was a problem hiding this comment.
Yeah, I think the difference here is judge vs scorer. The judge is only responsible for fuzzy matching (i.e., what uses an LLM). Regardless, It's unlikely users will use the judge, more likely the scorer, especially for exact matching.
| def parse_tool_call_expectations( | ||
| expectations: dict[str, Any] | None, | ||
| ) -> list["FunctionCall"] | None: | ||
| from mlflow.genai.utils.type import FunctionCall |
There was a problem hiding this comment.
Is there a reason to keep this import inline?
There was a problem hiding this comment.
Yeah, this will break the skinny build if added at the top of the file since it has a dependency on MLflow.
Signed-off-by: Samraj Moorjani <samraj.moorjani@databricks.com>
AveshCSingh
left a comment
There was a problem hiding this comment.
LGTM! Thanks for addressing my comments
|
Documentation preview for a1cace7 is available at: More info
|
…low#19613) Signed-off-by: Samraj Moorjani <samraj.moorjani@databricks.com>
…low#19613) Signed-off-by: Samraj Moorjani <samraj.moorjani@databricks.com>
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
Related Issues/PRs
#xxxWhat changes are proposed in this pull request?
As titled - updates tool call correctness judge to accept expected tool calls. Additionally, we introduce two new params - one to check for ordering and another to do fuzzy vs. exact matching between the expectations. Note that exact match only works when expectations are provided.
How is this PR tested?
test file:
output:

Does this PR require documentation update?
TODO: will update the docs page in a subsequent PR
Release Notes
Is this a user-facing change?
Update tool call correctness judge to evaluate using expected tool calls, and add options to check for ordering and do fuzzy or exact matching.
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.