Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

feat: add ml.llm.Claude3TextGenerator model#901

Merged
GarrettWu merged 5 commits intomainfrom
garrettwu-claude
Aug 20, 2024
Merged

feat: add ml.llm.Claude3TextGenerator model#901
GarrettWu merged 5 commits intomainfrom
garrettwu-claude

Conversation

@GarrettWu
Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes b/359901494 🦕

@GarrettWu GarrettWu requested a review from shobsi August 14, 2024 23:44
@GarrettWu GarrettWu self-assigned this Aug 14, 2024
@GarrettWu GarrettWu requested review from a team August 14, 2024 23:44
@product-auto-label product-auto-label Bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Aug 14, 2024
@GarrettWu

This comment was marked as resolved.

@GarrettWu GarrettWu added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 16, 2024
@bigframes-bot bigframes-bot removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 16, 2024
Comment thread bigframes/ml/llm.py
_GEMINI_1P5_PRO_FLASH_PREVIEW_ENDPOINT,
)

_CLAUDE_3_SONNET_ENDPOINT = "claude-3-sonnet"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add all BQML-supported models?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Leaving tests to be added.

Copy link
Copy Markdown
Contributor

@shobsi shobsi Aug 20, 2024

Choose a reason for hiding this comment

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

Sorry, I thought you were going to add tests in this PR itself. Are you going to send another PR for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. need to setup the connection for other regions.

Comment thread bigframes/ml/llm.py
(https://cloud.google.com/products#product-launch-stages).

Args:
model_name (str, Default to "claude-3-sonnet"):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[nit] "Defaults to ..."?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We use "Default to" in all the APIs... Keeping it for now.

Comment thread bigframes/ml/llm.py

@log_adapter.class_logger
class Claude3TextGenerator(base.BaseEstimator):
"""Claude3 text generator LLM model.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like "Consumer Procurement Entitlement Manager Identity and Access Management (IAM) role" is an additional requirement https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models#set-permissions, we should document this in the class docstring and after the release in the reference docs https://cloud.google.com/bigquery/docs/use-bigquery-dataframes#remote-models

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@GarrettWu GarrettWu requested review from jiaxunwu and shobsi August 20, 2024 01:26
@GarrettWu GarrettWu enabled auto-merge (squash) August 20, 2024 01:27
@GarrettWu GarrettWu merged commit 7050038 into main Aug 20, 2024
@GarrettWu GarrettWu deleted the garrettwu-claude branch August 20, 2024 17:41
Comment thread tests/system/conftest.py


@pytest.fixture(scope="session")
def session_us_east5() -> Generator[bigframes.Session, None, None]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did we use it anywhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

forgot to remove in this PR, but will use in PR of adding tests.

Comment thread bigframes/ml/llm.py
_GEMINI_1P5_PRO_FLASH_PREVIEW_ENDPOINT,
)

_CLAUDE_3_SONNET_ENDPOINT = "claude-3-sonnet"
Copy link
Copy Markdown
Contributor

@shobsi shobsi Aug 20, 2024

Choose a reason for hiding this comment

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

Sorry, I thought you were going to add tests in this PR itself. Are you going to send another PR for this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants