3737import com .comet .opik .domain .FeedbackScoreService ;
3838import com .comet .opik .domain .ProjectService ;
3939import com .comet .opik .domain .Streamer ;
40+ import com .comet .opik .domain .ThreadService ;
4041import com .comet .opik .domain .TraceSearchCriteria ;
4142import com .comet .opik .domain .TraceService ;
4243import com .comet .opik .domain .threads .TraceThreadService ;
105106public class TracesResource {
106107
107108 private final @ NonNull TraceService service ;
109+ private final @ NonNull ThreadService threadService ;
108110 private final @ NonNull FeedbackScoreService feedbackScoreService ;
109111 private final @ NonNull CommentService commentService ;
110112 private final @ NonNull FiltersFactory filtersFactory ;
@@ -639,7 +641,7 @@ public Response getTraceThreads(
639641
640642 log .info ("Get trace threads by '{}' on workspaceId '{}'" , searchCriteria , workspaceId );
641643
642- TraceThreadPage traceThreadPage = service . getTraceThreads (page , size , searchCriteria )
644+ TraceThreadPage traceThreadPage = threadService . find (page , size , searchCriteria )
643645 .map (it -> {
644646 // Remove sortableBy fields if dynamic sorting is disabled due to workspace size
645647 if (metadata .cannotUseDynamicSorting ()) {
@@ -690,7 +692,7 @@ public ChunkedOutput<JsonNode> searchTraceThreads(
690692 .uuidToTime (instantToUUIDMapper .toUpperBound (request .toTime ()))
691693 .build ();
692694
693- Flux <TraceThread > items = service . threadsSearch (request .limit (), searchCriteria )
695+ Flux <TraceThread > items = threadService . search (request .limit (), searchCriteria )
694696 .contextWrite (ctx -> ctx .put (RequestContext .WORKSPACE_ID , workspaceId )
695697 .put (RequestContext .USER_NAME , userName )
696698 .put (RequestContext .VISIBILITY , Optional .ofNullable (visibility ).orElse (Visibility .PRIVATE )));
@@ -716,7 +718,7 @@ public Response getTraceThread(
716718 log .info ("Getting trace thread by id '{}' and project id '{}' on workspace_id '{}' with truncate '{}'" ,
717719 identifier .threadId (), projectId , workspaceId , identifier .truncate ());
718720
719- TraceThread thread = service . getThreadById (projectId , identifier .threadId (), identifier .truncate ())
721+ TraceThread thread = threadService . getById (projectId , identifier .threadId (), identifier .truncate ())
720722 .contextWrite (ctx -> setRequestContext (ctx , requestContext ))
721723 .block ();
722724
@@ -877,7 +879,7 @@ public Response getThreadStats(@QueryParam("project_id") UUID projectId,
877879
878880 log .info ("Get trace thread stats by '{}' on workspaceId '{}'" , searchCriteria , workspaceId );
879881
880- ProjectStats projectStats = service . getThreadStats (searchCriteria )
882+ ProjectStats projectStats = threadService . getStats (searchCriteria )
881883 .contextWrite (ctx -> setRequestContext (ctx , requestContext ))
882884 .block ();
883885
0 commit comments