pykoi.component package#

Submodules#

pykoi.component.base module#

Base classes for components.

class pykoi.component.base.Chatbot(model: AbsLlm, **kwargs)[source]#

Bases: Component

Chatbot class represents a chatbot component.

model#

The model to use for the chatbot.

Type:

str

database#

The database to use for the chatbot.

Type:

str

class pykoi.component.base.Component(fetch_func: Callable | None, svelte_component: str, **kwargs)[source]#

Bases: object

Component class is the base class for all components.

id#

The unique identifier for the component.

Type:

str

data_source#

The data source for the component.

Type:

DataSource

svelte_component#

The name of the Svelte component.

Type:

str

props#

Additional properties for the component.

Type:

Dict[str, Any]

class pykoi.component.base.Dashboard(database: QuestionAnswerDatabase, **kwargs)[source]#

Bases: Component

Dashboard class represents a dashboard component.

database#

The database to use for the dashboard.

Type:

str

class pykoi.component.base.DataSource(id: str, fetch_func: Callable)[source]#

Bases: object

DataSource class is used to fetch data from a source using a provided function.

id#

The unique identifier for the data source.

Type:

str

fetch_func#

The function to fetch data from the source.

Type:

Callable

class pykoi.component.base.Dropdown(fetch_func: Callable, value_column: List[str], **kwargs)[source]#

Bases: Component

Dropdown class represents a dropdown component.

value_column#

The column to use for the dropdown values.

Type:

str

class pykoi.component.base.RAG(**kwargs)[source]#

Bases: Component

RAG class represents a RAG component.

Attributes:

pykoi.component.chatbot_database_factory module#

Chatbot Database Factory class.

class pykoi.component.chatbot_database_factory.ChatbotDatabaseFactory[source]#

Bases: object

A factory class for creating chatbot databases.

static create(feedback: str | FeedbackType)[source]#

Create a chatbot database.

Parameters:

feedback (Union[str, FeedbackType]) – The type of the chatbot.

Returns:

The created database.

Return type:

Union[QuestionAnswerDatabase, RankingDatabase]

pykoi.component.constants module#

Component constants.

class pykoi.component.constants.FeedbackType(value)[source]#

Bases: Enum

Feedback type.

RANK = 'rank'#
VOTE = 'vote'#

Module contents#