cuery.tool ========== .. py:module:: cuery.tool .. autoapi-nested-parse:: Base classes for tools with well-defined input and output interfaces. Tools are essentially wrappers of Tasks. But they use pydantic models to also define the *input* interface. The inputs are then used to customize a task's prompt, response model and input context. They're only really useful if a task's prompt or response are configurable, e.g. a classification task with configurable number of classes. Classes ------- .. autoapisummary:: cuery.tool.Tool Module Contents --------------- .. py:class:: Tool(/, **data) Bases: :py:obj:`cuery.utils.Configurable`, :py:obj:`abc.ABC` Base class for all tools. Subclasses need to implement prompt and response models; either statically as ClassVars, or dynamically as (executable) instance properties. .. py:attribute:: model_config Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict]. .. py:attribute:: model :type: str :value: None The LLM provider and model to use. .. py:property:: response_model :type: cuery.response.ResponseClass :abstractmethod: Defines the response model for this tool (ClassVar or property). .. py:property:: prompt :type: cuery.prompt.Prompt :abstractmethod: Defines the prompt for this tool (ClassVar or property). .. py:property:: task :type: cuery.task.Task Create a Task instance for this tool. .. py:property:: context :type: cuery.context.AnyContext | None .. py:method:: __call__(**kwargs) :async: