cuery.tools.flex.score#

Flexible scorer tool for assigning scores to data records.

Attributes#

SCORER_PROMPT

SCORER_PARAM_NAMES

PURCHASE_PROB_PROMPT

Example description for a purchase probability score.

PURCHASE_PROB_PARAMS

Example parameters for a purchase probability score.

Classes#

Scorer

Classify intent for keywords based on their SERP results.

Functions#

make_score_model(name, type, min, max, description)

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

Module Contents#

cuery.tools.flex.score.SCORER_PROMPT = ''#
cuery.tools.flex.score.SCORER_PARAM_NAMES = ('name', 'type', 'min', 'max', 'description')#
cuery.tools.flex.score.PURCHASE_PROB_PROMPT = Multiline-String#
Show Value
"""
Estimate the probability of a purchase action based on the keyword and its associated
attributes. The score should be between 0 and 10, where 0 means no purchase probability and
10 means very high purchase probability. Consider the context of the keyword, its intent,
and any other relevant attributes that might indicate a user's likelihood to purchase.
"""

Example description for a purchase probability score.

cuery.tools.flex.score.PURCHASE_PROB_PARAMS#

Example parameters for a purchase probability score.

cuery.tools.flex.score.make_score_model(name, type, min, max, description)#

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

Parameters:
  • name (str)

  • type (str)

  • min (float)

  • max (float)

  • description (str)

Return type:

cuery.ResponseClass

class cuery.tools.flex.score.Scorer(/, **data)#

Bases: cuery.tools.flex.base.FlexTool

Classify intent for keywords based on their SERP results.

Parameters:

data (Any)

name: str#

Name of the score to assign.

type: Literal['integer', 'float'] = 'float'#

Whether to return the score as integer or float.

min: float#

Minimum value of the score.

max: float#

Maximum value of the score.

description: str#

Description of the score to assign.

classmethod validate_name(name)#

Ensure the name is a valid Python identifier.

Parameters:

name (str)

Return type:

str

property scorer_params: dict#

Get the parameters for the score model.

Return type:

dict

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