MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / extract_answer

Function extract_answer

src/benchmarks/chembench/evaluate.py:29–32  ·  view source on GitHub ↗

Extract the answer from [ANSWER]...[/ANSWER] tags in the response.

(response: str)

Source from the content-addressed store, hash-verified

27
28
29def extract_answer(response: str) -> str | None:
30 """Extract the answer from [ANSWER]...[/ANSWER] tags in the response."""
31 match = _FLOAT_REGEX.search(response)
32 return match.group(1).strip() if match else None
33
34
35def extract_mcq_answer(response: str) -> list[str]:

Callers 3

run_single_questionFunction · 0.90
run_singleFunction · 0.90
score_answerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected