[Bugfix] Fix OpenAPI schema test failures (#31921)
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
@@ -90,7 +90,10 @@ def before_generate_case(context: schemathesis.hooks.HookContext, strategy):
|
|||||||
if (
|
if (
|
||||||
isinstance(content, list)
|
isinstance(content, list)
|
||||||
and len(content) > 0
|
and len(content) > 0
|
||||||
and any(item.get("type") == "file" for item in content)
|
and any(
|
||||||
|
isinstance(item, dict) and item.get("type") == "file"
|
||||||
|
for item in content
|
||||||
|
)
|
||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -139,6 +142,7 @@ def test_openapi_stateless(case: schemathesis.Case):
|
|||||||
timeout = {
|
timeout = {
|
||||||
# requires a longer timeout
|
# requires a longer timeout
|
||||||
("POST", "/v1/chat/completions"): LONG_TIMEOUT_SECONDS,
|
("POST", "/v1/chat/completions"): LONG_TIMEOUT_SECONDS,
|
||||||
|
("POST", "/v1/completions"): LONG_TIMEOUT_SECONDS,
|
||||||
}.get(key, DEFAULT_TIMEOUT_SECONDS)
|
}.get(key, DEFAULT_TIMEOUT_SECONDS)
|
||||||
|
|
||||||
# No need to verify SSL certificate for localhost
|
# No need to verify SSL certificate for localhost
|
||||||
|
|||||||
@@ -577,7 +577,9 @@ class ChatCompletionRequest(OpenAIBaseModel):
|
|||||||
min_tokens: int = 0
|
min_tokens: int = 0
|
||||||
skip_special_tokens: bool = True
|
skip_special_tokens: bool = True
|
||||||
spaces_between_special_tokens: bool = True
|
spaces_between_special_tokens: bool = True
|
||||||
truncate_prompt_tokens: Annotated[int, Field(ge=-1)] | None = None
|
truncate_prompt_tokens: Annotated[int, Field(ge=-1, le=_LONG_INFO.max)] | None = (
|
||||||
|
None
|
||||||
|
)
|
||||||
prompt_logprobs: int | None = None
|
prompt_logprobs: int | None = None
|
||||||
allowed_token_ids: list[int] | None = None
|
allowed_token_ids: list[int] | None = None
|
||||||
bad_words: list[str] = Field(default_factory=list)
|
bad_words: list[str] = Field(default_factory=list)
|
||||||
@@ -1058,7 +1060,9 @@ class CompletionRequest(OpenAIBaseModel):
|
|||||||
min_tokens: int = 0
|
min_tokens: int = 0
|
||||||
skip_special_tokens: bool = True
|
skip_special_tokens: bool = True
|
||||||
spaces_between_special_tokens: bool = True
|
spaces_between_special_tokens: bool = True
|
||||||
truncate_prompt_tokens: Annotated[int, Field(ge=-1)] | None = None
|
truncate_prompt_tokens: Annotated[int, Field(ge=-1, le=_LONG_INFO.max)] | None = (
|
||||||
|
None
|
||||||
|
)
|
||||||
allowed_token_ids: list[int] | None = None
|
allowed_token_ids: list[int] | None = None
|
||||||
prompt_logprobs: int | None = None
|
prompt_logprobs: int | None = None
|
||||||
# --8<-- [end:completion-sampling-params]
|
# --8<-- [end:completion-sampling-params]
|
||||||
|
|||||||
Reference in New Issue
Block a user