You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My code is as below, but it seems not work, please help thanks
from chatgpt_selenium_automation.handler import ChatGPTAutomation
# Define the path where the chrome driver is installed on your computer
chrome_driver_path = r"/chromedriver/chromedriver"
# the sintax r'"..."' is required because the space in "Program Files" in the chrome path
chrome_path = r'"/Applications/Google Chrome.app"'
# xattr -d com.apple.quarantine /Users/ethanwu/Documents/GitHub/llm_project/kgis_openai/chromedriver/chromedriver
# Create an instance
chatgpt = ChatGPTAutomation(chrome_path, chrome_driver_path)
# Define a prompt and send it to chatgpt
prompt = "What are the benefits of exercise?"
chatgpt.send_prompt_to_chatgpt(prompt)
# Retrieve the last response from ChatGPT
response = chatgpt.return_last_response()
print(response)
# Save the conversation to a text file
file_name = "conversation.txt"
chatgpt.save_conversation(file_name)
# Close the browser and terminate the WebDriver session
chatgpt.quit()
The text was updated successfully, but these errors were encountered:
In Mac, the path to launch Google chrome application is /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
use this variable to get it work chrome_path = r'"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"'
Also, make sure you disable quarantine on the downloaded chromedriver using this command in the terminal. xattr -d com.apple.quarantine path/to/chromedriver
send_promt_to_chatgpt(prompt) method actually send the prompt, but the python script freezes as there is an issue with check_response_ended() method that it internally uses. Commenting it worked like charm in my Mac M3 Pro ARM based machine.
My code is as below, but it seems not work, please help thanks
The text was updated successfully, but these errors were encountered: