We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c89e07 commit c58ee4eCopy full SHA for c58ee4e
1 file changed
examples/cohere/example.rb
@@ -6,18 +6,18 @@
6
conn.exec("CREATE EXTENSION IF NOT EXISTS vector")
7
8
conn.exec("DROP TABLE IF EXISTS documents")
9
-conn.exec("CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1024))")
+conn.exec("CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1536))")
10
11
# https://docs.cohere.com/reference/embed
12
def embed(texts, input_type)
13
- url = "https://api.cohere.com/v1/embed"
+ url = "https://api.cohere.com/v2/embed"
14
headers = {
15
"Authorization" => "Bearer #{ENV.fetch("CO_API_KEY")}",
16
"Content-Type" => "application/json"
17
}
18
data = {
19
texts: texts,
20
- model: "embed-english-v3.0",
+ model: "embed-v4.0",
21
input_type: input_type,
22
embedding_types: ["ubinary"]
23
0 commit comments