File size: 1,401 Bytes
50cb8a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from aeo_ex_generator.aeo_example_generator import ExampleGenerator

import openai
import os
import streamlit as st

import streamlit as st 

st.subheader("This space will autognerate the plans and the personas")

OpenAI_Key = st.text_input(" Please enter your OpenAI key here to continue")
# only continue if the key is given
if OpenAI_Key:
    st.write("Please wait, it will take a while to generate. ")
    os.environ['OPENAI_API_KEY'] = OpenAI_Key
    openai.api_key =os.environ['OPENAI_API_KEY'] 

    

    ex = ExampleGenerator() #declare the instance
    e = ex.auto_generate()
    
    st.write(ex.description) #the description is cached in this variable 
 
    st.subheader('Prefix Namespaces')
    st.write(e['@context']) #here are the prefix namespaces mentioned in the example



    result = [i for i in e['@graph']]
    st.subheader('Full example:')
    try:
        st.json(result)
    except:
        st.text_area("", result, height=400)

    if result:
        st.subheader("Auto generate specific plan")
        keywords = st.text_area("Enter keywords to keep in the plan","breadcrumbtrail")
        nkeywords= st.text_area("You can pass keywords to exclude from the example generation", "honeypot")
        personas = ex.generate_personas() 
        st.subheader("Person based on the existing description provided in the deception plan")
        st.write( ex.persona_descriptions)