Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with test_gemini_chat (gemini_test.GeminiModelWrapperTest) #234

Closed
zyzhang1130 opened this issue May 17, 2024 · 1 comment · Fixed by #233
Closed

Issue with test_gemini_chat (gemini_test.GeminiModelWrapperTest) #234

zyzhang1130 opened this issue May 17, 2024 · 1 comment · Fixed by #233
Assignees
Labels
bug Something isn't working work in progress Work in progress

Comments

@zyzhang1130
Copy link
Contributor

It seems the current test_gemini_chat (gemini_test.GeminiModelWrapperTest) is not compatible with response.candidates, and I got the following error in pr Gemini chat wrapper fix due to this reason.:

ERROR: test_gemini_chat (gemini_test.GeminiModelWrapperTest)
Test for chat API.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/unittest/mock.py", line 1336, in patched
    return func(*newargs, **newkeywargs)
  File "/home/runner/work/agentscope/agentscope/tests/gemini_test.py", line 62, in test_gemini_chat
    response = model(contents="Hi!")
  File "/home/runner/work/agentscope/agentscope/src/agentscope/models/model.py", line 117, in checking_wrapper
    return model_call(self, *args, **kwargs)
  File "/home/runner/work/agentscope/agentscope/src/agentscope/models/gemini_model.py", line 153, in __call__
    if response.candidates:
AttributeError: 'DummyResponse' object has no attribute 'candidates'

However, I think response.candidates is essential for error handling in the event that response returned from API does not contain any text (see the pr Gemini chat wrapper fix for details).

@DavdGao
Copy link
Collaborator

DavdGao commented May 21, 2024

Thanks for your report, and we will fix this bug as soon as possible.

@DavdGao DavdGao linked a pull request May 24, 2024 that will close this issue
4 tasks
@DavdGao DavdGao added bug Something isn't working work in progress Work in progress labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working work in progress Work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants