MCPcopy Create free account
hub / github.com/OpenBMB/ToolBench / display_conversation

Method display_conversation

toolbench/inference/LLM/llama_model.py:57–76  ·  view source on GitHub ↗
(self, detailed=False)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected