ha1772007 commited on
Commit
88ff633
·
verified ·
1 Parent(s): e9b73c4

Update chat.py

Browse files
Files changed (1) hide show
  1. chat.py +8 -0
chat.py CHANGED
@@ -16,6 +16,14 @@ def langchainConversation(conversation):
16
  chat_template = ChatPromptTemplate.from_messages(prompts)
17
  return chat_template.format_messages()
18
  def segmind_input_parser(input):
 
 
 
 
 
 
 
 
19
  toreturn = []
20
  for thisdict in input:
21
  toreturn.append({'role':thisdict['role'],'content':thisdict['context']})
 
16
  chat_template = ChatPromptTemplate.from_messages(prompts)
17
  return chat_template.format_messages()
18
  def segmind_input_parser(input):
19
+ toreturn = []
20
+ for thisdict in input:
21
+ if(thisdidt['role'] == 'ai'):
22
+ toreturn.append({'role':'assistant','content':thisdict['context']})
23
+ else:
24
+ toreturn.append({'role':thisdict['role'],'content':thisdict['context']})
25
+ return toreturn
26
+ def workers_input_parser(input):
27
  toreturn = []
28
  for thisdict in input:
29
  toreturn.append({'role':thisdict['role'],'content':thisdict['context']})