Task
Subpackages
- llmsmith.task.retrieval package
- llmsmith.task.textgen package
Submodules
llmsmith.task.base module
- class llmsmith.task.base.Task(name: str)
Bases:
Generic[T,U],ABCBase class for all tasks. All subclasses of Task should implement the execute method. In case you are using some LLM (or DB for retrieval) which is still not supported by this library, you can write your own implementation easily by subclassing Task.
- Parameters:
name (str) – The name of the task. The task name should be non-empty.
- Raises:
ValueError – If task name fails validation.
- abstract async execute(task_input: TaskInput[T]) TaskOutput[U]
Abstract method for executing the task.
- Parameters:
task_input (TaskInput[T]) – The input to the task.
- Returns:
The output of the task.
- Return type:
TaskOutput[U]
- name() str
Returns the name of the task.
- Returns:
task name.
- Return type:
str
llmsmith.task.models module
- class llmsmith.task.models.ChatResponse(text: str, raw_output: Any, function_calls: dict[str, llmsmith.task.models.FunctionCall] = None)
Bases:
object- function_calls: dict[str, FunctionCall] = None
- raw_output: Any
- text: str