hunk.code_window:         standalone_question = {
               "standalone_question": {
                   "question": lambda x: x["question"],
                   "chat_history": lambda x: get_buffer_string(x["chat_history"]),
               }
               | CONDENSE_QUESTION_PROMPT
               | ChatLiteLLM(temperature=0, model=self.model)
               | StrOutputParser(),
  
hunk.labels: keep keep replace replace keep keep keep keep
hunk.after_edit:                 "question": itemgetter("question"),
                   "chat_history": itemgetter("chat_history"),
  
hunk.file_path: backend/modules/brain/rags/quivr_rag.py
hunk.type: replace
file: import { createContext, useContext, useState } from "react";
  
  import { IntegrationBrains } from "@/lib/api/brain/types";
  
  interface BrainCreationContextProps {
    isBrainCreationModalOpened: boolean;
    setIsBrainCreationModalOpened: React.Dispatch<React.SetStateAction<boolean>>;
    creating: boolean;
    setCreating: React.Dispatch<React.SetStateAction<boolean>>;
    currentIntegrationBrain: IntegrationBrains | undefined;
    setCurrentIntegrationBrain: React.Dispatch<
      React.SetStateAction<IntegrationBrains | undefined>
    >;
  }
  
  export const BrainCreationContext = createContext<
    BrainCreationContextProps | undefined
  >(undefined);
  
  export const BrainCreationProvider = ({
    children,
  }: {
    children: React.ReactNode;
  }): JSX.Element => {
    const [isBrainCreationModalOpened, setIsBrainCreationModalOpened] =
      useState<boolean>(false);
    const [currentIntegrationBrain, setCurrentIntegrationBrain] =
      useState<IntegrationBrains>();
    const [creating, setCreating] = useState<boolean>(false);
  
    return (
      <BrainCreationContext.Provider
        value={{
          isBrainCreationModalOpened,
          setIsBrainCreationModalOpened,
          creating,
          setCreating,
          currentIntegrationBrain,
          setCurrentIntegrationBrain,
        }}
      >
        {children}
      </BrainCreationContext.Provider>
    );
  };
  
  export const useBrainCreationContext = (): BrainCreationContextProps => {
    const context = useContext(BrainCreationContext);
    if (!context) {
      throw new Error(
        "useBrainCreationContext must be used within a BrainCreationProvider"
      );
    }
  
    return context;
  };
  