Move files
This commit is contained in:
parent
cf0ac4b161
commit
0bf865ce2a
1 changed files with 117 additions and 2394 deletions
|
|
@ -1,30 +0,0 @@
|
|||
import inspect
|
||||
from typing import Any, Callable, TypeVar
|
||||
|
||||
from great_ai.great_ai.helper.get_function_metadata_store import (
|
||||
get_function_metadata_store,
|
||||
)
|
||||
|
||||
from .parameter import parameter
|
||||
|
||||
F = TypeVar("F", bound=Callable[..., Any])
|
||||
|
||||
|
||||
def automatically_decorate_parameters(func: F) -> F:
|
||||
signature = inspect.signature(func)
|
||||
parameter_names = [
|
||||
param.name
|
||||
for param in signature.parameters.values()
|
||||
if param.kind == param.POSITIONAL_OR_KEYWORD
|
||||
]
|
||||
|
||||
metadata = get_function_metadata_store(func)
|
||||
|
||||
for name in parameter_names:
|
||||
if (
|
||||
name not in metadata.model_parameter_names
|
||||
and name not in metadata.input_parameter_names
|
||||
):
|
||||
func = parameter(name)(func)
|
||||
|
||||
return func
|
||||
Loading…
Reference in a new issue