Get the texts as a vector
(&self)
| 83 | impl EmbeddingInput { |
| 84 | /// Get the texts as a vector |
| 85 | pub fn as_texts(&self) -> Vec<&str> { |
| 86 | match self { |
| 87 | Self::Single(text) => vec![text.as_str()], |
| 88 | Self::Multiple(texts) => texts.iter().map(String::as_str).collect(), |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | /// Get the number of texts |
| 93 | pub fn len(&self) -> usize { |
no outgoing calls