File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
volcengine-java-sdk-llmshield/src/main/java/com/volcengine/llmshield Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -65,4 +65,13 @@ public void setContentType(ContentTypeV2 contentType) {
6565 public List <MultiPart > getMultiPart () { return multiPart ; }
6666
6767 public void setMultiPart (List <MultiPart > multiPart ) { this .multiPart = multiPart ; }
68+
69+ // 追加单条历史消息
70+ public MessageV2 appendMultiPart (MultiPart contPart ) {
71+ if (this .multiPart == null ) {
72+ this .multiPart = new ArrayList <>();
73+ }
74+ this .multiPart .add (contPart );
75+ return this ; // 支持链式调用
76+ }
6877}
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ public MultiPart(MultiPart other) {
1616 this .contentType = other .contentType ;
1717 }
1818
19+ // 无参构造方法(保留,用于JSON反序列化等场景)
20+ public MultiPart () {}
1921 public String getContent () { return content ; }
2022
2123 public void setContent (String content ) { this .content = content ; }
You can’t perform that action at this time.
0 commit comments