Skip to content

Commit

Permalink
Removing unneeded function.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed Nov 17, 2023
1 parent 20a005e commit 984d313
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 39 deletions.
35 changes: 0 additions & 35 deletions src/main/java/ai/philterd/philter/PhilterClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,41 +258,6 @@ public ExplainResponse explain(String context, String documentId, String policyN

}

/**
* Gets the values replaced during a previous filter request. Philter's store feature must be enabled
* for this call to work. Check Philter's documentation for how to enable the store.
* @param documentId The document ID.
* @return A list of {@link FilteredSpan spans}.
* @throws IOException Thrown if the request can not be completed.
*/
public List<FilteredSpan> replacements(String documentId) throws IOException {

final Response<List<FilteredSpan>> response = service.replacements(documentId).execute();

if(response.isSuccessful()) {

return response.body();

} else {

if(response.code() == 401) {

throw new UnauthorizedException(UNAUTHORIZED);

} else if(response.code() == 503) {

throw new ServiceUnavailableException(SERVICE_UNAVAILABLE);

} else {

throw new ClientException("Unknown error: HTTP " + response.code());

}

}

}

/**
* Gets the status of Philter.
* @return A {@link StatusResponse} object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,12 @@ public interface PhilterService {
@POST("/api/explain")
Call<ExplainResponse> explain(@Query("c") String context, @Query("d") String documentId, @Query("p") String policyName, @Body String text);

@GET("/api/replacements")
Call<List<FilteredSpan>> replacements(@Query("d") String documentId);

// Status

@GET("/api/status")
Call<StatusResponse> status();

// Filter Profiles
// Policies

@Headers({"Accept: application/json"})
@GET("/api/policies")
Expand Down

0 comments on commit 984d313

Please sign in to comment.