langtree.core.operator¶
Module Contents¶
Classes¶
A class to represent and process custom call and parse operations. |
Functions¶
|
Default call function that returns the provided keyword arguments. |
|
Default parse function that returns the provided output without modifications. |
|
Return a function with specific arguments frozen. |
- langtree.core.operator.default_call(*args, **kwargs)[source]¶
Default call function that returns the provided keyword arguments.
- Parameters:
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- Returns:
The provided keyword arguments.
- Return type:
dict
- langtree.core.operator.default_parse(output)[source]¶
Default parse function that returns the provided output without modifications.
- Parameters:
output – The output to parse.
- Returns:
The unmodified output.
- langtree.core.operator.freeze(function, **top_kwargs)[source]¶
Return a function with specific arguments frozen.
- Parameters:
function (callable) – The function to freeze arguments for.
**top_kwargs – Keyword arguments to freeze.
- Returns:
The function with specific arguments frozen.
- Return type:
callable
- class langtree.core.operator.Operator(call=default_call, parse=default_parse)[source]¶
Bases:
objectA class to represent and process custom call and parse operations.
- __call__(*args, **kwargs)[source]¶
Call the Operator’s call function and parse its result.
- Parameters:
*args – Variable length argument list.
**kwargs – Arbitrary keyword arguments.
- Returns:
The parsed result of the call function.