cuery.tools.flex.score ====================== .. py:module:: cuery.tools.flex.score .. autoapi-nested-parse:: Flexible scorer tool for assigning scores to data records. Attributes ---------- .. autoapisummary:: cuery.tools.flex.score.SCORER_PROMPT cuery.tools.flex.score.SCORER_PARAM_NAMES cuery.tools.flex.score.PURCHASE_PROB_PROMPT cuery.tools.flex.score.PURCHASE_PROB_PARAMS Classes ------- .. autoapisummary:: cuery.tools.flex.score.Scorer Functions --------- .. autoapisummary:: cuery.tools.flex.score.make_score_model Module Contents --------------- .. py:data:: SCORER_PROMPT :value: '' .. py:data:: SCORER_PARAM_NAMES :value: ('name', 'type', 'min', 'max', 'description') .. py:data:: PURCHASE_PROB_PROMPT :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ 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. """ .. raw:: html
Example description for a purchase probability score. .. py:data:: PURCHASE_PROB_PARAMS Example parameters for a purchase probability score. .. py:function:: make_score_model(name, type, min, max, description) Dynamically create a response model for a score based on provided parameters. .. py:class:: Scorer(/, **data) Bases: :py:obj:`cuery.tools.flex.base.FlexTool` Classify intent for keywords based on their SERP results. .. py:attribute:: name :type: str Name of the score to assign. .. py:attribute:: type :type: Literal['integer', 'float'] :value: 'float' Whether to return the score as integer or float. .. py:attribute:: min :type: float Minimum value of the score. .. py:attribute:: max :type: float Maximum value of the score. .. py:attribute:: description :type: str Description of the score to assign. .. py:method:: validate_name(name) :classmethod: Ensure the name is a valid Python identifier. .. py:property:: scorer_params :type: dict Get the parameters for the score model. .. py:property:: prompt :type: cuery.Prompt Defines the prompt for this tool (ClassVar or property). .. py:property:: response_model :type: cuery.ResponseClass Defines the response model for this tool (ClassVar or property).