Skip to content

Commit

Permalink
Merge branch 'main' of github.com:philterd/philter-sdk-java
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed Jul 1, 2024
2 parents 353bca0 + b95aec6 commit 48ef650
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Release dependencies are available in Maven Central.

```
<dependency>
<groupId>com.mtnfog</groupId>
<groupId>ai.philterd</groupId>
<artifactId>philter-sdk-java</artifactId>
<version>1.3.0</version>
</dependency>
Expand Down
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 string containing the status of Philter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,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<String> status();

// Filter Profiles
// Policies

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

0 comments on commit 48ef650

Please sign in to comment.