langchain.js
    Preparing search index...
    • Helper to send and persist UI messages. Accepts a map of component names to React components as type argument to provide type safety. Will also write to the options?.stateKey state.

      Type Parameters

      • Decl extends Record<string, ElementType>

      Parameters

      • config: {
            configurable?: {
                __pregel_send?: (writes_: [string, unknown][]) => void;
                [key: string]: unknown;
            };
            metadata?: Record<string, unknown>;
            runId?: string;
            runName?: string;
            tags?: string[];
            writer?: (chunk: unknown) => void;
        }

        LangGraphRunnableConfig

      • Optionaloptions: { stateKey?: string }
        • OptionalstateKey?: string

          The key to write the UI messages to. Defaults to ui.

      Returns {
          delete: (id: string) => RemoveUIMessage;
          items: (UIMessage<string, Record<string, unknown>> | RemoveUIMessage)[];
          push: {
              <K extends string>(
                  message: {
                      id?: string;
                      metadata?: Record<string, unknown>;
                      name: K;
                      props: PropMap[K];
                  },
                  options?: { merge?: boolean; message?: MessageLike },
              ): UIMessage<K, PropMap[K]>;
              <K extends string>(
                  message: {
                      id?: string;
                      metadata?: Record<string, unknown>;
                      name: K;
                      props: Partial<PropMap[K]>;
                  },
                  options: { merge: true; message?: MessageLike },
              ): UIMessage<K, Partial<PropMap[K]>>;
          };
      }