UI#

class lumen.ai.ui.UI(data: str | Path | Source | Pipeline | list[str | Path | Source | Pipeline] | None = None, **params)#

UI provides a baseclass and high-level entrypoint to start chatting with your data.


Parameters#

agents

type: list
default: []
List of additional Agents to add beyond the default_agents.

analyses

type: list
default: []
List of custom analyses. If provided the AnalysesAgent will be added.

coordinator

type: lumen.ai.Coordinator
default: lumen.ai.Planner
The Coordinator class that will be responsible for coordinating the Agents.

default_agents

type: list
default: [<class 'lumen.ai.agents.TableListAgent'>, <class 'lumen.ai.agents.ChatAgent'>, <class 'lumen.ai.agents.DocumentListAgent'>, <class 'lumen.ai.agents.AnalystAgent'>, <class 'lumen.ai.agents.SourceAgent'>, <class 'lumen.ai.agents.SQLAgent'>, <class 'lumen.ai.agents.VegaLiteAgent'>]
List of default agents which will always be added.

export_functions

type: dict
default: {}
Dictionary mapping from name of exporter to export function.

interface

type: panel.chat.ChatInterface
default: None
The ChatInterface for the Coordinator to interact with.

llm

type: lumen.ai.llm.Llm
default: OpenAI()
The LLM provider to be used by default

log_level

type: Any
default: 'INFO'
Possible values: 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR'
The log level to use.

logs_db_path

type: str
default: None
The path to the log file that will store the messages exchanged with the LLM.

name

type: str
default: 'UI'
String identifier for this object.

notebook_preamble

type: str
default: ''
Preamble to add to exported notebook(s).

template

type: Any
default: panel.template.FastListTemplate
Possible values: panel.template.BootstrapTemplate | panel.template.EditableTemplate | panel.template.FastListTemplate | panel.template.MaterialTemplate | panel.template.GoldenTemplate | panel.template.SlidesTemplate | panel.template.VanillaTemplate
Panel template to serve the application in.

title

type: str
default: 'Lumen UI'
Title of the app.

tools

type: list
default: []
List of Tools that can be invoked by the coordinator.


Methods#

UI.servable(title: str | None = None, **kwargs)#

Serves the object or adds it to the configured pn.state.template if in a panel serve context, writes to the DOM if in a pyodide context and returns the Panel object to allow it to display itself in a notebook context.

Parameters:
  • title (str) – A string title to give the Document (if served as an app)

  • location (boolean or panel.io.location.Location) – Whether to create a Location component to observe and set the URL location.

  • area (str (deprecated)) – The area of a template to add the component too. Only has an effect if pn.config.template has been set.

  • target (str) – Target area to write to. If a template has been configured on pn.config.template this refers to the target area in the template while in pyodide this refers to the ID of the DOM node to write to.

Return type:

The Panel object itself

UI.show(**kwargs)#

Starts a Bokeh server and displays the Viewable in a new tab.

Parameters:
  • title (str | None) – A string title to give the Document (if served as an app)

  • port (int (optional, default=0)) – Allows specifying a specific port

  • address (str) – The address the server should listen on for HTTP requests.

  • websocket_origin (str or list(str) (optional)) – A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.

  • threaded (boolean (optional, default=False)) – Whether to launch the Server on a separate thread, allowing interactive use.

  • verbose (boolean (optional, default=True)) – Whether to print the address and port

  • open (boolean (optional, default=True)) – Whether to open the server in a new browser tab

  • location (boolean or panel.io.location.Location) – Whether to create a Location component to observe and set the URL location.

Returns:

server – Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)

Return type:

bokeh.server.Server or panel.io.server.StoppableThread

Types#

ChatUI

ChatUI provides a high-level entrypoint to start chatting with your data

ChatUI.html
ExplorerUI

ExplorerUI provides a high-level entrypoint to start chatting with your data

ExplorerUI.html