File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ import 'package:postgres/postgres.dart';
66
77Future <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' ,
You can’t perform that action at this time.
0 commit comments