olegkachur-e commented on code in PR #68665:
URL: https://github.com/apache/airflow/pull/68665#discussion_r3588263744
##########
providers/google/tests/system/google/cloud/gen_ai/example_gen_ai_generative_model_tuning.py:
##########
@@ -118,16 +126,21 @@ def _get_actual_model(key) -> str:
) as dag:
@task
- def get_gemini_api_key():
- return get_secret(GEMINI_API_KEY)
-
- get_gemini_api_key_task = get_gemini_api_key()
-
- @task
- def get_actual_model(key):
- return _get_actual_model(key)
-
- get_actual_model_task = get_actual_model(get_gemini_api_key_task)
+ def get_actual_model():
+ latest_available_model = max(
+ filter(lambda model: model["sft_availability"] ==
"GenerallyAvailable", STABLE_SFT_MODELS),
+ key=lambda model: model["guaranteed_until"],
+ )
+
+ if datetime.now(timezone.utc).date() >
latest_available_model["guaranteed_until"]:
+ msg = (
+ f"The model: {latest_available_model} guarantee date has
expired. "
+ f"Please check and update the stable SFT models list according
to the official documentation: "
+
f"https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/tuning/supervised-tuning#limitations"
+ )
+ raise ValueError(msg)
+
+ return latest_available_model
Review Comment:
The idea was to have in xcom a whole dictionary for visibility from the
airflow UI and put the reference job on myself :-)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]