Skip to content

Commit

Permalink
Export column analyses (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 authored Aug 5, 2024
1 parent 122e904 commit 0f0583e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lumen/ai/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

import nbformat

from panel import Column
from panel.chat import ChatStep

from lumen.ai.views import LumenOutput
from lumen.pipeline import Pipeline
from lumen.views import View
Expand Down Expand Up @@ -59,6 +62,11 @@ def export_notebook(assistant, preamble: str = ""):
cells += format_markdown(msg)
elif isinstance(msg.object, LumenOutput):
cells += format_output(msg)
elif isinstance(msg.object, Column):
for obj in msg.object:
if isinstance(obj, ChatStep):
continue
cells += format_output(obj)

nb = nbformat.v4.new_notebook(cells=cells)
return nbformat.v4.writes(nb)
2 changes: 1 addition & 1 deletion lumen/ai/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def __init__(self, **params):
if config_options:
options = pn.Param(self.analysis.param, parameters=config_options)
b = pn.widgets.Button(icon='rocket', name='Run...', on_click=self._rerun, button_type='success', margin=20)
self._tabs.insert(0, ('Config', pn.Column(options, b)))
self._tabs.insert(1, ('Config', pn.Column(options, b)))
with discard_events(self):
self._tabs.active = 2

Expand Down

0 comments on commit 0f0583e

Please sign in to comment.