-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up the mlflow trace for tool calling #47
base: main
Are you sure you want to change the base?
Conversation
# messages should be returned back to the Review App (or any other front end app) and stored there so it can be passed back to this stateless agent with the next turns of converastion. | ||
"messages": messages_log_with_tool_calls, | ||
} | ||
|
||
@mlflow.trace(span_type="AGENT") | ||
@mlflow.trace(span_type="CHAIN") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QQ, why change from agent to chain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly asking since this does still seem like the core agentic loop logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here RE "CHAIN" vs "AGENT"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?