Clean up the mlflow trace for tool calling#47
Conversation
| } | ||
|
|
||
| @mlflow.trace(span_type="AGENT") | ||
| @mlflow.trace(span_type="CHAIN") |
There was a problem hiding this comment.
QQ, why change from agent to chain?
There was a problem hiding this comment.
Mostly asking since this does still seem like the core agentic loop logic
There was a problem hiding this comment.
(same thinking as below)
| + tool_messages | ||
| ) | ||
| i += 1 | ||
| with mlflow.start_span(name=f"iteration_{i}", span_type="CHAIN") as span: |
There was a problem hiding this comment.
Same question here RE "CHAIN" vs "AGENT"
There was a problem hiding this comment.
I mirrored what LangGraph traces looked like here - they use a CHAIN for this type of logic. My thinking: this span represents logic that is actually a deterministic chain of steps.
There was a problem hiding this comment.
Got it, thanks! Do you have a pointer to a LangGraph "CHAIN" tracing example? i'm wondering if LangGraph uses that span name mostly writing a fixed chain, since the logic in this function calling agent thing looks similar to the Python equivalent of a LangGraph agent (e.g. if you translated something like LangGraph create_react_agent into Python code)
smurching
left a comment
There was a problem hiding this comment.
LGTM in general! Still curious to learn more about the CHAIN tracing example from langgraph
Related Issues/PRs
What changes are proposed in this pull request?
Clean up the Mlflow trace from the openai SDK function calling agent. Goal was to make the inputs/outputs + how the iterations run + how the tool function is called more clear in the trace / the code easier to read.
How is this PR tested?