langchain_core.load.serializable.try_neq_defaultΒΆ

langchain_core.load.serializable.try_neq_default(value: Any, key: str, model: BaseModel) bool[source]ΒΆ

Try to determine if a value is different from the default.

Parameters
  • value (Any) – The value.

  • key (str) – The key.

  • model (BaseModel) – The pydantic model.

Returns

Whether the value is different from the default.

Raises

Exception – If the key is not in the model.

Return type

bool