feat: Add trace generation for all LLM calls
This commit is contained in:
parent
ff116b0601
commit
56d26b2fa4
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue