MCPcopy
hub / github.com/openai/openai-python / construct

Method construct

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

Source from the content-addressed store, hash-verified

986 # type ignore required because we're adding explicit types to `**values`
987 @classmethod
988 def construct( # type: ignore
989 cls,
990 _fields_set: set[str] | None = None,
991 **values: Unpack[FinalRequestOptionsInput],
992 ) -> FinalRequestOptions:
993 kwargs: dict[str, Any] = {
994 # we unconditionally call `strip_not_given` on any value
995 # as it will just ignore any non-mapping types
996 key: strip_not_given(value)
997 for key, value in values.items()
998 }
999 if PYDANTIC_V1:
1000 return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated]
1001 return super().model_construct(_fields_set, **kwargs)
1002
1003 if not TYPE_CHECKING:
1004 # type checkers incorrectly complain about this assignment

Callers

nothing calls this directly

Calls 3

strip_not_givenFunction · 0.85
itemsMethod · 0.45
constructMethod · 0.45

Tested by

no test coverage detected