Skip to contents

set_temperature sets the temperature for the model used in the workflow.

Usage

set_temperature(workflow_obj, temperature)

Arguments

workflow_obj

an ai_workflow object created by ai_workflow() in the first place.

temperature

the temperature value used by the model. Should be between 0 and 1 (boundaries included).

Details

Set the temperature to be used by the model in the workflow. A temperature of zero will always give the same answer. A temperature of 1 will give very random answers that may not make full sense. Ideally if you want some level of randomness while still remaining sensible answers, you should target a value around 0.6 or 0.7. If you are trying to validate an AI workflow for specific answers to specific prompts, it is highly recommended to work with a temperature of zero.

Examples

my_workflow <- ai_workflow() |> 
set_model(model_name="llama3:8b-instruct-q5_0") |> 
set_temperature(0.8)