File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ fn main() -> Result<(), Box<dyn Error>> {
1313 client. execute ( "CREATE EXTENSION IF NOT EXISTS vector" , & [ ] ) ?;
1414 client. execute ( "DROP TABLE IF EXISTS documents" , & [ ] ) ?;
1515 client. execute (
16- "CREATE TABLE documents (id serial PRIMARY KEY, content text, embedding bit(1024 ))" ,
16+ "CREATE TABLE documents (id serial PRIMARY KEY, content text, embedding bit(1536 ))" ,
1717 & [ ] ,
1818 ) ?;
1919
@@ -47,11 +47,11 @@ fn main() -> Result<(), Box<dyn Error>> {
4747fn embed ( texts : & [ & str ] , input_type : & str ) -> Result < Vec < Vec < u8 > > , Box < dyn Error > > {
4848 let api_key = std:: env:: var ( "CO_API_KEY" ) . or ( Err ( "Set CO_API_KEY" ) ) ?;
4949
50- let response: Value = ureq:: post ( "https://api.cohere.com/v1 /embed" )
50+ let response: Value = ureq:: post ( "https://api.cohere.com/v2 /embed" )
5151 . header ( "Authorization" , & format ! ( "Bearer {}" , api_key) )
5252 . send_json ( serde_json:: json!( {
5353 "texts" : texts,
54- "model" : "embed-english-v3 .0" ,
54+ "model" : "embed-v4 .0" ,
5555 "input_type" : input_type,
5656 "embedding_types" : & [ "ubinary" ] ,
5757 } ) ) ?
You can’t perform that action at this time.
0 commit comments