# pylint: disable=line-too-long,useless-suppression,too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------


from __future__ import annotations

from typing import Any

try:
    from . import _enums as _generated_enums
except Exception:
    _generated_enums = None

def _append_error(errors: list[dict[str, str]], path: str, message: str) -> None:
    errors.append({'path': path, 'message': message})

def _type_label(value: Any) -> str:
    if value is None:
        return 'null'
    if isinstance(value, bool):
        return 'boolean'
    if isinstance(value, int):
        return 'integer'
    if isinstance(value, float):
        return 'number'
    if isinstance(value, str):
        return 'string'
    if isinstance(value, dict):
        return 'object'
    if isinstance(value, list):
        return 'array'
    return type(value).__name__

def _is_type(value: Any, expected: str) -> bool:
    if expected == 'string':
        return isinstance(value, str)
    if expected == 'integer':
        return isinstance(value, int) and not isinstance(value, bool)
    if expected == 'number':
        return (isinstance(value, int) and not isinstance(value, bool)) or isinstance(value, float)
    if expected == 'boolean':
        return isinstance(value, bool)
    if expected == 'object':
        return isinstance(value, dict)
    if expected == 'array':
        return isinstance(value, list)
    return True

def _append_type_mismatch(errors: list[dict[str, str]], path: str, expected: str, value: Any) -> None:
    _append_error(errors, path, f"Expected {expected}, got {_type_label(value)}")

def _enum_values(enum_name: str) -> tuple[tuple[str, ...] | None, str | None]:
    if _generated_enums is None:
        return None, f'enum type _enums.{enum_name} is unavailable'
    enum_cls = getattr(_generated_enums, enum_name, None)
    if enum_cls is None:
        return None, f'enum type _enums.{enum_name} is not defined'
    try:
        return tuple(str(member.value) for member in enum_cls), None
    except Exception:
        return None, f'enum type _enums.{enum_name} failed to load values'

def _validate_CreateResponse(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'agent' in value:
        _validate_CreateResponse_agent(value['agent'], f"{path}.agent", errors)
    if 'agent_reference' in value:
        _validate_CreateResponse_agent_reference(value['agent_reference'], f"{path}.agent_reference", errors)
    if 'agent_session_id' in value:
        _validate_CreateResponse_agent_session_id(value['agent_session_id'], f"{path}.agent_session_id", errors)
    if 'background' in value:
        _validate_CreateResponse_background(value['background'], f"{path}.background", errors)
    if 'context_management' in value:
        _validate_CreateResponse_context_management(value['context_management'], f"{path}.context_management", errors)
    if 'conversation' in value:
        _validate_CreateResponse_conversation(value['conversation'], f"{path}.conversation", errors)
    if 'include' in value:
        _validate_CreateResponse_include(value['include'], f"{path}.include", errors)
    if 'input' in value:
        _validate_CreateResponse_input(value['input'], f"{path}.input", errors)
    if 'instructions' in value:
        _validate_CreateResponse_instructions(value['instructions'], f"{path}.instructions", errors)
    if 'max_output_tokens' in value:
        _validate_CreateResponse_max_output_tokens(value['max_output_tokens'], f"{path}.max_output_tokens", errors)
    if 'max_tool_calls' in value:
        _validate_CreateResponse_max_output_tokens(value['max_tool_calls'], f"{path}.max_tool_calls", errors)
    if 'metadata' in value:
        _validate_CreateResponse_metadata(value['metadata'], f"{path}.metadata", errors)
    if 'model' in value:
        _validate_CreateResponse_model(value['model'], f"{path}.model", errors)
    if 'parallel_tool_calls' in value:
        _validate_CreateResponse_parallel_tool_calls(value['parallel_tool_calls'], f"{path}.parallel_tool_calls", errors)
    if 'previous_response_id' in value:
        _validate_CreateResponse_instructions(value['previous_response_id'], f"{path}.previous_response_id", errors)
    if 'prompt' in value:
        _validate_CreateResponse_prompt(value['prompt'], f"{path}.prompt", errors)
    if 'prompt_cache_key' in value:
        _validate_CreateResponse_prompt_cache_key(value['prompt_cache_key'], f"{path}.prompt_cache_key", errors)
    if 'prompt_cache_retention' in value:
        _validate_CreateResponse_prompt_cache_retention(value['prompt_cache_retention'], f"{path}.prompt_cache_retention", errors)
    if 'reasoning' in value:
        _validate_CreateResponse_reasoning(value['reasoning'], f"{path}.reasoning", errors)
    if 'safety_identifier' in value:
        _validate_CreateResponse_safety_identifier(value['safety_identifier'], f"{path}.safety_identifier", errors)
    if 'service_tier' in value:
        _validate_CreateResponse_service_tier(value['service_tier'], f"{path}.service_tier", errors)
    if 'store' in value:
        _validate_CreateResponse_parallel_tool_calls(value['store'], f"{path}.store", errors)
    if 'stream' in value:
        _validate_CreateResponse_background(value['stream'], f"{path}.stream", errors)
    if 'stream_options' in value:
        _validate_CreateResponse_stream_options(value['stream_options'], f"{path}.stream_options", errors)
    if 'structured_inputs' in value:
        _validate_CreateResponse_structured_inputs(value['structured_inputs'], f"{path}.structured_inputs", errors)
    if 'temperature' in value:
        _validate_CreateResponse_temperature(value['temperature'], f"{path}.temperature", errors)
    if 'text' in value:
        _validate_CreateResponse_text(value['text'], f"{path}.text", errors)
    if 'tool_choice' in value:
        _validate_CreateResponse_tool_choice(value['tool_choice'], f"{path}.tool_choice", errors)
    if 'tools' in value:
        _validate_CreateResponse_tools(value['tools'], f"{path}.tools", errors)
    if 'top_logprobs' in value:
        _validate_CreateResponse_max_output_tokens(value['top_logprobs'], f"{path}.top_logprobs", errors)
    if 'top_p' in value:
        _validate_CreateResponse_temperature(value['top_p'], f"{path}.top_p", errors)
    if 'truncation' in value:
        _validate_CreateResponse_truncation(value['truncation'], f"{path}.truncation", errors)
    if 'user' in value:
        _validate_CreateResponse_user(value['user'], f"{path}.user", errors)

def _validate_CreateResponse_agent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_CreateResponse_agent_reference(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_CreateResponse_agent_session_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_CreateResponse_background(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'boolean'):
        _append_type_mismatch(errors, path, 'boolean', value)
        return

def _validate_CreateResponse_context_management(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_CreateResponse_context_management_item(_item, f"{path}[{_idx}]", errors)

def _validate_CreateResponse_conversation(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return

def _validate_CreateResponse_include(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_CreateResponse_include_item(_item, f"{path}[{_idx}]", errors)

def _validate_CreateResponse_input(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_InputParam(value, path, errors)

def _validate_CreateResponse_instructions(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_CreateResponse_max_output_tokens(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_CreateResponse_metadata(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_CreateResponse_model(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_CreateResponse_parallel_tool_calls(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'boolean'):
        _append_type_mismatch(errors, path, 'boolean', value)
        return

def _validate_CreateResponse_prompt(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_Prompt(value, path, errors)

def _validate_CreateResponse_prompt_cache_key(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_CreateResponse_prompt_cache_retention(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    _allowed_values = ('in-memory', '24h')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_CreateResponse_reasoning(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_CreateResponse_safety_identifier(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_CreateResponse_service_tier(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ServiceTier(value, path, errors)

def _validate_CreateResponse_stream_options(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_CreateResponse_structured_inputs(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    for _key, _item in value.items():
        if _key not in ():
            _validate_CreateResponse_structured_inputs_additional_property(_item, f"{path}.{_key}", errors)

def _validate_CreateResponse_temperature(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'number'):
        _append_type_mismatch(errors, path, 'number', value)
        return

def _validate_CreateResponse_text(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ResponseTextParam(value, path, errors)

def _validate_CreateResponse_tool_choice(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_ToolChoiceOptions(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_ToolChoiceParam(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: OpenAI.ToolChoiceOptions, OpenAI.ToolChoiceParam; got {_type_label(value)}")
        return

def _validate_CreateResponse_tools(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ToolsArray(value, path, errors)

def _validate_CreateResponse_truncation(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    _allowed_values = ('auto', 'disabled')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_CreateResponse_user(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_CreateResponse_context_management_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ContextManagementParam(value, path, errors)

def _validate_CreateResponse_include_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_IncludeEnum(value, path, errors)

def _validate_OpenAI_InputParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'array'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_array(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: string, array; got {_type_label(value)}")
        return

def _validate_OpenAI_Prompt(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'id' in value:
        _validate_OpenAI_Prompt_id(value['id'], f"{path}.id", errors)
    if 'variables' in value:
        _validate_OpenAI_Prompt_variables(value['variables'], f"{path}.variables", errors)
    if 'version' in value:
        _validate_CreateResponse_instructions(value['version'], f"{path}.version", errors)

def _validate_OpenAI_ServiceTier(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    _allowed_values, _enum_error = _enum_values('ServiceTier')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_CreateResponse_structured_inputs_additional_property(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ResponseTextParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'format' in value:
        _validate_OpenAI_ResponseTextParam_format(value['format'], f"{path}.format", errors)
    if 'verbosity' in value:
        _validate_OpenAI_ResponseTextParam_verbosity(value['verbosity'], f"{path}.verbosity", errors)

def _validate_OpenAI_ToolChoiceOptions(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('ToolChoiceOptions')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ToolChoiceParam_type(value['type'], f"{path}.type", errors)
    _disc_value = value.get('type')
    if not isinstance(_disc_value, str):
        _append_error(errors, f"{path}.type", "Required discriminator 'type' is missing or invalid")
        return
    if _disc_value == 'allowed_tools':
        _validate_OpenAI_ToolChoiceAllowed(value, path, errors)
    if _disc_value == 'apply_patch':
        _validate_OpenAI_SpecificApplyPatchParam(value, path, errors)
    if _disc_value == 'code_interpreter':
        _validate_OpenAI_ToolChoiceCodeInterpreter(value, path, errors)
    if _disc_value == 'computer_use_preview':
        _validate_OpenAI_ToolChoiceComputerUsePreview(value, path, errors)
    if _disc_value == 'custom':
        _validate_OpenAI_ToolChoiceCustom(value, path, errors)
    if _disc_value == 'file_search':
        _validate_OpenAI_ToolChoiceFileSearch(value, path, errors)
    if _disc_value == 'function':
        _validate_OpenAI_ToolChoiceFunction(value, path, errors)
    if _disc_value == 'image_generation':
        _validate_OpenAI_ToolChoiceImageGeneration(value, path, errors)
    if _disc_value == 'mcp':
        _validate_OpenAI_ToolChoiceMCP(value, path, errors)
    if _disc_value == 'shell':
        _validate_OpenAI_SpecificFunctionShellParam(value, path, errors)
    if _disc_value == 'web_search_preview':
        _validate_OpenAI_ToolChoiceWebSearchPreview(value, path, errors)
    if _disc_value == 'web_search_preview_2025_03_11':
        _validate_OpenAI_ToolChoiceWebSearchPreview20250311(value, path, errors)

def _validate_OpenAI_ToolsArray(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ToolsArray_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ContextManagementParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'compact_threshold' in value:
        _validate_CreateResponse_max_output_tokens(value['compact_threshold'], f"{path}.compact_threshold", errors)
    if 'type' in value:
        _validate_OpenAI_ContextManagementParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_IncludeEnum(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_IncludeEnum_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected IncludeEnum to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_InputParam_string(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_InputParam_array(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_InputParam_array_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_Prompt_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_Prompt_variables(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_OpenAI_ResponseTextParam_format(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_TextResponseFormatConfiguration(value, path, errors)

def _validate_OpenAI_ResponseTextParam_verbosity(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_Verbosity(value, path, errors)

def _validate_OpenAI_ToolChoiceParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ToolChoiceParamType(value, path, errors)

def _validate_OpenAI_ToolChoiceAllowed(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'mode' not in value:
        _append_error(errors, f"{path}.mode", "Required property 'mode' is missing")
    if 'tools' not in value:
        _append_error(errors, f"{path}.tools", "Required property 'tools' is missing")
    if 'mode' in value:
        _validate_OpenAI_ToolChoiceAllowed_mode(value['mode'], f"{path}.mode", errors)
    if 'tools' in value:
        _validate_OpenAI_ToolChoiceAllowed_tools(value['tools'], f"{path}.tools", errors)
    if 'type' in value:
        _validate_OpenAI_ToolChoiceAllowed_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_SpecificApplyPatchParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_SpecificApplyPatchParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolChoiceCodeInterpreter(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ToolChoiceCodeInterpreter_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolChoiceComputerUsePreview(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ToolChoiceComputerUsePreview_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolChoiceCustom(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'name' in value:
        _validate_OpenAI_ToolChoiceCustom_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_OpenAI_ToolChoiceCustom_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolChoiceFileSearch(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ToolChoiceFileSearch_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolChoiceFunction(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'name' in value:
        _validate_OpenAI_ToolChoiceFunction_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_OpenAI_ToolChoiceFunction_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolChoiceImageGeneration(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ToolChoiceImageGeneration_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolChoiceMCP(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'server_label' not in value:
        _append_error(errors, f"{path}.server_label", "Required property 'server_label' is missing")
    if 'name' in value:
        _validate_CreateResponse_instructions(value['name'], f"{path}.name", errors)
    if 'server_label' in value:
        _validate_OpenAI_ToolChoiceMCP_server_label(value['server_label'], f"{path}.server_label", errors)
    if 'type' in value:
        _validate_OpenAI_ToolChoiceMCP_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_SpecificFunctionShellParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_SpecificFunctionShellParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolChoiceWebSearchPreview(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ToolChoiceWebSearchPreview_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolChoiceWebSearchPreview20250311(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ToolChoiceWebSearchPreview20250311_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolsArray_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_Tool(value, path, errors)

def _validate_OpenAI_ContextManagementParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_IncludeEnum_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('IncludeEnum')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_InputParam_array_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_Item(value, path, errors)

def _validate_OpenAI_TextResponseFormatConfiguration(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_TextResponseFormatConfiguration_type(value['type'], f"{path}.type", errors)
    _disc_value = value.get('type')
    if not isinstance(_disc_value, str):
        _append_error(errors, f"{path}.type", "Required discriminator 'type' is missing or invalid")
        return
    if _disc_value == 'json_object':
        _validate_OpenAI_TextResponseFormatConfigurationResponseFormatJsonObject(value, path, errors)
    if _disc_value == 'json_schema':
        _validate_OpenAI_TextResponseFormatJsonSchema(value, path, errors)
    if _disc_value == 'text':
        _validate_OpenAI_TextResponseFormatConfigurationResponseFormatText(value, path, errors)

def _validate_OpenAI_Verbosity(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    _allowed_values, _enum_error = _enum_values('Verbosity')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceParamType(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_ToolChoiceParamType_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected ToolChoiceParamType to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_ToolChoiceAllowed_mode(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('auto', 'required')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceAllowed_tools(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ToolChoiceAllowed_tools_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ToolChoiceAllowed_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('allowed_tools',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_SpecificApplyPatchParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('apply_patch',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceCodeInterpreter_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('code_interpreter',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceComputerUsePreview_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('computer_use_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceCustom_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceCustom_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('custom',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceFileSearch_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('file_search',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceFunction_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceFunction_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('function',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceImageGeneration_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('image_generation',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceMCP_server_label(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceMCP_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('mcp',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_SpecificFunctionShellParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('shell',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceWebSearchPreview_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('web_search_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceWebSearchPreview20250311_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('web_search_preview_2025_03_11',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_Tool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_Tool_type(value['type'], f"{path}.type", errors)
    _disc_value = value.get('type')
    if not isinstance(_disc_value, str):
        _append_error(errors, f"{path}.type", "Required discriminator 'type' is missing or invalid")
        return
    if _disc_value == 'a2a_preview':
        _validate_A2APreviewTool(value, path, errors)
    if _disc_value == 'apply_patch':
        _validate_OpenAI_ApplyPatchToolParam(value, path, errors)
    if _disc_value == 'azure_ai_search':
        _validate_AzureAISearchTool(value, path, errors)
    if _disc_value == 'azure_function':
        _validate_AzureFunctionTool(value, path, errors)
    if _disc_value == 'bing_custom_search_preview':
        _validate_BingCustomSearchPreviewTool(value, path, errors)
    if _disc_value == 'bing_grounding':
        _validate_BingGroundingTool(value, path, errors)
    if _disc_value == 'browser_automation_preview':
        _validate_BrowserAutomationPreviewTool(value, path, errors)
    if _disc_value == 'capture_structured_outputs':
        _validate_CaptureStructuredOutputsTool(value, path, errors)
    if _disc_value == 'code_interpreter':
        _validate_OpenAI_CodeInterpreterTool(value, path, errors)
    if _disc_value == 'computer_use_preview':
        _validate_OpenAI_ComputerUsePreviewTool(value, path, errors)
    if _disc_value == 'custom':
        _validate_OpenAI_CustomToolParam(value, path, errors)
    if _disc_value == 'fabric_dataagent_preview':
        _validate_MicrosoftFabricPreviewTool(value, path, errors)
    if _disc_value == 'file_search':
        _validate_OpenAI_FileSearchTool(value, path, errors)
    if _disc_value == 'function':
        _validate_OpenAI_FunctionTool(value, path, errors)
    if _disc_value == 'image_generation':
        _validate_OpenAI_ImageGenTool(value, path, errors)
    if _disc_value == 'local_shell':
        _validate_OpenAI_LocalShellToolParam(value, path, errors)
    if _disc_value == 'mcp':
        _validate_OpenAI_MCPTool(value, path, errors)
    if _disc_value == 'memory_search':
        _validate_MemorySearchTool(value, path, errors)
    if _disc_value == 'memory_search_preview':
        _validate_MemorySearchPreviewTool(value, path, errors)
    if _disc_value == 'openapi':
        _validate_OpenApiTool(value, path, errors)
    if _disc_value == 'sharepoint_grounding_preview':
        _validate_SharepointPreviewTool(value, path, errors)
    if _disc_value == 'shell':
        _validate_OpenAI_FunctionShellToolParam(value, path, errors)
    if _disc_value == 'web_search':
        _validate_OpenAI_WebSearchTool(value, path, errors)
    if _disc_value == 'web_search_preview':
        _validate_OpenAI_WebSearchPreviewTool(value, path, errors)
    if _disc_value == 'work_iq_preview':
        _validate_WorkIQPreviewTool(value, path, errors)

def _validate_OpenAI_Item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' in value:
        _validate_OpenAI_Item_type(value['type'], f"{path}.type", errors)
    if 'type' in value:
        _validate_OpenAI_Item_type(value['type'], f"{path}.type", errors)
    _disc_value = value.get('type', 'message')
    if not isinstance(_disc_value, str):
        _append_error(errors, f"{path}.type", "Required discriminator 'type' is missing or invalid")
        return
    if _disc_value == 'apply_patch_call':
        _validate_OpenAI_ApplyPatchToolCallItemParam(value, path, errors)
    if _disc_value == 'apply_patch_call_output':
        _validate_OpenAI_ApplyPatchToolCallOutputItemParam(value, path, errors)
    if _disc_value == 'code_interpreter_call':
        _validate_OpenAI_ItemCodeInterpreterToolCall(value, path, errors)
    if _disc_value == 'compaction':
        _validate_OpenAI_CompactionSummaryItemParam(value, path, errors)
    if _disc_value == 'computer_call':
        _validate_OpenAI_ItemComputerToolCall(value, path, errors)
    if _disc_value == 'computer_call_output':
        _validate_OpenAI_ComputerCallOutputItemParam(value, path, errors)
    if _disc_value == 'custom_tool_call':
        _validate_OpenAI_ItemCustomToolCall(value, path, errors)
    if _disc_value == 'custom_tool_call_output':
        _validate_OpenAI_ItemCustomToolCallOutput(value, path, errors)
    if _disc_value == 'file_search_call':
        _validate_OpenAI_ItemFileSearchToolCall(value, path, errors)
    if _disc_value == 'function_call':
        _validate_OpenAI_ItemFunctionToolCall(value, path, errors)
    if _disc_value == 'function_call_output':
        _validate_OpenAI_FunctionCallOutputItemParam(value, path, errors)
    if _disc_value == 'image_generation_call':
        _validate_OpenAI_ItemImageGenToolCall(value, path, errors)
    if _disc_value == 'item_reference':
        _validate_OpenAI_ItemReferenceParam(value, path, errors)
    if _disc_value == 'local_shell_call':
        _validate_OpenAI_ItemLocalShellToolCall(value, path, errors)
    if _disc_value == 'local_shell_call_output':
        _validate_OpenAI_ItemLocalShellToolCallOutput(value, path, errors)
    if _disc_value == 'mcp_approval_request':
        _validate_OpenAI_ItemMcpApprovalRequest(value, path, errors)
    if _disc_value == 'mcp_approval_response':
        _validate_OpenAI_MCPApprovalResponse(value, path, errors)
    if _disc_value == 'mcp_call':
        _validate_OpenAI_ItemMcpToolCall(value, path, errors)
    if _disc_value == 'mcp_list_tools':
        _validate_OpenAI_ItemMcpListTools(value, path, errors)
    if _disc_value == 'memory_search_call':
        _validate_MemorySearchToolCallItemParam(value, path, errors)
    if _disc_value == 'message':
        _validate_OpenAI_ItemMessage(value, path, errors)
    if _disc_value == 'output_message':
        _validate_OpenAI_ItemOutputMessage(value, path, errors)
    if _disc_value == 'reasoning':
        _validate_OpenAI_ItemReasoningItem(value, path, errors)
    if _disc_value == 'shell_call':
        _validate_OpenAI_FunctionShellCallItemParam(value, path, errors)
    if _disc_value == 'shell_call_output':
        _validate_OpenAI_FunctionShellCallOutputItemParam(value, path, errors)
    if _disc_value == 'web_search_call':
        _validate_OpenAI_ItemWebSearchToolCall(value, path, errors)

def _validate_OpenAI_TextResponseFormatConfiguration_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_TextResponseFormatConfigurationType(value, path, errors)

def _validate_OpenAI_TextResponseFormatConfigurationResponseFormatJsonObject(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_TextResponseFormatConfigurationResponseFormatJsonObject_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_TextResponseFormatJsonSchema(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'schema' not in value:
        _append_error(errors, f"{path}.schema", "Required property 'schema' is missing")
    if 'description' in value:
        _validate_OpenAI_TextResponseFormatJsonSchema_description(value['description'], f"{path}.description", errors)
    if 'name' in value:
        _validate_OpenAI_TextResponseFormatJsonSchema_name(value['name'], f"{path}.name", errors)
    if 'schema' in value:
        _validate_OpenAI_TextResponseFormatJsonSchema_schema(value['schema'], f"{path}.schema", errors)
    if 'strict' in value:
        _validate_CreateResponse_background(value['strict'], f"{path}.strict", errors)
    if 'type' in value:
        _validate_OpenAI_TextResponseFormatJsonSchema_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_TextResponseFormatConfigurationResponseFormatText(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_TextResponseFormatConfigurationResponseFormatText_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ToolChoiceParamType_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('ToolChoiceParamType')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolChoiceAllowed_tools_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    for _key, _item in value.items():
        if _key not in ():
            _validate_CreateResponse_structured_inputs_additional_property(_item, f"{path}.{_key}", errors)

def _validate_OpenAI_Tool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ToolType(value, path, errors)

def _validate_A2APreviewTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'agent_card_path' in value:
        _validate_A2APreviewTool_agent_card_path(value['agent_card_path'], f"{path}.agent_card_path", errors)
    if 'base_url' in value:
        _validate_A2APreviewTool_base_url(value['base_url'], f"{path}.base_url", errors)
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'project_connection_id' in value:
        _validate_A2APreviewTool_project_connection_id(value['project_connection_id'], f"{path}.project_connection_id", errors)
    if 'type' in value:
        _validate_A2APreviewTool_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ApplyPatchToolParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ApplyPatchToolParam_type(value['type'], f"{path}.type", errors)

def _validate_AzureAISearchTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'azure_ai_search' not in value:
        _append_error(errors, f"{path}.azure_ai_search", "Required property 'azure_ai_search' is missing")
    if 'azure_ai_search' in value:
        _validate_AzureAISearchTool_azure_ai_search(value['azure_ai_search'], f"{path}.azure_ai_search", errors)
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_AzureAISearchTool_type(value['type'], f"{path}.type", errors)

def _validate_AzureFunctionTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'azure_function' not in value:
        _append_error(errors, f"{path}.azure_function", "Required property 'azure_function' is missing")
    if 'azure_function' in value:
        _validate_AzureFunctionTool_azure_function(value['azure_function'], f"{path}.azure_function", errors)
    if 'type' in value:
        _validate_AzureFunctionTool_type(value['type'], f"{path}.type", errors)

def _validate_BingCustomSearchPreviewTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'bing_custom_search_preview' not in value:
        _append_error(errors, f"{path}.bing_custom_search_preview", "Required property 'bing_custom_search_preview' is missing")
    if 'bing_custom_search_preview' in value:
        _validate_BingCustomSearchPreviewTool_bing_custom_search_preview(value['bing_custom_search_preview'], f"{path}.bing_custom_search_preview", errors)
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_BingCustomSearchPreviewTool_type(value['type'], f"{path}.type", errors)

def _validate_BingGroundingTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'bing_grounding' not in value:
        _append_error(errors, f"{path}.bing_grounding", "Required property 'bing_grounding' is missing")
    if 'bing_grounding' in value:
        _validate_BingGroundingTool_bing_grounding(value['bing_grounding'], f"{path}.bing_grounding", errors)
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_BingGroundingTool_type(value['type'], f"{path}.type", errors)

def _validate_BrowserAutomationPreviewTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'browser_automation_preview' not in value:
        _append_error(errors, f"{path}.browser_automation_preview", "Required property 'browser_automation_preview' is missing")
    if 'browser_automation_preview' in value:
        _validate_BrowserAutomationPreviewTool_browser_automation_preview(value['browser_automation_preview'], f"{path}.browser_automation_preview", errors)
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_BrowserAutomationPreviewTool_type(value['type'], f"{path}.type", errors)

def _validate_CaptureStructuredOutputsTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'outputs' not in value:
        _append_error(errors, f"{path}.outputs", "Required property 'outputs' is missing")
    if 'outputs' in value:
        _validate_CaptureStructuredOutputsTool_outputs(value['outputs'], f"{path}.outputs", errors)
    if 'type' in value:
        _validate_CaptureStructuredOutputsTool_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_CodeInterpreterTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'container' in value:
        _validate_OpenAI_CodeInterpreterTool_container(value['container'], f"{path}.container", errors)
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_OpenAI_CodeInterpreterTool_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ComputerUsePreviewTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'environment' not in value:
        _append_error(errors, f"{path}.environment", "Required property 'environment' is missing")
    if 'display_width' not in value:
        _append_error(errors, f"{path}.display_width", "Required property 'display_width' is missing")
    if 'display_height' not in value:
        _append_error(errors, f"{path}.display_height", "Required property 'display_height' is missing")
    if 'display_height' in value:
        _validate_OpenAI_ComputerUsePreviewTool_display_height(value['display_height'], f"{path}.display_height", errors)
    if 'display_width' in value:
        _validate_OpenAI_ComputerUsePreviewTool_display_width(value['display_width'], f"{path}.display_width", errors)
    if 'environment' in value:
        _validate_OpenAI_ComputerUsePreviewTool_environment(value['environment'], f"{path}.environment", errors)
    if 'type' in value:
        _validate_OpenAI_ComputerUsePreviewTool_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_CustomToolParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'description' in value:
        _validate_OpenAI_CustomToolParam_description(value['description'], f"{path}.description", errors)
    if 'format' in value:
        _validate_OpenAI_CustomToolParam_format(value['format'], f"{path}.format", errors)
    if 'name' in value:
        _validate_OpenAI_CustomToolParam_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_OpenAI_CustomToolParam_type(value['type'], f"{path}.type", errors)

def _validate_MicrosoftFabricPreviewTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'fabric_dataagent_preview' not in value:
        _append_error(errors, f"{path}.fabric_dataagent_preview", "Required property 'fabric_dataagent_preview' is missing")
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'fabric_dataagent_preview' in value:
        _validate_MicrosoftFabricPreviewTool_fabric_dataagent_preview(value['fabric_dataagent_preview'], f"{path}.fabric_dataagent_preview", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_MicrosoftFabricPreviewTool_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_FileSearchTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'vector_store_ids' not in value:
        _append_error(errors, f"{path}.vector_store_ids", "Required property 'vector_store_ids' is missing")
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'filters' in value:
        _validate_OpenAI_FileSearchTool_filters(value['filters'], f"{path}.filters", errors)
    if 'max_num_results' in value:
        _validate_OpenAI_FileSearchTool_max_num_results(value['max_num_results'], f"{path}.max_num_results", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'ranking_options' in value:
        _validate_OpenAI_FileSearchTool_ranking_options(value['ranking_options'], f"{path}.ranking_options", errors)
    if 'type' in value:
        _validate_OpenAI_FileSearchTool_type(value['type'], f"{path}.type", errors)
    if 'vector_store_ids' in value:
        _validate_OpenAI_FileSearchTool_vector_store_ids(value['vector_store_ids'], f"{path}.vector_store_ids", errors)

def _validate_OpenAI_FunctionTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'description' in value:
        _validate_CreateResponse_instructions(value['description'], f"{path}.description", errors)
    if 'name' in value:
        _validate_OpenAI_ToolChoiceFunction_name(value['name'], f"{path}.name", errors)
    if 'parameters' in value:
        _validate_OpenAI_FunctionTool_parameters(value['parameters'], f"{path}.parameters", errors)
    if 'strict' in value:
        _validate_CreateResponse_background(value['strict'], f"{path}.strict", errors)
    if 'type' in value:
        _validate_OpenAI_FunctionTool_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ImageGenTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'action' in value:
        _validate_OpenAI_ImageGenTool_action(value['action'], f"{path}.action", errors)
    if 'background' in value:
        _validate_OpenAI_ImageGenTool_background(value['background'], f"{path}.background", errors)
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'input_fidelity' in value:
        _validate_OpenAI_ImageGenTool_input_fidelity(value['input_fidelity'], f"{path}.input_fidelity", errors)
    if 'input_image_mask' in value:
        _validate_OpenAI_ImageGenTool_input_image_mask(value['input_image_mask'], f"{path}.input_image_mask", errors)
    if 'model' in value:
        _validate_OpenAI_ImageGenTool_model(value['model'], f"{path}.model", errors)
    if 'moderation' in value:
        _validate_OpenAI_ImageGenTool_moderation(value['moderation'], f"{path}.moderation", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'output_compression' in value:
        _validate_OpenAI_ImageGenTool_output_compression(value['output_compression'], f"{path}.output_compression", errors)
    if 'output_format' in value:
        _validate_OpenAI_ImageGenTool_output_format(value['output_format'], f"{path}.output_format", errors)
    if 'partial_images' in value:
        _validate_OpenAI_ImageGenTool_partial_images(value['partial_images'], f"{path}.partial_images", errors)
    if 'quality' in value:
        _validate_OpenAI_ImageGenTool_quality(value['quality'], f"{path}.quality", errors)
    if 'size' in value:
        _validate_OpenAI_ImageGenTool_size(value['size'], f"{path}.size", errors)
    if 'type' in value:
        _validate_OpenAI_ImageGenTool_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_LocalShellToolParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_OpenAI_LocalShellToolParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_MCPTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'server_label' not in value:
        _append_error(errors, f"{path}.server_label", "Required property 'server_label' is missing")
    if 'allowed_tools' in value:
        _validate_OpenAI_MCPTool_allowed_tools(value['allowed_tools'], f"{path}.allowed_tools", errors)
    if 'authorization' in value:
        _validate_OpenAI_MCPTool_authorization(value['authorization'], f"{path}.authorization", errors)
    if 'connector_id' in value:
        _validate_OpenAI_MCPTool_connector_id(value['connector_id'], f"{path}.connector_id", errors)
    if 'headers' in value:
        _validate_OpenAI_MCPTool_headers(value['headers'], f"{path}.headers", errors)
    if 'project_connection_id' in value:
        _validate_OpenAI_MCPTool_project_connection_id(value['project_connection_id'], f"{path}.project_connection_id", errors)
    if 'require_approval' in value:
        _validate_OpenAI_MCPTool_require_approval(value['require_approval'], f"{path}.require_approval", errors)
    if 'server_description' in value:
        _validate_OpenAI_MCPTool_server_description(value['server_description'], f"{path}.server_description", errors)
    if 'server_label' in value:
        _validate_OpenAI_MCPTool_server_label(value['server_label'], f"{path}.server_label", errors)
    if 'server_url' in value:
        _validate_OpenAI_MCPTool_server_url(value['server_url'], f"{path}.server_url", errors)
    if 'type' in value:
        _validate_OpenAI_MCPTool_type(value['type'], f"{path}.type", errors)

def _validate_MemorySearchTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'memory_store_name' not in value:
        _append_error(errors, f"{path}.memory_store_name", "Required property 'memory_store_name' is missing")
    if 'scope' not in value:
        _append_error(errors, f"{path}.scope", "Required property 'scope' is missing")
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'memory_store_name' in value:
        _validate_MemorySearchTool_memory_store_name(value['memory_store_name'], f"{path}.memory_store_name", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'scope' in value:
        _validate_MemorySearchTool_scope(value['scope'], f"{path}.scope", errors)
    if 'search_options' in value:
        _validate_MemorySearchTool_search_options(value['search_options'], f"{path}.search_options", errors)
    if 'type' in value:
        _validate_MemorySearchTool_type(value['type'], f"{path}.type", errors)
    if 'update_delay' in value:
        _validate_MemorySearchTool_update_delay(value['update_delay'], f"{path}.update_delay", errors)

def _validate_MemorySearchPreviewTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'memory_store_name' not in value:
        _append_error(errors, f"{path}.memory_store_name", "Required property 'memory_store_name' is missing")
    if 'scope' not in value:
        _append_error(errors, f"{path}.scope", "Required property 'scope' is missing")
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'memory_store_name' in value:
        _validate_MemorySearchTool_memory_store_name(value['memory_store_name'], f"{path}.memory_store_name", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'scope' in value:
        _validate_MemorySearchTool_scope(value['scope'], f"{path}.scope", errors)
    if 'search_options' in value:
        _validate_MemorySearchTool_search_options(value['search_options'], f"{path}.search_options", errors)
    if 'type' in value:
        _validate_MemorySearchPreviewTool_type(value['type'], f"{path}.type", errors)
    if 'update_delay' in value:
        _validate_MemorySearchTool_update_delay(value['update_delay'], f"{path}.update_delay", errors)

def _validate_OpenApiTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'openapi' not in value:
        _append_error(errors, f"{path}.openapi", "Required property 'openapi' is missing")
    if 'openapi' in value:
        _validate_OpenApiTool_openapi(value['openapi'], f"{path}.openapi", errors)
    if 'type' in value:
        _validate_OpenApiTool_type(value['type'], f"{path}.type", errors)

def _validate_SharepointPreviewTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'sharepoint_grounding_preview' not in value:
        _append_error(errors, f"{path}.sharepoint_grounding_preview", "Required property 'sharepoint_grounding_preview' is missing")
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'sharepoint_grounding_preview' in value:
        _validate_SharepointPreviewTool_sharepoint_grounding_preview(value['sharepoint_grounding_preview'], f"{path}.sharepoint_grounding_preview", errors)
    if 'type' in value:
        _validate_SharepointPreviewTool_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_FunctionShellToolParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'environment' in value:
        _validate_OpenAI_FunctionShellToolParam_environment(value['environment'], f"{path}.environment", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_OpenAI_FunctionShellToolParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_WebSearchTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'custom_search_configuration' in value:
        _validate_OpenAI_WebSearchTool_custom_search_configuration(value['custom_search_configuration'], f"{path}.custom_search_configuration", errors)
    if 'description' in value:
        _validate_A2APreviewTool_description(value['description'], f"{path}.description", errors)
    if 'filters' in value:
        _validate_OpenAI_WebSearchTool_filters(value['filters'], f"{path}.filters", errors)
    if 'name' in value:
        _validate_A2APreviewTool_name(value['name'], f"{path}.name", errors)
    if 'search_context_size' in value:
        _validate_OpenAI_WebSearchTool_search_context_size(value['search_context_size'], f"{path}.search_context_size", errors)
    if 'type' in value:
        _validate_OpenAI_WebSearchTool_type(value['type'], f"{path}.type", errors)
    if 'user_location' in value:
        _validate_OpenAI_WebSearchTool_user_location(value['user_location'], f"{path}.user_location", errors)

def _validate_OpenAI_WebSearchPreviewTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'search_context_size' in value:
        _validate_OpenAI_WebSearchPreviewTool_search_context_size(value['search_context_size'], f"{path}.search_context_size", errors)
    if 'type' in value:
        _validate_OpenAI_WebSearchPreviewTool_type(value['type'], f"{path}.type", errors)
    if 'user_location' in value:
        _validate_OpenAI_WebSearchPreviewTool_user_location(value['user_location'], f"{path}.user_location", errors)

def _validate_WorkIQPreviewTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'work_iq_preview' not in value:
        _append_error(errors, f"{path}.work_iq_preview", "Required property 'work_iq_preview' is missing")
    if 'type' in value:
        _validate_WorkIQPreviewTool_type(value['type'], f"{path}.type", errors)
    if 'work_iq_preview' in value:
        _validate_WorkIQPreviewTool_work_iq_preview(value['work_iq_preview'], f"{path}.work_iq_preview", errors)

def _validate_OpenAI_Item_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ItemType(value, path, errors)

def _validate_OpenAI_ApplyPatchToolCallItemParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'status' not in value:
        _append_error(errors, f"{path}.status", "Required property 'status' is missing")
    if 'operation' not in value:
        _append_error(errors, f"{path}.operation", "Required property 'operation' is missing")
    if 'call_id' in value:
        _validate_OpenAI_ApplyPatchToolCallItemParam_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'id' in value:
        _validate_CreateResponse_instructions(value['id'], f"{path}.id", errors)
    if 'operation' in value:
        _validate_OpenAI_ApplyPatchToolCallItemParam_operation(value['operation'], f"{path}.operation", errors)
    if 'status' in value:
        _validate_OpenAI_ApplyPatchToolCallItemParam_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ApplyPatchToolCallItemParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ApplyPatchToolCallOutputItemParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'status' not in value:
        _append_error(errors, f"{path}.status", "Required property 'status' is missing")
    if 'call_id' in value:
        _validate_OpenAI_ApplyPatchToolCallItemParam_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'id' in value:
        _validate_CreateResponse_instructions(value['id'], f"{path}.id", errors)
    if 'output' in value:
        _validate_CreateResponse_instructions(value['output'], f"{path}.output", errors)
    if 'status' in value:
        _validate_OpenAI_ApplyPatchToolCallOutputItemParam_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ApplyPatchToolCallOutputItemParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemCodeInterpreterToolCall(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'status' not in value:
        _append_error(errors, f"{path}.status", "Required property 'status' is missing")
    if 'container_id' not in value:
        _append_error(errors, f"{path}.container_id", "Required property 'container_id' is missing")
    if 'code' not in value:
        _append_error(errors, f"{path}.code", "Required property 'code' is missing")
    if 'outputs' not in value:
        _append_error(errors, f"{path}.outputs", "Required property 'outputs' is missing")
    if 'code' in value:
        _validate_CreateResponse_instructions(value['code'], f"{path}.code", errors)
    if 'container_id' in value:
        _validate_OpenAI_ItemCodeInterpreterToolCall_container_id(value['container_id'], f"{path}.container_id", errors)
    if 'id' in value:
        _validate_OpenAI_ItemCodeInterpreterToolCall_id(value['id'], f"{path}.id", errors)
    if 'outputs' in value:
        _validate_OpenAI_ItemCodeInterpreterToolCall_outputs(value['outputs'], f"{path}.outputs", errors)
    if 'status' in value:
        _validate_OpenAI_ItemCodeInterpreterToolCall_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ItemCodeInterpreterToolCall_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_CompactionSummaryItemParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'encrypted_content' not in value:
        _append_error(errors, f"{path}.encrypted_content", "Required property 'encrypted_content' is missing")
    if 'encrypted_content' in value:
        _validate_OpenAI_CompactionSummaryItemParam_encrypted_content(value['encrypted_content'], f"{path}.encrypted_content", errors)
    if 'id' in value:
        _validate_CreateResponse_instructions(value['id'], f"{path}.id", errors)
    if 'type' in value:
        _validate_OpenAI_CompactionSummaryItemParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemComputerToolCall(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'action' not in value:
        _append_error(errors, f"{path}.action", "Required property 'action' is missing")
    if 'pending_safety_checks' not in value:
        _append_error(errors, f"{path}.pending_safety_checks", "Required property 'pending_safety_checks' is missing")
    if 'status' not in value:
        _append_error(errors, f"{path}.status", "Required property 'status' is missing")
    if 'action' in value:
        _validate_OpenAI_ItemComputerToolCall_action(value['action'], f"{path}.action", errors)
    if 'call_id' in value:
        _validate_OpenAI_ItemComputerToolCall_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'id' in value:
        _validate_OpenAI_ItemComputerToolCall_id(value['id'], f"{path}.id", errors)
    if 'pending_safety_checks' in value:
        _validate_OpenAI_ItemComputerToolCall_pending_safety_checks(value['pending_safety_checks'], f"{path}.pending_safety_checks", errors)
    if 'status' in value:
        _validate_OpenAI_ItemComputerToolCall_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ItemComputerToolCall_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ComputerCallOutputItemParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'output' not in value:
        _append_error(errors, f"{path}.output", "Required property 'output' is missing")
    if 'acknowledged_safety_checks' in value:
        _validate_OpenAI_ComputerCallOutputItemParam_acknowledged_safety_checks(value['acknowledged_safety_checks'], f"{path}.acknowledged_safety_checks", errors)
    if 'call_id' in value:
        _validate_OpenAI_ComputerCallOutputItemParam_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'id' in value:
        _validate_CreateResponse_instructions(value['id'], f"{path}.id", errors)
    if 'output' in value:
        _validate_OpenAI_ComputerCallOutputItemParam_output(value['output'], f"{path}.output", errors)
    if 'status' in value:
        _validate_OpenAI_ComputerCallOutputItemParam_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ComputerCallOutputItemParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemCustomToolCall(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'input' not in value:
        _append_error(errors, f"{path}.input", "Required property 'input' is missing")
    if 'call_id' in value:
        _validate_OpenAI_ItemCustomToolCall_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'id' in value:
        _validate_OpenAI_ItemCustomToolCall_id(value['id'], f"{path}.id", errors)
    if 'input' in value:
        _validate_OpenAI_ItemCustomToolCall_input(value['input'], f"{path}.input", errors)
    if 'name' in value:
        _validate_OpenAI_ItemCustomToolCall_name(value['name'], f"{path}.name", errors)
    if 'type' in value:
        _validate_OpenAI_ItemCustomToolCall_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemCustomToolCallOutput(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'output' not in value:
        _append_error(errors, f"{path}.output", "Required property 'output' is missing")
    if 'call_id' in value:
        _validate_OpenAI_ItemCustomToolCallOutput_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'id' in value:
        _validate_OpenAI_ItemCustomToolCallOutput_id(value['id'], f"{path}.id", errors)
    if 'output' in value:
        _validate_OpenAI_ItemCustomToolCallOutput_output(value['output'], f"{path}.output", errors)
    if 'type' in value:
        _validate_OpenAI_ItemCustomToolCallOutput_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemFileSearchToolCall(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'status' not in value:
        _append_error(errors, f"{path}.status", "Required property 'status' is missing")
    if 'queries' not in value:
        _append_error(errors, f"{path}.queries", "Required property 'queries' is missing")
    if 'id' in value:
        _validate_OpenAI_ItemFileSearchToolCall_id(value['id'], f"{path}.id", errors)
    if 'queries' in value:
        _validate_OpenAI_ItemFileSearchToolCall_queries(value['queries'], f"{path}.queries", errors)
    if 'results' in value:
        _validate_OpenAI_ItemFileSearchToolCall_results(value['results'], f"{path}.results", errors)
    if 'status' in value:
        _validate_OpenAI_ItemFileSearchToolCall_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ItemFileSearchToolCall_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemFunctionToolCall(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'arguments' not in value:
        _append_error(errors, f"{path}.arguments", "Required property 'arguments' is missing")
    if 'arguments' in value:
        _validate_OpenAI_ItemFunctionToolCall_arguments(value['arguments'], f"{path}.arguments", errors)
    if 'call_id' in value:
        _validate_OpenAI_ItemFunctionToolCall_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'id' in value:
        _validate_OpenAI_ItemFunctionToolCall_id(value['id'], f"{path}.id", errors)
    if 'name' in value:
        _validate_OpenAI_ItemFunctionToolCall_name(value['name'], f"{path}.name", errors)
    if 'status' in value:
        _validate_OpenAI_ItemComputerToolCall_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ItemFunctionToolCall_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_FunctionCallOutputItemParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'output' not in value:
        _append_error(errors, f"{path}.output", "Required property 'output' is missing")
    if 'call_id' in value:
        _validate_OpenAI_FunctionCallOutputItemParam_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'id' in value:
        _validate_CreateResponse_instructions(value['id'], f"{path}.id", errors)
    if 'output' in value:
        _validate_OpenAI_FunctionCallOutputItemParam_output(value['output'], f"{path}.output", errors)
    if 'status' in value:
        _validate_OpenAI_ComputerCallOutputItemParam_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_FunctionCallOutputItemParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemImageGenToolCall(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'status' not in value:
        _append_error(errors, f"{path}.status", "Required property 'status' is missing")
    if 'result' not in value:
        _append_error(errors, f"{path}.result", "Required property 'result' is missing")
    if 'id' in value:
        _validate_OpenAI_ItemImageGenToolCall_id(value['id'], f"{path}.id", errors)
    if 'result' in value:
        _validate_CreateResponse_instructions(value['result'], f"{path}.result", errors)
    if 'status' in value:
        _validate_OpenAI_ItemImageGenToolCall_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ItemImageGenToolCall_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemReferenceParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'id' in value:
        _validate_OpenAI_ItemReferenceParam_id(value['id'], f"{path}.id", errors)
    if 'type' in value:
        _validate_OpenAI_ItemReferenceParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemLocalShellToolCall(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'action' not in value:
        _append_error(errors, f"{path}.action", "Required property 'action' is missing")
    if 'status' not in value:
        _append_error(errors, f"{path}.status", "Required property 'status' is missing")
    if 'action' in value:
        _validate_OpenAI_ItemLocalShellToolCall_action(value['action'], f"{path}.action", errors)
    if 'call_id' in value:
        _validate_OpenAI_ItemLocalShellToolCall_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'id' in value:
        _validate_OpenAI_ItemLocalShellToolCall_id(value['id'], f"{path}.id", errors)
    if 'status' in value:
        _validate_OpenAI_ItemLocalShellToolCall_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ItemLocalShellToolCall_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemLocalShellToolCallOutput(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'output' not in value:
        _append_error(errors, f"{path}.output", "Required property 'output' is missing")
    if 'id' in value:
        _validate_OpenAI_ItemLocalShellToolCall_call_id(value['id'], f"{path}.id", errors)
    if 'output' in value:
        _validate_OpenAI_ItemLocalShellToolCallOutput_output(value['output'], f"{path}.output", errors)
    if 'status' in value:
        _validate_OpenAI_ItemLocalShellToolCallOutput_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ItemLocalShellToolCallOutput_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemMcpApprovalRequest(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'server_label' not in value:
        _append_error(errors, f"{path}.server_label", "Required property 'server_label' is missing")
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'arguments' not in value:
        _append_error(errors, f"{path}.arguments", "Required property 'arguments' is missing")
    if 'arguments' in value:
        _validate_OpenAI_ItemMcpApprovalRequest_arguments(value['arguments'], f"{path}.arguments", errors)
    if 'id' in value:
        _validate_OpenAI_ItemMcpApprovalRequest_id(value['id'], f"{path}.id", errors)
    if 'name' in value:
        _validate_OpenAI_ItemMcpApprovalRequest_name(value['name'], f"{path}.name", errors)
    if 'server_label' in value:
        _validate_OpenAI_ItemMcpApprovalRequest_server_label(value['server_label'], f"{path}.server_label", errors)
    if 'type' in value:
        _validate_OpenAI_ItemMcpApprovalRequest_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_MCPApprovalResponse(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'approval_request_id' not in value:
        _append_error(errors, f"{path}.approval_request_id", "Required property 'approval_request_id' is missing")
    if 'approve' not in value:
        _append_error(errors, f"{path}.approve", "Required property 'approve' is missing")
    if 'approval_request_id' in value:
        _validate_OpenAI_MCPApprovalResponse_approval_request_id(value['approval_request_id'], f"{path}.approval_request_id", errors)
    if 'approve' in value:
        _validate_OpenAI_MCPApprovalResponse_approve(value['approve'], f"{path}.approve", errors)
    if 'id' in value:
        _validate_CreateResponse_instructions(value['id'], f"{path}.id", errors)
    if 'reason' in value:
        _validate_CreateResponse_instructions(value['reason'], f"{path}.reason", errors)
    if 'type' in value:
        _validate_OpenAI_MCPApprovalResponse_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemMcpToolCall(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'server_label' not in value:
        _append_error(errors, f"{path}.server_label", "Required property 'server_label' is missing")
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'arguments' not in value:
        _append_error(errors, f"{path}.arguments", "Required property 'arguments' is missing")
    if 'approval_request_id' in value:
        _validate_CreateResponse_instructions(value['approval_request_id'], f"{path}.approval_request_id", errors)
    if 'arguments' in value:
        _validate_OpenAI_ItemMcpToolCall_arguments(value['arguments'], f"{path}.arguments", errors)
    if 'error' in value:
        _validate_OpenAI_ToolChoiceAllowed_tools_item(value['error'], f"{path}.error", errors)
    if 'id' in value:
        _validate_OpenAI_ItemMcpToolCall_id(value['id'], f"{path}.id", errors)
    if 'name' in value:
        _validate_OpenAI_ItemMcpToolCall_name(value['name'], f"{path}.name", errors)
    if 'output' in value:
        _validate_CreateResponse_instructions(value['output'], f"{path}.output", errors)
    if 'server_label' in value:
        _validate_OpenAI_ItemMcpToolCall_server_label(value['server_label'], f"{path}.server_label", errors)
    if 'status' in value:
        _validate_OpenAI_ItemMcpToolCall_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ItemMcpToolCall_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemMcpListTools(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'server_label' not in value:
        _append_error(errors, f"{path}.server_label", "Required property 'server_label' is missing")
    if 'tools' not in value:
        _append_error(errors, f"{path}.tools", "Required property 'tools' is missing")
    if 'error' in value:
        _validate_CreateResponse_instructions(value['error'], f"{path}.error", errors)
    if 'id' in value:
        _validate_OpenAI_ItemMcpListTools_id(value['id'], f"{path}.id", errors)
    if 'server_label' in value:
        _validate_OpenAI_ItemMcpListTools_server_label(value['server_label'], f"{path}.server_label", errors)
    if 'tools' in value:
        _validate_OpenAI_ItemMcpListTools_tools(value['tools'], f"{path}.tools", errors)
    if 'type' in value:
        _validate_OpenAI_ItemMcpListTools_type(value['type'], f"{path}.type", errors)

def _validate_MemorySearchToolCallItemParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'results' in value:
        _validate_MemorySearchToolCallItemParam_results(value['results'], f"{path}.results", errors)
    if 'type' in value:
        _validate_MemorySearchToolCallItemParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemMessage(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'role' not in value:
        _append_error(errors, f"{path}.role", "Required property 'role' is missing")
    if 'content' not in value:
        _append_error(errors, f"{path}.content", "Required property 'content' is missing")
    if 'content' in value:
        _validate_OpenAI_ItemMessage_content(value['content'], f"{path}.content", errors)
    if 'role' in value:
        _validate_OpenAI_ItemMessage_role(value['role'], f"{path}.role", errors)
    if 'type' in value:
        _validate_OpenAI_ItemMessage_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemOutputMessage(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'role' not in value:
        _append_error(errors, f"{path}.role", "Required property 'role' is missing")
    if 'content' not in value:
        _append_error(errors, f"{path}.content", "Required property 'content' is missing")
    if 'status' not in value:
        _append_error(errors, f"{path}.status", "Required property 'status' is missing")
    if 'content' in value:
        _validate_OpenAI_ItemOutputMessage_content(value['content'], f"{path}.content", errors)
    if 'id' in value:
        _validate_OpenAI_ItemOutputMessage_id(value['id'], f"{path}.id", errors)
    if 'role' in value:
        _validate_OpenAI_ItemOutputMessage_role(value['role'], f"{path}.role", errors)
    if 'status' in value:
        _validate_OpenAI_ItemOutputMessage_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ItemOutputMessage_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemReasoningItem(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'summary' not in value:
        _append_error(errors, f"{path}.summary", "Required property 'summary' is missing")
    if 'content' in value:
        _validate_OpenAI_ItemReasoningItem_content(value['content'], f"{path}.content", errors)
    if 'encrypted_content' in value:
        _validate_CreateResponse_instructions(value['encrypted_content'], f"{path}.encrypted_content", errors)
    if 'id' in value:
        _validate_OpenAI_ItemReasoningItem_id(value['id'], f"{path}.id", errors)
    if 'status' in value:
        _validate_OpenAI_ItemComputerToolCall_status(value['status'], f"{path}.status", errors)
    if 'summary' in value:
        _validate_OpenAI_ItemReasoningItem_summary(value['summary'], f"{path}.summary", errors)
    if 'type' in value:
        _validate_OpenAI_ItemReasoningItem_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_FunctionShellCallItemParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'action' not in value:
        _append_error(errors, f"{path}.action", "Required property 'action' is missing")
    if 'action' in value:
        _validate_OpenAI_FunctionShellCallItemParam_action(value['action'], f"{path}.action", errors)
    if 'call_id' in value:
        _validate_OpenAI_FunctionShellCallItemParam_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'environment' in value:
        _validate_OpenAI_FunctionShellCallItemParam_environment(value['environment'], f"{path}.environment", errors)
    if 'id' in value:
        _validate_CreateResponse_instructions(value['id'], f"{path}.id", errors)
    if 'status' in value:
        _validate_OpenAI_FunctionShellCallItemParam_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_FunctionShellCallItemParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_FunctionShellCallOutputItemParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'call_id' not in value:
        _append_error(errors, f"{path}.call_id", "Required property 'call_id' is missing")
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'output' not in value:
        _append_error(errors, f"{path}.output", "Required property 'output' is missing")
    if 'call_id' in value:
        _validate_OpenAI_FunctionShellCallItemParam_call_id(value['call_id'], f"{path}.call_id", errors)
    if 'id' in value:
        _validate_CreateResponse_instructions(value['id'], f"{path}.id", errors)
    if 'max_output_length' in value:
        _validate_CreateResponse_max_output_tokens(value['max_output_length'], f"{path}.max_output_length", errors)
    if 'output' in value:
        _validate_OpenAI_FunctionShellCallOutputItemParam_output(value['output'], f"{path}.output", errors)
    if 'status' in value:
        _validate_OpenAI_FunctionShellCallItemParam_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_FunctionShellCallOutputItemParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemWebSearchToolCall(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'status' not in value:
        _append_error(errors, f"{path}.status", "Required property 'status' is missing")
    if 'action' not in value:
        _append_error(errors, f"{path}.action", "Required property 'action' is missing")
    if 'action' in value:
        _validate_OpenAI_ItemWebSearchToolCall_action(value['action'], f"{path}.action", errors)
    if 'id' in value:
        _validate_OpenAI_ItemWebSearchToolCall_id(value['id'], f"{path}.id", errors)
    if 'status' in value:
        _validate_OpenAI_ItemWebSearchToolCall_status(value['status'], f"{path}.status", errors)
    if 'type' in value:
        _validate_OpenAI_ItemWebSearchToolCall_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_TextResponseFormatConfigurationType(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_TextResponseFormatConfigurationType_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected TextResponseFormatConfigurationType to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_TextResponseFormatConfigurationResponseFormatJsonObject_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('json_object',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_TextResponseFormatJsonSchema_description(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_TextResponseFormatJsonSchema_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_TextResponseFormatJsonSchema_schema(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ResponseFormatJsonSchemaSchema(value, path, errors)

def _validate_OpenAI_TextResponseFormatJsonSchema_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('json_schema',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_TextResponseFormatConfigurationResponseFormatText_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('text',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ToolType(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_ToolType_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected ToolType to be a string value, got {_type_label(value)}")
        return

def _validate_A2APreviewTool_agent_card_path(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_A2APreviewTool_base_url(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_A2APreviewTool_description(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_A2APreviewTool_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_A2APreviewTool_project_connection_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_A2APreviewTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('a2a_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ApplyPatchToolParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('apply_patch',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_AzureAISearchTool_azure_ai_search(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_AzureAISearchTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('azure_ai_search',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_AzureFunctionTool_azure_function(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_AzureFunctionTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('azure_function',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_BingCustomSearchPreviewTool_bing_custom_search_preview(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_BingCustomSearchPreviewTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('bing_custom_search_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_BingGroundingTool_bing_grounding(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_BingGroundingTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('bing_grounding',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_BrowserAutomationPreviewTool_browser_automation_preview(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_BrowserAutomationPreviewTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('browser_automation_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_CaptureStructuredOutputsTool_outputs(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_CaptureStructuredOutputsTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('capture_structured_outputs',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CodeInterpreterTool_container(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_AutoCodeInterpreterToolParam(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: string, OpenAI.AutoCodeInterpreterToolParam; got {_type_label(value)}")
        return

def _validate_OpenAI_CodeInterpreterTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('code_interpreter',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ComputerUsePreviewTool_display_height(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ComputerUsePreviewTool_display_width(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ComputerUsePreviewTool_environment(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ComputerUsePreviewTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('computer_use_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CustomToolParam_description(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CustomToolParam_format(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_CustomToolParam_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CustomToolParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('custom',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_MicrosoftFabricPreviewTool_fabric_dataagent_preview(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_MicrosoftFabricPreviewTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('fabric_dataagent_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FileSearchTool_filters(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return

def _validate_OpenAI_FileSearchTool_max_num_results(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_FileSearchTool_ranking_options(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_FileSearchTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('file_search',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FileSearchTool_vector_store_ids(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_InputParam_string(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_FunctionTool_parameters(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    for _key, _item in value.items():
        if _key not in ():
            _validate_CreateResponse_structured_inputs_additional_property(_item, f"{path}.{_key}", errors)

def _validate_OpenAI_FunctionTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('function',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ImageGenTool_action(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ImageGenTool_background(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('transparent', 'opaque', 'auto')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ImageGenTool_input_fidelity(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return

def _validate_OpenAI_ImageGenTool_input_image_mask(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ImageGenTool_model(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_ImageGenTool_model_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected ImageGenTool_model to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_ImageGenTool_moderation(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('auto', 'low')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ImageGenTool_output_compression(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ImageGenTool_output_format(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('png', 'webp', 'jpeg')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ImageGenTool_partial_images(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ImageGenTool_quality(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('low', 'medium', 'high', 'auto')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ImageGenTool_size(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('1024x1024', '1024x1536', '1536x1024', 'auto')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ImageGenTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('image_generation',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_LocalShellToolParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('local_shell',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPTool_allowed_tools(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'array'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_MCPTool_allowed_tools_array(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_MCPTool_allowed_tools_object(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: array, object; got {_type_label(value)}")
        return

def _validate_OpenAI_MCPTool_authorization(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPTool_connector_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('connector_dropbox', 'connector_gmail', 'connector_googlecalendar', 'connector_googledrive', 'connector_microsoftteams', 'connector_outlookcalendar', 'connector_outlookemail', 'connector_sharepoint')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPTool_headers(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    for _key, _item in value.items():
        if _key not in ():
            _validate_OpenAI_InputParam_string(_item, f"{path}.{_key}", errors)

def _validate_OpenAI_MCPTool_project_connection_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPTool_require_approval(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_MCPTool_require_approval_object(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_MCPTool_require_approval_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: object, string; got {_type_label(value)}")
        return

def _validate_OpenAI_MCPTool_server_description(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPTool_server_label(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPTool_server_url(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('mcp',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_MemorySearchTool_memory_store_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_MemorySearchTool_scope(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_MemorySearchTool_search_options(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_MemorySearchTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('memory_search',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_MemorySearchTool_update_delay(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_MemorySearchPreviewTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('memory_search_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenApiTool_openapi(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenApiTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('openapi',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_SharepointPreviewTool_sharepoint_grounding_preview(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_SharepointPreviewTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('sharepoint_grounding_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionShellToolParam_environment(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_OpenAI_FunctionShellToolParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('shell',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchTool_custom_search_configuration(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_WebSearchTool_filters(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_OpenAI_WebSearchTool_search_context_size(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('low', 'medium', 'high')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('web_search',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchTool_user_location(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_OpenAI_WebSearchPreviewTool_search_context_size(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_WebSearchPreviewTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('web_search_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchPreviewTool_user_location(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_WorkIQPreviewTool_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('work_iq_preview',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_WorkIQPreviewTool_work_iq_preview(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ItemType(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_ItemType_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected ItemType to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_ApplyPatchToolCallItemParam_call_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ApplyPatchToolCallItemParam_operation(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ApplyPatchToolCallItemParam_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ApplyPatchToolCallItemParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('apply_patch_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ApplyPatchToolCallOutputItemParam_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ApplyPatchToolCallOutputItemParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('apply_patch_call_output',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCodeInterpreterToolCall_container_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCodeInterpreterToolCall_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCodeInterpreterToolCall_outputs(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ItemCodeInterpreterToolCall_outputs_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ItemCodeInterpreterToolCall_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('in_progress', 'completed', 'incomplete', 'interpreting', 'failed')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCodeInterpreterToolCall_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('code_interpreter_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CompactionSummaryItemParam_encrypted_content(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CompactionSummaryItemParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('compaction',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemComputerToolCall_action(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ComputerAction(value, path, errors)

def _validate_OpenAI_ItemComputerToolCall_call_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemComputerToolCall_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemComputerToolCall_pending_safety_checks(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ItemComputerToolCall_pending_safety_checks_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ItemComputerToolCall_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('in_progress', 'completed', 'incomplete')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemComputerToolCall_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('computer_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ComputerCallOutputItemParam_acknowledged_safety_checks(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ItemComputerToolCall_pending_safety_checks_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ComputerCallOutputItemParam_call_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ComputerCallOutputItemParam_output(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ComputerScreenshotImage(value, path, errors)

def _validate_OpenAI_ComputerCallOutputItemParam_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return

def _validate_OpenAI_ComputerCallOutputItemParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('computer_call_output',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCustomToolCall_call_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCustomToolCall_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCustomToolCall_input(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCustomToolCall_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCustomToolCall_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('custom_tool_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCustomToolCallOutput_call_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCustomToolCallOutput_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCustomToolCallOutput_output(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'array'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_ItemCustomToolCallOutput_output_array(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: string, array; got {_type_label(value)}")
        return

def _validate_OpenAI_ItemCustomToolCallOutput_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('custom_tool_call_output',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemFileSearchToolCall_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemFileSearchToolCall_queries(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_InputParam_string(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ItemFileSearchToolCall_results(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ItemFileSearchToolCall_results_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ItemFileSearchToolCall_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('in_progress', 'searching', 'completed', 'incomplete', 'failed')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemFileSearchToolCall_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('file_search_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemFunctionToolCall_arguments(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemFunctionToolCall_call_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemFunctionToolCall_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemFunctionToolCall_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemFunctionToolCall_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('function_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionCallOutputItemParam_call_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionCallOutputItemParam_output(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'array'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_FunctionCallOutputItemParam_output_array(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: string, array; got {_type_label(value)}")
        return

def _validate_OpenAI_FunctionCallOutputItemParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('function_call_output',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemImageGenToolCall_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemImageGenToolCall_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('in_progress', 'completed', 'generating', 'failed')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemImageGenToolCall_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('image_generation_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemReferenceParam_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemReferenceParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('item_reference',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemLocalShellToolCall_action(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_LocalShellExecAction(value, path, errors)

def _validate_OpenAI_ItemLocalShellToolCall_call_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemLocalShellToolCall_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemLocalShellToolCall_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('in_progress', 'completed', 'incomplete')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemLocalShellToolCall_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('local_shell_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemLocalShellToolCallOutput_output(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemLocalShellToolCallOutput_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    _allowed_values = ('in_progress', 'completed', 'incomplete')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemLocalShellToolCallOutput_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('local_shell_call_output',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpApprovalRequest_arguments(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpApprovalRequest_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpApprovalRequest_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpApprovalRequest_server_label(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpApprovalRequest_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('mcp_approval_request',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPApprovalResponse_approval_request_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPApprovalResponse_approve(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'boolean'):
        _append_type_mismatch(errors, path, 'boolean', value)
        return

def _validate_OpenAI_MCPApprovalResponse_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('mcp_approval_response',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpToolCall_arguments(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpToolCall_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpToolCall_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpToolCall_server_label(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpToolCall_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ItemMcpToolCall_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('mcp_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpListTools_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpListTools_server_label(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMcpListTools_tools(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ItemMcpListTools_tools_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ItemMcpListTools_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('mcp_list_tools',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_MemorySearchToolCallItemParam_results(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_MemorySearchToolCallItemParam_results_item(_item, f"{path}[{_idx}]", errors)

def _validate_MemorySearchToolCallItemParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('memory_search_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemMessage_content(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'array'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_ItemMessage_content_array(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: string, array; got {_type_label(value)}")
        return

def _validate_OpenAI_ItemMessage_role(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ItemMessage_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    _allowed_values = ('message',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemOutputMessage_content(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ItemOutputMessage_content_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ItemOutputMessage_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemOutputMessage_role(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('assistant',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemOutputMessage_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('in_progress', 'completed', 'incomplete')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemOutputMessage_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('output_message',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemReasoningItem_content(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ItemReasoningItem_content_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ItemReasoningItem_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemReasoningItem_summary(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ItemReasoningItem_summary_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ItemReasoningItem_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('reasoning',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionShellCallItemParam_action(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_FunctionShellCallItemParam_call_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionShellCallItemParam_environment(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_OpenAI_FunctionShellCallItemParam_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return

def _validate_OpenAI_FunctionShellCallItemParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('shell_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionShellCallOutputItemParam_output(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_FunctionShellCallOutputItemParam_output_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_FunctionShellCallOutputItemParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('shell_call_output',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemWebSearchToolCall_action(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_WebSearchActionSearch(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_WebSearchActionOpenPage(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_2: list[dict[str, str]] = []
        _validate_OpenAI_WebSearchActionFind(value, path, _branch_errors_2)
        if not _branch_errors_2:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: OpenAI.WebSearchActionSearch, OpenAI.WebSearchActionOpenPage, OpenAI.WebSearchActionFind; got {_type_label(value)}")
        return

def _validate_OpenAI_ItemWebSearchToolCall_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemWebSearchToolCall_status(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('in_progress', 'searching', 'completed', 'failed')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemWebSearchToolCall_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('web_search_call',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_TextResponseFormatConfigurationType_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('TextResponseFormatConfigurationType')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ResponseFormatJsonSchemaSchema(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    for _key, _item in value.items():
        if _key not in ():
            _validate_CreateResponse_structured_inputs_additional_property(_item, f"{path}.{_key}", errors)

def _validate_OpenAI_ToolType_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('ToolType')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_AutoCodeInterpreterToolParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'file_ids' in value:
        _validate_OpenAI_AutoCodeInterpreterToolParam_file_ids(value['file_ids'], f"{path}.file_ids", errors)
    if 'memory_limit' in value:
        _validate_OpenAI_AutoCodeInterpreterToolParam_memory_limit(value['memory_limit'], f"{path}.memory_limit", errors)
    if 'network_policy' in value:
        _validate_OpenAI_AutoCodeInterpreterToolParam_network_policy(value['network_policy'], f"{path}.network_policy", errors)
    if 'type' in value:
        _validate_OpenAI_AutoCodeInterpreterToolParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ImageGenTool_model_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('gpt-image-1', 'gpt-image-1-mini', 'gpt-image-1.5')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPTool_allowed_tools_array(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_InputParam_string(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_MCPTool_allowed_tools_object(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_OpenAI_MCPTool_require_approval_object(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_OpenAI_MCPTool_require_approval_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    _allowed_values = ('always', 'never')
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemType_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('ItemType')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCodeInterpreterToolCall_outputs_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_CodeInterpreterOutputLogs(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_CodeInterpreterOutputImage(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: OpenAI.CodeInterpreterOutputLogs, OpenAI.CodeInterpreterOutputImage; got {_type_label(value)}")
        return

def _validate_OpenAI_ComputerAction(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ComputerAction_type(value['type'], f"{path}.type", errors)
    _disc_value = value.get('type')
    if not isinstance(_disc_value, str):
        _append_error(errors, f"{path}.type", "Required discriminator 'type' is missing or invalid")
        return
    if _disc_value == 'click':
        _validate_OpenAI_ClickParam(value, path, errors)
    if _disc_value == 'double_click':
        _validate_OpenAI_DoubleClickAction(value, path, errors)
    if _disc_value == 'drag':
        _validate_OpenAI_DragParam(value, path, errors)
    if _disc_value == 'keypress':
        _validate_OpenAI_KeyPressAction(value, path, errors)
    if _disc_value == 'move':
        _validate_OpenAI_MoveParam(value, path, errors)
    if _disc_value == 'screenshot':
        _validate_OpenAI_ScreenshotParam(value, path, errors)
    if _disc_value == 'scroll':
        _validate_OpenAI_ScrollParam(value, path, errors)
    if _disc_value == 'type':
        _validate_OpenAI_TypeParam(value, path, errors)
    if _disc_value == 'wait':
        _validate_OpenAI_WaitParam(value, path, errors)

def _validate_OpenAI_ItemComputerToolCall_pending_safety_checks_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ComputerCallSafetyCheckParam(value, path, errors)

def _validate_OpenAI_ComputerScreenshotImage(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'file_id' in value:
        _validate_OpenAI_ComputerScreenshotImage_file_id(value['file_id'], f"{path}.file_id", errors)
    if 'image_url' in value:
        _validate_OpenAI_ComputerScreenshotImage_image_url(value['image_url'], f"{path}.image_url", errors)
    if 'type' in value:
        _validate_OpenAI_ComputerScreenshotImage_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ItemCustomToolCallOutput_output_array(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ItemCustomToolCallOutput_output_array_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ItemFileSearchToolCall_results_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_FileSearchToolCallResults(value, path, errors)

def _validate_OpenAI_FunctionCallOutputItemParam_output_array(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_FunctionCallOutputItemParam_output_array_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_LocalShellExecAction(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'command' not in value:
        _append_error(errors, f"{path}.command", "Required property 'command' is missing")
    if 'env' not in value:
        _append_error(errors, f"{path}.env", "Required property 'env' is missing")
    if 'command' in value:
        _validate_OpenAI_LocalShellExecAction_command(value['command'], f"{path}.command", errors)
    if 'env' in value:
        _validate_OpenAI_LocalShellExecAction_env(value['env'], f"{path}.env", errors)
    if 'timeout_ms' in value:
        _validate_CreateResponse_max_output_tokens(value['timeout_ms'], f"{path}.timeout_ms", errors)
    if 'type' in value:
        _validate_OpenAI_LocalShellExecAction_type(value['type'], f"{path}.type", errors)
    if 'user' in value:
        _validate_CreateResponse_instructions(value['user'], f"{path}.user", errors)
    if 'working_directory' in value:
        _validate_CreateResponse_instructions(value['working_directory'], f"{path}.working_directory", errors)

def _validate_OpenAI_ItemMcpListTools_tools_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_MCPListToolsTool(value, path, errors)

def _validate_MemorySearchToolCallItemParam_results_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_MemorySearchItem(value, path, errors)

def _validate_OpenAI_ItemMessage_content_array(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ItemMessage_content_array_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ItemOutputMessage_content_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_OutputMessageContent(value, path, errors)

def _validate_OpenAI_ItemReasoningItem_content_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ReasoningTextContent(value, path, errors)

def _validate_OpenAI_ItemReasoningItem_summary_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_SummaryTextContent(value, path, errors)

def _validate_OpenAI_FunctionShellCallOutputItemParam_output_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_FunctionShellCallOutputContentParam(value, path, errors)

def _validate_OpenAI_WebSearchActionSearch(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'query' not in value:
        _append_error(errors, f"{path}.query", "Required property 'query' is missing")
    if 'queries' in value:
        _validate_OpenAI_WebSearchActionSearch_queries(value['queries'], f"{path}.queries", errors)
    if 'query' in value:
        _validate_OpenAI_WebSearchActionSearch_query(value['query'], f"{path}.query", errors)
    if 'sources' in value:
        _validate_OpenAI_WebSearchActionSearch_sources(value['sources'], f"{path}.sources", errors)
    if 'type' in value:
        _validate_OpenAI_WebSearchActionSearch_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_WebSearchActionOpenPage(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_WebSearchActionOpenPage_type(value['type'], f"{path}.type", errors)
    if 'url' in value:
        _validate_OpenAI_WebSearchActionOpenPage_url(value['url'], f"{path}.url", errors)

def _validate_OpenAI_WebSearchActionFind(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'url' not in value:
        _append_error(errors, f"{path}.url", "Required property 'url' is missing")
    if 'pattern' not in value:
        _append_error(errors, f"{path}.pattern", "Required property 'pattern' is missing")
    if 'pattern' in value:
        _validate_OpenAI_WebSearchActionFind_pattern(value['pattern'], f"{path}.pattern", errors)
    if 'type' in value:
        _validate_OpenAI_WebSearchActionFind_type(value['type'], f"{path}.type", errors)
    if 'url' in value:
        _validate_OpenAI_WebSearchActionFind_url(value['url'], f"{path}.url", errors)

def _validate_OpenAI_AutoCodeInterpreterToolParam_file_ids(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_InputParam_string(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_AutoCodeInterpreterToolParam_memory_limit(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return

def _validate_OpenAI_AutoCodeInterpreterToolParam_network_policy(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ContainerNetworkPolicyParam(value, path, errors)

def _validate_OpenAI_AutoCodeInterpreterToolParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('auto',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CodeInterpreterOutputLogs(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'logs' not in value:
        _append_error(errors, f"{path}.logs", "Required property 'logs' is missing")
    if 'logs' in value:
        _validate_OpenAI_CodeInterpreterOutputLogs_logs(value['logs'], f"{path}.logs", errors)
    if 'type' in value:
        _validate_OpenAI_CodeInterpreterOutputLogs_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_CodeInterpreterOutputImage(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'url' not in value:
        _append_error(errors, f"{path}.url", "Required property 'url' is missing")
    if 'type' in value:
        _validate_OpenAI_CodeInterpreterOutputImage_type(value['type'], f"{path}.type", errors)
    if 'url' in value:
        _validate_OpenAI_CodeInterpreterOutputImage_url(value['url'], f"{path}.url", errors)

def _validate_OpenAI_ComputerAction_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ComputerActionType(value, path, errors)

def _validate_OpenAI_ClickParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'button' not in value:
        _append_error(errors, f"{path}.button", "Required property 'button' is missing")
    if 'x' not in value:
        _append_error(errors, f"{path}.x", "Required property 'x' is missing")
    if 'y' not in value:
        _append_error(errors, f"{path}.y", "Required property 'y' is missing")
    if 'button' in value:
        _validate_OpenAI_ClickParam_button(value['button'], f"{path}.button", errors)
    if 'type' in value:
        _validate_OpenAI_ClickParam_type(value['type'], f"{path}.type", errors)
    if 'x' in value:
        _validate_OpenAI_ClickParam_x(value['x'], f"{path}.x", errors)
    if 'y' in value:
        _validate_OpenAI_ClickParam_y(value['y'], f"{path}.y", errors)

def _validate_OpenAI_DoubleClickAction(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'x' not in value:
        _append_error(errors, f"{path}.x", "Required property 'x' is missing")
    if 'y' not in value:
        _append_error(errors, f"{path}.y", "Required property 'y' is missing")
    if 'type' in value:
        _validate_OpenAI_DoubleClickAction_type(value['type'], f"{path}.type", errors)
    if 'x' in value:
        _validate_OpenAI_DoubleClickAction_x(value['x'], f"{path}.x", errors)
    if 'y' in value:
        _validate_OpenAI_DoubleClickAction_y(value['y'], f"{path}.y", errors)

def _validate_OpenAI_DragParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'path' not in value:
        _append_error(errors, f"{path}.path", "Required property 'path' is missing")
    if 'path' in value:
        _validate_OpenAI_DragParam_path(value['path'], f"{path}.path", errors)
    if 'type' in value:
        _validate_OpenAI_DragParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_KeyPressAction(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'keys' not in value:
        _append_error(errors, f"{path}.keys", "Required property 'keys' is missing")
    if 'keys' in value:
        _validate_OpenAI_KeyPressAction_keys(value['keys'], f"{path}.keys", errors)
    if 'type' in value:
        _validate_OpenAI_KeyPressAction_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_MoveParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'x' not in value:
        _append_error(errors, f"{path}.x", "Required property 'x' is missing")
    if 'y' not in value:
        _append_error(errors, f"{path}.y", "Required property 'y' is missing")
    if 'type' in value:
        _validate_OpenAI_MoveParam_type(value['type'], f"{path}.type", errors)
    if 'x' in value:
        _validate_OpenAI_MoveParam_x(value['x'], f"{path}.x", errors)
    if 'y' in value:
        _validate_OpenAI_MoveParam_y(value['y'], f"{path}.y", errors)

def _validate_OpenAI_ScreenshotParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ScreenshotParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ScrollParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'x' not in value:
        _append_error(errors, f"{path}.x", "Required property 'x' is missing")
    if 'y' not in value:
        _append_error(errors, f"{path}.y", "Required property 'y' is missing")
    if 'scroll_x' not in value:
        _append_error(errors, f"{path}.scroll_x", "Required property 'scroll_x' is missing")
    if 'scroll_y' not in value:
        _append_error(errors, f"{path}.scroll_y", "Required property 'scroll_y' is missing")
    if 'scroll_x' in value:
        _validate_OpenAI_ScrollParam_scroll_x(value['scroll_x'], f"{path}.scroll_x", errors)
    if 'scroll_y' in value:
        _validate_OpenAI_ScrollParam_scroll_y(value['scroll_y'], f"{path}.scroll_y", errors)
    if 'type' in value:
        _validate_OpenAI_ScrollParam_type(value['type'], f"{path}.type", errors)
    if 'x' in value:
        _validate_OpenAI_ScrollParam_x(value['x'], f"{path}.x", errors)
    if 'y' in value:
        _validate_OpenAI_ScrollParam_y(value['y'], f"{path}.y", errors)

def _validate_OpenAI_TypeParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'text' not in value:
        _append_error(errors, f"{path}.text", "Required property 'text' is missing")
    if 'text' in value:
        _validate_OpenAI_TypeParam_text(value['text'], f"{path}.text", errors)
    if 'type' in value:
        _validate_OpenAI_TypeParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_WaitParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_WaitParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ComputerCallSafetyCheckParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'id' not in value:
        _append_error(errors, f"{path}.id", "Required property 'id' is missing")
    if 'code' in value:
        _validate_CreateResponse_instructions(value['code'], f"{path}.code", errors)
    if 'id' in value:
        _validate_OpenAI_ComputerCallSafetyCheckParam_id(value['id'], f"{path}.id", errors)
    if 'message' in value:
        _validate_CreateResponse_instructions(value['message'], f"{path}.message", errors)

def _validate_OpenAI_ComputerScreenshotImage_file_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ComputerScreenshotImage_image_url(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ComputerScreenshotImage_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('computer_screenshot',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ItemCustomToolCallOutput_output_array_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_FunctionAndCustomToolCallOutput(value, path, errors)

def _validate_OpenAI_FileSearchToolCallResults(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'attributes' in value:
        _validate_OpenAI_FileSearchToolCallResults_attributes(value['attributes'], f"{path}.attributes", errors)
    if 'file_id' in value:
        _validate_OpenAI_InputParam_string(value['file_id'], f"{path}.file_id", errors)
    if 'filename' in value:
        _validate_OpenAI_InputParam_string(value['filename'], f"{path}.filename", errors)
    if 'score' in value:
        _validate_OpenAI_FileSearchToolCallResults_score(value['score'], f"{path}.score", errors)
    if 'text' in value:
        _validate_OpenAI_InputParam_string(value['text'], f"{path}.text", errors)

def _validate_OpenAI_FunctionCallOutputItemParam_output_array_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputTextContentParam(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_InputImageContentParamAutoParam(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union and _is_type(value, 'object'):
        _branch_errors_2: list[dict[str, str]] = []
        _validate_OpenAI_InputFileContentParam(value, path, _branch_errors_2)
        if not _branch_errors_2:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected one of: OpenAI.InputTextContentParam, OpenAI.InputImageContentParamAutoParam, OpenAI.InputFileContentParam; got {_type_label(value)}")
        return

def _validate_OpenAI_LocalShellExecAction_command(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_InputParam_string(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_LocalShellExecAction_env(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    for _key, _item in value.items():
        if _key not in ():
            _validate_OpenAI_InputParam_string(_item, f"{path}.{_key}", errors)

def _validate_OpenAI_LocalShellExecAction_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('exec',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MCPListToolsTool(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'input_schema' not in value:
        _append_error(errors, f"{path}.input_schema", "Required property 'input_schema' is missing")
    if 'annotations' in value:
        _validate_OpenAI_MCPListToolsTool_annotations(value['annotations'], f"{path}.annotations", errors)
    if 'description' in value:
        _validate_CreateResponse_instructions(value['description'], f"{path}.description", errors)
    if 'input_schema' in value:
        _validate_OpenAI_MCPListToolsTool_input_schema(value['input_schema'], f"{path}.input_schema", errors)
    if 'name' in value:
        _validate_OpenAI_MCPListToolsTool_name(value['name'], f"{path}.name", errors)

def _validate_MemorySearchItem(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'memory_item' not in value:
        _append_error(errors, f"{path}.memory_item", "Required property 'memory_item' is missing")
    if 'memory_item' in value:
        _validate_MemorySearchItem_memory_item(value['memory_item'], f"{path}.memory_item", errors)

def _validate_OpenAI_ItemMessage_content_array_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_MessageContent(value, path, errors)

def _validate_OpenAI_OutputMessageContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_OutputMessageContent_type(value['type'], f"{path}.type", errors)
    _disc_value = value.get('type')
    if not isinstance(_disc_value, str):
        _append_error(errors, f"{path}.type", "Required discriminator 'type' is missing or invalid")
        return
    if _disc_value == 'output_text':
        _validate_OpenAI_OutputMessageContentOutputTextContent(value, path, errors)
    if _disc_value == 'refusal':
        _validate_OpenAI_OutputMessageContentRefusalContent(value, path, errors)

def _validate_OpenAI_ReasoningTextContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'text' not in value:
        _append_error(errors, f"{path}.text", "Required property 'text' is missing")
    if 'text' in value:
        _validate_OpenAI_ReasoningTextContent_text(value['text'], f"{path}.text", errors)
    if 'type' in value:
        _validate_OpenAI_ReasoningTextContent_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_SummaryTextContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'text' not in value:
        _append_error(errors, f"{path}.text", "Required property 'text' is missing")
    if 'text' in value:
        _validate_OpenAI_SummaryTextContent_text(value['text'], f"{path}.text", errors)
    if 'type' in value:
        _validate_OpenAI_SummaryTextContent_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_FunctionShellCallOutputContentParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'stdout' not in value:
        _append_error(errors, f"{path}.stdout", "Required property 'stdout' is missing")
    if 'stderr' not in value:
        _append_error(errors, f"{path}.stderr", "Required property 'stderr' is missing")
    if 'outcome' not in value:
        _append_error(errors, f"{path}.outcome", "Required property 'outcome' is missing")
    if 'outcome' in value:
        _validate_OpenAI_FunctionShellCallOutputContentParam_outcome(value['outcome'], f"{path}.outcome", errors)
    if 'stderr' in value:
        _validate_OpenAI_FunctionShellCallOutputContentParam_stderr(value['stderr'], f"{path}.stderr", errors)
    if 'stdout' in value:
        _validate_OpenAI_FunctionShellCallOutputContentParam_stdout(value['stdout'], f"{path}.stdout", errors)

def _validate_OpenAI_WebSearchActionSearch_queries(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_InputParam_string(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_WebSearchActionSearch_query(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchActionSearch_sources(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_WebSearchActionSearch_sources_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_WebSearchActionSearch_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('search',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchActionOpenPage_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('open_page',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchActionOpenPage_url(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchActionFind_pattern(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchActionFind_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('find_in_page',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchActionFind_url(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ContainerNetworkPolicyParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ContainerNetworkPolicyParam_type(value['type'], f"{path}.type", errors)
    _disc_value = value.get('type')
    if not isinstance(_disc_value, str):
        _append_error(errors, f"{path}.type", "Required discriminator 'type' is missing or invalid")
        return
    if _disc_value == 'allowlist':
        _validate_OpenAI_ContainerNetworkPolicyAllowlistParam(value, path, errors)
    if _disc_value == 'disabled':
        _validate_OpenAI_ContainerNetworkPolicyDisabledParam(value, path, errors)

def _validate_OpenAI_CodeInterpreterOutputLogs_logs(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CodeInterpreterOutputLogs_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('logs',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CodeInterpreterOutputImage_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('image',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CodeInterpreterOutputImage_url(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ComputerActionType(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_ComputerActionType_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected ComputerActionType to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_ClickParam_button(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_ClickParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('click',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ClickParam_x(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ClickParam_y(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_DoubleClickAction_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('double_click',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_DoubleClickAction_x(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_DoubleClickAction_y(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_DragParam_path(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_DragParam_path_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_DragParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('drag',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_KeyPressAction_keys(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_InputParam_string(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_KeyPressAction_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('keypress',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MoveParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('move',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MoveParam_x(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_MoveParam_y(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ScreenshotParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('screenshot',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ScrollParam_scroll_x(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ScrollParam_scroll_y(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ScrollParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('scroll',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ScrollParam_x(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ScrollParam_y(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_TypeParam_text(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_TypeParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('type',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WaitParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('wait',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ComputerCallSafetyCheckParam_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionAndCustomToolCallOutput(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_FunctionAndCustomToolCallOutput_type(value['type'], f"{path}.type", errors)
    _disc_value = value.get('type')
    if not isinstance(_disc_value, str):
        _append_error(errors, f"{path}.type", "Required discriminator 'type' is missing or invalid")
        return
    if _disc_value == 'input_file':
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent(value, path, errors)
    if _disc_value == 'input_image':
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputImageContent(value, path, errors)
    if _disc_value == 'input_text':
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputTextContent(value, path, errors)

def _validate_OpenAI_FileSearchToolCallResults_attributes(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_OpenAI_FileSearchToolCallResults_score(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'number'):
        _append_type_mismatch(errors, path, 'number', value)
        return

def _validate_OpenAI_InputTextContentParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'text' not in value:
        _append_error(errors, f"{path}.text", "Required property 'text' is missing")
    if 'text' in value:
        _validate_OpenAI_InputTextContentParam_text(value['text'], f"{path}.text", errors)
    if 'type' in value:
        _validate_OpenAI_InputTextContentParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_InputImageContentParamAutoParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'detail' in value:
        _validate_OpenAI_InputImageContentParamAutoParam_detail(value['detail'], f"{path}.detail", errors)
    if 'file_id' in value:
        _validate_CreateResponse_instructions(value['file_id'], f"{path}.file_id", errors)
    if 'image_url' in value:
        _validate_OpenAI_InputImageContentParamAutoParam_image_url(value['image_url'], f"{path}.image_url", errors)
    if 'type' in value:
        _validate_OpenAI_InputImageContentParamAutoParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_InputFileContentParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'file_data' in value:
        _validate_CreateResponse_instructions(value['file_data'], f"{path}.file_data", errors)
    if 'file_id' in value:
        _validate_CreateResponse_instructions(value['file_id'], f"{path}.file_id", errors)
    if 'file_url' in value:
        _validate_OpenAI_InputImageContentParamAutoParam_image_url(value['file_url'], f"{path}.file_url", errors)
    if 'filename' in value:
        _validate_CreateResponse_instructions(value['filename'], f"{path}.filename", errors)
    if 'type' in value:
        _validate_OpenAI_InputFileContentParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_MCPListToolsTool_annotations(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return

def _validate_OpenAI_MCPListToolsTool_input_schema(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_MCPListToolsTool_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_MemorySearchItem_memory_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_MessageContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_MessageContent_type(value['type'], f"{path}.type", errors)
    _disc_value = value.get('type')
    if not isinstance(_disc_value, str):
        _append_error(errors, f"{path}.type", "Required discriminator 'type' is missing or invalid")
        return
    if _disc_value == 'computer_screenshot':
        _validate_OpenAI_ComputerScreenshotContent(value, path, errors)
    if _disc_value == 'input_file':
        _validate_OpenAI_MessageContentInputFileContent(value, path, errors)
    if _disc_value == 'input_image':
        _validate_OpenAI_MessageContentInputImageContent(value, path, errors)
    if _disc_value == 'input_text':
        _validate_OpenAI_MessageContentInputTextContent(value, path, errors)
    if _disc_value == 'output_text':
        _validate_OpenAI_MessageContentOutputTextContent(value, path, errors)
    if _disc_value == 'reasoning_text':
        _validate_OpenAI_MessageContentReasoningTextContent(value, path, errors)
    if _disc_value == 'refusal':
        _validate_OpenAI_MessageContentRefusalContent(value, path, errors)
    if _disc_value == 'text':
        _validate_OpenAI_TextContent(value, path, errors)

def _validate_OpenAI_OutputMessageContent_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_OutputMessageContentType(value, path, errors)

def _validate_OpenAI_OutputMessageContentOutputTextContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'text' not in value:
        _append_error(errors, f"{path}.text", "Required property 'text' is missing")
    if 'annotations' not in value:
        _append_error(errors, f"{path}.annotations", "Required property 'annotations' is missing")
    if 'logprobs' not in value:
        _append_error(errors, f"{path}.logprobs", "Required property 'logprobs' is missing")
    if 'annotations' in value:
        _validate_OpenAI_OutputMessageContentOutputTextContent_annotations(value['annotations'], f"{path}.annotations", errors)
    if 'logprobs' in value:
        _validate_OpenAI_OutputMessageContentOutputTextContent_logprobs(value['logprobs'], f"{path}.logprobs", errors)
    if 'text' in value:
        _validate_OpenAI_OutputMessageContentOutputTextContent_text(value['text'], f"{path}.text", errors)
    if 'type' in value:
        _validate_OpenAI_OutputMessageContentOutputTextContent_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_OutputMessageContentRefusalContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'refusal' not in value:
        _append_error(errors, f"{path}.refusal", "Required property 'refusal' is missing")
    if 'refusal' in value:
        _validate_OpenAI_OutputMessageContentRefusalContent_refusal(value['refusal'], f"{path}.refusal", errors)
    if 'type' in value:
        _validate_OpenAI_OutputMessageContentRefusalContent_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ReasoningTextContent_text(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ReasoningTextContent_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('reasoning_text',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_SummaryTextContent_text(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_SummaryTextContent_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('summary_text',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionShellCallOutputContentParam_outcome(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_FunctionShellCallOutputContentParam_stderr(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionShellCallOutputContentParam_stdout(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchActionSearch_sources_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_WebSearchActionSearchSources(value, path, errors)

def _validate_OpenAI_ContainerNetworkPolicyParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ContainerNetworkPolicyParamType(value, path, errors)

def _validate_OpenAI_ContainerNetworkPolicyAllowlistParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'allowed_domains' not in value:
        _append_error(errors, f"{path}.allowed_domains", "Required property 'allowed_domains' is missing")
    if 'allowed_domains' in value:
        _validate_OpenAI_ContainerNetworkPolicyAllowlistParam_allowed_domains(value['allowed_domains'], f"{path}.allowed_domains", errors)
    if 'domain_secrets' in value:
        _validate_OpenAI_ContainerNetworkPolicyAllowlistParam_domain_secrets(value['domain_secrets'], f"{path}.domain_secrets", errors)
    if 'type' in value:
        _validate_OpenAI_ContainerNetworkPolicyAllowlistParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ContainerNetworkPolicyDisabledParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_ContainerNetworkPolicyDisabledParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_ComputerActionType_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('ComputerActionType')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_DragParam_path_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_CoordParam(value, path, errors)

def _validate_OpenAI_FunctionAndCustomToolCallOutput_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_FunctionAndCustomToolCallOutputType(value, path, errors)

def _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'file_data' in value:
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent_file_data(value['file_data'], f"{path}.file_data", errors)
    if 'file_id' in value:
        _validate_CreateResponse_instructions(value['file_id'], f"{path}.file_id", errors)
    if 'file_url' in value:
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent_file_url(value['file_url'], f"{path}.file_url", errors)
    if 'filename' in value:
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent_filename(value['filename'], f"{path}.filename", errors)
    if 'type' in value:
        _validate_OpenAI_InputFileContentParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_FunctionAndCustomToolCallOutputInputImageContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'detail' not in value:
        _append_error(errors, f"{path}.detail", "Required property 'detail' is missing")
    if 'detail' in value:
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputImageContent_detail(value['detail'], f"{path}.detail", errors)
    if 'file_id' in value:
        _validate_CreateResponse_instructions(value['file_id'], f"{path}.file_id", errors)
    if 'image_url' in value:
        _validate_OpenAI_InputImageContentParamAutoParam_image_url(value['image_url'], f"{path}.image_url", errors)
    if 'type' in value:
        _validate_OpenAI_InputImageContentParamAutoParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_FunctionAndCustomToolCallOutputInputTextContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'text' not in value:
        _append_error(errors, f"{path}.text", "Required property 'text' is missing")
    if 'text' in value:
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputTextContent_text(value['text'], f"{path}.text", errors)
    if 'type' in value:
        _validate_OpenAI_InputTextContentParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_InputTextContentParam_text(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_InputTextContentParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('input_text',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_InputImageContentParamAutoParam_detail(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return

def _validate_OpenAI_InputImageContentParamAutoParam_image_url(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_InputImageContentParamAutoParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('input_image',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_InputFileContentParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('input_file',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MessageContent_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_MessageContentType(value, path, errors)

def _validate_OpenAI_ComputerScreenshotContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'image_url' not in value:
        _append_error(errors, f"{path}.image_url", "Required property 'image_url' is missing")
    if 'file_id' not in value:
        _append_error(errors, f"{path}.file_id", "Required property 'file_id' is missing")
    if 'file_id' in value:
        _validate_CreateResponse_instructions(value['file_id'], f"{path}.file_id", errors)
    if 'image_url' in value:
        _validate_OpenAI_InputImageContentParamAutoParam_image_url(value['image_url'], f"{path}.image_url", errors)
    if 'type' in value:
        _validate_OpenAI_ComputerScreenshotContent_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_MessageContentInputFileContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'file_data' in value:
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent_file_data(value['file_data'], f"{path}.file_data", errors)
    if 'file_id' in value:
        _validate_CreateResponse_instructions(value['file_id'], f"{path}.file_id", errors)
    if 'file_url' in value:
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent_file_url(value['file_url'], f"{path}.file_url", errors)
    if 'filename' in value:
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent_filename(value['filename'], f"{path}.filename", errors)
    if 'type' in value:
        _validate_OpenAI_InputFileContentParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_MessageContentInputImageContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'detail' in value:
        _validate_OpenAI_MessageContentInputImageContent_detail(value['detail'], f"{path}.detail", errors)
    if 'file_id' in value:
        _validate_CreateResponse_instructions(value['file_id'], f"{path}.file_id", errors)
    if 'image_url' in value:
        _validate_OpenAI_InputImageContentParamAutoParam_image_url(value['image_url'], f"{path}.image_url", errors)
    if 'type' in value:
        _validate_OpenAI_InputImageContentParamAutoParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_MessageContentInputTextContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'text' not in value:
        _append_error(errors, f"{path}.text", "Required property 'text' is missing")
    if 'text' in value:
        _validate_OpenAI_FunctionAndCustomToolCallOutputInputTextContent_text(value['text'], f"{path}.text", errors)
    if 'type' in value:
        _validate_OpenAI_InputTextContentParam_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_MessageContentOutputTextContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'text' not in value:
        _append_error(errors, f"{path}.text", "Required property 'text' is missing")
    if 'annotations' not in value:
        _append_error(errors, f"{path}.annotations", "Required property 'annotations' is missing")
    if 'logprobs' not in value:
        _append_error(errors, f"{path}.logprobs", "Required property 'logprobs' is missing")
    if 'annotations' in value:
        _validate_OpenAI_OutputMessageContentOutputTextContent_annotations(value['annotations'], f"{path}.annotations", errors)
    if 'logprobs' in value:
        _validate_OpenAI_OutputMessageContentOutputTextContent_logprobs(value['logprobs'], f"{path}.logprobs", errors)
    if 'text' in value:
        _validate_OpenAI_OutputMessageContentOutputTextContent_text(value['text'], f"{path}.text", errors)
    if 'type' in value:
        _validate_OpenAI_OutputMessageContentOutputTextContent_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_MessageContentReasoningTextContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'text' not in value:
        _append_error(errors, f"{path}.text", "Required property 'text' is missing")
    if 'text' in value:
        _validate_OpenAI_ReasoningTextContent_text(value['text'], f"{path}.text", errors)
    if 'type' in value:
        _validate_OpenAI_ReasoningTextContent_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_MessageContentRefusalContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'refusal' not in value:
        _append_error(errors, f"{path}.refusal", "Required property 'refusal' is missing")
    if 'refusal' in value:
        _validate_OpenAI_OutputMessageContentRefusalContent_refusal(value['refusal'], f"{path}.refusal", errors)
    if 'type' in value:
        _validate_OpenAI_OutputMessageContentRefusalContent_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_TextContent(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'text' not in value:
        _append_error(errors, f"{path}.text", "Required property 'text' is missing")
    if 'text' in value:
        _validate_OpenAI_InputParam_string(value['text'], f"{path}.text", errors)
    if 'type' in value:
        _validate_OpenAI_TextContent_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_OutputMessageContentType(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_OutputMessageContentType_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected OutputMessageContentType to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_OutputMessageContentOutputTextContent_annotations(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_OutputMessageContentOutputTextContent_annotations_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_OutputMessageContentOutputTextContent_logprobs(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_OutputMessageContentOutputTextContent_logprobs_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_OutputMessageContentOutputTextContent_text(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_OutputMessageContentOutputTextContent_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('output_text',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_OutputMessageContentRefusalContent_refusal(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_OutputMessageContentRefusalContent_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('refusal',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_WebSearchActionSearchSources(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'url' not in value:
        _append_error(errors, f"{path}.url", "Required property 'url' is missing")
    if 'type' in value:
        _validate_OpenAI_WebSearchActionSearchSources_type(value['type'], f"{path}.type", errors)
    if 'url' in value:
        _validate_OpenAI_InputParam_string(value['url'], f"{path}.url", errors)

def _validate_OpenAI_ContainerNetworkPolicyParamType(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_ContainerNetworkPolicyParamType_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected ContainerNetworkPolicyParamType to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_ContainerNetworkPolicyAllowlistParam_allowed_domains(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_InputParam_string(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ContainerNetworkPolicyAllowlistParam_domain_secrets(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_ContainerNetworkPolicyAllowlistParam_domain_secrets_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ContainerNetworkPolicyAllowlistParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('allowlist',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ContainerNetworkPolicyDisabledParam_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('disabled',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_CoordParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'x' not in value:
        _append_error(errors, f"{path}.x", "Required property 'x' is missing")
    if 'y' not in value:
        _append_error(errors, f"{path}.y", "Required property 'y' is missing")
    if 'x' in value:
        _validate_OpenAI_CoordParam_x(value['x'], f"{path}.x", errors)
    if 'y' in value:
        _validate_OpenAI_CoordParam_y(value['y'], f"{path}.y", errors)

def _validate_OpenAI_FunctionAndCustomToolCallOutputType(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_FunctionAndCustomToolCallOutputType_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected FunctionAndCustomToolCallOutputType to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent_file_data(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent_file_url(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionAndCustomToolCallOutputInputFileContent_filename(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FunctionAndCustomToolCallOutputInputImageContent_detail(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    return

def _validate_OpenAI_FunctionAndCustomToolCallOutputInputTextContent_text(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MessageContentType(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_MessageContentType_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected MessageContentType to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_ComputerScreenshotContent_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('computer_screenshot',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MessageContentInputImageContent_detail(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if value is None:
        return

def _validate_OpenAI_TextContent_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('text',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_OutputMessageContentType_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('OutputMessageContentType')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_OutputMessageContentOutputTextContent_annotations_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_Annotation(value, path, errors)

def _validate_OpenAI_OutputMessageContentOutputTextContent_logprobs_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_LogProb(value, path, errors)

def _validate_OpenAI_WebSearchActionSearchSources_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('url',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ContainerNetworkPolicyParamType_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('ContainerNetworkPolicyParamType')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ContainerNetworkPolicyAllowlistParam_domain_secrets_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_ContainerNetworkPolicyDomainSecretParam(value, path, errors)

def _validate_OpenAI_CoordParam_x(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_CoordParam_y(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_FunctionAndCustomToolCallOutputType_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('FunctionAndCustomToolCallOutputType')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_MessageContentType_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('MessageContentType')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_Annotation(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'type' in value:
        _validate_OpenAI_Annotation_type(value['type'], f"{path}.type", errors)
    _disc_value = value.get('type')
    if not isinstance(_disc_value, str):
        _append_error(errors, f"{path}.type", "Required discriminator 'type' is missing or invalid")
        return
    if _disc_value == 'container_file_citation':
        _validate_OpenAI_ContainerFileCitationBody(value, path, errors)
    if _disc_value == 'file_citation':
        _validate_OpenAI_FileCitationBody(value, path, errors)
    if _disc_value == 'file_path':
        _validate_OpenAI_FilePath(value, path, errors)
    if _disc_value == 'url_citation':
        _validate_OpenAI_UrlCitationBody(value, path, errors)

def _validate_OpenAI_LogProb(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'token' not in value:
        _append_error(errors, f"{path}.token", "Required property 'token' is missing")
    if 'logprob' not in value:
        _append_error(errors, f"{path}.logprob", "Required property 'logprob' is missing")
    if 'bytes' not in value:
        _append_error(errors, f"{path}.bytes", "Required property 'bytes' is missing")
    if 'top_logprobs' not in value:
        _append_error(errors, f"{path}.top_logprobs", "Required property 'top_logprobs' is missing")
    if 'bytes' in value:
        _validate_OpenAI_LogProb_bytes(value['bytes'], f"{path}.bytes", errors)
    if 'logprob' in value:
        _validate_OpenAI_LogProb_logprob(value['logprob'], f"{path}.logprob", errors)
    if 'token' in value:
        _validate_OpenAI_InputParam_string(value['token'], f"{path}.token", errors)
    if 'top_logprobs' in value:
        _validate_OpenAI_LogProb_top_logprobs(value['top_logprobs'], f"{path}.top_logprobs", errors)

def _validate_OpenAI_ContainerNetworkPolicyDomainSecretParam(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'domain' not in value:
        _append_error(errors, f"{path}.domain", "Required property 'domain' is missing")
    if 'name' not in value:
        _append_error(errors, f"{path}.name", "Required property 'name' is missing")
    if 'value' not in value:
        _append_error(errors, f"{path}.value", "Required property 'value' is missing")
    if 'domain' in value:
        _validate_OpenAI_ContainerNetworkPolicyDomainSecretParam_domain(value['domain'], f"{path}.domain", errors)
    if 'name' in value:
        _validate_OpenAI_ContainerNetworkPolicyDomainSecretParam_name(value['name'], f"{path}.name", errors)
    if 'value' in value:
        _validate_OpenAI_ContainerNetworkPolicyDomainSecretParam_value(value['value'], f"{path}.value", errors)

def _validate_OpenAI_Annotation_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_AnnotationType(value, path, errors)

def _validate_OpenAI_ContainerFileCitationBody(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'container_id' not in value:
        _append_error(errors, f"{path}.container_id", "Required property 'container_id' is missing")
    if 'file_id' not in value:
        _append_error(errors, f"{path}.file_id", "Required property 'file_id' is missing")
    if 'start_index' not in value:
        _append_error(errors, f"{path}.start_index", "Required property 'start_index' is missing")
    if 'end_index' not in value:
        _append_error(errors, f"{path}.end_index", "Required property 'end_index' is missing")
    if 'filename' not in value:
        _append_error(errors, f"{path}.filename", "Required property 'filename' is missing")
    if 'container_id' in value:
        _validate_OpenAI_ContainerFileCitationBody_container_id(value['container_id'], f"{path}.container_id", errors)
    if 'end_index' in value:
        _validate_OpenAI_ContainerFileCitationBody_end_index(value['end_index'], f"{path}.end_index", errors)
    if 'file_id' in value:
        _validate_OpenAI_ContainerFileCitationBody_file_id(value['file_id'], f"{path}.file_id", errors)
    if 'filename' in value:
        _validate_OpenAI_ContainerFileCitationBody_filename(value['filename'], f"{path}.filename", errors)
    if 'start_index' in value:
        _validate_OpenAI_ContainerFileCitationBody_start_index(value['start_index'], f"{path}.start_index", errors)
    if 'type' in value:
        _validate_OpenAI_ContainerFileCitationBody_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_FileCitationBody(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'file_id' not in value:
        _append_error(errors, f"{path}.file_id", "Required property 'file_id' is missing")
    if 'index' not in value:
        _append_error(errors, f"{path}.index", "Required property 'index' is missing")
    if 'filename' not in value:
        _append_error(errors, f"{path}.filename", "Required property 'filename' is missing")
    if 'file_id' in value:
        _validate_OpenAI_ContainerFileCitationBody_file_id(value['file_id'], f"{path}.file_id", errors)
    if 'filename' in value:
        _validate_OpenAI_FileCitationBody_filename(value['filename'], f"{path}.filename", errors)
    if 'index' in value:
        _validate_OpenAI_FileCitationBody_index(value['index'], f"{path}.index", errors)
    if 'type' in value:
        _validate_OpenAI_FileCitationBody_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_FilePath(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'file_id' not in value:
        _append_error(errors, f"{path}.file_id", "Required property 'file_id' is missing")
    if 'index' not in value:
        _append_error(errors, f"{path}.index", "Required property 'index' is missing")
    if 'file_id' in value:
        _validate_OpenAI_ContainerFileCitationBody_file_id(value['file_id'], f"{path}.file_id", errors)
    if 'index' in value:
        _validate_OpenAI_FileCitationBody_index(value['index'], f"{path}.index", errors)
    if 'type' in value:
        _validate_OpenAI_FilePath_type(value['type'], f"{path}.type", errors)

def _validate_OpenAI_UrlCitationBody(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'type' not in value:
        _append_error(errors, f"{path}.type", "Required property 'type' is missing")
    if 'url' not in value:
        _append_error(errors, f"{path}.url", "Required property 'url' is missing")
    if 'start_index' not in value:
        _append_error(errors, f"{path}.start_index", "Required property 'start_index' is missing")
    if 'end_index' not in value:
        _append_error(errors, f"{path}.end_index", "Required property 'end_index' is missing")
    if 'title' not in value:
        _append_error(errors, f"{path}.title", "Required property 'title' is missing")
    if 'end_index' in value:
        _validate_OpenAI_UrlCitationBody_end_index(value['end_index'], f"{path}.end_index", errors)
    if 'start_index' in value:
        _validate_OpenAI_UrlCitationBody_start_index(value['start_index'], f"{path}.start_index", errors)
    if 'title' in value:
        _validate_OpenAI_UrlCitationBody_title(value['title'], f"{path}.title", errors)
    if 'type' in value:
        _validate_OpenAI_UrlCitationBody_type(value['type'], f"{path}.type", errors)
    if 'url' in value:
        _validate_OpenAI_UrlCitationBody_url(value['url'], f"{path}.url", errors)

def _validate_OpenAI_LogProb_bytes(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_LogProb_bytes_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_LogProb_logprob(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'number'):
        _append_type_mismatch(errors, path, 'number', value)
        return

def _validate_OpenAI_LogProb_top_logprobs(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'array'):
        _append_type_mismatch(errors, path, 'array', value)
        return
    for _idx, _item in enumerate(value):
        _validate_OpenAI_LogProb_top_logprobs_item(_item, f"{path}[{_idx}]", errors)

def _validate_OpenAI_ContainerNetworkPolicyDomainSecretParam_domain(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ContainerNetworkPolicyDomainSecretParam_name(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ContainerNetworkPolicyDomainSecretParam_value(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_AnnotationType(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _matched_union = False
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_0: list[dict[str, str]] = []
        _validate_OpenAI_InputParam_string(value, path, _branch_errors_0)
        if not _branch_errors_0:
            _matched_union = True
    if not _matched_union and _is_type(value, 'string'):
        _branch_errors_1: list[dict[str, str]] = []
        _validate_OpenAI_AnnotationType_2(value, path, _branch_errors_1)
        if not _branch_errors_1:
            _matched_union = True
    if not _matched_union:
        _append_error(errors, path, f"Expected AnnotationType to be a string value, got {_type_label(value)}")
        return

def _validate_OpenAI_ContainerFileCitationBody_container_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ContainerFileCitationBody_end_index(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ContainerFileCitationBody_file_id(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ContainerFileCitationBody_filename(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_ContainerFileCitationBody_start_index(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_ContainerFileCitationBody_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('container_file_citation',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FileCitationBody_filename(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FileCitationBody_index(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_FileCitationBody_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('file_citation',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_FilePath_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('file_path',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_UrlCitationBody_end_index(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_UrlCitationBody_start_index(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_UrlCitationBody_title(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_UrlCitationBody_type(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values = ('url_citation',)
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_UrlCitationBody_url(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_LogProb_bytes_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'integer'):
        _append_type_mismatch(errors, path, 'integer', value)
        return

def _validate_OpenAI_LogProb_top_logprobs_item(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _validate_OpenAI_TopLogProb(value, path, errors)

def _validate_OpenAI_AnnotationType_2(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    _allowed_values, _enum_error = _enum_values('AnnotationType')
    if _enum_error is not None:
        _append_error(errors, path, _enum_error)
        return
    if _allowed_values is None:
        return
    if value not in _allowed_values:
        _append_error(errors, path, f"Invalid value '{value}'. Allowed: {', '.join(str(v) for v in _allowed_values)}")
    if not _is_type(value, 'string'):
        _append_type_mismatch(errors, path, 'string', value)
        return

def _validate_OpenAI_TopLogProb(value: Any, path: str, errors: list[dict[str, str]]) -> None:
    if not _is_type(value, 'object'):
        _append_type_mismatch(errors, path, 'object', value)
        return
    if 'token' not in value:
        _append_error(errors, f"{path}.token", "Required property 'token' is missing")
    if 'logprob' not in value:
        _append_error(errors, f"{path}.logprob", "Required property 'logprob' is missing")
    if 'bytes' not in value:
        _append_error(errors, f"{path}.bytes", "Required property 'bytes' is missing")
    if 'bytes' in value:
        _validate_OpenAI_LogProb_bytes(value['bytes'], f"{path}.bytes", errors)
    if 'logprob' in value:
        _validate_OpenAI_LogProb_logprob(value['logprob'], f"{path}.logprob", errors)
    if 'token' in value:
        _validate_OpenAI_InputParam_string(value['token'], f"{path}.token", errors)

ROOT_SCHEMAS = ['CreateResponse']

class CreateResponseValidator:
    """Generated validator for the root schema."""

    @staticmethod
    def validate(payload: Any) -> list[dict[str, str]]:
        errors: list[dict[str, str]] = []
        _validate_CreateResponse(payload, '$', errors)
        return errors

def validate_CreateResponse(payload: Any) -> list[dict[str, str]]:
    return CreateResponseValidator.validate(payload)
