@@ -38,6 +38,7 @@ embedding_response = client.embeddings.create(
3838 " Are restraints of trade enforceable under English law?" ,
3939 " What is a non-compete clause?" ,
4040 ],
41+ task = " retrieval/query" ,
4142)
4243print (embedding_response.embeddings)
4344```
@@ -68,6 +69,7 @@ async def main() -> None:
6869 " Are restraints of trade enforceable under English law?" ,
6970 " What is a non-compete clause?" ,
7071 ],
72+ task = " retrieval/query" ,
7173 )
7274 print (embedding_response.embeddings)
7375
@@ -107,6 +109,7 @@ async def main() -> None:
107109 " Are restraints of trade enforceable under English law?" ,
108110 " What is a non-compete clause?" ,
109111 ],
112+ task = " retrieval/query" ,
110113 )
111114 print (embedding_response.embeddings)
112115
167170 " Are restraints of trade enforceable under English law?" ,
168171 " What is a non-compete clause?" ,
169172 ],
173+ task = " retrieval/query" ,
170174 )
171175except isaacus.APIConnectionError as e:
172176 print (" The server could not be reached" )
@@ -216,6 +220,7 @@ client.with_options(max_retries=5).embeddings.create(
216220 " Are restraints of trade enforceable under English law?" ,
217221 " What is a non-compete clause?" ,
218222 ],
223+ task = " retrieval/query" ,
219224)
220225```
221226
@@ -245,6 +250,7 @@ client.with_options(timeout=5.0).embeddings.create(
245250 " Are restraints of trade enforceable under English law?" ,
246251 " What is a non-compete clause?" ,
247252 ],
253+ task = " retrieval/query" ,
248254)
249255```
250256
@@ -289,6 +295,7 @@ client = Isaacus()
289295response = client.embeddings.with_raw_response.create(
290296 model = " kanon-2-embedder" ,
291297 texts = [" Are restraints of trade enforceable under English law?" , " What is a non-compete clause?" ],
298+ task = " retrieval/query" ,
292299)
293300print (response.headers.get(' X-My-Header' ))
294301
@@ -313,6 +320,7 @@ with client.embeddings.with_streaming_response.create(
313320 " Are restraints of trade enforceable under English law?" ,
314321 " What is a non-compete clause?" ,
315322 ],
323+ task = " retrieval/query" ,
316324) as response:
317325 print (response.headers.get(" X-My-Header" ))
318326
0 commit comments