brestok commited on
Commit
7373a4a
·
1 Parent(s): b2a0883

Add dynamic handling for changed fields in prompts

Browse files

Introduced the `field_changed` variable to dynamically reflect which fields require updates when generating messages and prompts. Adjusted the prompt template to incorporate `{field_changed}`, improving clarity in user guidance when no clinics are found.

trauma/api/message/ai/openai_request.py CHANGED
@@ -71,7 +71,9 @@ async def generate_final_response(
71
 
72
  @openai_wrapper(temperature=0.8)
73
  async def generate_empty_final_response(
74
- user_message: str, message_history_str: str, empty_field_instructions: dict
 
 
75
  ):
76
  field_changed = ", ".join(empty_field_instructions.keys())
77
  messages = [
 
71
 
72
  @openai_wrapper(temperature=0.8)
73
  async def generate_empty_final_response(
74
+ user_message: str,
75
+ message_history_str: str,
76
+ empty_field_instructions: dict
77
  ):
78
  field_changed = ", ".join(empty_field_instructions.keys())
79
  messages = [