Skip to content

Commit da6d8ef

Browse files
committed
Updated Cohere example [skip ci]
1 parent 658ae3a commit da6d8ef

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

examples/cohere/example.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import 'package:postgres/postgres.dart';
66

77
Future<List<dynamic>> embed(
88
List<String> texts, String inputType, String apiKey) async {
9-
var url = Uri.https('api.cohere.com', 'v1/embed');
9+
var url = Uri.https('api.cohere.com', 'v2/embed');
1010
var headers = {
1111
'Authorization': 'Bearer ${apiKey}',
1212
'Content-Type': 'application/json'
1313
};
1414
var data = {
1515
'texts': texts,
16-
'model': 'embed-english-v3.0',
16+
'model': 'embed-v4.0',
1717
'input_type': inputType,
1818
'embedding_types': ['ubinary']
1919
};
@@ -44,7 +44,7 @@ void main() async {
4444

4545
await connection.execute('DROP TABLE IF EXISTS documents');
4646
await connection.execute(
47-
'CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1024))');
47+
'CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1536))');
4848

4949
var input = [
5050
'The dog is barking',

0 commit comments

Comments
 (0)