We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 47fb628 + d7ff1c7 commit c978583Copy full SHA for c978583
1 file changed
src/Agents/Agent.php
@@ -131,4 +131,25 @@ public function embed(string $text): array
131
132
return $this->adapter->embed($text);
133
}
134
+
135
+ /**
136
+ * Get embeddings for a batch of input texts using underlying adapter (if supported)
137
+ *
138
+ * @param array<int, string> $texts
139
+ * @return array{
140
+ * embeddings: array<int, array<int, float>>,
141
+ * tokensProcessed: int|null,
142
+ * totalDuration: int|null,
143
+ * }
144
145
+ * @throws \Exception
146
+ */
147
+ public function bulkEmbed(array $texts): array
148
+ {
149
+ if (! $this->adapter->getSupportForEmbeddings()) {
150
+ throw new \Exception('This adapter does not support embedding/embedding API.');
151
+ }
152
153
+ return $this->adapter->bulkEmbed($texts);
154
155
0 commit comments