Skip to content

Commit

Permalink
test: add unit test for retrieving previous conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
HanaokaYuzu committed Apr 5, 2024
1 parent 3aa2371 commit 0ea771c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_client_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ async def test_continuous_conversation(self):
self.assertTrue(response2.text)
logger.debug(response2.text)

@logger.catch(reraise=True)
async def test_retrieve_previous_conversation(self):
chat = self.geminiclient.start_chat()
await chat.send_message("Fine weather today")
self.assertTrue(len(chat.metadata) == 3)
previous_session = chat.metadata
logger.debug(previous_session)
previous_chat = self.geminiclient.start_chat(metadata=previous_session)
response = await previous_chat.send_message("What was my previous message?")
logger.debug(response)

@logger.catch(reraise=True)
async def test_chatsession_with_image(self):
chat = self.geminiclient.start_chat()
Expand Down

0 comments on commit 0ea771c

Please sign in to comment.