Skip to content

Commit 3f9e9a2

Browse files
committed
Updated Cohere example [skip ci]
1 parent 6ff9b89 commit 3f9e9a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/cohere/example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
register_vector(conn)
1010

1111
conn.execute('DROP TABLE IF EXISTS documents')
12-
conn.execute('CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1024))')
12+
conn.execute('CREATE TABLE documents (id bigserial PRIMARY KEY, content text, embedding bit(1536))')
1313

1414

1515
def embed(input, input_type):
16-
co = cohere.Client()
17-
response = co.embed(texts=input, model='embed-english-v3.0', input_type=input_type, embedding_types=['ubinary'])
16+
co = cohere.ClientV2()
17+
response = co.embed(texts=input, model='embed-v4.0', input_type=input_type, embedding_types=['ubinary'])
1818
return [np.unpackbits(np.array(embedding, dtype=np.uint8)) for embedding in response.embeddings.ubinary]
1919

2020

0 commit comments

Comments
 (0)