cuery.tools.flex.classify#

Attributes#

Classes#

Classifier

Zero-shot classify a data record with arbitrary attributes.

Functions#

prompt_definitions(categories)

Generate the definitions section for the entity extraction prompt.

make_category_model(categories)

Dynamically create a response model for a score based on provided parameters.

Module Contents#

cuery.tools.flex.classify.PROMPT = ''#
cuery.tools.flex.classify.prompt_definitions(categories)#

Generate the definitions section for the entity extraction prompt.

Parameters:

categories (dict[str, str])

Return type:

str

cuery.tools.flex.classify.make_category_model(categories)#

Dynamically create a response model for a score based on provided parameters.

Parameters:

categories (dict[str, str])

Return type:

cuery.ResponseClass

class cuery.tools.flex.classify.Classifier(/, **data)#

Bases: cuery.tools.flex.base.FlexTool

Zero-shot classify a data record with arbitrary attributes.

Parameters:

data (Any)

categories: dict[str, str]#

Dictionary of category labels and their descriptions.

instructions: str = ''#

Additional instructions (context) for the classification task.

property prompt: cuery.Prompt#

Defines the prompt for this tool (ClassVar or property).

Return type:

cuery.Prompt

property response_model: cuery.ResponseClass#

Defines the response model for this tool (ClassVar or property).

Return type:

cuery.ResponseClass