Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make json schema output more compatible with Open AI structured outpu… #3433

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

gcanti
Copy link
Contributor

@gcanti gcanti commented Aug 8, 2024

…t (remove "oneOf" and "const"), closes #3432

@gcanti gcanti added the schema label Aug 8, 2024
Copy link

changeset-bot bot commented Aug 8, 2024

🦋 Changeset detected

Latest commit: 7c93da3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@effect/schema Minor
@effect/cli Major
@effect/cluster-browser Major
@effect/cluster-node Major
@effect/cluster-workflow Major
@effect/cluster Major
@effect/experimental Major
@effect/platform-browser Major
@effect/platform-bun Major
@effect/platform-node-shared Major
@effect/platform-node Major
@effect/platform Major
@effect/rpc-http Major
@effect/rpc Major
@effect/sql Major
@effect/sql-d1 Major
@effect/sql-mssql Major
@effect/sql-mysql2 Major
@effect/sql-pg Major
@effect/sql-sqlite-bun Major
@effect/sql-sqlite-node Major
@effect/sql-drizzle Major
@effect/sql-kysely Major
@effect/sql-sqlite-react-native Major
@effect/sql-sqlite-wasm Major

Not sure what this means? Click here to learn what changesets are.

Click here if you"re a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot changed the base branch from main to next-minor August 8, 2024 10:08
@gcanti gcanti changed the base branch from next-minor to main August 8, 2024 12:02
@gcanti gcanti removed the next-minor label Aug 8, 2024
@gcanti gcanti marked this pull request as ready for review August 8, 2024 12:02
@github-actions github-actions bot changed the base branch from main to next-minor August 9, 2024 08:53
@gcanti gcanti changed the base branch from next-minor to main August 9, 2024 10:36
@gcanti gcanti removed the next-minor label Aug 9, 2024
@github-actions github-actions bot changed the base branch from main to next-minor August 12, 2024 04:46
@gcanti gcanti changed the base branch from next-minor to main August 12, 2024 04:47
@gcanti gcanti removed the next-minor label Aug 12, 2024
@gcanti gcanti merged commit c1987e2 into main Aug 12, 2024
11 checks passed
@gcanti gcanti deleted the schema-3432 branch August 12, 2024 05:03
@github-actions github-actions bot mentioned this pull request Aug 12, 2024
suddenlyGiovanni added a commit to suddenlyGiovanni/resume that referenced this pull request Sep 3, 2024
## 0.71.1

### Patch Changes

- Updated dependencies [[`14a47a8`](Effect-TS/effect@14a47a8), [`0c09841`](Effect-TS/effect@0c09841)]:
  - [email protected]

## 0.71.0

### Minor Changes

- [#3433](Effect-TS/effect#3433) [`c1987e2`](Effect-TS/effect@c1987e2) - Make json schema output more compatible with Open AI structured output, closes #3432.

  JSONSchema

  - remove `oneOf` in favour of `anyOf` (e.g. in `JsonSchema7object`, `JsonSchema7empty`, `JsonSchema7Enums`)
  - remove `const` in favour of `enum` (e.g. in `JsonSchema7Enums`)
  - remove `JsonSchema7Const` type
  - remove `JsonSchema7OneOf` type

  AST

  - remove `identifier` annotation from `Schema.Null`
  - remove `identifier` annotation from `Schema.Object`

### Patch Changes

- [#3448](Effect-TS/effect#3448) [`1ceed14`](Effect-TS/effect@1ceed14) - add Schema.ArrayEnsure & Schema.NonEmptyArrayEnsure

  These schemas can be used to ensure that a value is an array, from a value that may be an array or a single value.

  ```ts
  import { Schema } from "@effect/schema"

  const schema = Schema.ArrayEnsure(Schema.String)

  Schema.decodeUnknownSync(schema)("hello")
  // => ["hello"]

  Schema.decodeUnknownSync(schema)(["a", "b", "c"])
  // => ["a", "b", "c"]
  ```

- [#3450](Effect-TS/effect#3450) [`0e42a8f`](Effect-TS/effect@0e42a8f) - update dependencies

- Updated dependencies [[`8295281`](Effect-TS/effect@8295281), [`c940df6`](Effect-TS/effect@c940df6), [`00b6c6d`](Effect-TS/effect@00b6c6d), [`f8d95a6`](Effect-TS/effect@f8d95a6)]:
  - [email protected]

Signed-off-by: Giovanni Ravalico <[email protected]>
suddenlyGiovanni added a commit to suddenlyGiovanni/resume that referenced this pull request Sep 3, 2024
- Updated dependencies [[`14a47a8`](Effect-TS/effect@14a47a8), [`0c09841`](Effect-TS/effect@0c09841)]:
  - [email protected]

- [#3433](Effect-TS/effect#3433) [`c1987e2`](Effect-TS/effect@c1987e2) - Make json schema output more compatible with Open AI structured output, closes #3432.

  JSONSchema

  - remove `oneOf` in favour of `anyOf` (e.g. in `JsonSchema7object`, `JsonSchema7empty`, `JsonSchema7Enums`)
  - remove `const` in favour of `enum` (e.g. in `JsonSchema7Enums`)
  - remove `JsonSchema7Const` type
  - remove `JsonSchema7OneOf` type

  AST

  - remove `identifier` annotation from `Schema.Null`
  - remove `identifier` annotation from `Schema.Object`

- [#3448](Effect-TS/effect#3448) [`1ceed14`](Effect-TS/effect@1ceed14) - add Schema.ArrayEnsure & Schema.NonEmptyArrayEnsure

  These schemas can be used to ensure that a value is an array, from a value that may be an array or a single value.

  ```ts
  import { Schema } from "@effect/schema"

  const schema = Schema.ArrayEnsure(Schema.String)

  Schema.decodeUnknownSync(schema)("hello")
  // => ["hello"]

  Schema.decodeUnknownSync(schema)(["a", "b", "c"])
  // => ["a", "b", "c"]
  ```

- [#3450](Effect-TS/effect#3450) [`0e42a8f`](Effect-TS/effect@0e42a8f) - update dependencies

- Updated dependencies [[`8295281`](Effect-TS/effect@8295281), [`c940df6`](Effect-TS/effect@c940df6), [`00b6c6d`](Effect-TS/effect@00b6c6d), [`f8d95a6`](Effect-TS/effect@f8d95a6)]:
  - [email protected]

Signed-off-by: Giovanni Ravalico <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

From Discord: make json schema output more compatible with Open AI structured output
1 participant