File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 1414from flask_restful import Api
1515from flask_restful import Resource
1616
17- openai .api_key = "__API__KEY__ "
17+ openai .api_key = "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 "
1818model_engine = "text-davinci-003"
1919
2020app = Flask (__name__ )
@@ -82,16 +82,14 @@ def sanitize(input_string: str) -> str:
8282 return input_string
8383
8484
85- def chunk_output (
86- scan_output : str , max_token_size : int
87- ) -> list [dict [str , Any ]]:
88- scan_output_dict = json .loads (scan_output )
85+ def chunk_output (scan_output : dict ,
86+ max_token_size : int ) -> list [dict [str , Any ]]:
8987 output_chunks = []
9088 current_chunk = {}
9189 current_token_count = 0
9290
9391 # Convert JSON to AI usable chunks
94- for ip , scan_data in scan_output_dict .items ():
92+ for ip , scan_data in scan_output .items ():
9593 new_data_token_count = len (json .dumps ({ip : scan_data }).split ())
9694
9795 if current_token_count + new_data_token_count <= max_token_size :
You can’t perform that action at this time.
0 commit comments