Merge pull request 'Bug Fixes. Workflow Engine' (#81) from develop into main
Reviewed-on: #81
This commit is contained in:
commit
46b703e5a2
|
|
@ -158,7 +158,8 @@ def parse_decision_questions(section_text: str) -> Dict[str, str]:
|
||||||
for pattern in patterns:
|
for pattern in patterns:
|
||||||
matches = re.finditer(pattern, section_text, re.MULTILINE | re.IGNORECASE)
|
matches = re.finditer(pattern, section_text, re.MULTILINE | re.IGNORECASE)
|
||||||
for match in matches:
|
for match in matches:
|
||||||
question_type = match.group(1).strip().lower()
|
# Preserve original case for question IDs (e.g., "qAnalyst" not "qanalyst")
|
||||||
|
question_type = match.group(1).strip()
|
||||||
answer = match.group(2).strip()
|
answer = match.group(2).strip()
|
||||||
|
|
||||||
# Entferne Klammern und Whitespace
|
# Entferne Klammern und Whitespace
|
||||||
|
|
|
||||||
|
|
@ -1488,6 +1488,14 @@ async def execute_unified_prompt(
|
||||||
'vitalwerte': 7
|
'vitalwerte': 7
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Wrapper function to match workflow_executor's expected signature: (prompt, model) -> str
|
||||||
|
# workflow_executor calls: openrouter_call_func(prompt, "anthropic/claude-sonnet-4")
|
||||||
|
# but call_openrouter expects: call_openrouter(prompt, max_tokens=4096)
|
||||||
|
async def workflow_llm_call(prompt: str, model: str = None) -> str:
|
||||||
|
# Ignore model parameter (already set in OPENROUTER_MODEL env var)
|
||||||
|
# Use default max_tokens=4096 from call_openrouter
|
||||||
|
return await call_openrouter(prompt)
|
||||||
|
|
||||||
# Execute with prompt_executor
|
# Execute with prompt_executor
|
||||||
# Always enable debug when saving to collect metadata for value table
|
# Always enable debug when saving to collect metadata for value table
|
||||||
result = await execute_prompt_with_data(
|
result = await execute_prompt_with_data(
|
||||||
|
|
@ -1495,7 +1503,7 @@ async def execute_unified_prompt(
|
||||||
profile_id=profile_id,
|
profile_id=profile_id,
|
||||||
modules=modules,
|
modules=modules,
|
||||||
timeframes=timeframes,
|
timeframes=timeframes,
|
||||||
openrouter_call_func=call_openrouter,
|
openrouter_call_func=workflow_llm_call, # Use wrapper with correct signature
|
||||||
enable_debug=debug or save # Enable debug if saving for metadata collection
|
enable_debug=debug or save # Enable debug if saving for metadata collection
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,11 +86,19 @@ async def execute_workflow_endpoint(
|
||||||
"type": "workflow"
|
"type": "workflow"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Wrapper function to match workflow_executor's expected signature: (prompt, model) -> str
|
||||||
|
# workflow_executor calls: openrouter_call_func(prompt, "anthropic/claude-sonnet-4")
|
||||||
|
# but call_openrouter expects: call_openrouter(prompt, max_tokens=4096)
|
||||||
|
async def workflow_llm_call(prompt: str, model: str) -> str:
|
||||||
|
# Ignore model parameter (already set in OPENROUTER_MODEL env var)
|
||||||
|
# Use default max_tokens=4096 from call_openrouter
|
||||||
|
return await call_openrouter(prompt)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = await execute_workflow_prompt(
|
result = await execute_workflow_prompt(
|
||||||
prompt=workflow_prompt,
|
prompt=workflow_prompt,
|
||||||
variables=variables,
|
variables=variables,
|
||||||
openrouter_call_func=call_openrouter,
|
openrouter_call_func=workflow_llm_call, # Use wrapper with correct signature
|
||||||
enable_debug=request.enable_debug
|
enable_debug=request.enable_debug
|
||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ export function QuestionAugmentationPanel({ node, onChange }) {
|
||||||
|
|
||||||
{questions.map((q, idx) => (
|
{questions.map((q, idx) => (
|
||||||
<QuestionEditor
|
<QuestionEditor
|
||||||
key={q.id}
|
key={idx}
|
||||||
question={q}
|
question={q}
|
||||||
index={idx}
|
index={idx}
|
||||||
onChange={(field, value) => handleQuestionChange(idx, field, value)}
|
onChange={(field, value) => handleQuestionChange(idx, field, value)}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user