Skip to content

Commit

Permalink
Swap order of functions
Browse files Browse the repository at this point in the history
  • Loading branch information
chowington committed Nov 22, 2024
1 parent 2d23fba commit 01675b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ def safe_generate_structured_response(
return fail_safe_response



def get_embedding(text, model=openai_config["embeddings"]):
text = text.replace("\n", " ")
if not text:
Expand Down
16 changes: 8 additions & 8 deletions reverie/backend_server/persona/prompt_template/run_gpt_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2711,14 +2711,16 @@ def __chat_func_validate(gpt_response, prompt=""): ############
example_output = 'Jane Doe was interesting to talk to.' ########
special_instruction = 'The output should ONLY contain a string that summarizes anything interesting that the agent may have noticed' ########
fail_safe = get_fail_safe() ########
output = safe_generate_structured_response(
output = ChatGPT_safe_generate_structured_response(
prompt,
gpt_param,
Convo_Takeaways,
5,
example_output,
special_instruction,
3,
fail_safe,
__chat_func_validate,
__chat_func_clean_up,
True
)
if output != False:
return output, [output, prompt, gpt_param, prompt_input, fail_safe]
Expand All @@ -2732,16 +2734,14 @@ def __chat_func_validate(gpt_response, prompt=""): ############
prompt = generate_prompt(prompt_input, prompt_template)

fail_safe = get_fail_safe()
output = ChatGPT_safe_generate_structured_response(
output = safe_generate_structured_response(
prompt,
gpt_param,
Convo_Takeaways,
example_output,
special_instruction,
3,
5,
fail_safe,
__chat_func_validate,
__chat_func_clean_up,
True
)

if debug or verbose:
Expand Down

0 comments on commit 01675b5

Please sign in to comment.