hunk.code_window:         SystemMessage(
               content=(
                   "When answering use markdown or any other techniques to display the content in a nice and aerated way.  Use the following pieces of context from files provided by the user to answer the users question in the same language as the user question. Your name is Quivr. You're a helpful assistant.  If you don't know the answer with the context provided from the files, just say that you don't know, don't try to make up an answer."
               )
           ),
           HumanMessagePromptTemplate.from_template(template_answer),
       ]
   )
  
hunk.labels: keep keep keep keep add keep keep keep keep keep
hunk.after_edit:         MessagesPlaceholder(variable_name="chat_history", optional=False),
  
hunk.file_path: backend/modules/brain/rags/quivr_rag.py
hunk.type: add
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;
  };
  