(self, detailed=False)
| 55 | self.conversation_history = messages |
| 56 | |
| 57 | def display_conversation(self, detailed=False): |
| 58 | role_to_color = { |
| 59 | "system": "red", |
| 60 | "user": "green", |
| 61 | "assistant": "blue", |
| 62 | "function": "magenta", |
| 63 | } |
| 64 | print("before_print"+"*"*50) |
| 65 | for message in self.conversation_history: |
| 66 | print_obj = f"{message['role']}: {message['content']} " |
| 67 | if "function_call" in message.keys(): |
| 68 | print_obj = print_obj + f"function_call: {message['function_call']}" |
| 69 | print_obj += "" |
| 70 | print( |
| 71 | colored( |
| 72 | print_obj, |
| 73 | role_to_color[message["role"]], |
| 74 | ) |
| 75 | ) |
| 76 | print("end_print"+"*"*50) |
| 77 | |
| 78 | def parse(self,functions,process_id,**args): |
| 79 | conv = get_conversation_template(self.template) |
nothing calls this directly
no outgoing calls
no test coverage detected