provide LLM the dialogue history and the current prompt to get response
(self, current_prompt, history)
| 32 | {"role": "system", "content": self.prefix}] |
| 33 | |
| 34 | def execute(self, current_prompt, history): |
| 35 | ''' provide LLM the dialogue history and the current prompt to get response ''' |
| 36 | messages = self.messages + history |
| 37 | messages.append({'role': 'user', "content": current_prompt + self.suffix}) |
| 38 | response, status = self.LLM.run(messages) |
| 39 | if status: |
| 40 | return response |
| 41 | else: |
| 42 | return "OpenAI API error." |