diff --git a/docs/core-concepts/embeddings.md b/docs/core-concepts/embeddings.md index 2fcbc95..7c09a21 100644 --- a/docs/core-concepts/embeddings.md +++ b/docs/core-concepts/embeddings.md @@ -16,12 +16,26 @@ $response = Prism::embeddings() ->generate(); // Get your embeddings vector -$embeddings = $response->embeddings; +$embeddings = $response->embeddings[0]; // Check token usage echo $response->usage->tokens; ``` +Each vector index corresponds to the input text index when sending multiple chunks: + +```php +$response = Prism::embeddings() + ->using(Provider::OpenAI, 'text-embedding-3-large') + ->fromInput(['Your text here', 'Another text here']) + ->generate(); +``` + +```php +// Get the embeddings vectors +$vectors = $response->embeddings; +``` + ## Input Methods You've got two convenient ways to feed text into the embeddings generator: @@ -68,7 +82,7 @@ The embeddings response gives you everything you need: ```php // Get the embeddings vector -$vector = $response->embeddings; +$vector = $response->embeddings[0]; // Check token usage $tokenCount = $response->usage->tokens; diff --git a/src/Embeddings/Generator.php b/src/Embeddings/Generator.php index 32afb31..7a636d4 100644 --- a/src/Embeddings/Generator.php +++ b/src/Embeddings/Generator.php @@ -12,7 +12,8 @@ class Generator { - protected string $input = ''; + /** @var string|array */ + protected string|array $input = ''; /** @var array */ protected array $clientOptions = []; @@ -34,7 +35,8 @@ public function using(string|ProviderEnum $provider, string $model): self return $this; } - public function fromInput(string $input): self + /** @param string|array $input */ + public function fromInput(string|array $input): self { $this->input = $input; diff --git a/src/Embeddings/Request.php b/src/Embeddings/Request.php index 184544a..c4a4bca 100644 --- a/src/Embeddings/Request.php +++ b/src/Embeddings/Request.php @@ -9,12 +9,13 @@ class Request { /** + * @param string|array $input * @param array $clientOptions * @param array{0: array|int, 1?: Closure|int, 2?: ?callable, 3?: bool} $clientRetry */ public function __construct( public readonly string $model, - public readonly string $input, + public readonly string|array $input, public readonly array $clientOptions, public readonly array $clientRetry, ) {} diff --git a/src/Embeddings/Response.php b/src/Embeddings/Response.php index 23335ff..87a91ae 100644 --- a/src/Embeddings/Response.php +++ b/src/Embeddings/Response.php @@ -9,7 +9,7 @@ class Response { /** - * @param array $embeddings + * @param array> $embeddings */ public function __construct( public readonly array $embeddings, diff --git a/src/Providers/OpenAI/Handlers/Embeddings.php b/src/Providers/OpenAI/Handlers/Embeddings.php index d4713bc..5f8490c 100644 --- a/src/Providers/OpenAI/Handlers/Embeddings.php +++ b/src/Providers/OpenAI/Handlers/Embeddings.php @@ -36,8 +36,11 @@ public function handle(Request $request): EmbeddingsResponse )); } + /** @var array> $dataItems */ + $dataItems = data_get($data, 'data', []); + return new EmbeddingsResponse( - embeddings: data_get($data, 'data.0.embedding', []), + embeddings: collect($dataItems)->pluck('embedding')->toArray(), usage: new EmbeddingsUsage(data_get($data, 'usage.total_tokens', null)), ); } diff --git a/tests/Fixtures/openai/embeddings-array-input-1.json b/tests/Fixtures/openai/embeddings-array-input-1.json new file mode 100644 index 0000000..bfe4d53 --- /dev/null +++ b/tests/Fixtures/openai/embeddings-array-input-1.json @@ -0,0 +1,3093 @@ +{ + "object": "list", + "data": [ + { + "object": "embedding", + "index": 0, + "embedding": [ + 0.0022756963, + -0.009305916, + 0.015742613, + -0.0077253063, + -0.0047450014, + 0.014917395, + -0.009807394, + -0.038264707, + -0.0069127847, + -0.028590616, + 0.025251659, + 0.018116701, + -0.0036309576, + -0.02554366, + 0.00055543496, + -0.016428178, + 0.02828592, + 0.0054083494, + 0.009610611, + -0.016415482, + -0.015412526, + 0.004272088, + 0.0069953064, + -0.007223828, + -0.0039007403, + 0.018573744, + 0.008734611, + -0.022699833, + 0.011508612, + 0.023893224, + 0.015602961, + -0.0035706533, + -0.034963835, + -0.0041514793, + -0.026178442, + -0.02150644, + -0.0057066972, + 0.011768873, + 0.008455306, + 0.004129262, + 0.019157745, + -0.014358787, + 0.008982176, + 0.0063605234, + -0.04570436, + 0.017900875, + -0.005570219, + -0.0007716578, + -0.02215392, + -0.0039229575, + 0.02101131, + -0.017608874, + -0.011699047, + -0.02256018, + 0.01633931, + 0.017164527, + -0.00838548, + 0.0015901309, + 0.02507392, + -0.024997747, + 0.007807828, + 0.005798741, + -0.022115832, + 0.002948566, + -0.0061764363, + -0.025556356, + -0.008074437, + 0.0010585003, + 0.00023824192, + 0.004637088, + 0.02071931, + 0.013393917, + 0.004608523, + -0.015996527, + 0.016555134, + -0.008950437, + -0.007553915, + 0.01364783, + -0.0069826106, + 0.0052940883, + 0.009921655, + -0.04590749, + 0.0030453703, + 0.023982093, + 0.023080703, + 0.0070016542, + -0.023550441, + 0.009934351, + -0.006563654, + -0.03328801, + -0.0026994138, + 0.019919483, + 0.0016885222, + 0.0010561198, + -0.02264905, + 0.0049862186, + 0.015374439, + 0.03153601, + -0.005459132, + -0.015983831, + -0.00515761, + 0.019894093, + -0.009331307, + -0.006189132, + -0.03118053, + -0.009483655, + -0.015234787, + -0.028819138, + 0.021024005, + -0.018269049, + -0.002910479, + 0.012765482, + 0.005129045, + -0.049640015, + -0.0429621, + -0.0004479186, + 0.021531831, + -0.016885223, + 0.006525567, + -0.04141323, + 0.0008998046, + 0.033465747, + 0.012911482, + -0.010518351, + -0.0005959023, + 0.018396005, + 0.000059461294, + -0.013140003, + 0.011965656, + 0.005767002, + 0.007103219, + 0.008652089, + 0.018446788, + -0.0008775872, + -0.01917044, + 0.021912701, + -0.029733226, + -0.0042593926, + 0.0014933265, + -0.005116349, + 0.014955482, + 0.021366788, + -0.01876418, + 0.011013481, + -0.0074333064, + 0.022674441, + 0.01917044, + 0.014955482, + -0.0036785663, + 0.0063097407, + 0.025708703, + -0.027752703, + 0.036665052, + -0.004389523, + 0.013863656, + 0.008004611, + -0.0056432188, + 0.010283481, + -0.0058749146, + -0.008728263, + 0.010683394, + -0.00003173914, + 0.03217079, + -0.023880528, + -0.002616892, + 0.030368008, + 0.029631661, + 0.016618613, + 0.002209044, + 0.0010489785, + -0.011641916, + 0.018535657, + -0.0076364367, + 0.0074333064, + -0.0011315004, + 0.004462523, + 0.009934351, + -0.007528524, + -0.006239915, + -0.0057320883, + -0.02828592, + 0.0043006535, + 0.029301573, + 0.024794616, + -0.015717221, + -0.018167483, + 0.007484089, + 0.0086330455, + -0.011692699, + -0.0063605234, + 0.0019678266, + 0.03694436, + -0.0023328268, + -0.020820875, + -0.6890186, + -0.019551309, + 0.0034913053, + 0.0067286976, + 0.028336704, + 0.02341079, + 0.007154002, + 0.010619916, + 0.009591568, + -0.00943922, + -0.021303311, + 0.000044112443, + 0.019830614, + 0.0022677614, + -0.009604263, + -0.0020805006, + -0.0004106251, + 0.006595393, + -0.041337054, + 0.0111594815, + -0.013419308, + 0.02770192, + -0.011451482, + 0.00020947831, + 0.015412526, + -0.0004538697, + 0.014460352, + -0.008569567, + -0.01887844, + -0.01771044, + -0.009401133, + 0.024591485, + 0.012943221, + -0.008975829, + 0.03483688, + -0.005094132, + -0.024261398, + 0.024070963, + -0.0038086968, + 0.031028183, + -0.015031656, + -0.023245746, + 0.030164879, + 0.00686835, + 0.010105742, + 0.011451482, + 0.030291835, + 0.017659657, + 0.0020709787, + -0.0067350455, + 0.009712176, + 0.0166567, + 0.0036753924, + 0.027955834, + 0.003983262, + 0.003092979, + 0.029885573, + -0.016847135, + 0.0021519137, + 0.023245746, + 0.011749829, + 0.0143206995, + -0.019817919, + -0.029580878, + -0.0015750548, + 0.0184087, + -0.0027787616, + 0.01934818, + 0.027549572, + -0.008506089, + 0.012359221, + 0.0028295442, + -0.0052591753, + 0.006449393, + 0.009344002, + 0.02258557, + 0.023588529, + 0.0010164459, + 0.018992702, + -0.0030279139, + -0.006817567, + -0.010118438, + -0.007922089, + -0.007293654, + 0.020554267, + 0.010899221, + -0.02983479, + -0.0038626532, + 0.002731153, + -0.018903831, + 0.02998714, + 0.024566093, + -0.004430784, + 0.026483137, + 0.017545396, + 0.0412101, + -0.020148005, + 0.014663482, + 0.021519136, + -0.029910965, + -0.0014631744, + 0.003431001, + 0.034176704, + 0.036081053, + 0.028057398, + 0.01849757, + 0.0033675227, + 0.00935035, + 0.020744702, + -0.012530612, + 0.017050266, + 0.011546698, + -0.007706263, + 0.0133050475, + -0.007446002, + -0.022484006, + 0.0059098275, + 0.025734095, + -0.019119658, + -0.019005397, + -0.013368526, + -0.0026819573, + 0.022522094, + -0.007960176, + -0.00078197307, + 0.028133573, + 0.013990613, + -0.02002105, + -0.021163657, + -0.002913653, + 0.013470091, + 0.016085396, + 0.01195296, + -0.01677096, + 0.004827523, + -0.013063829, + 0.025734095, + -0.030342616, + 0.017608874, + -0.022420527, + -0.018865744, + 0.0020090875, + -0.006163741, + 0.0021122396, + -0.0014401635, + -0.01113409, + -0.00531948, + -0.011432438, + -0.021646094, + 0.0051956973, + 0.0056210016, + -0.00023129898, + -0.012746438, + 0.003424653, + 0.024642268, + -0.0017900874, + 0.0012640113, + -0.0054178713, + -0.024845399, + -0.030545747, + -0.016085396, + 0.016669396, + -0.013228873, + -0.008734611, + 0.009490003, + -0.007376176, + 0.0069762627, + -0.0056495667, + -0.012067221, + -0.023766268, + 0.02884453, + -0.015882265, + -0.003358001, + 0.0052560014, + -0.01677096, + 0.0013711308, + -0.021836529, + -0.019564005, + -0.006344654, + 0.016707484, + 0.008760002, + 0.0041832183, + -0.0138128735, + -0.012854352, + 0.009496351, + 0.005776523, + 0.0014131851, + 0.025327833, + -0.017786613, + 0.015387135, + 0.0020217833, + -0.011013481, + 0.0074269585, + 0.0015766417, + 0.01595844, + 0.013419308, + -0.002693066, + 0.0021122396, + 0.01414296, + -0.0023121962, + -0.004234001, + -0.0065382626, + 0.0030707617, + -0.0047100885, + 0.013254264, + -0.017456526, + -0.0111594815, + -0.029631661, + 0.0037198272, + 0.0074650454, + 0.016110787, + -0.0138128735, + -0.017304178, + -0.0037452185, + 0.021404875, + 0.016999483, + 0.019297397, + 0.00686835, + -0.01393983, + -0.0092614805, + -0.0023693268, + -0.020935137, + -0.005240132, + -0.0014425439, + 0.00643035, + 0.0030421964, + 0.0029469791, + -0.007369828, + 0.001253696, + -0.0021471528, + -0.001917044, + 0.018649919, + 0.00077324477, + 0.015145917, + 0.0069889585, + 0.001328283, + 0.016402787, + -0.008696524, + 0.016758265, + -0.00044434794, + -0.007738002, + 0.01677096, + -0.00082363066, + -0.028057398, + 0.010911916, + 0.00009938318, + -0.0060970886, + -0.011267395, + -0.027397225, + 0.008899654, + 0.012879742, + 0.01683444, + -0.01762157, + 0.014714265, + -0.0039991317, + 0.0080617415, + -0.0018853049, + -0.018814962, + 0.034151312, + 0.020947833, + 0.016542438, + 0.0222047, + 0.015387135, + -0.00096804375, + 0.004433958, + 0.000515761, + -0.007731654, + -0.026178442, + 0.00978835, + -0.0066969586, + 0.014803135, + -0.025899138, + -0.0023931311, + -0.006627132, + 0.006716002, + -0.0012560764, + -0.018726092, + 0.0022376094, + -0.0178247, + 0.00488148, + 0.0031453487, + -0.021811137, + 0.029860182, + 0.0117879165, + -0.002727979, + -0.011057916, + -0.017380353, + 0.007331741, + -0.012403656, + 0.0033643488, + 0.007154002, + 0.014422265, + 0.0011719677, + -0.009616959, + 0.014041395, + 0.000610185, + 0.046110623, + -0.02078279, + 0.031612184, + -0.0051893494, + 0.0065001757, + -0.025353225, + -0.028184356, + -0.023486963, + 0.026203834, + -0.013089221, + -0.022318963, + -0.0005459132, + 0.023398094, + -0.007712611, + 0.0065382626, + -0.006052654, + -0.012530612, + -0.0021138266, + 0.023982093, + -0.0033103921, + -0.02942853, + 0.0019710006, + 0.007699915, + -0.0008434676, + -0.03041879, + -0.017075656, + -0.008785394, + -0.013495482, + 0.07810368, + -0.004833871, + 0.015171308, + 0.008277567, + 0.036715835, + 0.00054035883, + -0.038848706, + -0.0046275663, + -0.0054273927, + -0.012137047, + -0.0067413934, + 0.009655046, + 0.024870789, + 0.0070968717, + 0.02633079, + -0.0042847837, + -0.005941567, + -0.024566093, + 0.019310093, + -0.02384244, + -0.008245829, + 0.016593222, + 0.015920352, + 0.02709253, + -0.015247483, + 0.004348262, + 0.025518268, + 0.02615305, + -0.0011116633, + -0.023372702, + 0.0015663265, + -0.0012179895, + -0.004976697, + -0.002321718, + -0.015501396, + 0.0047894362, + 0.00045267947, + -0.012213221, + 0.004868784, + -0.0062970454, + 0.040549923, + -0.008747307, + 0.0051734797, + -0.016923308, + 0.004637088, + -0.0015766417, + -0.027752703, + 0.05093497, + -0.03041879, + -0.0028644572, + 0.015387135, + 0.02709253, + 0.0022820442, + -0.010391395, + -0.004348262, + 0.011178525, + -0.00663348, + -0.02428679, + -0.0140033085, + 0.016263135, + -0.014739656, + -0.037706096, + -0.005554349, + -0.00072841323, + -0.025988007, + -0.02042731, + -0.012625829, + -0.012410004, + -0.0028089138, + -0.00291524, + -0.012410004, + 0.003688088, + -0.012809916, + -0.0069953064, + 0.017354961, + -0.0026121312, + -0.0034595663, + -0.009737568, + -0.0009886742, + 0.009826438, + 0.0008220437, + -0.008163307, + 0.0013909678, + 0.0036404792, + -0.029200008, + 0.022712529, + 0.026635485, + 0.011108698, + 0.0054146973, + 0.0044022184, + -0.002175718, + -0.0025946747, + 0.005125871, + -0.015564874, + -0.0054273927, + -0.021988876, + -0.016237743, + 0.025200877, + -0.008410872, + -0.0032596097, + -0.008112524, + 0.001955131, + -0.009286872, + 0.0006280382, + 0.043673057, + -0.008525133, + -0.011356264, + -0.024946963, + 0.004227653, + -0.011172177, + 0.020414615, + 0.0149047, + -0.019068874, + 0.007528524, + -0.012035482, + 0.030444182, + 0.012130699, + 0.032424703, + 0.0035674793, + -0.009077393, + -0.0073888716, + -0.0064652627, + 0.025061224, + -0.012264003, + 0.009509047, + -0.0010212068, + 0.0124861775, + -0.013254264, + -0.0014623809, + -0.012733743, + -0.0036214357, + 0.0071286107, + -0.010435829, + 0.010029568, + -0.0043292185, + -0.0025724573, + -0.004132436, + 0.01084209, + -0.025594441, + -0.024121746, + -0.040219836, + -0.015247483, + 0.01291783, + -0.013279656, + -0.02866679, + -0.023512354, + -0.004833871, + -0.008055394, + -0.01616157, + 0.05151897, + 0.011762525, + 0.009267828, + -0.031662967, + 0.03950888, + 0.0046656537, + -0.014155656, + -0.014803135, + -0.0065319147, + 0.0045101317, + 0.027143313, + 0.021760354, + -0.00020055169, + 0.019614788, + 0.0036690445, + -0.000138462, + -0.0066906107, + -0.010829395, + -0.0045958273, + -0.0303934, + 0.02960627, + 0.026559312, + 0.014853917, + 0.00982009, + 0.009242438, + -0.020973222, + 0.0035896967, + 0.004602175, + -0.008645741, + -0.009540785, + -0.013901743, + 0.017634265, + -0.027498791, + 0.0050370013, + 0.0071603497, + 0.033034097, + -0.0075412197, + 0.022687137, + 0.0063097407, + 0.016085396, + -0.00038900282, + 0.028641399, + -0.014460352, + 0.0025296095, + -0.010118438, + -0.017342266, + 0.010473916, + -0.0052496535, + -0.015387135, + -0.018434092, + -0.00033127726, + 0.02767653, + 0.0010711959, + 0.005110001, + -0.013470091, + -0.00794748, + 0.005059219, + 0.013571656, + -0.014396873, + -0.00471961, + -0.026178442, + -0.018738788, + -0.0195767, + -0.012581395, + -0.029885573, + -0.00987722, + -0.003358001, + -0.041337054, + 0.013101917, + -0.0094519155, + -0.03813775, + -0.0007399187, + -0.004021349, + -0.0143206995, + -0.003903914, + 0.016631309, + -0.0007228589, + -0.017367657, + -0.015564874, + 0.029530095, + -0.0043450883, + -0.009826438, + -0.000052220803, + 0.011432438, + 0.02507392, + -0.02188731, + -0.018954614, + 0.021531831, + 0.010099394, + -0.02285218, + 0.013698612, + -0.004621219, + 0.02960627, + -0.012848004, + 0.018370613, + 0.00054234255, + 0.012936873, + -0.020973222, + 0.003465914, + 0.0036277836, + 0.0067223497, + -0.030063313, + -0.0021995225, + -0.024248702, + 0.026178442, + -0.009813742, + -0.010239046, + 0.008156959, + -0.010010525, + -0.013114613, + 0.021874614, + -0.010956351, + 0.008334698, + -0.008544176, + 0.016415482, + -0.0035611314, + -0.009655046, + 0.0135589605, + -0.007833219, + 0.018104006, + 0.019475136, + -0.022484006, + -0.023474267, + 0.0037293488, + 0.009470959, + 0.027219485, + -0.007090524, + -0.015171308, + -0.017050266, + -0.0045482186, + -0.013673221, + -0.0056178276, + 0.010429481, + 0.0050655664, + 0.008131567, + -0.00073357084, + -0.032577053, + -0.028184356, + 0.0047799144, + 0.0060272627, + -0.016060004, + -0.021747658, + -0.020973222, + 0.0015544243, + -0.0015893374, + 0.024769224, + -0.001953544, + -0.012410004, + 0.015323657, + -0.012708351, + 0.009052003, + -0.010194612, + 0.019094266, + -0.025480181, + 0.008512437, + 0.003351653, + 0.012962264, + 0.022509398, + -0.008893306, + -0.02323305, + -0.016313918, + 0.0011941851, + -0.0042974795, + 0.018180178, + -0.005773349, + 0.026051486, + 0.0052909143, + 0.0067604366, + -0.00634148, + -0.018040527, + 0.019487832, + -0.017862787, + -0.0012314786, + 0.027219485, + -0.015869569, + -0.02060505, + 0.039838966, + 0.008696524, + -0.0022534789, + -0.029453922, + 0.009267828, + -0.021557223, + 0.035877924, + -0.014269917, + -0.014549222, + -0.023207659, + 0.011559394, + -0.016618613, + 0.020414615, + 0.006424002, + -0.013533569, + 0.016428178, + 0.013203482, + 0.019767135, + -0.0014441308, + 0.016199656, + 0.0048148273, + -0.013838265, + 0.0078713065, + -0.036157228, + -0.027117921, + -0.009921655, + 0.0097058285, + -0.0044720448, + -0.009769307, + -0.014219134, + 0.009889916, + -0.042987492, + 0.024616877, + -0.0106516555, + 0.0047894362, + 0.011019829, + 0.021671485, + -0.023601225, + 0.006747741, + -0.031078964, + 0.0058685667, + -0.005097306, + -0.01385096, + -0.0065509584, + 0.0004407773, + 0.009413829, + -0.009832785, + -0.042352706, + -0.010975394, + 0.008664785, + 0.0025248486, + 0.012048177, + -0.006887393, + -0.014041395, + -0.007039741, + 0.0018519788, + 0.014485743, + 0.033211835, + 0.0052940883, + -0.0017012178, + -0.012778178, + -0.015349047, + 0.01829444, + -0.005795567, + -0.0482181, + -0.017723136, + 0.00914722, + -0.0109055685, + 0.0000068499508, + -0.015831484, + -0.028184356, + 0.01764696, + -0.017291483, + -0.002658153, + -0.022433223, + -0.017266091, + 0.015222091, + 0.007953828, + -0.01908157, + 0.007896698, + -0.00010959921, + -0.019475136, + 0.016415482, + 0.007084176, + 0.00017377178, + -0.009299568, + -0.015882265, + 0.004976697, + -0.0059098275, + -0.020985918, + 0.003538914, + 0.0038943924, + -0.0016139352, + 0.004421262, + 0.012708351, + -0.0149047, + 0.012460786, + 0.0022979137, + -0.003796001, + 0.0004649784, + -0.008842524, + 0.015882265, + -0.017342266, + -0.016707484, + -0.0052083926, + -0.022179311, + -0.020655831, + 0.018065918, + 0.009299568, + -0.0077189584, + 0.025899138, + 0.2191778, + 0.01201009, + -0.0050052623, + 0.037452184, + -0.00040983164, + 0.031434443, + 0.0018535657, + 0.0024915223, + -0.017278787, + 0.013203482, + -0.011464177, + -0.006595393, + 0.0015972722, + -0.003538914, + 0.006230393, + -0.0049227406, + -0.025086615, + -0.02381705, + 0.00021344572, + -0.035573225, + 0.0107151335, + -0.016529744, + 0.0008736198, + -0.017316874, + 0.03775688, + 0.0020170223, + -0.044079315, + 0.0065700016, + 0.013952525, + 0.024388354, + -0.018992702, + -0.008607655, + 0.00590348, + 0.00160362, + -0.014409569, + 0.013013047, + 0.0069127847, + 0.003942001, + 0.0057066972, + -0.0037737836, + 0.009851829, + -0.013127308, + 0.017316874, + -0.016428178, + 0.017380353, + 0.02451531, + -0.0187007, + -0.02729566, + 0.003205653, + 0.036461923, + -0.015145917, + -0.018738788, + 0.0065192194, + 0.010162872, + 0.0054464363, + 0.009185307, + 0.026026094, + -0.020173397, + -0.019868702, + -0.0061002625, + 0.01066435, + 0.009490003, + -0.01639009, + 0.00089821767, + -0.030063313, + 0.009636003, + -0.014917395, + 0.014333395, + -0.0032167619, + -0.0160727, + -0.0014314352, + -0.024997747, + 0.0002239593, + 0.022331659, + -0.009032959, + -0.01011209, + 0.024946963, + -0.0128607, + 0.019538615, + 0.03501462, + -0.026787834, + -0.0000737935, + -0.0068048714, + -0.011203916, + -0.016923308, + -0.030164879, + 0.0040753055, + 0.014561917, + -0.019043483, + -0.020744702, + 0.011388003, + -0.012670265, + -0.00013538726, + -0.0013401852, + 0.0178247, + 0.0057003493, + -0.006525567, + 0.010232698, + 0.0032850008, + -0.011349916, + -0.010892873, + -0.055149928, + -0.009458263, + -0.004878306, + -0.028742965, + -0.0031183704, + 0.002802566, + 0.03676662, + 0.003172327, + -0.005557523, + -0.0026216528, + -0.00032969032, + 0.017938962, + -0.0015449026, + 0.0023836093, + -0.002661327, + -0.017012179, + 0.0035928707, + 0.030291835, + -0.023956703, + 0.01878957, + -0.01914505, + -0.0029977616, + 0.033414967, + -0.02051618, + -0.01297496, + -0.011540351, + 0.011997394, + 0.025442094, + -0.011826003, + 0.038569402, + -0.0033770443, + -0.007922089, + 0.019995658, + -0.033745054, + -0.018751483, + 0.009591568, + 0.018104006, + -0.026838616, + -0.012225917, + 0.024794616, + 0.00082442415, + -0.0010283481, + 0.0064017843, + -0.0049735233, + -0.035471663, + 0.012321134, + 0.0075729587, + -0.029910965, + -0.018332526, + -0.030901225, + -0.014536526, + -0.017240701, + -0.01721531, + 0.024921572, + -0.02022418, + -0.044612534, + -0.0056463927, + -0.01385096, + -0.0008418807, + -0.0028517616, + -0.0065065236, + 0.053017057, + -0.011641916, + 0.008093481, + 0.005640045, + -0.16148874, + 0.009185307, + -0.024629572, + -0.016415482, + 0.015729917, + 0.0006538263, + 0.023194963, + -0.0074586975, + -0.018104006, + 0.018853048, + 0.010264438, + 0.0104612205, + -0.032983314, + 0.0023756747, + 0.019018093, + 0.016555134, + 0.00017168891, + -0.014371483, + 0.023296528, + 0.01966557, + 0.03834088, + 0.0026724355, + 0.0010632612, + -0.0076237414, + 0.0027803485, + 0.030520355, + -0.025556356, + 0.0037769575, + -0.011051568, + 0.0017900874, + 0.005979654, + -0.0029406312, + 0.025530964, + -0.00847435, + 0.010340611, + 0.0054020016, + 0.00010682204, + -0.0065573063, + 0.017812004, + 0.03529392, + 0.013178091, + 0.02787966, + -0.0014131851, + 0.014892004, + -0.009750264, + 0.009902611, + 0.009344002, + -0.0017504136, + 0.023588529, + -0.0047037406, + 0.009458263, + -0.03737601, + 0.016110787, + 0.0012148155, + 0.0022566528, + 0.016897917, + -0.014117569, + 0.0015052287, + -0.005862219, + -0.0006391469, + -0.012321134, + -0.011311829, + -0.013178091, + 0.0020217833, + -0.0012425873, + -0.003983262, + -0.0063510016, + -0.014879309, + 0.006446219, + 0.00604948, + -0.0024820007, + 0.002648631, + 0.003431001, + 0.007490437, + 0.000079695, + 0.023474267, + -0.017634265, + -0.0065446105, + 0.021823833, + -0.023194963, + -0.015133222, + 0.034176704, + -0.025975311, + 0.0213287, + -0.01569183, + 0.002215392, + 0.0040975227, + 0.014968178, + 0.014168352, + -0.0074650454, + 0.007325393, + -0.003577001, + -0.009344002, + -0.025645224, + 0.018104006, + 0.0110325245, + 0.009032959, + 0.010473916, + -0.0058146105, + -0.003656349, + 0.0055829147, + -0.021519136, + -0.028692182, + 0.02556905, + 0.016364701, + 0.033592705, + 0.012441742, + 0.027117921, + 0.019513223, + -0.0051480886, + -0.020122614, + 0.010264438, + 0.019906787, + 0.02545479, + -0.0107151335, + 0.038797922, + -0.014980874, + -0.025404006, + 0.030444182, + -0.0091345245, + 0.04664384, + 0.0008049839, + 0.0016726527, + 0.012867047, + -0.0007633263, + 0.0033675227, + -0.10796385, + -0.022953745, + 0.020566963, + 0.02051618, + -0.0062843496, + -0.005275045, + 0.009305916, + 0.013520873, + -0.0143206995, + 0.0037039577, + -0.011235655, + -0.017977048, + -0.015222091, + -0.013584351, + 0.023753572, + 0.008487046, + 0.025175486, + -0.02866679, + -0.00038900282, + 0.005160784, + -0.00070143497, + 0.01148322, + -0.0049798707, + 0.0067667845, + -0.0042879577, + 0.007522176, + -0.009026611, + 0.029910965, + 0.0072492193, + 0.011254699, + 0.02419792, + -0.009947047, + 0.017304178, + -0.0040657837, + -0.011629221, + -0.0005570219, + -0.024654964, + 0.0023391745, + 0.014739656, + -0.026965573, + 0.012759134, + -0.0074713933, + -0.002397892, + -0.047532536, + 0.006855654, + -0.0044879145, + 0.00028704084, + 0.018688004, + 0.022928353, + -0.0070333933, + -0.0037452185, + 0.025797572, + -0.02960627, + 0.0045958273, + 0.041692533, + -0.00590348, + 0.016669396, + -0.001878957, + -0.0097058285, + -0.006665219, + 0.0067985235, + -0.0011465764, + -0.020211484, + 0.007966524, + 0.008264872, + 0.015933048, + -0.011057916, + -0.0023471094, + 0.0051480886, + -0.015158613, + 0.012048177, + -0.00648748, + -0.016618613, + -0.008969481, + -0.010086698, + -0.03867097, + -0.03407514, + 0.0056717843, + -0.000030871273, + -0.02258557, + 0.0019789354, + -0.009769307, + 0.0074396543, + -0.0011759351, + -0.0006601741, + -0.020148005, + -0.010239046, + -0.0067794803, + -0.007515828, + -0.015818788, + -0.0044022184, + 0.011248351, + 0.031002792, + -0.013673221, + -0.016961396, + 0.018129397, + -0.014460352, + -0.002136044, + 0.017393049, + -0.02363931, + -0.0063065668, + -0.010156524, + -0.040194444, + 0.0069127847, + -0.017786613, + -0.0067413934, + 0.00876635, + -0.009978785, + 0.01677096, + 0.010042263, + -0.008290263, + 0.017012179, + -0.01063896, + 0.012695655, + 0.01376209, + 0.007960176, + -0.017139135, + -0.008874264, + 0.015425222, + 0.0052179145, + 0.022369746, + -0.00923609, + 0.022255484, + 0.030342616, + -0.0045990013, + -0.0006197067, + -0.020414615, + 0.021900006, + -0.01326696, + 0.016859831, + -0.027600355, + -0.011007134, + 0.011546698, + -0.024642268, + 0.0033326095, + 0.026076877, + -0.0143841775, + -0.029961748, + -0.0041578272, + 0.01224496, + 0.009629655, + 0.0027041747, + -0.006563654, + -0.036715835, + 0.01098809, + -0.023677398, + -0.011991046, + 0.014955482, + -0.016021917, + -0.004053088, + 0.018776875, + 0.003875349, + -0.008290263, + 0.011146786, + 0.010505655, + -0.019221222, + 0.015768005, + 0.0013885873, + 0.005947915, + -0.011851395, + 0.0051480886, + -0.031078964, + 0.035903316, + -0.009090089, + 0.008804437, + -0.009153568, + -0.004684697, + -0.013609743, + -0.016694788, + -0.013698612, + 0.014676178, + -0.029860182, + -0.018624527, + 0.005167132, + 0.019830614, + 0.011146786, + 0.039229576, + -0.017938962, + -0.0069953064, + -0.028616007, + -0.008322002, + 0.010772264, + 0.013571656, + 0.019856006, + -0.024388354, + 0.0109055685, + 0.010296177, + 0.024705745, + -0.016644005, + -0.0012473481, + 0.0054242187, + 0.004611697, + -0.004668827, + -0.01335583, + 0.011242003, + -0.0015806091, + 0.003970566, + 0.025302442, + -0.003023153, + -0.007858611, + 0.017875483, + 0.031282097, + -0.00537661, + 0.004649784, + 0.003026327, + -0.0071603497, + -0.011997394, + -0.016212352, + -0.03387201, + -0.042911317, + 0.009045655, + 0.0074079153, + 0.018256353, + 0.016707484, + -0.003983262, + 0.022623658, + 0.0074142627, + 0.012137047, + -0.001381446, + -0.0058495235, + -0.019068874, + 0.026940182, + 0.0030009355, + 0.012124351, + 0.007833219, + -0.020503484, + 0.0060590017, + 0.017177222, + -0.0040721316, + 0.00012566715, + 0.0010815111, + 0.005113175, + -0.0015353808, + 0.009483655, + -0.016301222, + -0.010346959, + -0.014460352, + 0.007084176, + 0.015983831, + 0.018814962, + -0.025213571, + 0.036868185, + 0.00441174, + 0.008734611, + 0.003903914, + -0.007915742, + 0.0053893058, + 0.028032009, + -0.020109918, + -0.0063287844, + 0.0045069577, + 0.024464529, + 0.00759835, + 0.00575748, + -0.012498873, + -0.026178442, + -0.0030056965, + 0.00038047292, + 0.0008442611, + -0.028920704, + -0.02341079, + 0.008696524, + 0.018688004, + 0.014396873, + 0.028158965, + -0.013952525, + -0.0031501097, + 0.0018995875, + -0.0034183052, + 0.012949569, + -0.04088001, + 0.0025851529, + -0.001883718, + -0.049462274, + -0.0088806115, + -0.004576784, + -0.021836529, + -0.014079482, + -0.015425222, + 0.0040753055, + 0.002727979, + -0.03138366, + 0.041159317, + -0.017608874, + -0.018637223, + 0.014587308, + 0.010486611, + -0.015387135, + -0.019424353, + -0.002800979 + ] + }, { + "object": "embedding", + "index": 1, + "embedding": [ + 0.0022756963, + -0.009305916, + 0.015742613, + -0.0077253063, + -0.0047450014, + 0.014917395, + -0.009807394, + -0.038264707, + -0.0069127847, + -0.028590616, + 0.025251659, + 0.018116701, + -0.0036309576, + -0.02554366, + 0.00055543496, + -0.016428178, + 0.02828592, + 0.0054083494, + 0.009610611, + -0.016415482, + -0.015412526, + 0.004272088, + 0.0069953064, + -0.007223828, + -0.0039007403, + 0.018573744, + 0.008734611, + -0.022699833, + 0.011508612, + 0.023893224, + 0.015602961, + -0.0035706533, + -0.034963835, + -0.0041514793, + -0.026178442, + -0.02150644, + -0.0057066972, + 0.011768873, + 0.008455306, + 0.004129262, + 0.019157745, + -0.014358787, + 0.008982176, + 0.0063605234, + -0.04570436, + 0.017900875, + -0.005570219, + -0.0007716578, + -0.02215392, + -0.0039229575, + 0.02101131, + -0.017608874, + -0.011699047, + -0.02256018, + 0.01633931, + 0.017164527, + -0.00838548, + 0.0015901309, + 0.02507392, + -0.024997747, + 0.007807828, + 0.005798741, + -0.022115832, + 0.002948566, + -0.0061764363, + -0.025556356, + -0.008074437, + 0.0010585003, + 0.00023824192, + 0.004637088, + 0.02071931, + 0.013393917, + 0.004608523, + -0.015996527, + 0.016555134, + -0.008950437, + -0.007553915, + 0.01364783, + -0.0069826106, + 0.0052940883, + 0.009921655, + -0.04590749, + 0.0030453703, + 0.023982093, + 0.023080703, + 0.0070016542, + -0.023550441, + 0.009934351, + -0.006563654, + -0.03328801, + -0.0026994138, + 0.019919483, + 0.0016885222, + 0.0010561198, + -0.02264905, + 0.0049862186, + 0.015374439, + 0.03153601, + -0.005459132, + -0.015983831, + -0.00515761, + 0.019894093, + -0.009331307, + -0.006189132, + -0.03118053, + -0.009483655, + -0.015234787, + -0.028819138, + 0.021024005, + -0.018269049, + -0.002910479, + 0.012765482, + 0.005129045, + -0.049640015, + -0.0429621, + -0.0004479186, + 0.021531831, + -0.016885223, + 0.006525567, + -0.04141323, + 0.0008998046, + 0.033465747, + 0.012911482, + -0.010518351, + -0.0005959023, + 0.018396005, + 0.000059461294, + -0.013140003, + 0.011965656, + 0.005767002, + 0.007103219, + 0.008652089, + 0.018446788, + -0.0008775872, + -0.01917044, + 0.021912701, + -0.029733226, + -0.0042593926, + 0.0014933265, + -0.005116349, + 0.014955482, + 0.021366788, + -0.01876418, + 0.011013481, + -0.0074333064, + 0.022674441, + 0.01917044, + 0.014955482, + -0.0036785663, + 0.0063097407, + 0.025708703, + -0.027752703, + 0.036665052, + -0.004389523, + 0.013863656, + 0.008004611, + -0.0056432188, + 0.010283481, + -0.0058749146, + -0.008728263, + 0.010683394, + -0.00003173914, + 0.03217079, + -0.023880528, + -0.002616892, + 0.030368008, + 0.029631661, + 0.016618613, + 0.002209044, + 0.0010489785, + -0.011641916, + 0.018535657, + -0.0076364367, + 0.0074333064, + -0.0011315004, + 0.004462523, + 0.009934351, + -0.007528524, + -0.006239915, + -0.0057320883, + -0.02828592, + 0.0043006535, + 0.029301573, + 0.024794616, + -0.015717221, + -0.018167483, + 0.007484089, + 0.0086330455, + -0.011692699, + -0.0063605234, + 0.0019678266, + 0.03694436, + -0.0023328268, + -0.020820875, + -0.6890186, + -0.019551309, + 0.0034913053, + 0.0067286976, + 0.028336704, + 0.02341079, + 0.007154002, + 0.010619916, + 0.009591568, + -0.00943922, + -0.021303311, + 0.000044112443, + 0.019830614, + 0.0022677614, + -0.009604263, + -0.0020805006, + -0.0004106251, + 0.006595393, + -0.041337054, + 0.0111594815, + -0.013419308, + 0.02770192, + -0.011451482, + 0.00020947831, + 0.015412526, + -0.0004538697, + 0.014460352, + -0.008569567, + -0.01887844, + -0.01771044, + -0.009401133, + 0.024591485, + 0.012943221, + -0.008975829, + 0.03483688, + -0.005094132, + -0.024261398, + 0.024070963, + -0.0038086968, + 0.031028183, + -0.015031656, + -0.023245746, + 0.030164879, + 0.00686835, + 0.010105742, + 0.011451482, + 0.030291835, + 0.017659657, + 0.0020709787, + -0.0067350455, + 0.009712176, + 0.0166567, + 0.0036753924, + 0.027955834, + 0.003983262, + 0.003092979, + 0.029885573, + -0.016847135, + 0.0021519137, + 0.023245746, + 0.011749829, + 0.0143206995, + -0.019817919, + -0.029580878, + -0.0015750548, + 0.0184087, + -0.0027787616, + 0.01934818, + 0.027549572, + -0.008506089, + 0.012359221, + 0.0028295442, + -0.0052591753, + 0.006449393, + 0.009344002, + 0.02258557, + 0.023588529, + 0.0010164459, + 0.018992702, + -0.0030279139, + -0.006817567, + -0.010118438, + -0.007922089, + -0.007293654, + 0.020554267, + 0.010899221, + -0.02983479, + -0.0038626532, + 0.002731153, + -0.018903831, + 0.02998714, + 0.024566093, + -0.004430784, + 0.026483137, + 0.017545396, + 0.0412101, + -0.020148005, + 0.014663482, + 0.021519136, + -0.029910965, + -0.0014631744, + 0.003431001, + 0.034176704, + 0.036081053, + 0.028057398, + 0.01849757, + 0.0033675227, + 0.00935035, + 0.020744702, + -0.012530612, + 0.017050266, + 0.011546698, + -0.007706263, + 0.0133050475, + -0.007446002, + -0.022484006, + 0.0059098275, + 0.025734095, + -0.019119658, + -0.019005397, + -0.013368526, + -0.0026819573, + 0.022522094, + -0.007960176, + -0.00078197307, + 0.028133573, + 0.013990613, + -0.02002105, + -0.021163657, + -0.002913653, + 0.013470091, + 0.016085396, + 0.01195296, + -0.01677096, + 0.004827523, + -0.013063829, + 0.025734095, + -0.030342616, + 0.017608874, + -0.022420527, + -0.018865744, + 0.0020090875, + -0.006163741, + 0.0021122396, + -0.0014401635, + -0.01113409, + -0.00531948, + -0.011432438, + -0.021646094, + 0.0051956973, + 0.0056210016, + -0.00023129898, + -0.012746438, + 0.003424653, + 0.024642268, + -0.0017900874, + 0.0012640113, + -0.0054178713, + -0.024845399, + -0.030545747, + -0.016085396, + 0.016669396, + -0.013228873, + -0.008734611, + 0.009490003, + -0.007376176, + 0.0069762627, + -0.0056495667, + -0.012067221, + -0.023766268, + 0.02884453, + -0.015882265, + -0.003358001, + 0.0052560014, + -0.01677096, + 0.0013711308, + -0.021836529, + -0.019564005, + -0.006344654, + 0.016707484, + 0.008760002, + 0.0041832183, + -0.0138128735, + -0.012854352, + 0.009496351, + 0.005776523, + 0.0014131851, + 0.025327833, + -0.017786613, + 0.015387135, + 0.0020217833, + -0.011013481, + 0.0074269585, + 0.0015766417, + 0.01595844, + 0.013419308, + -0.002693066, + 0.0021122396, + 0.01414296, + -0.0023121962, + -0.004234001, + -0.0065382626, + 0.0030707617, + -0.0047100885, + 0.013254264, + -0.017456526, + -0.0111594815, + -0.029631661, + 0.0037198272, + 0.0074650454, + 0.016110787, + -0.0138128735, + -0.017304178, + -0.0037452185, + 0.021404875, + 0.016999483, + 0.019297397, + 0.00686835, + -0.01393983, + -0.0092614805, + -0.0023693268, + -0.020935137, + -0.005240132, + -0.0014425439, + 0.00643035, + 0.0030421964, + 0.0029469791, + -0.007369828, + 0.001253696, + -0.0021471528, + -0.001917044, + 0.018649919, + 0.00077324477, + 0.015145917, + 0.0069889585, + 0.001328283, + 0.016402787, + -0.008696524, + 0.016758265, + -0.00044434794, + -0.007738002, + 0.01677096, + -0.00082363066, + -0.028057398, + 0.010911916, + 0.00009938318, + -0.0060970886, + -0.011267395, + -0.027397225, + 0.008899654, + 0.012879742, + 0.01683444, + -0.01762157, + 0.014714265, + -0.0039991317, + 0.0080617415, + -0.0018853049, + -0.018814962, + 0.034151312, + 0.020947833, + 0.016542438, + 0.0222047, + 0.015387135, + -0.00096804375, + 0.004433958, + 0.000515761, + -0.007731654, + -0.026178442, + 0.00978835, + -0.0066969586, + 0.014803135, + -0.025899138, + -0.0023931311, + -0.006627132, + 0.006716002, + -0.0012560764, + -0.018726092, + 0.0022376094, + -0.0178247, + 0.00488148, + 0.0031453487, + -0.021811137, + 0.029860182, + 0.0117879165, + -0.002727979, + -0.011057916, + -0.017380353, + 0.007331741, + -0.012403656, + 0.0033643488, + 0.007154002, + 0.014422265, + 0.0011719677, + -0.009616959, + 0.014041395, + 0.000610185, + 0.046110623, + -0.02078279, + 0.031612184, + -0.0051893494, + 0.0065001757, + -0.025353225, + -0.028184356, + -0.023486963, + 0.026203834, + -0.013089221, + -0.022318963, + -0.0005459132, + 0.023398094, + -0.007712611, + 0.0065382626, + -0.006052654, + -0.012530612, + -0.0021138266, + 0.023982093, + -0.0033103921, + -0.02942853, + 0.0019710006, + 0.007699915, + -0.0008434676, + -0.03041879, + -0.017075656, + -0.008785394, + -0.013495482, + 0.07810368, + -0.004833871, + 0.015171308, + 0.008277567, + 0.036715835, + 0.00054035883, + -0.038848706, + -0.0046275663, + -0.0054273927, + -0.012137047, + -0.0067413934, + 0.009655046, + 0.024870789, + 0.0070968717, + 0.02633079, + -0.0042847837, + -0.005941567, + -0.024566093, + 0.019310093, + -0.02384244, + -0.008245829, + 0.016593222, + 0.015920352, + 0.02709253, + -0.015247483, + 0.004348262, + 0.025518268, + 0.02615305, + -0.0011116633, + -0.023372702, + 0.0015663265, + -0.0012179895, + -0.004976697, + -0.002321718, + -0.015501396, + 0.0047894362, + 0.00045267947, + -0.012213221, + 0.004868784, + -0.0062970454, + 0.040549923, + -0.008747307, + 0.0051734797, + -0.016923308, + 0.004637088, + -0.0015766417, + -0.027752703, + 0.05093497, + -0.03041879, + -0.0028644572, + 0.015387135, + 0.02709253, + 0.0022820442, + -0.010391395, + -0.004348262, + 0.011178525, + -0.00663348, + -0.02428679, + -0.0140033085, + 0.016263135, + -0.014739656, + -0.037706096, + -0.005554349, + -0.00072841323, + -0.025988007, + -0.02042731, + -0.012625829, + -0.012410004, + -0.0028089138, + -0.00291524, + -0.012410004, + 0.003688088, + -0.012809916, + -0.0069953064, + 0.017354961, + -0.0026121312, + -0.0034595663, + -0.009737568, + -0.0009886742, + 0.009826438, + 0.0008220437, + -0.008163307, + 0.0013909678, + 0.0036404792, + -0.029200008, + 0.022712529, + 0.026635485, + 0.011108698, + 0.0054146973, + 0.0044022184, + -0.002175718, + -0.0025946747, + 0.005125871, + -0.015564874, + -0.0054273927, + -0.021988876, + -0.016237743, + 0.025200877, + -0.008410872, + -0.0032596097, + -0.008112524, + 0.001955131, + -0.009286872, + 0.0006280382, + 0.043673057, + -0.008525133, + -0.011356264, + -0.024946963, + 0.004227653, + -0.011172177, + 0.020414615, + 0.0149047, + -0.019068874, + 0.007528524, + -0.012035482, + 0.030444182, + 0.012130699, + 0.032424703, + 0.0035674793, + -0.009077393, + -0.0073888716, + -0.0064652627, + 0.025061224, + -0.012264003, + 0.009509047, + -0.0010212068, + 0.0124861775, + -0.013254264, + -0.0014623809, + -0.012733743, + -0.0036214357, + 0.0071286107, + -0.010435829, + 0.010029568, + -0.0043292185, + -0.0025724573, + -0.004132436, + 0.01084209, + -0.025594441, + -0.024121746, + -0.040219836, + -0.015247483, + 0.01291783, + -0.013279656, + -0.02866679, + -0.023512354, + -0.004833871, + -0.008055394, + -0.01616157, + 0.05151897, + 0.011762525, + 0.009267828, + -0.031662967, + 0.03950888, + 0.0046656537, + -0.014155656, + -0.014803135, + -0.0065319147, + 0.0045101317, + 0.027143313, + 0.021760354, + -0.00020055169, + 0.019614788, + 0.0036690445, + -0.000138462, + -0.0066906107, + -0.010829395, + -0.0045958273, + -0.0303934, + 0.02960627, + 0.026559312, + 0.014853917, + 0.00982009, + 0.009242438, + -0.020973222, + 0.0035896967, + 0.004602175, + -0.008645741, + -0.009540785, + -0.013901743, + 0.017634265, + -0.027498791, + 0.0050370013, + 0.0071603497, + 0.033034097, + -0.0075412197, + 0.022687137, + 0.0063097407, + 0.016085396, + -0.00038900282, + 0.028641399, + -0.014460352, + 0.0025296095, + -0.010118438, + -0.017342266, + 0.010473916, + -0.0052496535, + -0.015387135, + -0.018434092, + -0.00033127726, + 0.02767653, + 0.0010711959, + 0.005110001, + -0.013470091, + -0.00794748, + 0.005059219, + 0.013571656, + -0.014396873, + -0.00471961, + -0.026178442, + -0.018738788, + -0.0195767, + -0.012581395, + -0.029885573, + -0.00987722, + -0.003358001, + -0.041337054, + 0.013101917, + -0.0094519155, + -0.03813775, + -0.0007399187, + -0.004021349, + -0.0143206995, + -0.003903914, + 0.016631309, + -0.0007228589, + -0.017367657, + -0.015564874, + 0.029530095, + -0.0043450883, + -0.009826438, + -0.000052220803, + 0.011432438, + 0.02507392, + -0.02188731, + -0.018954614, + 0.021531831, + 0.010099394, + -0.02285218, + 0.013698612, + -0.004621219, + 0.02960627, + -0.012848004, + 0.018370613, + 0.00054234255, + 0.012936873, + -0.020973222, + 0.003465914, + 0.0036277836, + 0.0067223497, + -0.030063313, + -0.0021995225, + -0.024248702, + 0.026178442, + -0.009813742, + -0.010239046, + 0.008156959, + -0.010010525, + -0.013114613, + 0.021874614, + -0.010956351, + 0.008334698, + -0.008544176, + 0.016415482, + -0.0035611314, + -0.009655046, + 0.0135589605, + -0.007833219, + 0.018104006, + 0.019475136, + -0.022484006, + -0.023474267, + 0.0037293488, + 0.009470959, + 0.027219485, + -0.007090524, + -0.015171308, + -0.017050266, + -0.0045482186, + -0.013673221, + -0.0056178276, + 0.010429481, + 0.0050655664, + 0.008131567, + -0.00073357084, + -0.032577053, + -0.028184356, + 0.0047799144, + 0.0060272627, + -0.016060004, + -0.021747658, + -0.020973222, + 0.0015544243, + -0.0015893374, + 0.024769224, + -0.001953544, + -0.012410004, + 0.015323657, + -0.012708351, + 0.009052003, + -0.010194612, + 0.019094266, + -0.025480181, + 0.008512437, + 0.003351653, + 0.012962264, + 0.022509398, + -0.008893306, + -0.02323305, + -0.016313918, + 0.0011941851, + -0.0042974795, + 0.018180178, + -0.005773349, + 0.026051486, + 0.0052909143, + 0.0067604366, + -0.00634148, + -0.018040527, + 0.019487832, + -0.017862787, + -0.0012314786, + 0.027219485, + -0.015869569, + -0.02060505, + 0.039838966, + 0.008696524, + -0.0022534789, + -0.029453922, + 0.009267828, + -0.021557223, + 0.035877924, + -0.014269917, + -0.014549222, + -0.023207659, + 0.011559394, + -0.016618613, + 0.020414615, + 0.006424002, + -0.013533569, + 0.016428178, + 0.013203482, + 0.019767135, + -0.0014441308, + 0.016199656, + 0.0048148273, + -0.013838265, + 0.0078713065, + -0.036157228, + -0.027117921, + -0.009921655, + 0.0097058285, + -0.0044720448, + -0.009769307, + -0.014219134, + 0.009889916, + -0.042987492, + 0.024616877, + -0.0106516555, + 0.0047894362, + 0.011019829, + 0.021671485, + -0.023601225, + 0.006747741, + -0.031078964, + 0.0058685667, + -0.005097306, + -0.01385096, + -0.0065509584, + 0.0004407773, + 0.009413829, + -0.009832785, + -0.042352706, + -0.010975394, + 0.008664785, + 0.0025248486, + 0.012048177, + -0.006887393, + -0.014041395, + -0.007039741, + 0.0018519788, + 0.014485743, + 0.033211835, + 0.0052940883, + -0.0017012178, + -0.012778178, + -0.015349047, + 0.01829444, + -0.005795567, + -0.0482181, + -0.017723136, + 0.00914722, + -0.0109055685, + 0.0000068499508, + -0.015831484, + -0.028184356, + 0.01764696, + -0.017291483, + -0.002658153, + -0.022433223, + -0.017266091, + 0.015222091, + 0.007953828, + -0.01908157, + 0.007896698, + -0.00010959921, + -0.019475136, + 0.016415482, + 0.007084176, + 0.00017377178, + -0.009299568, + -0.015882265, + 0.004976697, + -0.0059098275, + -0.020985918, + 0.003538914, + 0.0038943924, + -0.0016139352, + 0.004421262, + 0.012708351, + -0.0149047, + 0.012460786, + 0.0022979137, + -0.003796001, + 0.0004649784, + -0.008842524, + 0.015882265, + -0.017342266, + -0.016707484, + -0.0052083926, + -0.022179311, + -0.020655831, + 0.018065918, + 0.009299568, + -0.0077189584, + 0.025899138, + 0.2191778, + 0.01201009, + -0.0050052623, + 0.037452184, + -0.00040983164, + 0.031434443, + 0.0018535657, + 0.0024915223, + -0.017278787, + 0.013203482, + -0.011464177, + -0.006595393, + 0.0015972722, + -0.003538914, + 0.006230393, + -0.0049227406, + -0.025086615, + -0.02381705, + 0.00021344572, + -0.035573225, + 0.0107151335, + -0.016529744, + 0.0008736198, + -0.017316874, + 0.03775688, + 0.0020170223, + -0.044079315, + 0.0065700016, + 0.013952525, + 0.024388354, + -0.018992702, + -0.008607655, + 0.00590348, + 0.00160362, + -0.014409569, + 0.013013047, + 0.0069127847, + 0.003942001, + 0.0057066972, + -0.0037737836, + 0.009851829, + -0.013127308, + 0.017316874, + -0.016428178, + 0.017380353, + 0.02451531, + -0.0187007, + -0.02729566, + 0.003205653, + 0.036461923, + -0.015145917, + -0.018738788, + 0.0065192194, + 0.010162872, + 0.0054464363, + 0.009185307, + 0.026026094, + -0.020173397, + -0.019868702, + -0.0061002625, + 0.01066435, + 0.009490003, + -0.01639009, + 0.00089821767, + -0.030063313, + 0.009636003, + -0.014917395, + 0.014333395, + -0.0032167619, + -0.0160727, + -0.0014314352, + -0.024997747, + 0.0002239593, + 0.022331659, + -0.009032959, + -0.01011209, + 0.024946963, + -0.0128607, + 0.019538615, + 0.03501462, + -0.026787834, + -0.0000737935, + -0.0068048714, + -0.011203916, + -0.016923308, + -0.030164879, + 0.0040753055, + 0.014561917, + -0.019043483, + -0.020744702, + 0.011388003, + -0.012670265, + -0.00013538726, + -0.0013401852, + 0.0178247, + 0.0057003493, + -0.006525567, + 0.010232698, + 0.0032850008, + -0.011349916, + -0.010892873, + -0.055149928, + -0.009458263, + -0.004878306, + -0.028742965, + -0.0031183704, + 0.002802566, + 0.03676662, + 0.003172327, + -0.005557523, + -0.0026216528, + -0.00032969032, + 0.017938962, + -0.0015449026, + 0.0023836093, + -0.002661327, + -0.017012179, + 0.0035928707, + 0.030291835, + -0.023956703, + 0.01878957, + -0.01914505, + -0.0029977616, + 0.033414967, + -0.02051618, + -0.01297496, + -0.011540351, + 0.011997394, + 0.025442094, + -0.011826003, + 0.038569402, + -0.0033770443, + -0.007922089, + 0.019995658, + -0.033745054, + -0.018751483, + 0.009591568, + 0.018104006, + -0.026838616, + -0.012225917, + 0.024794616, + 0.00082442415, + -0.0010283481, + 0.0064017843, + -0.0049735233, + -0.035471663, + 0.012321134, + 0.0075729587, + -0.029910965, + -0.018332526, + -0.030901225, + -0.014536526, + -0.017240701, + -0.01721531, + 0.024921572, + -0.02022418, + -0.044612534, + -0.0056463927, + -0.01385096, + -0.0008418807, + -0.0028517616, + -0.0065065236, + 0.053017057, + -0.011641916, + 0.008093481, + 0.005640045, + -0.16148874, + 0.009185307, + -0.024629572, + -0.016415482, + 0.015729917, + 0.0006538263, + 0.023194963, + -0.0074586975, + -0.018104006, + 0.018853048, + 0.010264438, + 0.0104612205, + -0.032983314, + 0.0023756747, + 0.019018093, + 0.016555134, + 0.00017168891, + -0.014371483, + 0.023296528, + 0.01966557, + 0.03834088, + 0.0026724355, + 0.0010632612, + -0.0076237414, + 0.0027803485, + 0.030520355, + -0.025556356, + 0.0037769575, + -0.011051568, + 0.0017900874, + 0.005979654, + -0.0029406312, + 0.025530964, + -0.00847435, + 0.010340611, + 0.0054020016, + 0.00010682204, + -0.0065573063, + 0.017812004, + 0.03529392, + 0.013178091, + 0.02787966, + -0.0014131851, + 0.014892004, + -0.009750264, + 0.009902611, + 0.009344002, + -0.0017504136, + 0.023588529, + -0.0047037406, + 0.009458263, + -0.03737601, + 0.016110787, + 0.0012148155, + 0.0022566528, + 0.016897917, + -0.014117569, + 0.0015052287, + -0.005862219, + -0.0006391469, + -0.012321134, + -0.011311829, + -0.013178091, + 0.0020217833, + -0.0012425873, + -0.003983262, + -0.0063510016, + -0.014879309, + 0.006446219, + 0.00604948, + -0.0024820007, + 0.002648631, + 0.003431001, + 0.007490437, + 0.000079695, + 0.023474267, + -0.017634265, + -0.0065446105, + 0.021823833, + -0.023194963, + -0.015133222, + 0.034176704, + -0.025975311, + 0.0213287, + -0.01569183, + 0.002215392, + 0.0040975227, + 0.014968178, + 0.014168352, + -0.0074650454, + 0.007325393, + -0.003577001, + -0.009344002, + -0.025645224, + 0.018104006, + 0.0110325245, + 0.009032959, + 0.010473916, + -0.0058146105, + -0.003656349, + 0.0055829147, + -0.021519136, + -0.028692182, + 0.02556905, + 0.016364701, + 0.033592705, + 0.012441742, + 0.027117921, + 0.019513223, + -0.0051480886, + -0.020122614, + 0.010264438, + 0.019906787, + 0.02545479, + -0.0107151335, + 0.038797922, + -0.014980874, + -0.025404006, + 0.030444182, + -0.0091345245, + 0.04664384, + 0.0008049839, + 0.0016726527, + 0.012867047, + -0.0007633263, + 0.0033675227, + -0.10796385, + -0.022953745, + 0.020566963, + 0.02051618, + -0.0062843496, + -0.005275045, + 0.009305916, + 0.013520873, + -0.0143206995, + 0.0037039577, + -0.011235655, + -0.017977048, + -0.015222091, + -0.013584351, + 0.023753572, + 0.008487046, + 0.025175486, + -0.02866679, + -0.00038900282, + 0.005160784, + -0.00070143497, + 0.01148322, + -0.0049798707, + 0.0067667845, + -0.0042879577, + 0.007522176, + -0.009026611, + 0.029910965, + 0.0072492193, + 0.011254699, + 0.02419792, + -0.009947047, + 0.017304178, + -0.0040657837, + -0.011629221, + -0.0005570219, + -0.024654964, + 0.0023391745, + 0.014739656, + -0.026965573, + 0.012759134, + -0.0074713933, + -0.002397892, + -0.047532536, + 0.006855654, + -0.0044879145, + 0.00028704084, + 0.018688004, + 0.022928353, + -0.0070333933, + -0.0037452185, + 0.025797572, + -0.02960627, + 0.0045958273, + 0.041692533, + -0.00590348, + 0.016669396, + -0.001878957, + -0.0097058285, + -0.006665219, + 0.0067985235, + -0.0011465764, + -0.020211484, + 0.007966524, + 0.008264872, + 0.015933048, + -0.011057916, + -0.0023471094, + 0.0051480886, + -0.015158613, + 0.012048177, + -0.00648748, + -0.016618613, + -0.008969481, + -0.010086698, + -0.03867097, + -0.03407514, + 0.0056717843, + -0.000030871273, + -0.02258557, + 0.0019789354, + -0.009769307, + 0.0074396543, + -0.0011759351, + -0.0006601741, + -0.020148005, + -0.010239046, + -0.0067794803, + -0.007515828, + -0.015818788, + -0.0044022184, + 0.011248351, + 0.031002792, + -0.013673221, + -0.016961396, + 0.018129397, + -0.014460352, + -0.002136044, + 0.017393049, + -0.02363931, + -0.0063065668, + -0.010156524, + -0.040194444, + 0.0069127847, + -0.017786613, + -0.0067413934, + 0.00876635, + -0.009978785, + 0.01677096, + 0.010042263, + -0.008290263, + 0.017012179, + -0.01063896, + 0.012695655, + 0.01376209, + 0.007960176, + -0.017139135, + -0.008874264, + 0.015425222, + 0.0052179145, + 0.022369746, + -0.00923609, + 0.022255484, + 0.030342616, + -0.0045990013, + -0.0006197067, + -0.020414615, + 0.021900006, + -0.01326696, + 0.016859831, + -0.027600355, + -0.011007134, + 0.011546698, + -0.024642268, + 0.0033326095, + 0.026076877, + -0.0143841775, + -0.029961748, + -0.0041578272, + 0.01224496, + 0.009629655, + 0.0027041747, + -0.006563654, + -0.036715835, + 0.01098809, + -0.023677398, + -0.011991046, + 0.014955482, + -0.016021917, + -0.004053088, + 0.018776875, + 0.003875349, + -0.008290263, + 0.011146786, + 0.010505655, + -0.019221222, + 0.015768005, + 0.0013885873, + 0.005947915, + -0.011851395, + 0.0051480886, + -0.031078964, + 0.035903316, + -0.009090089, + 0.008804437, + -0.009153568, + -0.004684697, + -0.013609743, + -0.016694788, + -0.013698612, + 0.014676178, + -0.029860182, + -0.018624527, + 0.005167132, + 0.019830614, + 0.011146786, + 0.039229576, + -0.017938962, + -0.0069953064, + -0.028616007, + -0.008322002, + 0.010772264, + 0.013571656, + 0.019856006, + -0.024388354, + 0.0109055685, + 0.010296177, + 0.024705745, + -0.016644005, + -0.0012473481, + 0.0054242187, + 0.004611697, + -0.004668827, + -0.01335583, + 0.011242003, + -0.0015806091, + 0.003970566, + 0.025302442, + -0.003023153, + -0.007858611, + 0.017875483, + 0.031282097, + -0.00537661, + 0.004649784, + 0.003026327, + -0.0071603497, + -0.011997394, + -0.016212352, + -0.03387201, + -0.042911317, + 0.009045655, + 0.0074079153, + 0.018256353, + 0.016707484, + -0.003983262, + 0.022623658, + 0.0074142627, + 0.012137047, + -0.001381446, + -0.0058495235, + -0.019068874, + 0.026940182, + 0.0030009355, + 0.012124351, + 0.007833219, + -0.020503484, + 0.0060590017, + 0.017177222, + -0.0040721316, + 0.00012566715, + 0.0010815111, + 0.005113175, + -0.0015353808, + 0.009483655, + -0.016301222, + -0.010346959, + -0.014460352, + 0.007084176, + 0.015983831, + 0.018814962, + -0.025213571, + 0.036868185, + 0.00441174, + 0.008734611, + 0.003903914, + -0.007915742, + 0.0053893058, + 0.028032009, + -0.020109918, + -0.0063287844, + 0.0045069577, + 0.024464529, + 0.00759835, + 0.00575748, + -0.012498873, + -0.026178442, + -0.0030056965, + 0.00038047292, + 0.0008442611, + -0.028920704, + -0.02341079, + 0.008696524, + 0.018688004, + 0.014396873, + 0.028158965, + -0.013952525, + -0.0031501097, + 0.0018995875, + -0.0034183052, + 0.012949569, + -0.04088001, + 0.0025851529, + -0.001883718, + -0.049462274, + -0.0088806115, + -0.004576784, + -0.021836529, + -0.014079482, + -0.015425222, + 0.0040753055, + 0.002727979, + -0.03138366, + 0.041159317, + -0.017608874, + -0.018637223, + 0.014587308, + 0.010486611, + -0.015387135, + -0.019424353, + -0.002800979 + ] + } + ], + "model": "text-embedding-ada-002", + "usage": { + "prompt_tokens": 16, + "total_tokens": 16 + } +} diff --git a/tests/Providers/OpenAI/EmbeddingsTest.php b/tests/Providers/OpenAI/EmbeddingsTest.php index 9fbf285..7ad8f41 100644 --- a/tests/Providers/OpenAI/EmbeddingsTest.php +++ b/tests/Providers/OpenAI/EmbeddingsTest.php @@ -20,11 +20,28 @@ ->fromInput('The food was delicious and the waiter...') ->generate(); - expect($response->embeddings)->toBeArray(); - expect($response->embeddings)->not->toBeEmpty(); + expect($response->embeddings[0])->toBeArray(); + expect($response->embeddings[0])->not->toBeEmpty(); expect($response->usage->tokens)->toBe(8); }); +it('returns embeddings from array input', function (): void { + FixtureResponse::fakeResponseSequence('v1/embeddings', 'openai/embeddings-array-input'); + + $response = Prism::embeddings() + ->using(Provider::OpenAI, 'text-embedding-ada-002') + ->fromInput([ + 'The food was delicious and the waiter...', + 'The food was delicious and the waiter...', + ]) + ->generate(); + + expect($response->embeddings[1])->toBeArray(); + expect($response->embeddings[1])->not->toBeEmpty(); + expect($response->embeddings[0])->toEqual($response->embeddings[1]); + expect($response->usage->tokens)->toBe(16); +}); + it('returns embeddings from file', function (): void { FixtureResponse::fakeResponseSequence('v1/embeddings', 'openai/embeddings-file');