prefix_config_spec#

langchain_core.runnables.configurable.prefix_config_spec(spec: ConfigurableFieldSpec, prefix: str) ConfigurableFieldSpec[source]#

Prefix the id of a ConfigurableFieldSpec.

This is useful when a RunnableConfigurableAlternatives is used as a ConfigurableField of another RunnableConfigurableAlternatives.

Parameters:
  • spec (ConfigurableFieldSpec) – The ConfigurableFieldSpec to prefix.

  • prefix (str) – The prefix to add.

Returns:

The prefixed ConfigurableFieldSpec.

Return type:

ConfigurableFieldSpec