Cleanup ENABLE_TASKV2_METADATA_CURRENT_URL_VALIDATION experiment (#3836)
This commit is contained in:
committed by
GitHub
parent
1f90055672
commit
47899085cf
@@ -263,7 +263,6 @@ async def initialize_task_v2_metadata(
|
||||
user_prompt: str | None,
|
||||
current_browser_url: str | None,
|
||||
user_url: str | None,
|
||||
current_run_id: str,
|
||||
) -> TaskV2:
|
||||
thought = await app.DATABASE.create_thought(
|
||||
task_v2_id=task_v2.observer_cruise_id,
|
||||
@@ -272,35 +271,17 @@ async def initialize_task_v2_metadata(
|
||||
thought_scenario=ThoughtScenario.generate_metadata,
|
||||
)
|
||||
|
||||
enable_current_url_validation = await app.EXPERIMENTATION_PROVIDER.is_feature_enabled_cached(
|
||||
"ENABLE_TASKV2_METADATA_CURRENT_URL_VALIDATION",
|
||||
current_run_id,
|
||||
properties={"organization_id": task_v2.organization_id},
|
||||
metadata_prompt = prompt_engine.load_prompt(
|
||||
"task_v2_generate_metadata",
|
||||
user_goal=user_prompt,
|
||||
current_browser_url=current_browser_url or "about:blank",
|
||||
user_url=user_url,
|
||||
)
|
||||
metadata_response = await app.LLM_API_HANDLER(
|
||||
prompt=metadata_prompt,
|
||||
thought=thought,
|
||||
prompt_name="task_v2_generate_metadata",
|
||||
)
|
||||
|
||||
if enable_current_url_validation:
|
||||
metadata_prompt = prompt_engine.load_prompt(
|
||||
"task_v2_generate_metadata_with_current_url",
|
||||
user_goal=user_prompt,
|
||||
current_browser_url=current_browser_url or "about:blank",
|
||||
user_url=user_url,
|
||||
)
|
||||
metadata_response = await app.LLM_API_HANDLER(
|
||||
prompt=metadata_prompt,
|
||||
thought=thought,
|
||||
prompt_name="task_v2_generate_metadata_with_current_url",
|
||||
)
|
||||
else:
|
||||
metadata_prompt = prompt_engine.load_prompt(
|
||||
"task_v2_generate_metadata",
|
||||
user_goal=user_prompt,
|
||||
user_url=user_url,
|
||||
)
|
||||
metadata_response = await app.LLM_API_HANDLER(
|
||||
prompt=metadata_prompt,
|
||||
thought=thought,
|
||||
prompt_name="task_v2_generate_metadata",
|
||||
)
|
||||
|
||||
# validate
|
||||
LOG.info(f"Initialized task v2 initial response: {metadata_response}")
|
||||
@@ -587,7 +568,6 @@ async def run_task_v2_helper(
|
||||
user_prompt=task_v2.prompt,
|
||||
current_browser_url=current_url,
|
||||
user_url=task_v2.url,
|
||||
current_run_id=current_run_id,
|
||||
)
|
||||
url = str(task_v2.url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user