@reward_function
decorator transforms a regular Python function into a reward function with standardized inputs/outputs and deployment capabilities.
.deploy()
method for deploying the function to Fireworks@reward_function
should accept the following parameters:
messages
(List[Dict[str, str]]
): Required. List of conversation messages, with the last message typically being the one evaluated.
original_messages
(Optional[List[Dict[str, str]]]
): Optional. The conversation context, without the message being evaluated.
**kwargs
: Optional. Additional parameters (like metadata) that can be passed to the function.
EvaluateResult
object or a compatible tuple format:
.deploy()
.deploy()
method to the function, allowing it to be deployed to Fireworks.
name
(str
): Required. ID for the deployed evaluator.
description
(str
): Optional. Human-readable description of the evaluator.
account_id
(Optional[str]
): Optional. Fireworks account ID. If not provided, will be read from config or environment.
auth_token
(Optional[str]
): Optional. Authentication token. If not provided, will be read from config or environment.
force
(bool
): Optional. Whether to overwrite an existing evaluator with the same name. Default is False.
providers
(Optional[List[Dict[str, str]]]
): Optional. List of provider configurations. If not provided, uses a default provider.
str
: The evaluation ID that can be used in RL training.ValueError
: Raised if authentication fails or required parameters are missing.requests.exceptions.HTTPError
: Raised if the API request fails.EvaluateResult
or a compatible tupleEvaluateResult
object.
.deploy()
is called, the decorator: