15
15
from shutil import make_archive
16
16
from directory_structure import Tree
17
17
from alive_progress import alive_bar
18
- import time
18
+ from time import sleep
19
19
import openai
20
20
from dotenv import load_dotenv
21
21
load_dotenv ()
73
73
setting_token .write ("OPENAI_TOKEN=" + '"' + userkey + '"' )
74
74
75
75
targets = input ("Enter Filename: (Press enter for 'input/sample_sources' ) " ) or "input/sample_sources"
76
- investigation = input ("Enter name for your investigation: " )
76
+ # investigation = input("Enter name for your investigation: ")
77
77
78
78
search = open (targets ,"r" )
79
79
query = search .read ()
110
110
pass
111
111
else :
112
112
os .environ ['OPENAI_TOKEN' ] = input ('Enter API Key: ' ).replace (" " ,"" )
113
- f_jsonpath = 'output/' + investigation + '/results'
113
+ # f_jsonpath = 'output/'+investigation+'/results'
114
114
token = os .environ .get ("OPENAI_TOKEN" )
115
115
116
- os .mkdir ('output/' + investigation )
117
- os .mkdir ('output/' + investigation + '/results/' )
116
+ # os.mkdir('output/'+investigation)
117
+ # os.mkdir('output/'+investigation+'/results/')
118
118
119
119
with open (targets , 'r' ) as targets :
120
120
for line in targets :
124
124
for search in openai_targets :
125
125
#search = search.strip()
126
126
response = openai .Completion .create (
127
- model = "code -davinci-002 " ,
128
- prompt = search + "\n Here's what this code is doing: \n 1. " ,
127
+ model = "text -davinci-003 " ,
128
+ prompt = search + "\n \n " ,
129
129
temperature = 0 ,
130
- max_tokens = 64 ,
130
+ max_tokens = 3600 ,
131
131
top_p = 1 ,
132
132
frequency_penalty = 0 ,
133
133
presence_penalty = 0 ,
134
134
stop = ["\" \" \" " ]
135
135
)
136
136
response = response ['choices' ][0 ]['text' ]
137
- with open ('output/' + investigation + '/results/' + str (search .rsplit ('/' , 1 )[- 1 ])+ ".txt" , "w" ) as f :
138
- f .write (response )
139
- fadedresponse = fade .greenblue ("1." + response )
137
+ # with open('output/'+investigation+'/results/'+str(search.rsplit('/', 1)[-1])+ ".txt", "w") as f:
138
+ # f.write(response)
139
+ fadedresponse = fade .greenblue (response )
140
140
141
141
print (' ' * 39 + "🆁🅴🆂🆄🅻🆃🆂\n " + "𝘚𝘦𝘢𝘳𝘤𝘩 𝘴𝘰𝘶𝘳𝘤𝘦 𝘪𝘯𝘱𝘶𝘵:" + str (search ).strip ())
142
- print ("\n \033 [36mHere's what I think this code is doing:" )
142
+ print ("\n \033 [36mHere's your code:" )
143
+ sleep (5 )
143
144
print (fadedresponse )
144
145
print (faded_seperator )
145
146
146
147
147
148
148
- path = Tree (f_jsonpath , absolute = False )
149
+ # path = Tree(f_jsonpath, absolute=False)
149
150
print (path )
0 commit comments