Clean code deprecations
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
package org.springframework.ai.openai.samples.helloworld;
|
||||
|
||||
import org.springframework.ai.chat.client.ChatClient;
|
||||
import java.util.Scanner;
|
||||
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ You can connect to the weather server using either STDIO or SSE transport:
|
||||
For servers using SSE transport:
|
||||
|
||||
```java
|
||||
var transport = new HttpClientSseClientTransport("http://localhost:8080");
|
||||
var transport = HttpClientSseClientTransport.builder("http://localhost:8080").build();
|
||||
var client = McpClient.sync(transport).build();
|
||||
```
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ You can connect to the weather server using either STDIO or SSE transport:
|
||||
For servers using SSE transport:
|
||||
|
||||
```java
|
||||
var transport = new HttpClientSseClientTransport("http://localhost:8080");
|
||||
var transport = HttpClientSseClientTransport.builder("http://localhost:8080").build();
|
||||
var client = McpClient.sync(transport).build();
|
||||
```
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.springframework.ai.mcp.sample.server;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import io.modelcontextprotocol.server.McpSyncServerExchange;
|
||||
import io.modelcontextprotocol.spec.McpSchema;
|
||||
import io.modelcontextprotocol.spec.McpSchema.CreateMessageResult;
|
||||
import io.modelcontextprotocol.spec.McpSchema.LoggingLevel;
|
||||
|
||||
@@ -24,7 +24,7 @@ import io.modelcontextprotocol.client.transport.HttpClientSseClientTransport;
|
||||
public class ClientSse {
|
||||
|
||||
public static void main(String[] args) {
|
||||
var transport = new HttpClientSseClientTransport("http://localhost:8080");
|
||||
var transport = HttpClientSseClientTransport.builder("http://localhost:8080").build();
|
||||
new SampleClient(transport).run();
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ You can connect to the weather server using either STDIO or SSE transport:
|
||||
For servers using SSE transport:
|
||||
|
||||
```java
|
||||
var transport = new HttpClientSseClientTransport("http://localhost:8080");
|
||||
var transport = HttpClientSseClientTransport.builder("http://localhost:8080").build();
|
||||
var client = McpClient.sync(transport).build();
|
||||
```
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import io.modelcontextprotocol.client.transport.HttpClientSseClientTransport;
|
||||
public class ClientSse {
|
||||
|
||||
public static void main(String[] args) {
|
||||
var transport = new HttpClientSseClientTransport("http://localhost:8080");
|
||||
var transport = HttpClientSseClientTransport.builder("http://localhost:8080").build();
|
||||
new SampleClient(transport).run();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user