Use system instructions to steer the behavior of a model

This commit is contained in:
ajaysi
2024-08-18 17:37:30 +05:30
parent b97ad5eb2b
commit c4af40f93d
3 changed files with 29 additions and 10 deletions

View File

@@ -30,7 +30,14 @@ def read_return_config_section(config_section):
with open(config_path, 'r', encoding="utf-8") as file:
config = json.load(file)
if config_section == 'llm_config':
if config_section == 'system_prompt':
prompt_file_path = os.path.join(os.getcwd(), 'lib', 'workspace', 'alwrity_prompts', 'alwrity_system_instruction.prompts')
with open(prompt_file_path, 'r') as file:
content = file.read()
return content
elif config_section == 'llm_config':
gpt_provider = config['LLM Options']['GPT Provider']
model = config['LLM Options']['Model']
temperature = config['LLM Options']['Temperature']