morpheus_llm.llm.task_handlers.simple_task_handler.SimpleTaskHandler#

class SimpleTaskHandler(output_columns=None)[source]#

Bases: LLMTaskHandler

Copies fields from an LLMContext to columns in the DataFrame contained in the ControlMessage payload.

Parameters:
output_columnslist[str], optional

The list of columns to copy from the LLMContext instance to the DataFrame. If None, defaults to ["response"].

Methods

get_input_names(self)

Get the input names for the task handler.

try_handle(self, context)

Convert the given context into a list of ControlMessage instances.

get_input_names(
self: morpheus_llm._lib.llm.LLMTaskHandler,
) list[str][source]#

Get the input names for the task handler.

Returns:
list[str]

The input names for the task handler.

async try_handle(
self: morpheus_llm._lib.llm.LLMTaskHandler,
context: morpheus_llm._lib.llm.LLMContext,
) Awaitable[list[morpheus._lib.messages.ControlMessage] | None][source]#

Convert the given context into a list of ControlMessage instances.

Parameters:
contextmorpheus._lib.llm.LLMContext

Context instance to use for the execution

Returns:
Task[Optional[list[ControlMessage]]]