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

Function process_system_message

toolbench/utils.py:9–15  ·  view source on GitHub ↗
(system_message, functions)

Source from the content-addressed store, hash-verified

7
8
9def process_system_message(system_message, functions):
10 assert "with a function call to actually excute your step." in system_message
11 # we find that following ReACT format and merging the thought node and function call node is easier for model to learn to integrate the action input json string in its prediction than learn to predict a json string directly.
12 system_message = system_message.replace("with a function call to actually excute your step.", "with a function call to actually excute your step. Your output should follow this format:\nThought:\nAction\nAction Input:\n")
13 # add all the function dicts in the prompt.
14 system_message = system_message + "\nSpecifically, you have access to the following APIs: " + str(functions)
15 return system_message
16
17def get_gpu_memory(max_gpus=None):
18 """Get available memory for each GPU."""

Callers 4

parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
preprocess_rapidapiFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected