mcp-java8-sdk
mcp-java8-sdk copied to clipboard
问题反馈:ImageContent 和 EmbeddedResource 还没有获取属性
TextContent 有,另两个没有。
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class TextContent implements Content { // @formatter:on
@JsonProperty("audience") List<Role> audience;
@JsonProperty("priority") Double priority;
@JsonProperty("text") String text;
public TextContent(String content) {
this(null, null, content);
}
}
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonIgnoreProperties(ignoreUnknown = true)
public static class ImageContent implements Content { // @formatter:on
@JsonProperty("audience") List<Role> audience;
@JsonProperty("priority") Double priority;
@JsonProperty("data") String data;
@JsonProperty("mimeType") String mimeType;
}
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonIgnoreProperties(ignoreUnknown = true)
public static class EmbeddedResource implements Content { // @formatter:on
@JsonProperty("audience") List<Role> audience;
@JsonProperty("priority") Double priority;
@JsonProperty("resource") ResourceContents resource;
}
提交了个 pr 了。。。并添加了 solon 的适配。。。这是适配后的应用效果:
https://solon.noear.org/article/994
最好把单测也迁过来。。。不然,没法确认正确性
ok。好像单元测试也挺多的偷懒了……其实这个仓库也是随手顺便上传的
@krrr 即然开搞了,建议好好搞下:)
已加单元测试
帅呀!。。。拉个分支,可以同步 0.9.0 的代码了:)