juliuslipp commited on
Commit
ba6724b
1 Parent(s): 89af628

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -1
README.md CHANGED
@@ -124,7 +124,33 @@ console.log(results);
124
 
125
  ## Using API
126
 
127
- You’ll be able to use the models through our API as well. The API is coming soon and will have some exciting features. Stay tuned!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  ## Evaluation
130
 
 
124
 
125
  ## Using API
126
 
127
+ You can use the large model via our API as follows:
128
+
129
+ ```python
130
+ from mixedbread_ai.client import MixedbreadAI
131
+
132
+ mxbai = MixedbreadAI(api_key="{MIXEDBREAD_API_KEY}")
133
+
134
+ res = mxbai.reranking(
135
+ model="mixedbread-ai/mxbai-rerank-large-v1",
136
+ query="Who is the author of To Kill a Mockingbird?",
137
+ input=[
138
+ "To Kill a Mockingbird is a novel by Harper Lee published in 1960. It was immediately successful, winning the Pulitzer Prize, and has become a classic of modern American literature.",
139
+ "The novel Moby-Dick was written by Herman Melville and first published in 1851. It is considered a masterpiece of American literature and deals with complex themes of obsession, revenge, and the conflict between good and evil.",
140
+ "Harper Lee, an American novelist widely known for her novel To Kill a Mockingbird, was born in 1926 in Monroeville, Alabama. She received the Pulitzer Prize for Fiction in 1961.",
141
+ "Jane Austen was an English novelist known primarily for her six major novels, which interpret, critique and comment upon the British landed gentry at the end of the 18th century.",
142
+ "The Harry Potter series, which consists of seven fantasy novels written by British author J.K. Rowling, is among the most popular and critically acclaimed books of the modern era.",
143
+ "The Great Gatsby, a novel written by American author F. Scott Fitzgerald, was published in 1925. The story is set in the Jazz Age and follows the life of millionaire Jay Gatsby and his pursuit of Daisy Buchanan."
144
+ ],
145
+ top_k=3,
146
+ return_input=false
147
+ )
148
+
149
+ print(res.data)
150
+ ```
151
+
152
+ The API comes with additional features, such as a continous trained reranker! Check out the [docs](https://www.mixedbread.ai/docs) for more information.
153
+
154
 
155
  ## Evaluation
156