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

test: Add tests for VertexAIChatGeminiGenerator and migrate from preview #1042

Merged
merged 15 commits into from
Sep 6, 2024

Conversation

Amnah199
Copy link
Contributor

@Amnah199 Amnah199 commented Aug 30, 2024

Related Issues

Proposed Changes:

  • Migrate from preview package to stable version
  • Add a new test file for VertexAIChatGeminiGenerator
  • Add pipeline serialization/deserialization test

How did you test it?

  • Ran all the tests

Notes for the reviewer

Checklist

@Amnah199 Amnah199 marked this pull request as ready for review August 30, 2024 15:16
@Amnah199 Amnah199 requested a review from a team as a code owner August 30, 2024 15:16
@Amnah199 Amnah199 requested review from davidsbatista and removed request for a team August 30, 2024 15:16
@Amnah199
Copy link
Contributor Author

@julian-risch worst case scenario, merging changes with testing failing only on windows is an option?

@davidsbatista
Copy link
Contributor

You should also add a serialization/deserialization test of a pipeline containing a VertexAIChatGeminiGenerator

@github-actions github-actions bot added the type:documentation Improvements or additions to documentation label Sep 3, 2024
@davidsbatista
Copy link
Contributor

@Amnah199 here's an example of the type of test I mentioned above:

https://github.com/deepset-ai/haystack-experimental/blob/main/test/components/retrievers/test_auto_merging_retriever.py#L103

Amnah199 and others added 7 commits September 4, 2024 13:39
The QdrantDocumentStore did not properly implement the DocumentStore
protocol.
* fix: Add NONE option to EmbeddingTruncateMode

* refactor: Validate input with _missing_ method

* test: Add EmbeddingTruncateMode test

* refactor: Revert "refactor: Validate input with _missing_ method"

This reverts commit 8334a50.

* Update integrations/nvidia/src/haystack_integrations/components/embedders/nvidia/truncate.py

---------

Co-authored-by: Madeesh Kannan <[email protected]>
@Amnah199 Amnah199 changed the title test: Add tests for VertexAIChatGeminiGenerator test: Add tests for VertexAIChatGeminiGenerator and migrate from preview Sep 6, 2024
@Amnah199 Amnah199 requested a review from vblagoje September 6, 2024 11:59
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment about tool definition

assert gemini._model_name == "gemini-1.5-flash"
assert gemini._project_id == "TestID123"
assert gemini._safety_settings == {HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_ONLY_HIGH}
# assert repr(gemini._tools) == repr([Tool(function_declarations=[GET_CURRENT_WEATHER_FUNC])])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why comment out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was by mistake. Just fixed it 👍

@vblagoje vblagoje self-requested a review September 6, 2024 12:40
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Amnah199 Amnah199 merged commit b897441 into main Sep 6, 2024
16 checks passed
@Amnah199 Amnah199 deleted the add-gemini-chat-tests branch September 6, 2024 14:25
Amnah199 added a commit that referenced this pull request Oct 2, 2024
…iew package in vertexai (#1042)

* Add tests for chat generator and migrate from preview package to a stable version of vertexai generative_model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests for VertexAIGeminiChatGenerator Migration from vertex_ai.preview to vertex_ai.generative_model
8 participants