MCPcopy Create free account
hub / github.com/AutoPackAI/autopack / format_pack_to_openai_function

Function format_pack_to_openai_function

autopack/utils.py:108–123  ·  view source on GitHub ↗
(pack: "Pack")

Source from the content-addressed store, hash-verified

106
107
108def format_pack_to_openai_function(pack: "Pack") -> dict[str, Any]:
109 # Change this if/when other LLMs support functions
110 required = []
111 run_args = pack.args
112 for arg_name, arg in run_args.items():
113 arg_required = arg.pop("required", [])
114 if arg_required:
115 required.append(arg_name)
116 run_args[arg_name] = arg
117
118 return {
119 "name": pack.name,
120 "description": pack.description,
121 "parameters": {"type": "object", "properties": run_args},
122 "required": required,
123 }
124
125
126def run_args_from_args_schema(args_schema: type[BaseModel]) -> dict[str, dict[str, str]]:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected