Skip to content

Commit

Permalink
fix: the field is indeed wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouhaoJiang committed Jun 24, 2024
1 parent 1d652e6 commit ad7fbc7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions api/core/ops/entities/trace_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@


class BaseTraceInfo(BaseModel):
message_id: str
message_id: Optional[str] = None
message_data: Any
inputs: Union[str, dict[str, Any], list, None]
outputs: Union[str, dict[str, Any], list, None]
start_time: datetime
end_time: datetime
start_time: Optional[datetime] = None
end_time: Optional[datetime] = None
metadata: dict[str, Any]


Expand Down
4 changes: 2 additions & 2 deletions api/core/ops/langfuse_trace/langfuse_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def message_trace(
"total_tokens": trace_info.total_tokens,
"error": trace_info.error,
"provider_response_latency": message_data.provider_response_latency,
"created_at": trace_info.start_at,
"created_at": trace_info.start_time,
},
output=trace_info.outputs,
metadata=metadata,
Expand All @@ -179,7 +179,7 @@ def message_trace(
langfuse_generation_data = LangfuseGeneration(
name=f"generation_{message_id}",
trace_id=message_id,
start_time=trace_info.start_at,
start_time=trace_info.start_time,
end_time=trace_info.end_time,
model=message_data.model_id,
input=trace_info.inputs,
Expand Down
4 changes: 2 additions & 2 deletions api/core/ops/langsmith_trace/langsmith_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def message_trace(self, trace_info: MessageTraceInfo, **kwargs):
name=f"message_{message_id}",
inputs=trace_info.inputs,
run_type=LangSmithRunType.chain,
start_time=trace_info.start_at,
start_time=trace_info.start_time,
end_time=trace_info.end_time,
outputs=message_data.answer,
extra={
Expand All @@ -189,7 +189,7 @@ def message_trace(self, trace_info: MessageTraceInfo, **kwargs):
name=f"llm_{message_id}",
inputs=trace_info.inputs,
run_type=LangSmithRunType.llm,
start_time=trace_info.start_at,
start_time=trace_info.start_time,
end_time=trace_info.end_time,
outputs=message_data.answer,
extra={
Expand Down
2 changes: 1 addition & 1 deletion api/core/ops/trace_queue_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def message_trace(self, message_id):
inputs=inputs,
outputs=message_data.answer,
file_list=message_data.message[0].get("files", []),
start_at=created_at,
start_time=created_at,
end_time=created_at + timedelta(seconds=message_data.provider_response_latency),
metadata=metadata,
message_file_data=message_file_data,
Expand Down

0 comments on commit ad7fbc7

Please sign in to comment.