MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / construct

Method construct

src/opencode_ai/_models.py:812–825  ·  view source on GitHub ↗
(  # type: ignore
        cls,
        _fields_set: set[str] | None = None,
        **values: Unpack[FinalRequestOptionsInput],
    )

Source from the content-addressed store, hash-verified

810 # type ignore required because we're adding explicit types to `**values`
811 @classmethod
812 def construct( # type: ignore
813 cls,
814 _fields_set: set[str] | None = None,
815 **values: Unpack[FinalRequestOptionsInput],
816 ) -> FinalRequestOptions:
817 kwargs: dict[str, Any] = {
818 # we unconditionally call `strip_not_given` on any value
819 # as it will just ignore any non-mapping types
820 key: strip_not_given(value)
821 for key, value in values.items()
822 }
823 if PYDANTIC_V2:
824 return super().model_construct(_fields_set, **kwargs)
825 return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated]
826
827 if not TYPE_CHECKING:
828 # type checkers incorrectly complain about this assignment

Callers

nothing calls this directly

Calls 2

strip_not_givenFunction · 0.85
constructMethod · 0.45

Tested by

no test coverage detected