feat(solon-webrx): Add solon-webrx adaptive - #110
Closed
noear wants to merge 0 commit into
Closed
Conversation
Contributor
|
Very interesting. Thank you for the contribution @noear ! |
Author
|
Hope to support java8! solon supports java8 through java24! vert.x also supports java8+ |
Author
|
This is what solon (Solon-AI) looks like with mcp integrated: for Server (Support for multiple endpoints)@McpServerEndpoint(sseEndpoint = "/mcp/sse")
public class McpServerTool {
@ToolMapping(description = "查询天气预报")
public String getWeather(@Param(description = "城市位置") String location) {
return "晴,14度";
}
@ResourceMapping(uri = "config://app-version", description = "获取应用版本号")
public String getAppVersion() {
return "v3.2.0";
}
@ResourceMapping(uri = "db://users/{user_id}/email", description = "根据用户ID查询邮箱")
public String getEmail(@Param(description = "用户Id") String user_id) {
return user_id + "@example.com";
}
@PromptMapping(description = "生成关于某个主题的提问")
public Collection<ChatMessage> askQuestion(@Param(description = "主题") String topic) {
return Arrays.asList(
ChatMessage.ofUser("请解释一下'" + topic + "'的概念?")
);
}
}
public class McpServerApp {
public static void main(String[] args) {
Solon.start(McpServerApp.class, args);
}
}for Clientpublic class McpClientApp {
public static void main(String[] args) throws Exception {
McpClientProvider clientToolProvider = McpClientProvider.builder()
.apiUrl("http://localhost:8080/mcp/sse")
.build();
ChatModel chatModel = ChatModel.of("http://127.0.0.1:11434/api/chat")
.provider("ollama")
.model("qwen2.5:1.5b")
.defaultToolsAdd(clientToolProvider)
.build();
ChatResponse resp = chatModel.prompt("杭州今天的天气怎么样?")
.call();
}
} |
Author
|
What else is wrong with this pr? |
Member
Author
|
The change of v0.10.0 WebFluxSseServerTransportProvider is synchronized to the WebRxSseServerTransportProvider |
Author
|
Excuse me, how long does it take to check generally? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Add solon-webrx adaptive。
Solon is a java enterprise application development framework similar to spring. There is no java-ee. support for java8 ~ java24, and native runtime.
How Has This Been Tested?
junit run mcp-solon/mcp-solon-webrx/src/test/java
Breaking Changes
add module: mcp-solon/mcp-solon-webrx
Types of changes
Checklist
Additional context
mcp-solon-webrx references the code and unit tests of mcp-spring-webmvc and mcp-spring-webflux