Skip to content

Commit 79bc371

Browse files
committed
Updated Cohere example [skip ci]
1 parent 39ba4b5 commit 79bc371

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/cohere/example.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ let db = db_postgres.open("localhost", "", "", "pgvector_example")
55

66
db.exec(sql"CREATE EXTENSION IF NOT EXISTS vector")
77
db.exec(sql"DROP TABLE IF EXISTS documents")
8-
db.exec(sql"CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1024))")
8+
db.exec(sql"CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1536))")
99

1010
proc embed(texts: openArray[string], inputType: string): seq[string] =
11-
let url = "https://api.cohere.com/v1/embed"
11+
let url = "https://api.cohere.com/v2/embed"
1212
let body = %*{
1313
"texts": texts,
14-
"model": "embed-english-v3.0",
14+
"model": "embed-v4.0",
1515
"input_type": inputType,
1616
"embedding_types": ["ubinary"]
1717
}

0 commit comments

Comments
 (0)