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