Repository navigation
test(e2e): move live-provider legacy tests into tests/e2e #44120
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
707bbe7
test(e2e): move live-provider legacy tests into tests/e2e
yuneng-berri 8bcfd99
test(e2e): address review on the live-provider test move
yuneng-berri 10de0aa
test(e2e): accept both guardrail block shapes on a blocked stream
yuneng-berri fde0767
test(realtime): restore direct SDK realtime tests against OpenAI
yuneng-berri 79325a2
test: make realtime and Nova stream checks deterministic
yuneng-berri b6be38c
test(realtime): own intent forwarding with a unit test instead of a l…
yuneng-berri f975bcb
Merge remote-tracking branch 'origin/main' into litellm_test_94082c
yuneng-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import Final | ||
|
|
||
| from pydantic import TypeAdapter | ||
|
|
||
| SENTIMENT_PROMPT: Final = "Classify the sentiment of this review: 'The battery died after two days.'" | ||
| SENTIMENT_LABELS: Final = frozenset({"positive", "negative", "neutral"}) | ||
| SENTIMENT_OUTPUT_FORMAT: Final[dict[str, object]] = { | ||
| "type": "json_schema", | ||
| "schema": { | ||
| "type": "object", | ||
| "properties": {"sentiment": {"type": "string", "enum": sorted(SENTIMENT_LABELS)}}, | ||
| "required": ["sentiment"], | ||
| "additionalProperties": False, | ||
| }, | ||
| } | ||
| _SENTIMENT_JSON: Final = TypeAdapter(dict[str, str]) | ||
|
|
||
|
|
||
| def assert_sentiment_json(text: str) -> None: | ||
| parsed = _SENTIMENT_JSON.validate_json(text) | ||
| assert set(parsed) == {"sentiment"}, f"output_format schema not enforced, extra or missing keys: {parsed}" | ||
| assert parsed["sentiment"] in SENTIMENT_LABELS, f"sentiment outside the schema enum: {parsed}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.