cuery.tools.schema ================== .. py:module:: cuery.tools.schema Attributes ---------- .. autoapisummary:: cuery.tools.schema.SYSTEM_PROMPT cuery.tools.schema.CONVERSATIONAL_SYSTEM_PROMPT cuery.tools.schema.SCHEMA_CONTEXT Classes ------- .. autoapisummary:: cuery.tools.schema.SchemaResponse cuery.tools.schema.ConversationalSchemaResponse cuery.tools.schema.SchemaGenerator Module Contents --------------- .. py:data:: SYSTEM_PROMPT :value: '' .. py:data:: CONVERSATIONAL_SYSTEM_PROMPT :value: '' .. py:data:: SCHEMA_CONTEXT :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Please modify, extend, or replace the schema in the following section based on the user's request. If the user wants to add fields, merge them with the existing schema. If they want to remove fields, remove them from the existing schema. If they want to modify field types or descriptions, update the existing schema accordingly. ## Current Schema {schema} """ .. raw:: html
.. py:class:: SchemaResponse(/, **data) Bases: :py:obj:`cuery.Response` Response from the AI that includes both conversation and schema update. .. py:attribute:: reasoning :type: str Brief explanation of schema design choices .. py:attribute:: json_schema :type: dict[str, Any] Valid JSON schema as a dictionary defining a structured output .. py:method:: validate_json_schema(json_schema) :classmethod: Validate that the schema is a proper JSON schema. .. py:class:: ConversationalSchemaResponse(/, **data) Bases: :py:obj:`SchemaResponse` Response from the AI that includes both conversation and schema update. .. py:attribute:: answer :type: str Conversational response to the user .. py:attribute:: examples :type: list[dict[str, Any]] :value: None Some example records that conform to the schema .. py:method:: validate_examples(examples, info) :classmethod: Validate that example data conforms to the schema. .. py:class:: SchemaGenerator(/, **data) Bases: :py:obj:`cuery.Tool` Create or modify a JSON schema given a prompt and optionally an existing schema. .. py:attribute:: instructions :type: str Prompt instructions with details of the schema to generate. .. py:attribute:: current_schema :type: dict | None :value: None Optional existing schema to modify or extend. .. py:attribute:: response_model :type: ClassVar[cuery.ResponseClass] All instances of this tool will use the SchemaResponse model. .. py:property:: prompt :type: cuery.Prompt Add system and assistant messages to user's prompt. .. py:method:: __call__(**kwds) :async: Extracts a two-level topic hierarchy from a list of texts.