Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions camel/agents/chat_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1781,8 +1781,18 @@ def summarize(
# convert structured output to custom markdown if present
if structured_output:
# convert structured output to custom markdown
# exclude operation_mode and target_workflow_filename
# if present (used for workflow save logic, not persisted)
exclude_fields = []
if hasattr(structured_output, 'operation_mode'):
exclude_fields.append('operation_mode')
if hasattr(structured_output, 'target_workflow_filename'):
exclude_fields.append('target_workflow_filename')

summary_content = context_util.structured_output_to_markdown(
structured_data=structured_output, metadata=metadata
structured_data=structured_output,
metadata=metadata,
exclude_fields=exclude_fields if exclude_fields else None,
)
if add_user_messages:
summary_content = self._append_user_messages_section(
Expand Down Expand Up @@ -2215,8 +2225,18 @@ async def asummarize(
# convert structured output to custom markdown if present
if structured_output:
# convert structured output to custom markdown
# exclude operation_mode and target_workflow_filename
# if present (used for workflow save logic, not persisted)
exclude_fields = []
if hasattr(structured_output, 'operation_mode'):
exclude_fields.append('operation_mode')
if hasattr(structured_output, 'target_workflow_filename'):
exclude_fields.append('target_workflow_filename')

summary_content = context_util.structured_output_to_markdown(
structured_data=structured_output, metadata=metadata
structured_data=structured_output,
metadata=metadata,
exclude_fields=exclude_fields if exclude_fields else None,
)
if add_user_messages:
summary_content = self._append_user_messages_section(
Expand Down
30 changes: 15 additions & 15 deletions camel/benchmarks/browsecomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class QueryResponse(BaseModel):
)
exact_answer: str = Field(description="""your succinct, final answer.""")
confidence: str = Field(
description="""
description=r"""
your confidence score between 0|\%| and 100|\%| for your answer.
"""
)
Expand Down Expand Up @@ -92,7 +92,7 @@ class GradingResponse(BaseModel):
incorrect."""
)
confidence: str = Field(
description="""The extracted confidence score between 0|\%|
description=r"""The extracted confidence score between 0|\%|
and 100|\%| from [response]. Put 100 if there is no confidence score available.
"""
)
Expand Down Expand Up @@ -160,8 +160,8 @@ class EvalResult(BaseModel):
{content}
"""

GRADER_TEMPLATE = """
Judge whether the following [response] to [question] is correct or not
GRADER_TEMPLATE = r"""
Judge whether the following [response] to [question] is correct or not
based on the precise and unambiguous [correct_answer] below.

[question]: {question}
Expand All @@ -171,26 +171,26 @@ class EvalResult(BaseModel):
Your judgement must be in the format and criteria specified below:

extracted_final_answer: The final exact answer extracted from the [response].
Put the extracted answer as 'None' if there is no exact, final answer to
Put the extracted answer as 'None' if there is no exact, final answer to
extract from the response.

[correct_answer]: {correct_answer}

reasoning: Explain why the extracted_final_answer is correct or incorrect
based on [correct_answer], focusing only on if there are meaningful
differences between [correct_answer] and the extracted_final_answer.
Do not comment on any background to the problem, do not attempt
to solve the problem, do not argue for any answer different
reasoning: Explain why the extracted_final_answer is correct or incorrect
based on [correct_answer], focusing only on if there are meaningful
differences between [correct_answer] and the extracted_final_answer.
Do not comment on any background to the problem, do not attempt
to solve the problem, do not argue for any answer different
than [correct_answer], focus only on whether the answers match.

correct: Answer 'yes' if extracted_final_answer matches the
[correct_answer] given above, or is within a small margin of error for
numerical problems. Answer 'no' otherwise, i.e. if there is any
inconsistency, ambiguity, non-equivalency, or if the extracted answer is
correct: Answer 'yes' if extracted_final_answer matches the
[correct_answer] given above, or is within a small margin of error for
numerical problems. Answer 'no' otherwise, i.e. if there is any
inconsistency, ambiguity, non-equivalency, or if the extracted answer is
incorrect.


confidence: The extracted confidence score between 0|\%| and 100|\%|
confidence: The extracted confidence score between 0|\%| and 100|\%|
from [response]. Put 100 if there is no confidence score available.
""".strip()

Expand Down
Loading
Loading