PentestGPT/example_chatgpt_playwright.py
Grey_D e78fc1a4a7 feat: 🎸 Update playwright for interface consistency
Now the playwright version has the same interface as the API version.
2023-03-19 19:39:57 +08:00

24 lines
752 B
Python

from chatgpt_wrapper import ChatGPT
from llm_handle.parser import extract_cmd
from task_handle.cmd_execution import execute_cmd
import os
if __name__ == "__main__":
bot = ChatGPT()
conversations = bot.get_history()
print(conversations)
# 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?"
response = bot.ask("Hello, world!")
print(response)