When the tool expects complex inputs that require nested models, pydantic will generate a JSON Schema that will include references to other schemas using the `$ref` keyword (cf https://json-schema.org/understanding-json-schema/structuring#dollarref).
But the `$ref` keyword is not supported by OpenAI.
This fix:
1. Resolves the references and inlines the corresponding schemas.
2. Removes the then useless root `$defs` field of the JSON schema to save tokens.
Co-authored-by: Jean-Marc Le Roux <contact@jmlx.io>
Co-authored-by: Jack Gerrits <jackgerrits@users.noreply.github.com>
* Remove isinstance check from FunctionTool (#3987)
* Move __init__ Args to class docstring
---------
Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
* add tests to ruff for core
* fmt
* lint
* lint fixes
* fixup more dirs
* dont include non python
* lint fixes
* lint fixes
* fix dir name
* dont relative include