llamachat / app.py
SreedeviBDP's picture
Update app.py
a507cd6 verified
raw
history blame contribute delete
558 Bytes
import os
from llama_index.llms.llama_api import LlamaAPI
from dotenv import load_dotenv
import streamlit as st
load_dotenv()
def get_llama_response(query):
llm = LlamaAPI(model="llama-70b-chat",api_key=os.environ["LLAMA_API_Key"])
response = llm.complete(query)
return response
st.set_page_config(page_title="Q&A Chatbot")
st.header("Application")
input = st.text_input("Input: ",key="input")
response = get_llama_response(input)
submit = st.button("Ask the query")
if submit:
st.subheader("The Respose is")
st.write(response)