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

Method sift_first_invalid_message

toolbench/inference/Tree/Tree.py:141–150  ·  view source on GitHub ↗
(messages)

Source from the content-addressed store, hash-verified

139 Returns chained results, starting from this node up to the root node
140 '''
141 def sift_first_invalid_message(messages):
142 use_messages = []
143 flag = True
144 for message_id in range(len(messages))[::-1]:
145 if not ("valid" in messages[message_id].keys() and messages[message_id]["valid"] == False):
146 use_messages = [messages[message_id]] + use_messages
147 elif flag:
148 flag = False
149 use_messages = [messages[message_id]] + use_messages
150 return use_messages
151
152 now_node = self
153 result = []

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected