Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Apr 2, 2025

Important

Adds tool_call_id to ToolMessage dictionary in _convert_message_to_dict() to enhance tool call tracking.

  • Behavior:
    • Adds tool_call_id to ToolMessage dictionary in _convert_message_to_dict() in langchain.py.
    • Enhances tracking of tool calls by capturing tool_call_id in message conversion.

This description was created by Ellipsis for 456028e. It will automatically update as commits are pushed.

Greptile Summary

Disclaimer: Experimental PR review

The PR updates the Langchain integration in langfuse-python to capture a new tool_call_id field from ToolMessage instances for enhanced tracing.

  • Updated file: langfuse/callback/langchain.py – added tool_call_id extraction in _convert_message_to_dict.
  • Ensures tool call identifiers are captured alongside existing message data.
  • Change is localized and should propagate correctly to downstream logging and processing.
  • Developers should verify that the new field is compatible with existing trace handling.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp enabled auto-merge (squash) April 2, 2025 14:50
@hassiebp hassiebp merged commit 5f598cc into main Apr 2, 2025
10 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-4576-langchain-jump-playground branch April 2, 2025 16:23
@ajram23
Copy link

ajram23 commented Apr 15, 2025

@hassiebp 👀 Does this make traces better???

@hassiebp
Copy link
Contributor Author

@hassiebp 👀 Does this make traces better???

@ajram23 This should improve the "jump to playground" experience when originating off a Langchain trace with tool calls by relating tool calls by the LLM with the Tool response of the application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants