cuery.tools.flex.generic ======================== .. py:module:: cuery.tools.flex.generic .. autoapi-nested-parse:: Tool(s) to iterate over data with a response model defined by json schemas. The idea is to first generate a schema with an LLM using the `SchemaGenerator` tool, then use that schema process records with the `Generic` tool. Attributes ---------- .. autoapisummary:: cuery.tools.flex.generic.GENERIC_PROMPT cuery.tools.flex.generic.SCHEMA_CONVERSION_PROMPT Classes ------- .. autoapisummary:: cuery.tools.flex.generic.Generic cuery.tools.flex.generic.Auto Module Contents --------------- .. py:data:: GENERIC_PROMPT :value: '' .. py:data:: SCHEMA_CONVERSION_PROMPT :value: '' .. py:class:: Generic(/, **data) Bases: :py:obj:`cuery.tools.flex.base.FlexTool` Tools that iterates over records with a JSON-schema response model. .. py:attribute:: response_schema :type: dict JSON schema used as response model. .. py:attribute:: instructions :type: str Instructions for the tool, describing its purpose and how to use it. .. py:property:: prompt :type: cuery.Prompt Generate a prompt string based on the instructions and current schema. .. py:property:: response_model :type: cuery.ResponseClass Defines the response model for this tool (ClassVar or property). .. py:class:: Auto(/, **data) Bases: :py:obj:`Generic` Fully automatic, general-purpose tool for processing data records. First auto-generates a response model from the response model instructions, then iterates over the records using that model and the provided tools instructions. .. py:attribute:: response_schema :type: str | dict | None :value: None Instructions to generate a JSON schema used as response model. .. py:attribute:: schema_model :type: str :value: None Specific model to use to generate the JSON schema. .. py:attribute:: _response :type: cuery.ResponseSet | None :value: None .. py:property:: prompt :type: cuery.Prompt Generate a prompt string based on the instructions and current schema. .. py:method:: response_model() :async: Defines the response model for this tool (ClassVar or property). .. py:method:: task() :async: Create a Task instance for this tool. .. py:method:: __call__(**kwargs) :async: Normalize the nested input records back into individual columns in output.