MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / construct

Method construct

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

Source from the content-addressed store, hash-verified

1127 # type ignore required because we're adding explicit types to `**values`
1128 @classmethod
1129 def construct( # type: ignore
1130 cls,
1131 _fields_set: set[str] | None = None,
1132 **values: Unpack[FinalRequestOptionsInput],
1133 ) -> FinalRequestOptions:
1134 kwargs: dict[str, Any] = {
1135 # we unconditionally call `strip_not_given` on any value
1136 # as it will just ignore any non-mapping types
1137 key: strip_not_given(value)
1138 for key, value in values.items()
1139 }
1140 if PYDANTIC_V1:
1141 return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated]
1142 return super().model_construct(_fields_set, **kwargs)
1143
1144 if not TYPE_CHECKING:
1145 # 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