Spaces:
Running
Running
Fix metadata of trace v3
Browse files- src/workflows_v2.py +5 -23
src/workflows_v2.py
CHANGED
|
@@ -17,7 +17,7 @@ env_path = os.path.join(script_dir, '.env')
|
|
| 17 |
load_dotenv(env_path)
|
| 18 |
|
| 19 |
# --- Atla Insights Configuration ---
|
| 20 |
-
from atla_insights import configure, instrument, instrument_agno, instrument_openai, mark_success, mark_failure, tool
|
| 21 |
|
| 22 |
# Model configuration - using same model across all agents but you can change them to any model you want
|
| 23 |
DEFAULT_MODEL_ID = "gpt-4o"
|
|
@@ -169,29 +169,8 @@ def create_agents(model_id: str = DEFAULT_MODEL_ID):
|
|
| 169 |
|
| 170 |
|
| 171 |
# --- Execution function ---
|
|
|
|
| 172 |
async def startup_validation_execution(
|
| 173 |
-
workflow: Workflow,
|
| 174 |
-
execution_input: WorkflowExecutionInput,
|
| 175 |
-
startup_idea: str,
|
| 176 |
-
model_id: str = DEFAULT_MODEL_ID,
|
| 177 |
-
progress_callback=None,
|
| 178 |
-
**kwargs: Any,
|
| 179 |
-
) -> str:
|
| 180 |
-
"""Wrapper function that applies instrument decorator with dynamic metadata"""
|
| 181 |
-
|
| 182 |
-
# Apply the instrument decorator with the dynamic model_id metadata
|
| 183 |
-
instrumented_func = instrument(
|
| 184 |
-
"Startup Idea Validation Workflow",
|
| 185 |
-
metadata=get_metadata(model_id)
|
| 186 |
-
)(_startup_validation_execution_impl)
|
| 187 |
-
|
| 188 |
-
# Execute the instrumented function
|
| 189 |
-
return await instrumented_func(
|
| 190 |
-
workflow, execution_input, startup_idea, model_id, progress_callback, **kwargs
|
| 191 |
-
)
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
async def _startup_validation_execution_impl(
|
| 195 |
workflow: Workflow,
|
| 196 |
execution_input: WorkflowExecutionInput, # This is a Pydantic model to ensure type safety
|
| 197 |
startup_idea: str,
|
|
@@ -201,6 +180,9 @@ async def _startup_validation_execution_impl(
|
|
| 201 |
) -> str:
|
| 202 |
"""Execute the complete startup idea validation workflow"""
|
| 203 |
|
|
|
|
|
|
|
|
|
|
| 204 |
# Create agents with the specified model
|
| 205 |
idea_clarifier_agent, market_research_agent, competitor_analysis_agent, report_agent = create_agents(model_id)
|
| 206 |
|
|
|
|
| 17 |
load_dotenv(env_path)
|
| 18 |
|
| 19 |
# --- Atla Insights Configuration ---
|
| 20 |
+
from atla_insights import configure, instrument, instrument_agno, instrument_openai, mark_success, mark_failure, tool, set_metadata
|
| 21 |
|
| 22 |
# Model configuration - using same model across all agents but you can change them to any model you want
|
| 23 |
DEFAULT_MODEL_ID = "gpt-4o"
|
|
|
|
| 169 |
|
| 170 |
|
| 171 |
# --- Execution function ---
|
| 172 |
+
@instrument("Startup Idea Validation Workflow")
|
| 173 |
async def startup_validation_execution(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
workflow: Workflow,
|
| 175 |
execution_input: WorkflowExecutionInput, # This is a Pydantic model to ensure type safety
|
| 176 |
startup_idea: str,
|
|
|
|
| 180 |
) -> str:
|
| 181 |
"""Execute the complete startup idea validation workflow"""
|
| 182 |
|
| 183 |
+
# Set dynamic metadata for this execution
|
| 184 |
+
set_metadata(get_metadata(model_id))
|
| 185 |
+
|
| 186 |
# Create agents with the specified model
|
| 187 |
idea_clarifier_agent, market_research_agent, competitor_analysis_agent, report_agent = create_agents(model_id)
|
| 188 |
|