Skip to content

Commit

Permalink
Merge pull request #4 from blue-moon22/add_options
Browse files Browse the repository at this point in the history
adding type of formula
  • Loading branch information
blue-moon22 authored Jun 10, 2023
2 parents 2bc48b5 + 7d2dc3e commit f5f90c1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ def addtodatabaserating(rating):
st.title("🪄🧪 FormulAI")
prompt = st.text_input("What would you like to formulate?")

# Adding options:
options = ['Cream', 'Spray', 'Any']
selected_option = st.selectbox('Select an option:', options)
st.write('You selected:', selected_option)

# Prompt templates
ingredients_template = PromptTemplate(
input_variables = ['chemical','csvdata'],
template = "Write me the ingredients for a formulation that includes {chemical} while leveraging current formulations found in: {csvdata}, if the chemical is not directly in csvdata suggest a similar chemical. do not mention dataset in response. The function of the ingredients should be in the format: 'ingredient: (function) for example: 'Glycerin: (Humectant)"
template = f"Write me the ingredients for a {selected_option} "+ "formulation that includes {chemical} while leveraging current formulations found in: {csvdata}, if the chemical is not directly in csvdata suggest a similar chemical. Do not mention dataset in response. The function of the ingredients should be in the format: 'ingredient: (function)', for example: 'Glycerin: (Humectant)"
)

protocol_template = PromptTemplate(
Expand Down Expand Up @@ -65,11 +70,14 @@ def addtodatabaserating(rating):
wiki_research = wiki.run(prompt)
protocol = protocol_chain.run(ingredients=ingredients, wikipedia_research=wiki_research)

st.write('## Ingredients')
st.write(ingredients)
st.write('## Protocol')
st.write(protocol)

addtodatabase(protocol,ingredients)

st.write('## Extra Information')
with st.expander('Ingredients History'):
st.info(ingredients_memory.buffer)

Expand All @@ -79,6 +87,7 @@ def addtodatabaserating(rating):
with st.expander('Wikipedia Research'):
st.info(wiki_research)

st.write('### Feedback')
rating = st.number_input('Enter your rating for the supplied formulation')

if st.button('Submit Rating'):
Expand Down

0 comments on commit f5f90c1

Please sign in to comment.