Sanchit Verma commited on
Commit
1f597c7
·
1 Parent(s): 9553198

Refactor docstring in handle_message function for clarity

Browse files

Updated the docstring to provide a clearer description of the function's purpose and parameters in app.py.

Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -1,20 +1,20 @@
1
  import gradio as gr
 
 
2
  from prompts import PERSONAS
3
  from utils import generate_response
4
- from config import DEFAULT_PERSONA
5
 
6
 
7
  def handle_message(persona, user_input, history):
8
- """
9
- Handle a new message in the chat.
10
-
11
  Args:
12
- persona (str): The selected persona
13
- user_input (str): The user's message
14
- history (list): Chat history in messages format
15
-
16
- Returns:l
17
- list: Updated chat history with new messages
18
  """
19
  # Validate inputs
20
  if not persona or persona not in PERSONAS:
 
1
  import gradio as gr
2
+
3
+ from config import DEFAULT_PERSONA
4
  from prompts import PERSONAS
5
  from utils import generate_response
 
6
 
7
 
8
  def handle_message(persona, user_input, history):
9
+ """Process a chat message and return updated history.
10
+
 
11
  Args:
12
+ persona: Selected chat persona
13
+ user_input: User's message
14
+ history: Previous chat messages
15
+
16
+ Returns:
17
+ Updated chat history with new messages
18
  """
19
  # Validate inputs
20
  if not persona or persona not in PERSONAS: