Skip to content

Commit

Permalink
Fix the JSON parsing exception returned by content security risk moni…
Browse files Browse the repository at this point in the history
…toring. #49
  • Loading branch information
cuiwei1 committed Jan 10, 2025
1 parent 1d8cd96 commit 73acfc8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
package dev.langchain4j.community.model.zhipu.shared;

import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.List;
import java.util.Map;

@JsonInclude(NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ErrorResponse {
private List<SensitiveFilter> contentFilter;
private Map<String, String> error;

public Map<String, String> getError() {
Expand All @@ -12,4 +20,12 @@ public Map<String, String> getError() {
public void setError(Map<String, String> error) {
this.error = error;
}

public List<SensitiveFilter> getContentFilter() {
return contentFilter;
}

public void setContentFilter(List<SensitiveFilter> contentFilter) {
this.contentFilter = contentFilter;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dev.langchain4j.community.model.zhipu.shared;

/**
* Illegal or harmful information: Severity level.
*/
public class SensitiveFilter {
private String role;
private Integer level;

public String getRole() {
return role;
}

public void setRole(final String role) {
this.role = role;
}

public Integer getLevel() {
return level;
}

public void setLevel(final Integer level) {
this.level = level;
}
}

0 comments on commit 73acfc8

Please sign in to comment.