-
Notifications
You must be signed in to change notification settings - Fork 348
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
refactor(prompts): Enforce zod schemas match openapi types (3/3) #6316
refactor(prompts): Enforce zod schemas match openapi types (3/3) #6316
Conversation
commit: |
fcb3895
to
508433b
Compare
a3ad339
to
3448a08
Compare
extra_parameters: z.record(z.unknown()).optional(), | ||
}); | ||
export const phoenixPromptResponseFormatSchema = | ||
schemaMatches<PromptResponseFormat>()( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be worth a comment that running this util enforces the openAPI schema
@@ -1,18 +1,24 @@ | |||
import z from "zod"; | |||
import { jsonSchemaZodSchema } from "../../jsonSchema"; | |||
import { schemaMatches } from "../../../utils/schemaMatches"; | |||
import { PromptResponseFormat } from "../../../types/prompts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably need to shuffle around this directory since it's not clear that this type relates to the REST API based types (e.g. openapi)
132cc3a
into
cephalization/prompts/reorganize-ts-schemas-2
Depends on #6315
This PR introduces a new type utility to enforce that zod schemas for phoenix prompt types will always match the corresponding openapi generated types.
This pull request is 3 / 3 in a series of refactors to make the TS client easier to understand and maintain
Partially resolves #6305