Skip to content

Commit 74f6f2c

Browse files
committed
Revert "reasoning tokens and quoting"
This reverts commit a20dee9.
1 parent 857ba0a commit 74f6f2c

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

src/eva/assistant/agentic/system.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,13 @@ async def _run_tool_loop(
201201
"response": response_content,
202202
"prompt_tokens": llm_stats.get("prompt_tokens", 0),
203203
"output_tokens": llm_stats.get("completion_tokens", 0),
204-
"reasoning_tokens": llm_stats.get("reasoning_tokens", 0),
205204
"cost": llm_stats.get("cost", 0.0),
206205
"cost_source": llm_stats.get("cost_source", "unknown"),
207206
"stop_reason": llm_stats.get("finish_reason", "unknown"),
208207
"latency": llm_stats.get("latency", 0.0),
209208
"parameters": json.dumps(llm_stats.get("parameters", {})),
210209
"tool_calls": json.dumps(response_tool_calls_for_stats) if response_tool_calls_for_stats else "",
211-
"reasoning": f'"{llm_stats.get("reasoning", "")}"',
210+
"reasoning": llm_stats.get("reasoning_content", ""),
212211
}
213212
self.agent_perf_stats.append(perf_stat)
214213
logger.debug(
@@ -376,16 +375,15 @@ def save_agent_perf_stats(self) -> None:
376375
fieldnames = [
377376
"prompt",
378377
"response",
379-
"reasoning",
380378
"prompt_tokens",
381379
"output_tokens",
382-
"reasoning_tokens",
383380
"cost",
384381
"cost_source",
385382
"stop_reason",
386383
"parameters",
387384
"tool_calls",
388385
"latency",
386+
"reasoning"
389387
]
390388
writer = csv.DictWriter(f, fieldnames=fieldnames)
391389
writer.writeheader()

src/eva/assistant/pipeline/alm_vllm.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,10 @@ async def complete(
200200

201201
# Extract reasoning if present (OpenAI o1 and compatible models)
202202
reasoning = getattr(message, "reasoning_content", None)
203-
reasoning_tokens = getattr(usage, "reasoning_tokens", 0) if usage else 0
204203

205204
stats = {
206205
"prompt_tokens": usage.prompt_tokens if usage else 0,
207206
"completion_tokens": usage.completion_tokens if usage else 0,
208-
"reasoning_tokens": reasoning_tokens,
209207
"finish_reason": response.choices[0].finish_reason or "unknown",
210208
"model": response.model or self.model,
211209
"cost": 0.0, # Self-hosted, no API cost

src/eva/assistant/services/llm.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ async def complete(
7474
usage = getattr(response, "usage", None)
7575
prompt_tokens = getattr(usage, "prompt_tokens", 0) if usage else 0
7676
completion_tokens = getattr(usage, "completion_tokens", 0) if usage else 0
77-
reasoning_tokens = getattr(usage, "reasoning_tokens", 0) if usage else 0
7877
finish_reason = getattr(response.choices[0], "finish_reason", "unknown")
7978
model = getattr(response, "model", self.model)
8079
hidden_params = getattr(response, "_hidden_params", {}) or {}
@@ -87,7 +86,6 @@ async def complete(
8786
stats = {
8887
"prompt_tokens": prompt_tokens,
8988
"completion_tokens": completion_tokens,
90-
"reasoning_tokens": reasoning_tokens,
9189
"finish_reason": finish_reason,
9290
"model": model,
9391
"cost": response_cost,

tests/unit/assistant/test_agentic_system.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def test_simple_response(self):
6767
llm_client.complete = AsyncMock(
6868
return_value=(
6969
_make_llm_response("Hello, how can I help you?"),
70-
{"prompt_tokens": 10, "completion_tokens": 5, "reasoning_tokens": 0, "finish_reason": "stop"},
70+
{"prompt_tokens": 10, "completion_tokens": 5, "finish_reason": "stop"},
7171
)
7272
)
7373

@@ -117,11 +117,11 @@ async def test_single_tool_call_then_response(self):
117117
side_effect=[
118118
(
119119
_make_llm_response("What if there is text here", tool_calls=[tool_call]),
120-
{"prompt_tokens": 20, "completion_tokens": 10, "reasoning_tokens": 0, "finish_reason": "tool_calls"},
120+
{"prompt_tokens": 20, "completion_tokens": 10, "finish_reason": "tool_calls"},
121121
),
122122
(
123123
_make_llm_response("Your reservation ABC123 is confirmed."),
124-
{"prompt_tokens": 30, "completion_tokens": 15, "reasoning_tokens": 0, "finish_reason": "stop"},
124+
{"prompt_tokens": 30, "completion_tokens": 15, "finish_reason": "stop"},
125125
),
126126
]
127127
)
@@ -204,11 +204,11 @@ async def test_tool_call_with_error_result(self):
204204
side_effect=[
205205
(
206206
_make_llm_response("", tool_calls=[tool_call]),
207-
{"prompt_tokens": 20, "completion_tokens": 10, "reasoning_tokens": 0, "finish_reason": "tool_calls"},
207+
{"prompt_tokens": 20, "completion_tokens": 10, "finish_reason": "tool_calls"},
208208
),
209209
(
210210
_make_llm_response("I couldn't find that reservation."),
211-
{"prompt_tokens": 30, "completion_tokens": 10, "reasoning_tokens": 0, "finish_reason": "stop"},
211+
{"prompt_tokens": 30, "completion_tokens": 10, "finish_reason": "stop"},
212212
),
213213
]
214214
)
@@ -291,7 +291,7 @@ async def test_transfer_to_agent(self):
291291
llm_client.complete = AsyncMock(
292292
return_value=(
293293
_make_llm_response("", tool_calls=[tool_call]),
294-
{"prompt_tokens": 20, "completion_tokens": 5, "reasoning_tokens": 0, "finish_reason": "tool_calls"},
294+
{"prompt_tokens": 20, "completion_tokens": 5, "finish_reason": "tool_calls"},
295295
)
296296
)
297297

0 commit comments

Comments
 (0)