Skip to content

Commit b83298a

Browse files
committed
Updated Cohere example [skip ci]
1 parent e74036e commit b83298a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/cohere/example.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ Postgrex.query!(pid, "DROP TABLE IF EXISTS documents", [])
77

88
Postgrex.query!(
99
pid,
10-
"CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1024))",
10+
"CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1536))",
1111
[]
1212
)
1313

1414
defmodule Example do
1515
def embed(texts, input_type) do
1616
api_key = System.fetch_env!("CO_API_KEY")
17-
url = "https://api.cohere.com/v1/embed"
17+
url = "https://api.cohere.com/v2/embed"
1818

1919
data = %{
2020
"texts" => texts,
21-
"model" => "embed-english-v3.0",
21+
"model" => "embed-v4.0",
2222
"input_type" => input_type,
2323
"embedding_types" => ["ubinary"]
2424
}

0 commit comments

Comments
 (0)