|
1 | 1 | /*
|
2 |
| -* Copyright 2022 Basis Technology Corp. |
3 |
| -* |
4 |
| -* Licensed under the Apache License, Version 2.0 (the "License"); |
5 |
| -* you may not use this file except in compliance with the License. |
6 |
| -* You may obtain a copy of the License at |
7 |
| -* |
8 |
| -* http://www.apache.org/licenses/LICENSE-2.0 |
9 |
| -* |
10 |
| -* Unless required by applicable law or agreed to in writing, software |
11 |
| -* distributed under the License is distributed on an "AS IS" BASIS, |
12 |
| -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 |
| -* See the License for the specific language governing permissions and |
14 |
| -* limitations under the License. |
15 |
| -*/ |
| 2 | + * Copyright 2023 Basis Technology Corp. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
16 | 16 | package com.basistech.rosette.examples;
|
17 | 17 |
|
18 | 18 | import com.basistech.rosette.api.HttpRosetteAPI;
|
19 | 19 | import com.basistech.rosette.apimodel.DocumentRequest;
|
| 20 | +import com.basistech.rosette.apimodel.EmbeddingsMode; |
20 | 21 | import com.basistech.rosette.apimodel.SemanticVectorsOptions;
|
21 | 22 | import com.basistech.rosette.apimodel.SemanticVectorsResponse;
|
22 | 23 |
|
@@ -50,6 +51,9 @@ private void run() throws IOException {
|
50 | 51 | // When no options, use <?>.
|
51 | 52 | DocumentRequest<SemanticVectorsOptions> request = DocumentRequest.<SemanticVectorsOptions>builder()
|
52 | 53 | .content(semanticVectorsData)
|
| 54 | + .options(SemanticVectorsOptions.builder() |
| 55 | + .embeddingsMode(EmbeddingsMode.GEN_1) |
| 56 | + .build()) |
53 | 57 | .build();
|
54 | 58 | SemanticVectorsResponse response = rosetteApi.perform(SEMANTIC_VECTORS_SERVICE_PATH, request, SemanticVectorsResponse.class);
|
55 | 59 | System.out.println(responseToJson(response));
|
|
0 commit comments