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

Function without_omit

tests/lib/threads/test_beta_threads.py:2250–2256  ·  view source on GitHub ↗

`hints` with the `| Omit` that every optional field of a thread params type adds to the type `create()` gives it.

(hints: dict[str, Any])

Source from the content-addressed store, hash-verified

2248
2249
2250def without_omit(hints: dict[str, Any]) -> dict[str, Any]:
2251 """`hints` with the `| Omit` that every optional field of a thread params type adds to the type `create()` gives it."""
2252 assert all(Omit in get_args(hint) for hint in hints.values())
2253 return {
2254 field: reduce(operator.or_, (member for member in get_args(hint) if member is not Omit))
2255 for field, hint in hints.items()
2256 }
2257
2258
2259def run_turn(thread: BetaMessageThread[Any], method: str, *messages: BetaMessageParam, **overrides: Any) -> None:

Calls 1

get_argsFunction · 0.50

Tested by

no test coverage detected