Fix scorers issue on Strands traces#18835
Conversation
Signed-off-by: joelrobin18 <joelrobin1818@gmail.com>
|
Documentation preview for b4471b1 is available at: More info
|
| response: str, | ||
| expected_response: str | None = None, | ||
| expected_facts: list[str] | None = None, | ||
| expected_facts: str | list[str] | None = None, |
There was a problem hiding this comment.
Is this related to the change? (It looks like not?)
mlflow/genai/utils/trace_utils.py
Outdated
| if isinstance(value, str): | ||
| return value | ||
|
|
||
| # Handle list of messages directly (e.g., from Strands) |
There was a problem hiding this comment.
@joelrobin18 This logic certainly works, but one context I should've shared is we generally try to remove this type of custojm parsing. LLMs are generally good enough to handle the full messages not just a content string. In general no parsing is easier to reaon about from user perspective. Ideally we also want to remove L302-207, but it's breaking change so we kept them.
I think we can simply has isinstance(dict) check at L302 and let strands messages fallback to str(value)
There was a problem hiding this comment.
Hi,
Please let me know if I can help contribute to this issue. I had originally raised it and it is blocking me in adopting MLFlow in my team.
Signed-off-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com>
Signed-off-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com>
Signed-off-by: Yuki Watanabe <31463517+B-Step62@users.noreply.github.com>
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
Related Issues/PRs
Fix #18796
What changes are proposed in this pull request?
Fix scorers issue when using Strands traces using autotracing
How is this PR tested?
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
Fix scorers issue when using Strands traces using autotracing
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.