Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Try to fix index error
Browse files Browse the repository at this point in the history
  • Loading branch information
terry3041 committed Dec 22, 2022
1 parent ab3b123 commit 15fe662
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pyChatGPT"
version = "0.3.9.5"
version = "0.3.9.6"
authors = [
{ name="terry3041", email="[email protected]" },
]
Expand Down
5 changes: 4 additions & 1 deletion src/pyChatGPT/pyChatGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,14 +597,17 @@ def send_message(self, message: str) -> dict:

# Wait for the response to be ready
self.__verbose_print('[send_msg] Waiting for completion')
WebDriverWait(self.driver, 5).until(
EC.presence_of_element_located((By.CLASS_NAME, 'result-streaming'))
)
WebDriverWait(self.driver, 120).until_not(
EC.presence_of_element_located((By.CLASS_NAME, 'result-streaming'))
)

# Get the response element
self.__verbose_print('[send_msg] Finding response element')
response = self.driver.find_elements(
By.XPATH, '//div[@class="flex-1 overflow-hidden"]//div[p]'
By.XPATH, '//div[starts-with(@class, "markdown prose w-full break-words")]'
)[-1]

# Check if the response is an error
Expand Down

0 comments on commit 15fe662

Please sign in to comment.