|
| 1 | +/** |
| 2 | + * Copyright 2023 Sven Loesekann |
| 3 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | + you may not use this file except in compliance with the License. |
| 5 | + You may obtain a copy of the License at |
| 6 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | + Unless required by applicable law or agreed to in writing, software |
| 8 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | + See the License for the specific language governing permissions and |
| 11 | + limitations under the License. |
| 12 | + */ |
| 13 | +package ch.xxx.mcpserver.client.external; |
| 14 | + |
| 15 | +import java.util.Map; |
| 16 | +import java.util.function.Function; |
| 17 | + |
| 18 | +import org.springframework.ai.tool.annotation.ToolParam; |
| 19 | + |
| 20 | +/** |
| 21 | + * |
| 22 | + * @author sven |
| 23 | + */ |
| 24 | +public interface TmdbClient extends Function<TmdbClient.Request, TmdbClient.Response> { |
| 25 | + public static final Map<Integer, String> GENRE_MAP = Map.ofEntries( |
| 26 | + Map.entry(28, "Action"), |
| 27 | + Map.entry(12, "Adventure"), |
| 28 | + Map.entry(16, "Animation"), |
| 29 | + Map.entry(35, "Comedy"), |
| 30 | + Map.entry(80, "Crime"), |
| 31 | + Map.entry(99, "Documentary"), |
| 32 | + Map.entry(18, "Drama"), |
| 33 | + Map.entry(10751, "Family"), |
| 34 | + Map.entry(14, "Fantasy"), |
| 35 | + Map.entry(36, "History"), |
| 36 | + Map.entry(27, "Horror"), |
| 37 | + Map.entry(10402, "Music"), |
| 38 | + Map.entry(9648, "Mystery"), |
| 39 | + Map.entry(10749, "Romance"), |
| 40 | + Map.entry(878, "Science Fiction"), |
| 41 | + Map.entry(10770, "TV Movie"), |
| 42 | + Map.entry(53, "Thriller"), |
| 43 | + Map.entry(10752, "War"), |
| 44 | + Map.entry(37, "Western") |
| 45 | + ); |
| 46 | + |
| 47 | + record Request(@ToolParam(description = "The movie title") String query) { |
| 48 | + } |
| 49 | + |
| 50 | + record Response(Integer page, Integer total_pages, Integer total_results, Movie[] results) { } |
| 51 | + |
| 52 | + record Movie(boolean adult, String backdrop_path, Integer[] genere_ids, Long id, String original_language, |
| 53 | + String original_title, String overview, Double popularity, String poster_path, String release_date, String title, |
| 54 | + boolean video, Double vote_average, Integer vote_count) { } |
| 55 | +} |
0 commit comments