Toggle Menu
Prev Up Next

# `langchain_core.beta.runnables.context`.PrefixContext

class langchain_core.beta.runnables.context.PrefixContext(prefix: str = '')

  Context for a runnable with a prefix.

  Attributes

  `prefix` |

  Methods

  `__init__`([prefix]) |
  `getter`(key, /) |
  `setter`([_key, _value]) |

  Parameters

    prefix (str) –

  __init__(prefix: str = '')
    Parameters

      prefix (str) –

  getter(key: Union[str, List[str]], /) → ContextGet
    Parameters

      key (Union[str, List[str]]) –

    Return type

      ContextGet

  setter(_key: Optional[str] = None, _value: Optional[Union[Runnable[Input, Output], Callable[[Input], Output], Callable[[Input], Awaitable[Output]], Any]] = None, /, **kwargs: Union[Runnable[Input, Output], Callable[[Input], Output], Callable[[Input], Awaitable[Output]], Any]) → ContextSet
    Parameters

      - _key (Optional[str]) –

      - _value (Optional[Union[Runnable[Input, Output], Callable[[Input], Output], Callable[[Input], Awaitable[Output]], Any]]) –

      - kwargs (Union[Runnable[Input, Output], Callable[[Input], Output], Callable[[Input], Awaitable[Output]], Any]) –

    Return type

      ContextSet