File size: 821 Bytes
e8185ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import streamlit as st
from langchain_groq import ChatGroq

from langchain.prompts import PromptTemplate

st.title('AI Scientist')
st.subheader('Here you will find solution for your problem')

model=ChatGroq(temperature=0.6,
               groq_api_key='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',
              model_name="llama-3.1-70b-versatile")

A=st.text_input('ENTER YOUR PROBLEM') 

SUB=st.button('SUBMIT')

B=PromptTemplate(input=['C'],
                 template="""you are a highest ranked scientist working in Harvard University for more than 30 years,
                       you know every concepts and reactions in science,now tell me about {C} in 20 words and suggest an alternate for it in 20 words.""")
if SUB:
    D=B.format(C=A)
    response=model.invoke(D)
    st.write(response.content)