Skip to content

Commit

Permalink
fixing readme and removing openai method
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberRoute committed Sep 19, 2024
1 parent 751d2bf commit b46a468
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ Ensure the following dependencies are installed:
Install `pipenv` if it's not already installed:
```bash
pip install pipenv
sudo pip install pipenv
```
Then, use `pipenv` to create the virtual environment and install the required dependencies:
```bash
pipenv install
sudo pipenv install
```
To activate the virtual environment:
```bash
pipenv shell
sudo pipenv shell
```
3. **Run the application**:
Expand Down
18 changes: 0 additions & 18 deletions core/sniffer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from PyQt6.QtCore import QObject, pyqtSignal as Signal
import scapy.all as scapy
from openai import OpenAI

client = OpenAI(api_key='') # Import OpenAI



class PacketCollector(QObject):
Expand Down Expand Up @@ -34,17 +30,3 @@ def process_packet(self, packet):

def stop_capture(self):
self.running = False

@staticmethod
def analyze_packet_with_openai(packet_info):
try:
response = client.chat.completions.create(
model="gpt-4-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": f"Analyze the following packet information: {packet_info}"}
]
)
print(response.choices[0].message.content.strip())
except Exception as e:
return f"Error during OpenAI API call: {str(e)}"

0 comments on commit b46a468

Please sign in to comment.