Skip to content

Commit 2cb50d8

Browse files
author
camel-docs-bot
committed
Auto-update documentation after merge [skip ci]
1 parent d64f52f commit 2cb50d8

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/mintlify/reference/camel.toolkits.function_tool.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,3 +460,35 @@ the method will raise :obj:`jsonschema.exceptions.SchemaError`.
460460
**Parameters:**
461461

462462
- **value** (Dict[str, Any]): the new dictionary value for the function's parameters.
463+
464+
<a id="camel.toolkits.function_tool.tool"></a>
465+
466+
## tool
467+
468+
```python
469+
def tool(func: Optional[Callable] = None):
470+
```
471+
472+
A decorator that converts a Python function into a FunctionTool
473+
instance.
474+
475+
This decorator can be used with or without parentheses:
476+
- @tool - without parentheses, uses default settings
477+
- @tool() - with parentheses, uses default settings
478+
- @tool(synthesize_output=True) - with custom settings
479+
480+
**Parameters:**
481+
482+
- **func** (Optional[Callable], optional): The function to be decorated. This is automatically passed when using @tool without parentheses. (default: :obj:`None`)
483+
- **openai_tool_schema** (Optional[Dict[str, Any]], optional): A user-defined OpenAI tool schema to override the default result. (default: :obj:`None`)
484+
- **synthesize_schema** (bool, optional): Whether to enable schema synthesis. (default: :obj:`False`)
485+
- **synthesize_schema_model** (Optional[BaseModelBackend], optional): Model to use for schema synthesis. (default: :obj:`None`)
486+
- **synthesize_schema_max_retries** (int, optional): Maximum number of retries for schema synthesis. (default: :obj:`2`)
487+
- **synthesize_output** (bool, optional): Whether to enable output synthesis. (default: :obj:`False`)
488+
- **synthesize_output_model** (Optional[BaseModelBackend], optional): Model to use for output synthesis. (default: :obj:`None`)
489+
- **synthesize_output_format** (Optional[Type[BaseModel]], optional): Format for synthesized output. (default: :obj:`None`)
490+
491+
**Returns:**
492+
493+
Callable[[Callable], FunctionTool]: A decorator function that converts
494+
the decorated function into a FunctionTool instance.

0 commit comments

Comments
 (0)