aeo_v2 / pages /3_Lure_Generation.py
ibibek's picture
Upload 32 files
50cb8a1
raw
history blame
986 Bytes
from lureGeneration.LureGenerator import LureGenerator
import openai
import os
import streamlit as st
import streamlit as st
st.subheader("In this example you can Lure based on AEO ")
OpenAI_Key = st.text_input(" Please enter your OpenAI key here to continue")
# only continue if the key is given
if OpenAI_Key:
os.environ['OPENAI_API_KEY'] = OpenAI_Key
openai.api_key =os.environ['OPENAI_API_KEY']
# ['honeytoken','honeypot','honeyfile']
honey_type = st.text_area(" Please enter one of the type: ['honeytoken','honeypot','honeyfile'] ","honeyfile", height=50)
# Description
description = st.text_area("Please enter the description. ", "CEO of a critical mining company", height=50)
ex = LureGenerator() #declare the instance
e = ex.generate(honey_type,description)
response = ex.lure[0].content
json_ld = ex.lure[0].json
st.subheader('Content')
st.write(response)
st.subheader('JSON-LD Description')
st.write(json_ld)