PrefixContext#

class langchain_core.beta.runnables.context.PrefixContext(prefix: str = '')[source]#

Context for a runnable with a prefix.

Attributes

prefix

Methods

__init__([prefix])

getter(key, /)

setter([_key, _value])

Parameters:

prefix (str)

__init__(prefix: str = '')[source]#
Parameters:

prefix (str)

getter(key: str | list[str], /) ContextGet[source]#
Parameters:

key (str | list[str])

Return type:

ContextGet

setter(_key: str | None = None, _value: Runnable[Input, Output] | Callable[[Input], Output] | Callable[[Input], Awaitable[Output]] | Any | None = None, /, **kwargs: Runnable[Input, Output] | Callable[[Input], Output] | Callable[[Input], Awaitable[Output]] | Any) ContextSet[source]#
Parameters:
  • _key (str | None)

  • _value (Runnable[Input, Output] | Callable[[Input], Output] | Callable[[Input], Awaitable[Output]] | Any | None)

  • kwargs (Runnable[Input, Output] | Callable[[Input], Output] | Callable[[Input], Awaitable[Output]] | Any)

Return type:

ContextSet