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

Function react_parser

toolbench/inference/utils.py:34–38  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

32
33# For prediction parsing, into ReACT format
34def react_parser(string):
35 thought = [string[string.find("Thought: ") + len("Thought: "): string.find("\nAction: ")]]
36 action = [string[string.find("Action: ") + len("Action: "): string.find("\nAction Input: ")]]
37 action_input = [string[string.find("Action Input: ") + len("Action Input: "):]]
38 return thought[0], action[0], action_input[0]
39
40# For toolllama's predictions
41def prepare_logits_processor(

Callers 4

parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected