Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

Adds fix for unavailable source code in notebook

elijahbenizzy60a1b32de988
diff --git a/burr/core/action.py b/burr/core/action.py
index ee22d2d0..47cc9457 100644
--- a/burr/core/action.py
+++ b/burr/core/action.py
@@ -211,7 +211,10 @@ class Action(Function, Reducer, abc.ABC):
the source code of the class in which the action is implemented,
but can be overwritten." Override if you want debugging/tracking
to display a different source"""
- return inspect.getsource(self.__class__)
+ try:
+ return inspect.getsource(self.__class__)
+ except Exception:
+ return "No source available"
def input_schema(self) -> Any:
"""Returns the input schema for the action.