AnjanSB commited on
Commit
7a5d4de
·
1 Parent(s): bd6d3b5

feat: fix bug

Browse files
Files changed (1) hide show
  1. app.py +0 -15
app.py CHANGED
@@ -5,20 +5,6 @@ from dotenv import load_dotenv
5
 
6
  load_dotenv()
7
 
8
- def transform_dict_to_list(data):
9
- """
10
- Transforms a dict of lists into a list of dicts.
11
- Assumes all lists have the same length.
12
- """
13
- keys = data.keys()
14
- # zip(*data.values()) transposes the lists of values
15
- transposed_values = zip(*data.values())
16
-
17
- # Create a list of dictionaries by zipping keys with each transposed row of values
18
- list_of_dicts = [dict(zip(keys, values)) for values in transposed_values]
19
-
20
- return list_of_dicts
21
-
22
  def respond(
23
  message,
24
  history,
@@ -37,7 +23,6 @@ def respond(
37
  )
38
 
39
  def sanitize_messages(history):
40
- history = transform_dict_to_list(history)
41
  return [
42
  {"role": m["role"], "content": m["content"]}
43
  for m in history
 
5
 
6
  load_dotenv()
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  def respond(
9
  message,
10
  history,
 
23
  )
24
 
25
  def sanitize_messages(history):
 
26
  return [
27
  {"role": m["role"], "content": m["content"]}
28
  for m in history