morpheus.llm.task_handlers.simple_task_handler.SimpleTaskHandler
- class SimpleTaskHandler(output_columns=None)[source]
Bases:
<a href="morpheus.llm.html#morpheus.llm.LLMTaskHandler">morpheus._lib.llm.LLMTaskHandler</a>
Copies fields from an
LLMContext
to columns in the DataFrame contained in theControlMessage
payload.- Parameters
- output_columns
The list of columns to copy from the
LLMContext
instance to the DataFrame. If<a href="https://docs.python.org/3/library/constants.html#None">None</a>
, defaults to["response"]
.
Methods
<a href="#morpheus.llm.task_handlers.simple_task_handler.SimpleTaskHandler.get_input_names">get_input_names</a>
(self)Get the input names for the task handler. <a href="#morpheus.llm.task_handlers.simple_task_handler.SimpleTaskHandler.try_handle">try_handle</a>
(self, context)Convert the given context
into a list ofControlMessage
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 ofControlMessage
instances.- Parameters
-
context :
<a href="morpheus.llm.html#morpheus.llm.LLMContext">morpheus._lib.llm.LLMContext</a>
Context instance to use for the execution
-
context :
- Returns
- Task[Optional[list[ControlMessage]]]