MCPcopy
hub / github.com/landing-ai/vision-agent / text

Method text

vision_agent/utils/execute.py:271–289  ·  view source on GitHub ↗

Returns the text representation of this object, i.e. including the main result or the error traceback, optionally along with the logs (stdout, stderr).

(self, include_logs: bool = True, include_results: bool = True)

Source from the content-addressed store, hash-verified

269 "Error object if an error occurred, None otherwise."
270
271 def text(self, include_logs: bool = True, include_results: bool = True) -> str:
272 """Returns the text representation of this object, i.e. including the main
273 result or the error traceback, optionally along with the logs (stdout, stderr).
274 """
275 prefix = str(self.logs) if include_logs else ""
276 if self.error:
277 return prefix + "\n----- Error -----\n" + self.error.traceback
278
279 if include_results:
280 result_str = [
281 (
282 f"----- Final output -----\n{res.text}"
283 if res.is_main_result
284 else f"----- Intermediate output-----\n{res.text}"
285 )
286 for res in self.results
287 ]
288 return prefix + "\n" + "\n".join(result_str)
289 return prefix
290
291 @property
292 def success(self) -> bool:

Callers 13

run_tool_testingFunction · 0.80
get_tool_for_taskFunction · 0.80
overlay_bounding_boxesFunction · 0.80
_plot_countingFunction · 0.80
overlay_bboxesFunction · 0.80
debug_codeFunction · 0.80
test_codeFunction · 0.80
maybe_run_actionFunction · 0.80
run_codeFunction · 0.80
execute_code_actionFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_codeFunction · 0.64