Skip to content

Commit

Permalink
chore(callbacks): add deprecation notice to get_trace_id and get_trac…
Browse files Browse the repository at this point in the history
…e_url (langfuse#414)
  • Loading branch information
marcklingen authored Feb 27, 2024
1 parent dc96f6c commit ca3e390
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions langfuse/utils/base_callback_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,23 @@ def __init__(
)

def get_trace_id(self):
"""
This method is deprecated and will be removed in a future version as it is not concurrency-safe.
Please refer to the [documentation](https://langfuse.com/docs/integrations/langchain/get-started#interoperability) on how to use interop with the Langfuse SDK to get the id of a trace.
Returns:
The ID of the current/last trace or None if no trace is available.
"""
return self.trace.id if self.trace else None

def get_trace_url(self):
"""
This method is deprecated and will be removed in a future version as it is not concurrency-safe.
Please refer to the [documentation](https://langfuse.com/docs/tracing/url) for more information.
Returns:
The URL of the current/last trace or None if no trace is available.
"""
return self.trace.get_trace_url() if self.trace else None

def flush(self):
Expand Down

0 comments on commit ca3e390

Please sign in to comment.