mirror of
https://github.com/weyne85/PentestGPT.git
synced 2025-10-29 16:58:59 +00:00
feat: 🎸 API support
Add support for ChatGPT API (for pro only)
This commit is contained in:
21
example_chatgpt_playwright.py
Normal file
21
example_chatgpt_playwright.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from chatgpt_wrapper import ChatGPT
|
||||
|
||||
import os
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
bot = ChatGPT()
|
||||
conversations = bot.get_history()
|
||||
# structure of conversation:
|
||||
# {conversation_id (str): {'id': conversation_id, 'title': conversation_title, 'create_time': conversation_create_time'}}
|
||||
|
||||
## select a past conversation
|
||||
selected_id = list(conversations.keys())[0]
|
||||
result = bot.get_conversation(selected_id)
|
||||
## Get the conversation history
|
||||
# print(result)
|
||||
|
||||
## Try to ask a question in this conversation
|
||||
question = "What is the meaning of life?"
|
||||
success, response, message = bot.ask("Hello, world!")
|
||||
print(response)
|
||||
Reference in New Issue
Block a user