This commit is contained in:
jinli.yl 2025-06-20 12:36:51 +08:00
parent 34b16ab1b1
commit e8d7e093f7
2 changed files with 7 additions and 2 deletions

View file

@ -291,7 +291,7 @@ class StepContextGenerator(BaseContextGenerator, PromptMixin):
return [int(num) for num in numbers]
except Exception as e:
logger.error(f"Error parsing rerank response: {e}")
logger.exception(f"Error parsing rerank response: {e}")
return []
def _format_experiences_for_context(self, experiences: List[VectorStoreNode]) -> str:

View file

@ -362,7 +362,12 @@ class StepSummarizer(BaseSummarizer, PromptMixin):
# Parse validation result
is_valid = "valid" in response_content.lower() and "invalid" not in response_content.lower()
score_match = re.search(r'score[:\s]*([0-9.]+)', response_content.lower())
score = float(score_match.group(1)) if score_match else 0.5
# add by jinli 0620
try:
score = float(score_match.group(1)) if score_match else 0.5
except Exception:
score = -1
return {
"is_valid": is_valid and score > 0.3,