Setup

library(googleAuthR)
library(googleCloudVertexAIR)

options(googleAuthR.scopes.selected = "https://www.googleapis.com/auth/cloud-platform")

gar_auth_service(json_file = Sys.getenv("GAR_SERVICE_JSON"))

Set global arguements

projectId <- Sys.getenv("GCVA_DEFAULT_PROJECT_ID")
gcva_region_set(region = "us-central1")
## 2024-07-08 12:35:30.808604> Region set to 'us-central1'
gcva_project_set(projectId = projectId)
## 2024-07-08 12:35:30.809378> ProjectId set to 'gc-vertex-ai-r'

Text

## set verbose log for debugging assistance
# options(googleAuthR.verbose = 0)
result_gemini <- gcva_gemini_text(
  prompt="Give me ten interview questions for the role of a data scientist related to the R language.",
  modelId="gemini-1.0-pro",
  stream=FALSE)

result_gemini
## [1] "##  10 Interview Questions for a Data Scientist (R-focused):\n\n1.  **What are your preferred packages in R for data manipulation, analysis, and visualization?** ( This assesses their familiarity with core R functionalities and popular packages.)\n2. **Describe your experience with data cleaning and wrangling in R. Have you encountered any  challenging datasets, and how did you handle them?** (Evaluates their data cleaning skills and problem-solving abilities.)\n3. **Explain the difference between  supervised and unsupervised learning. Can you provide an example of each using R code with a real-world dataset?** (Tests their understanding of machine learning concepts and ability to apply them in R.)\n4. **How do you choose the appropriate  machine learning model for a given problem? What are your criteria for evaluating model performance?** (Examines their model selection and evaluation expertise.)\n5. **Have you ever created interactive data visualizations in R using libraries like `shiny` or ` plotly`? If so, could you describe a project and its impact?** (Assesses their ability to create impactful and insightful visualizations.)\n6. **Explain the concept of cross-validation and its importance in machine learning. How do you implement it in R?** (Evaluates their understanding of bias-variance trade -off and model validation techniques.)\n7. **How do you handle missing data in your R projects? What methods do you use for imputation or handling missing values?** (Assesses their ability to address common data quality issues.)\n8. **Describe your experience with deploying machine learning models into production. What tools  or platforms have you used?** (Examines their understanding of model deployment and real-world applications.)\n9. **Have you ever collaborated with other data scientists or teams on R projects? How did you manage communication and code versioning?** (Evaluates their teamwork and collaboration skills.)\n10. **What are  some of the current trends or advancements in the R ecosystem that you are following?** (Assesses their awareness of ongoing developments and their commitment to staying updated.)\n\n**Bonus:**\n\n* **Present a portfolio or GitHub repository showcasing your R projects and explain your approach to each project.** (This allows the interviewer to directly assess your skills  and experience.)\n\n**Additional Notes:**\n\n* Adjust the difficulty level of the questions based on the candidate's experience and seniority.\n* Encourage the candidate to elaborate on their answers and showcase their problem-solving skills.\n* Be prepared to answer any clarifying questions they might have about the questions or R functionalities.\n\nI  hope these questions are helpful for your interview! "

refs:

notes:

2024-02-21 - see potential bug here: https://www.googlecloudcommunity.com/gc/AI-ML/Gemini-s-safety-config-400-error-from-today/m-p/712922/highlight/true and references: https://cloud.google.com/vertex-ai/docs/generative-ai/multimodal/configure-safety-attributes#gemini-TASK-samples-drest

# request_debug <- readRDS("request_debug.rds")
# request_debug$body_json