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 auto-fixualization for a jupyter notebookk

elijahbenizzyd8ce50c218ac
diff --git a/burr/core/application.py b/burr/core/application.py
index f103add7..28dd9b36 100644
--- a/burr/core/application.py
+++ b/burr/core/application.py
@@ -1585,6 +1585,16 @@ class Application:
"""
return self._builder
+ def _repr_mimebundle_(self, include=None, exclude=None, **kwargs):
+ """Attribute read by notebook renderers
+ This returns the attribute of the `graphviz.Digraph` returned by `self.display_all_functions()`
+
+ The parameters `include`, `exclude`, and `**kwargs` are required, but not explicitly used
+ ref: https://ipython.readthedocs.io/en/stable/config/integrating.html
+ """
+ dot = self.visualize(include_conditions=True, include_state=False)
+ return dot._repr_mimebundle_(include=include, exclude=exclude, **kwargs)
+
def _assert_set(value: Optional[Any], field: str, method: str):
if value is None: