feat: Add trace generation for all LLM calls

This commit is contained in:
3un01a 2026-04-08 14:11:46 -07:00
parent ff116b0601
commit 56d26b2fa4
3 changed files with 7 additions and 4 deletions

View File

@ -219,6 +219,7 @@ If you update it, send the full deduplicated list and remove stale entries.
messages=messages,
track_name=f"Dreamer/{self.name}",
iteration_callback=iteration_callback,
trace_name=f"dreamer_{self.name}",
)
# Log metrics

View File

@ -1499,9 +1499,9 @@ async def honcho_llm_call(
result: (
HonchoLLMCallResponse[Any] | AsyncIterator[HonchoLLMCallStreamChunk]
) = await decorated()
if trace_name and isinstance(result, HonchoLLMCallResponse):
if isinstance(result, HonchoLLMCallResponse):
log_reasoning_trace(
task_type=trace_name,
task_type=trace_name or "untagged",
llm_settings=llm_settings,
prompt=prompt,
response=result,
@ -1549,9 +1549,9 @@ async def honcho_llm_call(
stream_final=stream_final_only,
iteration_callback=iteration_callback,
)
if trace_name and isinstance(result, HonchoLLMCallResponse):
if isinstance(result, HonchoLLMCallResponse):
log_reasoning_trace(
task_type=trace_name,
task_type=trace_name or "untagged",
llm_settings=llm_settings,
prompt=prompt,
response=result,

View File

@ -215,6 +215,7 @@ async def create_short_summary(
llm_settings=settings.SUMMARY,
prompt=prompt,
max_tokens=settings.SUMMARY.MAX_TOKENS_SHORT,
trace_name="short_summary",
)
@ -240,6 +241,7 @@ async def create_long_summary(
llm_settings=settings.SUMMARY,
prompt=prompt,
max_tokens=settings.SUMMARY.MAX_TOKENS_LONG,
trace_name="long_summary",
)