|
| 1 | +package com.meilisearch.sdk.model; |
| 2 | + |
| 3 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 4 | +import java.util.Map; |
| 5 | +import lombok.*; |
| 6 | +import lombok.experimental.Accessors; |
| 7 | + |
| 8 | +@Builder |
| 9 | +@AllArgsConstructor(access = AccessLevel.PACKAGE) |
| 10 | +@Getter |
| 11 | +@Setter |
| 12 | +@Accessors(chain = true) |
| 13 | +@JsonInclude(JsonInclude.Include.NON_NULL) |
| 14 | +public class Embedder { |
| 15 | + /** Source of the embedder. Accepts: ollama, rest, openAI, huggingFace and userProvided */ |
| 16 | + protected EmbedderSource source; |
| 17 | + |
| 18 | + /** |
| 19 | + * API key for authentication with the embedder service. Optional: Only applicable for openAi, |
| 20 | + * ollama, and rest sources. |
| 21 | + */ |
| 22 | + protected String apiKey; |
| 23 | + |
| 24 | + /** |
| 25 | + * Model to use for generating embeddings. Optional: Only applicable for ollama, openAI, and |
| 26 | + * huggingFace sources. |
| 27 | + */ |
| 28 | + protected String model; |
| 29 | + |
| 30 | + /** Template for document embedding. Optional. */ |
| 31 | + protected String documentTemplate; |
| 32 | + |
| 33 | + /** |
| 34 | + * Dimensions of the embedding vectors. Optional: Only applicable for openAi, huggingFace, |
| 35 | + * ollama, and rest sources. |
| 36 | + */ |
| 37 | + protected Integer dimensions; |
| 38 | + |
| 39 | + /** Distribution configuration. Optional. */ |
| 40 | + protected EmbedderDistribution distribution; |
| 41 | + |
| 42 | + /** Request configuration. Mandatory only when using rest embedder, optional otherwise. */ |
| 43 | + protected Map<String, Object> request; |
| 44 | + |
| 45 | + /** Response configuration. Mandatory only when using rest embedder, optional otherwise. */ |
| 46 | + protected Map<String, Object> response; |
| 47 | + |
| 48 | + /** Maximum bytes for document template. Optional. */ |
| 49 | + protected Integer documentTemplateMaxBytes; |
| 50 | + |
| 51 | + /** Revision identifier. Optional: Only applicable for huggingFace. */ |
| 52 | + protected String revision; |
| 53 | + |
| 54 | + /** HTTP headers. Optional: Only applicable for rest. */ |
| 55 | + protected Map<String, String> headers; |
| 56 | + |
| 57 | + /** Whether to use binary quantization. Optional. */ |
| 58 | + protected Boolean binaryQuantized; |
| 59 | + |
| 60 | + /** URL for the embedder service. Optional. */ |
| 61 | + protected String url; |
| 62 | + |
| 63 | + /** Input fields for the embedder. Optional. */ |
| 64 | + protected String[] inputField; |
| 65 | + |
| 66 | + /** Type of input for the embedder. Optional. */ |
| 67 | + protected EmbedderInputType inputType; |
| 68 | + |
| 69 | + /** Query for the embedder. Optional. */ |
| 70 | + protected String query; |
| 71 | + |
| 72 | + public Embedder() {} |
| 73 | +} |
0 commit comments