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

Method display_conversation

toolbench/inference/LLM/davinci_model.py:52–71  ·  view source on GitHub ↗
(self, detailed=False)

Source from the content-addressed store, hash-verified

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")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected