implement

implement(
    definition: str,
    configs: list[dict] | None = None,
    assertions: str | Callable[[str], tuple[str, float]] | None = <function generate_assertions>
) -> tuple[str, float]

(openai<1) Implement a function from a definition.

Parameters:
NameDescription
definitionThe function definition, including the signature and docstr.

Type: str
configsThe list of configurations for completion.

Type: list[dict] | None

Default: None
assertionsThe assertion code which serves as a filter of the responses, or an assertion generator.

Type: str | Callable[[str], tuple[str, float]] | None

Default: <function generate_assertions>
Returns:
TypeDescription
tuple[str, float]str: The implementation. float: The cost of the implementation. int: The index of the configuration which generates the implementation.