import os # Still init with the fake one if 'OPENAI_API_KEY' not in os.environ: os.environ['OPENAI_API_KEY'] = 'none' import pandas as pd import requests import streamlit as st from IPython.core.display import HTML from langchain.agents import AgentType, initialize_agent, load_tools from langchain.chat_models import ChatOpenAI from PIL import Image from rmrkl import ChatZeroShotAgent, RetryAgentExecutor from chemcrow.agents import ChemCrow, make_tools from chemcrow.agents.prompts import (FORMAT_INSTRUCTIONS, QUESTION_PROMPT, SUFFIX) from chemcrow.frontend.streamlit_callback_handler import \ StreamlitCallbackHandlerChem from langchain.callbacks import StreamlitCallbackHandler from chemcrow.frontend.utils import cdk from dotenv import load_dotenv load_dotenv() ss = st.session_state icon = Image.open('assets/logo0.png') st.set_page_config( page_title="ChemCrow", page_icon = icon ) # Set width of sidebar st.markdown( """