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

feat: mesop cloudrun gemini app #1388

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

ghchinoy
Copy link
Contributor

@ghchinoy ghchinoy commented Nov 11, 2024

Description

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:

Fixes #1387 🦕

@ghchinoy ghchinoy requested a review from a team as a code owner November 11, 2024 00:04
@@ -0,0 +1,100 @@
# Cloud Run application utilizing Mesop that demonstrates working with Vertex AI Gemini API
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# Cloud Run application utilizing Mesop that demonstrates working with Vertex AI Gemini API
# Mesop Gemini App on Cloud Run

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will revise with a different suggestion for review "Mesop application using Vertex AI Gemini API on Cloud Run"

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd recommend changing the folder name to just mesop-cloudrun (gemini is redundant)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was to align with the streamlit example

Copy link
Collaborator

Choose a reason for hiding this comment

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

The streamlit one probably shouldn't have "gemini" either, tbh.

gemini/sample-apps/gemini-mesop-cloudrun/README.md Outdated Show resolved Hide resolved
gemini/sample-apps/gemini-mesop-cloudrun/shared/navmenu.py Outdated Show resolved Hide resolved
gemini/sample-apps/gemini-mesop-cloudrun/shared/navmenu.py Outdated Show resolved Hide resolved
Comment on lines 184 to 242
## Marketing events
def on_change_marketing_category(e: me.RadioChangeEvent) -> None:
state = me.state(State)
state.marketing_product_category = e.value


def on_change_marketing_target(e: me.RadioChangeEvent) -> None:
state = me.state(State)
state.marketing_target_audience = e.value


def on_change_marketing_location(e: me.RadioChangeEvent) -> None:
state = me.state(State)
state.marketing_target_location = e.value


def on_selection_change_marketing_goals(e: me.SelectSelectionChangeEvent) -> None:
s = me.state(State)
s.marketing_campaign_selected_goals = e.values
print(f"selected: {s.marketing_campaign_selected_goals}")


def on_change_marketing_brand_voice(e: me.RadioChangeEvent) -> None:
state = me.state(State)
state.marketing_brand_voice = e.value


def on_change_marketing_budget(e: me.RadioChangeEvent) -> None:
state = me.state(State)
state.marketing_budget = e.value
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any way to simplify this into fewer methods?

gemini/sample-apps/gemini-mesop-cloudrun/main.py Outdated Show resolved Hide resolved
gemini/sample-apps/gemini-mesop-cloudrun/main.py Outdated Show resolved Hide resolved
gemini/sample-apps/gemini-mesop-cloudrun/main.py Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's a lot of duplicated code in this file. Is it possible to clean it up/split into separate files/modularize?

I would also recommend moving the prompts into dedicated files. Possibly in the .prompt format https://docs.continue.dev/customize/deep-dives/prompt-files

@holtskinner
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat]: Create a Mesop version of the starter Gemini Cloud Run app
2 participants