MetaGPT
1# function in tools, https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools
2# Reference: https://github.com/KillianLucas/open-interpreter/blob/v0.1.14/interpreter/llm/setup_openai_coding_llm.py
3GENERAL_FUNCTION_SCHEMA = {4"name": "execute",5"description": "Executes code on the user's machine, **in the users local environment**, and returns the output",6"parameters": {7"type": "object",8"properties": {9"language": {10"type": "string",11"description": "The programming language (required parameter to the `execute` function)",12"enum": [13"python",14"R",15"shell",16"applescript",17"javascript",18"html",19"powershell",20],21},22"code": {"type": "string", "description": "The code to execute (required)"},23},24"required": ["language", "code"],25},26}
27
28
29# tool_choice value for general_function_schema
30# https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice
31GENERAL_TOOL_CHOICE = {"type": "function", "function": {"name": "execute"}}32