mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
update env api schema
This commit is contained in:
parent
52a94470db
commit
9f4ee42079
4 changed files with 44 additions and 9 deletions
|
|
@ -340,6 +340,14 @@ def print_members(module, indent=0):
|
|||
print(f"{prefix}Method: {name}")
|
||||
|
||||
|
||||
def get_function_schema(func: Callable) -> dict[str, Union[dict, Any, str]]:
|
||||
sig = inspect.signature(func)
|
||||
parameters = sig.parameters
|
||||
return_type = sig.return_annotation
|
||||
param_schema = {name: parameter.annotation for name, parameter in parameters.items()}
|
||||
return {"input_params": param_schema, "return_type": return_type, "func_desc": func.__doc__, "func": func}
|
||||
|
||||
|
||||
def parse_recipient(text):
|
||||
# FIXME: use ActionNode instead.
|
||||
pattern = r"## Send To:\s*([A-Za-z]+)\s*?" # hard code for now
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue