Commit bafc7b9
committed
bug #805 Feature/treat nullable fields as required (HaKIMus)
This PR was squashed before being merged into the main branch.
Discussion
----------
Feature/treat nullable fields as required
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Docs? | no <!-- required for new features -->
| Issues | Fix #585 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
Context: #585 (comment)
Summary: Nullable fields must be present in the required list of their parent output structure, otherwise platforms (like openai) will reject the call.
Proof of work: #585 (comment)
`structured-output-union-types.php` output:
```php
file:///~/ai/examples/openai/structured-output-union-types.php#L33 Symfony\AI\Fixtures\StructuredOutput\UnionType\UnionTypeDtofile:///~/ai/fixtures/StructuredOutput/UnionType/UnionTypeDto.php#L14 {#310
+time: Symfony\AI\Fixtures\StructuredOutput\UnionType\HumanReadableTimeUnionfile:///~/ai/fixtures/StructuredOutput/UnionType/HumanReadableTimeUnion.php#L14 {#316
+readableTime: "2023-10-07T19:32:10Z"
}
}
```
<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- For new features, provide some code snippets to help understand usage.
- Features and deprecations must be submitted against branch main.
- Update/add documentation as required (we can help!)
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
- Never break backward compatibility (see https://symfony.com/bc).
-->
Commits
-------
57d9b91 Feature/treat nullable fields as requiredFile tree
4 files changed
+8
-5
lines changed- src
- agent/tests/StructuredOutput
- platform
- src/Contract/JsonSchema
- tests/Contract/JsonSchema
4 files changed
+8
-5
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
121 | 123 | | |
122 | 124 | | |
123 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| |||
0 commit comments