Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Validate endpoint response OpenAI openapi spec#5194

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
BrianLi23 wants to merge23 commits intotensorzero:main
base:main
Choose a base branch
Loading
fromBrianLi23:validate-endpoint-response-openai-openapi-spec

Conversation

@BrianLi23
Copy link
Contributor

Overview:

  • Load schema file provided by OpenAI, and parse out schemas to check according to TensorZero's OpenAI-compatible inference endpoint.
  • Make requests to TensorZero's OpenAI-compatible inference endpoint, and confirm that the responses match the schema from OpenAI.

The endpoints to check on:

  • Chat completion compliance (/v1/chat/completions)
  • Embedding creation compliance (/v1/embeddings)

These tests will be wired to CI for additional validation in ensuring all related calls are in compliance (For now this will be done as non-blocking)

Resolves#2387

…validate-endpoint-response-openai-openapi-spec
…validate-endpoint-response-openai-openapi-spec
…validate-endpoint-response-openai-openapi-spec
…validate-endpoint-response-openai-openapi-spec
…validate-endpoint-response-openai-openapi-spec
…validate-endpoint-response-openai-openapi-spec
…validate-endpoint-response-openai-openapi-spec
CopilotAI review requested due to automatic review settingsDecember 15, 2025 05:52
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull request overview

This PR adds comprehensive OpenAPI specification compliance validation for TensorZero's OpenAI-compatible inference endpoints. It downloads the official OpenAI OpenAPI spec and validates that TensorZero's responses conform to the schema definitions.

Key changes:

  • Implements spec downloading, parsing, and sanitization logic to handle OpenAI spec quirks
  • Adds validation tests for chat completions endpoint (/v1/chat/completions) covering basic requests, tool calls, and various finish reasons
  • Adds validation tests for embeddings endpoint (/v1/embeddings) with single and array inputs

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 21 comments.

FileDescription
tensorzero-core/tests/e2e/openai_spec_compliance.rsNew test module with 411 lines implementing OpenAPI spec validation framework and compliance tests for chat completions and embeddings endpoints
tensorzero-core/tests/e2e/tests.rsAdds module declaration to include the new compliance test suite
tensorzero-core/Cargo.tomlAddsserde_yml dev dependency for YAML parsing
Cargo.lockUpdates lock file with newserde_yml andlibyml dependencies

Comment on lines +38 to +47
/// Spec yaml publishes `seed.minimum` with a value smaller than i64::MIN.
/// We clamp the literal so serde_yml can parse the document
fn fix_yaml_parse_issues(raw: &str) -> Cow<'_, str> {
const OPENAI_SEED_MIN: &str = "-9223372036854776000";
if raw.contains(OPENAI_SEED_MIN) {
Cow::Owned(raw.replace(OPENAI_SEED_MIN, "-9223372036854775808"))
} else {
Cow::Borrowed(raw)
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Would e.g.i128 work?

BrianLi23 reacted with thumbs down emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@GabrielBianconiGabrielBianconiGabrielBianconi left review comments

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Validate responses from the OpenAI-compatible endpoint with the OpenAI OpenAPI spec

2 participants

@BrianLi23@GabrielBianconi

[8]ページ先頭

©2009-2025 Movatter.jp