Skip to content

Commit 78703c9

Browse files
committed
Updated Cohere example [skip ci]
1 parent 7270fb3 commit 78703c9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

examples/cohere/example.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66

77
pg_query($db, 'CREATE EXTENSION IF NOT EXISTS vector');
88
pg_query($db, 'DROP TABLE IF EXISTS documents');
9-
pg_query($db, 'CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1024))');
9+
pg_query($db, 'CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1536))');
1010

1111
// https://docs.cohere.com/reference/embed
1212
function embed($texts, $inputType)
1313
{
1414
$apiKey = getenv('CO_API_KEY') or die("Set CO_API_KEY\n");
15-
$url = 'https://api.cohere.com/v1/embed';
15+
$url = 'https://api.cohere.com/v2/embed';
1616
$data = [
1717
'texts' => $texts,
18-
'model' => 'embed-english-v3.0',
18+
'model' => 'embed-v4.0',
1919
'input_type' => $inputType,
2020
'embedding_types' => ['ubinary']
2121
];

0 commit comments

Comments
 (0)