Skip to content

Commit

Permalink
first (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrm0 authored Dec 22, 2023
1 parent 37772e2 commit c26988c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions trulens_eval/trulens_eval/instruments.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,13 @@ def find_instrumented(f):
# instrumented app gets unloaded, it will be evicted from this set.
setattr(w, Instrument.APPS, weakref.WeakSet([self.app]))

# Hack for llama_index trace_method not preserving wrapped method signature.
if "trace_method.<locals>.decorator.<locals>.wrapper" == func.__qualname__:
actual_func = func.__closure__[1].cell_contents
func_sig = inspect.signature(actual_func)
func.__signature__ = func_sig
func.__name__ = actual_func.__name__

w.__name__ = func.__name__

# NOTE(piotrm): This is important; langchain checks signatures to adjust
Expand Down

0 comments on commit c26988c

Please sign in to comment.