langchain_core.beta.runnables.context.Context¶

class langchain_core.beta.runnables.context.Context[source]¶

Context for a runnable.

Methods

__init__()

create_scope(scope, /)

Create a context scope.

getter(key, /)

setter([_key, _value])

__init__()¶
static create_scope(scope: str, /) PrefixContext[source]¶

Create a context scope.

Parameters

scope (str) – The scope.

Returns

The context scope.

Return type

PrefixContext

static getter(key: Union[str, List[str]], /) ContextGet[source]¶
Parameters

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

Return type

ContextGet

static 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[source]¶
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