import os import gradio as gr import pinecone from gpt_index import GPTIndexMemory, GPTPineconeIndex OPENAI_API_KEY=os.environ.get("OPENAI_API_KEY") PINECONE_API_KEY=os.environ.get("PINECONE_API_KEY") PINECONE_ENV=os.environ.get("PINECONE_ENV") pointing_pinecone_index=pinecone.Index("sethgodin") main_index=GPTPineconeIndex([],pinecone_index=pointing_pinecone_index) memory = GPTIndexMemory(index=main_index, memory_key="chat_history", query_kwargs={"response_mode": "compact"}) llm=OpenAI(temperature=0.3) agent_chain = initialize_agent([], llm, agent="conversational-react-description", memory=memory