morpheus.llm.task_handlers.simple_task_handler.SimpleTaskHandler

class SimpleTaskHandler(output_columns=None)[source]

Bases: morpheus._lib.llm.LLMTaskHandler

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

Parameters
output_columns

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._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._lib.llm.LLMTaskHandler, context: morpheus._lib.llm.LLMContext)Awaitable[Optional[List[morpheus._lib.messages.ControlMessage]]][source]

Convert the given context into a list of ControlMessage instances.

Parameters
context : morpheus._lib.llm.LLMContext

Context instance to use for the execution

Returns
Task[Optional[list[ControlMessage]]]

Previous morpheus.llm.task_handlers.simple_task_handler
Next morpheus.loaders
© Copyright 2024, NVIDIA. Last updated on Apr 25, 2024.