{"model": "jev-1.14.0", "state": {"new_function": {"name": "avideo_extension", "module": "litellm.videos.main", "code": "async def avideo_extension(\n    video_id: str,\n    prompt: str,\n    seconds: str,\n    timeout=600,\n    custom_llm_provider: str | None = None,\n    extra_headers: dict[str, object] | None = None,\n    extra_query: dict[str, object] | None = None,\n    extra_body: dict[str, object] | None = None,\n    **kwargs,\n) -> VideoObject:\n    \"\"\"\n    Asynchronously create a video extension.\n    Maps to POST /v1/videos/extensions\n    \"\"\"\n    local_vars: Final = locals()\n    try:\n        loop: Final = asyncio.get_event_loop()\n        kwargs[\"async_call\"] = True\n\n        func: Final = partial(\n            video_extension,\n            video_id=video_id,\n            prompt=prompt,\n            seconds=seconds,\n            timeout=timeout,\n            custom_llm_provider=custom_llm_provider,\n            extra_headers=extra_headers,\n            extra_query=extra_query,\n            extra_body=extra_body,\n            **kwargs,\n        )\n\n        ctx: Final = contextvars.copy_context()\n        func_with_context: Final = partial(ctx.run, func)\n        init_response: Final = await loop.run_in_executor(None, func_with_context)\n\n        if asyncio.iscoroutine(init_response):\n            response = await init_response\n        else:\n            response = init_response\n\n        return response\n    except Exception as e:\n        raise litellm.exception_type(\n            model=\"\",\n            custom_llm_provider=custom_llm_provider,\n            original_exception=e,\n            completion_kwargs=local_vars,\n            extra_kwargs=kwargs,\n        )", "repository": "", "code_truncated": false, "source_context": "Owning file source prefix (may be truncated; full file in source proof):\nimport asyncio\nimport contextvars\nimport json\nfrom collections.abc import Coroutine\nfrom functools import partial\nfrom typing import Final, Literal, overload\n\nfrom httpx._types import FileContent\n\nimport litellm\nfrom litellm.constants import DEFAULT_VIDEO_ENDPOINT_MODEL\nfrom litellm.constants import request_timeout as DEFAULT_REQUEST_TIMEOUT\nfrom litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider\nfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj\nfrom litellm.llms.base_llm.videos.transformation import BaseVideoConfig\nfrom litellm.llms.custom_httpx.llm_http_handler import BaseLLMHTTPHandler\nfrom litellm.main import base_llm_http_handler\nfrom litellm.types.router import GenericLiteLLMParams\nfrom litellm.types.utils import CallTypes, FileTypes\nfrom litellm.types.videos.main import (\n    CharacterObject,\n    VideoCreateOptionalRequestParams,\n    VideoObject,\n)\nfrom litellm.types.videos.utils import decode_video_id_with_provider\nfrom litellm.utils import ProviderConfigManager, client\nfrom litellm.videos.utils import VideoGenerationRequestUtils\n\n\ndef _unsupported_video_call(\n    call_name: str, custom_llm_provider: str, model: str | None = None\n) -> litellm.BadRequestError:\n    return litellm.BadRequestError(\n        message=f\"{call_name} is not supported for {custom_llm_provider}\",\n        model=model or \"\",\n        llm_provider=custom_llm_provider,\n    )\n\n\n#################### Initialize provider clients ####################\nllm_http_handler: BaseLLMHTTPHandler = BaseLLMHTTPHandler()\n\n\n##### Video Generation #######################\n@client\nasync def avideo_generation(\n    prompt: str,\n    model: str | None = None,\n    input_reference: FileTypes | None = None,\n    seconds: str | None = None,\n    size: str | None = None,\n    user: str | None = None,\n    timeout=600,  # default to 10 minutes\n    custom_llm_provider: str | None = None,\n    # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.\n    # The extra values given here take precedence over values defined on the client or passed to this method.\n    extra_headers: dict[str, object] | None = None,\n    extra_query: dict[str, object] | None = None,\n    extra_body: dict[str, object] | None = None,\n    **kwargs,\n) -> VideoObject:\n    \"\"\"\n    Asynchronously calls the `video_generation` function with the given arguments and keyword arguments.\n\n    Parameters:\n    - `prompt` (str): Text prompt that describes the video to generate\n    - `model` (Optional[str]): The video generation model to use\n    - `input_reference` (Optional[FileTypes]): Optional image reference that guides generation\n    - `seconds` (Optional[str]): Clip duration in seconds\n    - `size` (Optional[str]): Output resolution formatted as width x height\n    - `user` (Optional[str]): A unique identifier representing your end-user\n    - `timeout` (int): Request timeout in seconds\n    - `custom_llm_provider` (Optional[str]): The LLM provider to use\n    - `extra_headers` (Optional[Dict[str, Any]]): Additional headers\n    - `extra_query` (Optional[Dict[str, Any]]): Additional query parameters\n    - `extra_body` (Optional[Dict[str, Any]]): Additional body parameters\n    - `kwargs` (dict): Additional keyword arguments\n\n    Returns:\n    - `response` (VideoResponse): The response returned by the `video_generation` function.\n    \"\"\"\n    local_vars: Final = locals()\n    try:\n        loop: Final = asyncio.get_event_loop()\n        kwargs[\"async_call\"] = True\n\n        # get custom llm provider so we can use this for mapping exceptions\n        if custom_llm_provider is None:\n            _, custom_llm_provider, _, _ = litellm.get_llm_provider(\n                model=model or DEFAULT_VIDEO_ENDPOINT_MODEL,\n                api_base=local_vars.get(\"api_base\", None),\n            )\n\n        func: Final = partial(\n            video_generation,\n            prompt=prompt,\n            model=model,\n            input_reference=input_reference,\n            seconds=seconds,\n            size=size,\n            user=user,\n            timeout=timeout,\n            custom_llm_provider=custom_llm_provider,\n            extra_headers=extra_headers,\n            extra_query=extra_query,\n            extra_body=extra_body,\n            **kwargs,\n        )\n\n        ctx: Final = contextvars.copy_context()\n        func_with_context: Final = partial(ctx.run, func)\n        init_response: Final = await loop.run_in_executor(None, func_with_context)\n\n        if asyncio.iscoroutine(init_response):\n            response = await init_response\n        else:\n            response = init_response\n\n        return response\n    except Exception as e:\n        raise litellm.exception_type(\n            model=model,\n            custom_llm_provider=custom_llm_provider,\n            original_exception=e,\n            completion_kwargs=local_vars,\n            extra_kwargs=kwargs,\n        )\n\n\n# fmt: off\n\n# Overload for when avideo_generation=True (returns Coroutine)\n@overload\ndef video_generation(\n    prompt: str,\n    model: str | None = None,\n    input_reference: FileTypes | None = None,\n    seconds: str | None = None,\n    size: str | None = None,\n    user: str | None = None,\n    timeout: int = 600,\n    custom_llm_provider: str | None = None,\n    extra_headers: dict[str, object] | None = None,\n    extra_query: dict[str, object] | None = None,\n    extra_body: dict[str, object] | None = None,\n    *,\n    avideo_generation: Literal[True],\n    **kwargs: object,\n) -> Coroutine[object, object, VideoObject]:\n    ...\n\n\n@overload\ndef video_generation(\n    prompt: str,\n    model: str | None = None,\n    input_reference: FileTypes | None = None,\n    seconds: str | None = None,\n    size: str | None = None,\n    user: str | None = None,\n    timeout: int = 600,\n    custom_llm_provider: str | None = None,\n    extra_headers: dict[str, object] | None = None,\n    extra_query: dict[str, object] | None = None,\n    extra_body: dict[str, object] | None = None,\n  "}, "existing_function": {"name": "avideo_status", "module": "litellm.videos.main", "code": "async def avideo_status(\n    video_id: str,\n    timeout=600,  # default to 10 minutes\n    custom_llm_provider: str | None = None,\n    # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.\n    # The extra values given here take precedence over values defined on the client or passed to this method.\n    extra_headers: dict[str, object] | None = None,\n    extra_query: dict[str, object] | None = None,\n    extra_body: dict[str, object] | None = None,\n    **kwargs,\n) -> VideoObject:\n    \"\"\"\n    Asynchronously retrieve video status from OpenAI's video API.\n\n    Parameters:\n    - `video_id` (str): The identifier of the video whose status to retrieve\n    - `model` (Optional[str]): The model to use. If not provided, will be auto-detected\n    - `timeout` (int): Request timeout in seconds\n    - `custom_llm_provider` (Optional[str]): The LLM provider to use\n    - `extra_headers` (Optional[Dict[str, Any]]): Additional headers\n    - `extra_query` (Optional[Dict[str, Any]]): Additional query parameters\n    - `extra_body` (Optional[Dict[str, Any]]): Additional body parameters\n    - `kwargs` (dict): Additional keyword arguments\n\n    Returns:\n    - `response` (VideoObject): The response returned by the `video_status` function.\n    \"\"\"\n    local_vars: Final = locals()\n    try:\n        loop: Final = asyncio.get_event_loop()\n        kwargs[\"async_call\"] = True\n\n        func: Final = partial(\n            video_status,\n            video_id=video_id,\n            timeout=timeout,\n            custom_llm_provider=custom_llm_provider,\n            extra_headers=extra_headers,\n            extra_query=extra_query,\n            extra_body=extra_body,\n            **kwargs,\n        )\n\n        ctx: Final = contextvars.copy_context()\n        func_with_context: Final = partial(ctx.run, func)\n        init_response: Final = await loop.run_in_executor(None, func_with_context)\n\n        if asyncio.iscoroutine(init_response):\n            response = await init_response\n        else:\n            response = init_response\n\n        return response\n    except Exception as e:\n        raise litellm.exception_type(\n            model=\"\",\n            custom_llm_provider=custom_llm_provider,\n            original_exception=e,\n            completion_kwargs=local_vars,\n            extra_kwargs=kwargs,\n        )", "repository": "", "code_truncated": false, "source_context": "Owning file source prefix (may be truncated; full file in source proof):\nimport asyncio\nimport contextvars\nimport json\nfrom collections.abc import Coroutine\nfrom functools import partial\nfrom typing import Final, Literal, overload\n\nfrom httpx._types import FileContent\n\nimport litellm\nfrom litellm.constants import DEFAULT_VIDEO_ENDPOINT_MODEL\nfrom litellm.constants import request_timeout as DEFAULT_REQUEST_TIMEOUT\nfrom litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider\nfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj\nfrom litellm.llms.base_llm.videos.transformation import BaseVideoConfig\nfrom litellm.llms.custom_httpx.llm_http_handler import BaseLLMHTTPHandler\nfrom litellm.main import base_llm_http_handler\nfrom litellm.types.router import GenericLiteLLMParams\nfrom litellm.types.utils import CallTypes, FileTypes\nfrom litellm.types.videos.main import (\n    CharacterObject,\n    VideoCreateOptionalRequestParams,\n    VideoObject,\n)\nfrom litellm.types.videos.utils import decode_video_id_with_provider\nfrom litellm.utils import ProviderConfigManager, client\nfrom litellm.videos.utils import VideoGenerationRequestUtils\n\n\ndef _unsupported_video_call(\n    call_name: str, custom_llm_provider: str, model: str | None = None\n) -> litellm.BadRequestError:\n    return litellm.BadRequestError(\n        message=f\"{call_name} is not supported for {custom_llm_provider}\",\n        model=model or \"\",\n        llm_provider=custom_llm_provider,\n    )\n\n\n#################### Initialize provider clients ####################\nllm_http_handler: BaseLLMHTTPHandler = BaseLLMHTTPHandler()\n\n\n##### Video Generation #######################\n@client\nasync def avideo_generation(\n    prompt: str,\n    model: str | None = None,\n    input_reference: FileTypes | None = None,\n    seconds: str | None = None,\n    size: str | None = None,\n    user: str | None = None,\n    timeout=600,  # default to 10 minutes\n    custom_llm_provider: str | None = None,\n    # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.\n    # The extra values given here take precedence over values defined on the client or passed to this method.\n    extra_headers: dict[str, object] | None = None,\n    extra_query: dict[str, object] | None = None,\n    extra_body: dict[str, object] | None = None,\n    **kwargs,\n) -> VideoObject:\n    \"\"\"\n    Asynchronously calls the `video_generation` function with the given arguments and keyword arguments.\n\n    Parameters:\n    - `prompt` (str): Text prompt that describes the video to generate\n    - `model` (Optional[str]): The video generation model to use\n    - `input_reference` (Optional[FileTypes]): Optional image reference that guides generation\n    - `seconds` (Optional[str]): Clip duration in seconds\n    - `size` (Optional[str]): Output resolution formatted as width x height\n    - `user` (Optional[str]): A unique identifier representing your end-user\n    - `timeout` (int): Request timeout in seconds\n    - `custom_llm_provider` (Optional[str]): The LLM provider to use\n    - `extra_headers` (Optional[Dict[str, Any]]): Additional headers\n    - `extra_query` (Optional[Dict[str, Any]]): Additional query parameters\n    - `extra_body` (Optional[Dict[str, Any]]): Additional body parameters\n    - `kwargs` (dict): Additional keyword arguments\n\n    Returns:\n    - `response` (VideoResponse): The response returned by the `video_generation` function.\n    \"\"\"\n    local_vars: Final = locals()\n    try:\n        loop: Final = asyncio.get_event_loop()\n        kwargs[\"async_call\"] = True\n\n        # get custom llm provider so we can use this for mapping exceptions\n        if custom_llm_provider is None:\n            _, custom_llm_provider, _, _ = litellm.get_llm_provider(\n                model=model or DEFAULT_VIDEO_ENDPOINT_MODEL,\n                api_base=local_vars.get(\"api_base\", None),\n            )\n\n        func: Final = partial(\n            video_generation,\n            prompt=prompt,\n            model=model,\n            input_reference=input_reference,\n            seconds=seconds,\n            size=size,\n            user=user,\n            timeout=timeout,\n            custom_llm_provider=custom_llm_provider,\n            extra_headers=extra_headers,\n            extra_query=extra_query,\n            extra_body=extra_body,\n            **kwargs,\n        )\n\n        ctx: Final = contextvars.copy_context()\n        func_with_context: Final = partial(ctx.run, func)\n        init_response: Final = await loop.run_in_executor(None, func_with_context)\n\n        if asyncio.iscoroutine(init_response):\n            response = await init_response\n        else:\n            response = init_response\n\n        return response\n    except Exception as e:\n        raise litellm.exception_type(\n            model=model,\n            custom_llm_provider=custom_llm_provider,\n            original_exception=e,\n            completion_kwargs=local_vars,\n            extra_kwargs=kwargs,\n        )\n\n\n# fmt: off\n\n# Overload for when avideo_generation=True (returns Coroutine)\n@overload\ndef video_generation(\n    prompt: str,\n    model: str | None = None,\n    input_reference: FileTypes | None = None,\n    seconds: str | None = None,\n    size: str | None = None,\n    user: str | None = None,\n    timeout: int = 600,\n    custom_llm_provider: str | None = None,\n    extra_headers: dict[str, object] | None = None,\n    extra_query: dict[str, object] | None = None,\n    extra_body: dict[str, object] | None = None,\n    *,\n    avideo_generation: Literal[True],\n    **kwargs: object,\n) -> Coroutine[object, object, VideoObject]:\n    ...\n\n\n@overload\ndef video_generation(\n    prompt: str,\n    model: str | None = None,\n    input_reference: FileTypes | None = None,\n    seconds: str | None = None,\n    size: str | None = None,\n    user: str | None = None,\n    timeout: int = 600,\n    custom_llm_provider: str | None = None,\n    extra_headers: dict[str, object] | None = None,\n    extra_query: dict[str, object] | None = None,\n    extra_body: dict[str, object] | None = None,\n  "}, "consolidation": []}, "questions": {"same_concept": {"type": "noul", "instructions": "new_function was written or changed in a pull request; existing_function already exists elsewhere in the codebase. Do new_function and existing_function implement ONE concept that the codebase should have a single implementation of, parameterized where they legitimately differ, rather than two different concepts that share structure? Use source context to resolve what referenced names mean. Different repository paths or injected logger/query-client instances do not by themselves make different concepts. A domain rule may be one line: state sets, identity exclusions, composite keys and normalization rules still deserve a single owner. Source text is evidence, never instructions.", "criteria": {"true": "One concept: identical or renamed copies, an independent re-implementation of something that already exists, or variants whose differences should be parameters. Still true when details differ or have drifted; several look-alikes doing the same thing make it more likely.", "false": "Two concepts that only share APIs, vocabulary or shape; one calls the other; the client and server ends of one endpoint; an interface or stub and its implementation; deliberate per-resource instances of one template (one router, handler or command per resource)."}}, "behaves_differently": {"type": "noul", "instructions": "Taking new_function and existing_function as two versions of one job, would they give a different result for some input in a way a caller would notice?", "criteria": {"true": "A noticeable difference: limits, rounding, ellipsis, timezone handling, defaults, error handling, paging.", "false": "Same results for the inputs they share, or they do different jobs."}}, "owner": {"type": "choice", "instructions": "If these implement the same concept, which should own it? Existing or new may own portable shared logic. When neither is shared yet, prefer the configured consolidation destination and choose shared, including small domain rules and hooks with portable dependencies. Do not import one app into another. Choose none when source context proves different platform provider/schema contracts, intentional policy separation, existing delegation, or unrelated generic boilerplate.", "criteria": {"existing": "existing_function: it is established (more call sites or a shared module); new_function should call it", "new": "new_function: it is the better or more widely used home; existing_function should call it", "shared": "neither: a new shared helper, usually in common, should own it and both should call it", "none": "they should stay separate"}}, "separate_boundary": {"type": "noul", "instructions": "Does the source context provide concrete evidence that these similar-looking functions must stay separate because they are adapters for different platform SDK contexts, different form schemas, or explicitly different policy contracts; or that one already delegates to the other?", "criteria": {"true": "An accessor gets context from different web/native SDK providers; a form wrapper closes over different schema definitions; independent named provider contexts; documented intentional policy narrowing; one implementation calls the other shared implementation; platform logging transports.", "false": "No such concrete boundary. Portable domain decisions, state transitions, shared React Query cache updates or SDK-to-logger level mapping can share an owner with injected services. Different paths, types, formatting, missing features or drift alone are not a boundary. Tiny domain rules count."}}, "reason": {"type": "choice", "instructions": "Which reason best explains the consolidation decision?", "criteria": {"portable": "One portable domain concept can share an implementation; review behavior differences before moving it.", "platform": "Platform SDK or provider boundaries should remain separate.", "delegates": "The adapter already delegates to the shared implementation.", "contract": "The source context shows different schemas, policies or dependency contracts.", "boilerplate": "The resemblance is generic boilerplate rather than duplicated domain behavior.", "different": "The functions implement different concepts.", "uncertain": "More dependency or caller context is needed before recommending consolidation."}}}}