build_extra_kwargs#

langchain_core.utils.utils.build_extra_kwargs(extra_kwargs: Dict[str, Any], values: Dict[str, Any], all_required_field_names: Set[str]) Dict[str, Any][source]#

Build extra kwargs from values and extra_kwargs.

Parameters:
  • extra_kwargs (Dict[str, Any]) – Extra kwargs passed in by user.

  • values (Dict[str, Any]) – Values passed in by user.

  • all_required_field_names (Set[str]) – All required field names for the pydantic class.

Returns:

Extra kwargs.

Return type:

Dict[str, Any]

Raises:
  • ValueError – If a field is specified in both values and extra_kwargs.

  • ValueError – If a field is specified in model_kwargs.