-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix)(chat)Remove spaces when obtaining a MemoryReviewResult
- Loading branch information
xiuzhu
committed
Aug 23, 2024
1 parent
afa82bf
commit 0a6a7de
Showing
2 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
14 changes: 13 additions & 1 deletion
14
chat/api/src/main/java/com/tencent/supersonic/chat/api/pojo/enums/MemoryReviewResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
package com.tencent.supersonic.chat.api.pojo.enums; | ||
|
||
|
||
import com.tencent.supersonic.common.pojo.exception.InvalidArgumentException; | ||
import org.apache.commons.lang3.StringUtils; | ||
|
||
public enum MemoryReviewResult { | ||
|
||
POSITIVE, | ||
NEGATIVE | ||
NEGATIVE; | ||
|
||
public static MemoryReviewResult getMemoryReviewResult(String value) { | ||
String validValue = StringUtils.trim(value); | ||
for (MemoryReviewResult reviewRet : MemoryReviewResult.values()) { | ||
if (StringUtils.equalsIgnoreCase(reviewRet.name(), validValue)) { | ||
return reviewRet; | ||
} | ||
} | ||
throw new InvalidArgumentException("Invalid MemoryReviewResult type:[" + value +"]"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters