|
16 | 16 | package ch.xxx.mcpserver.config;
|
17 | 17 |
|
18 | 18 | import org.springframework.ai.tool.annotation.Tool;
|
19 |
| -import org.springframework.context.annotation.Bean; |
20 |
| -import org.springframework.context.annotation.Configuration; |
| 19 | +import org.springframework.stereotype.Service; |
21 | 20 |
|
22 |
| -import ch.xxx.mcpserver.client.OpenLibraryRestClient; |
| 21 | +import ch.xxx.mcpserver.client.external.OpenLibraryClient; |
23 | 22 | import ch.xxx.mcpserver.client.external.TmdbClient;
|
24 | 23 |
|
25 |
| -@Configuration |
| 24 | +@Service |
26 | 25 | public class FunctionConfig {
|
27 |
| - private final OpenLibraryRestClient openLibraryClient; |
| 26 | + private final OpenLibraryClient openLibraryClient; |
28 | 27 | private final TmdbClient tmdbClient;
|
29 | 28 | public static final String OPEN_LIBRARY_CLIENT = "openLibraryClient";
|
30 | 29 | public static final String THE_MOVIE_DATABASE_CLIENT = "theMovieDatabaseClient";
|
31 | 30 |
|
32 |
| - public FunctionConfig(OpenLibraryRestClient openLibraryClient, TmdbClient tmdbClient) { |
| 31 | + public FunctionConfig(OpenLibraryClient openLibraryClient, TmdbClient tmdbClient) { |
33 | 32 | this.openLibraryClient = openLibraryClient;
|
34 | 33 | this.tmdbClient = tmdbClient;
|
35 | 34 | }
|
36 |
| - |
37 |
| - @Bean(OPEN_LIBRARY_CLIENT) |
| 35 | + /* |
| 36 | + @Tool(description="Test") |
| 37 | + public String test() { |
| 38 | + return "Test successful"; |
| 39 | + } |
| 40 | +*/ |
| 41 | + |
38 | 42 | @Tool(description = "Search for books by author, title or subject.")
|
39 |
| - public OpenLibraryRestClient.Response openLibraryClient(OpenLibraryRestClient.Request request) { |
| 43 | + public OpenLibraryClient.Response openLibraryClient(OpenLibraryClient.Request request) { |
40 | 44 | return this.openLibraryClient.loadBooks(request);
|
41 | 45 | }
|
42 |
| - |
43 |
| - @Bean(THE_MOVIE_DATABASE_CLIENT) |
| 46 | + |
44 | 47 | @Tool(description = "Search for movies by title.")
|
45 | 48 | public TmdbClient.Response theMovieDatabaseClient(TmdbClient.Request request) {
|
46 | 49 | return this.tmdbClient.loadMovies(request);
|
|
0 commit comments