Skip to contents

set_system_prompt sets the system prompt to be used by the model.

Usage

set_system_prompt(workflow_obj, system_prompt)

Arguments

workflow_obj

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

system_prompt

the mode to be used by the model in the workflow - it needs to be either 'chat' or 'completion'.

Value

the workflow object with the system prompt specified as new parameter.

Details

This sets the system prompt of the model in the workflow. This is where you can give additional guidance or a personality to change the way your model will answer prompts.

Examples

my_workflow <- ai_workflow() |> 
set_system_prompt(system_prompt="You are a helpful AI assistant. 
Answer to the best of your knowledge")
my_workflow <- ai_workflow() |> 
set_system_prompt(system_prompt="You are a helpful AI assistant
 and an expert in financial analysis.")