()
| 154 | |
| 155 | |
| 156 | def test_nested_data_function(): |
| 157 | func_schema = function_schema(complex_args_function) |
| 158 | assert isinstance(func_schema.params_json_schema, dict) |
| 159 | assert func_schema.params_json_schema.get("title") == "complex_args_function_args" |
| 160 | |
| 161 | # Valid input |
| 162 | model = OuterModel(inner=InnerModel(a=1, b="hello"), foo=Foo(a=2, b="world")) |
| 163 | valid_input = { |
| 164 | "model": model.model_dump(), |
| 165 | } |
| 166 | |
| 167 | parsed = func_schema.params_pydantic_model(**valid_input) |
| 168 | args, kwargs_dict = func_schema.to_call_args(parsed) |
| 169 | |
| 170 | result = complex_args_function(*args, **kwargs_dict) |
| 171 | assert result == "1, hello, 2, world" |
| 172 | |
| 173 | |
| 174 | def complex_args_and_docs_function(model: OuterModel, some_flag: int = 0) -> str: |
nothing calls this directly
no test coverage detected