Skip to content

Commit ac26687

Browse files
natewiebe13OskarStark
authored andcommitted
[Platform][Voyage] Embedding update
1 parent 1f39a86 commit ac26687

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

src/platform/src/Bridge/Voyage/ModelClient.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public function request(Model $model, object|string|array $payload, array $optio
3939
'json' => [
4040
'model' => $model->getName(),
4141
'input' => $payload,
42+
'input_type' => $options['input_type'] ?? null,
43+
'truncation' => $options['truncation'] ?? true,
44+
'output_dimension' => $options['dimensions'] ?? null,
4245
],
4346
]));
4447
}

src/platform/src/Bridge/Voyage/Voyage.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,34 @@
1919
*/
2020
class Voyage extends Model
2121
{
22+
/** Supported dimensions: 2048, 1024, 512, or 256 */
23+
public const V3_5 = 'voyage-3.5';
24+
/** Supported dimensions: 2048, 1024, 512, or 256 */
25+
public const V3_5_LITE = 'voyage-3.5-lite';
26+
/** Fixed 1024 dimensions */
2227
public const V3 = 'voyage-3';
28+
/** Fixed 512 dimensions */
2329
public const V3_LITE = 'voyage-3-lite';
30+
/** Supported dimensions: 2048, 1024, 512, or 256 */
31+
public const V3_LARGE = 'voyage-3-large';
32+
/** Fixed 1024 dimensions */
2433
public const FINANCE_2 = 'voyage-finance-2';
34+
/** Fixed 1024 dimensions */
2535
public const MULTILINGUAL_2 = 'voyage-multilingual-2';
36+
/** Fixed 1024 dimensions */
2637
public const LAW_2 = 'voyage-law-2';
38+
/** Supported dimensions: 2048, 1024, 512, or 256 */
39+
public const CODE_3 = 'voyage-code-3';
40+
/** Fixed 1536 dimensions */
2741
public const CODE_2 = 'voyage-code-2';
2842

43+
public const INPUT_TYPE_DOCUMENT = 'document';
44+
public const INPUT_TYPE_QUERY = 'query';
45+
2946
/**
30-
* @param array<string, mixed> $options
47+
* @param array{dimensions?: int, input_type?: self::INPUT_TYPE_*, truncation?: bool} $options
3148
*/
32-
public function __construct(string $name = self::V3, array $options = [])
49+
public function __construct(string $name = self::V3_5_LITE, array $options = [])
3350
{
3451
parent::__construct($name, [Capability::INPUT_MULTIPLE], $options);
3552
}

src/platform/tests/Bridge/Voyage/ResultConverterTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,15 @@ public function testItSupportsVoyageModel(string $modelName)
103103

104104
public static function voyageModelsProvider(): iterable
105105
{
106+
yield 'V3_5' => [Voyage::V3_5];
107+
yield 'V3_5_LITE' => [Voyage::V3_5_LITE];
106108
yield 'V3' => [Voyage::V3];
107109
yield 'V3_LITE' => [Voyage::V3_LITE];
110+
yield 'V3_LARGE' => [Voyage::V3_LARGE];
108111
yield 'FINANCE_2' => [Voyage::FINANCE_2];
109112
yield 'MULTILINGUAL_2' => [Voyage::MULTILINGUAL_2];
110113
yield 'LAW_2' => [Voyage::LAW_2];
114+
yield 'CODE_3' => [Voyage::CODE_3];
111115
yield 'CODE_2' => [Voyage::CODE_2];
112116
}
113117
}

0 commit comments

Comments
 (0)