MCPcopy
hub / github.com/zai-org/ChatGLM3 / contains_custom_function

Function contains_custom_function

openai_api_demo/api_server.py:515–526  ·  view source on GitHub ↗

Determine whether 'function_call' according to a special function prefix. For example, the functions defined in "tools_using_demo/tool_register.py" are all "get_xxx" and start with "get_" [Note] This is not a rigorous judgment method, only for reference. :param value: :return

(value: str)

Source from the content-addressed store, hash-verified

513
514
515def contains_custom_function(value: str) -> bool:
516 """
517 Determine whether 'function_call' according to a special function prefix.
518
519 For example, the functions defined in "tools_using_demo/tool_register.py" are all "get_xxx" and start with "get_"
520
521 [Note] This is not a rigorous judgment method, only for reference.
522
523 :param value:
524 :return:
525 """
526 return value and 'get_' in value
527
528
529if __name__ == "__main__":

Callers 2

create_chat_completionFunction · 0.70
predict_streamFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected