Skip to content

Commit fecda56

Browse files
Auto-generated code for 8.16 (#2569)
1 parent f9a5a18 commit fecda56

8 files changed

+214
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.indices.create({
7+
index: "jinaai-index",
8+
mappings: {
9+
properties: {
10+
content: {
11+
type: "semantic_text",
12+
inference_id: "jinaai-embeddings",
13+
},
14+
},
15+
},
16+
});
17+
console.log(response);
18+
----
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
index: "jinaai-index",
8+
query: {
9+
semantic: {
10+
field: "content",
11+
query: "who inspired taking care of the sea?",
12+
},
13+
},
14+
});
15+
console.log(response);
16+
----
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
query: {
8+
intervals: {
9+
my_text: {
10+
all_of: {
11+
ordered: false,
12+
max_gaps: 1,
13+
intervals: [
14+
{
15+
match: {
16+
query: "my favorite food",
17+
max_gaps: 0,
18+
ordered: true,
19+
},
20+
},
21+
{
22+
match: {
23+
query: "cold porridge",
24+
max_gaps: 4,
25+
ordered: true,
26+
},
27+
},
28+
],
29+
},
30+
},
31+
},
32+
},
33+
});
34+
console.log(response);
35+
----
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.bulk({
7+
index: "jinaai-index",
8+
operations: [
9+
{
10+
index: {
11+
_index: "jinaai-index",
12+
_id: "1",
13+
},
14+
},
15+
{
16+
content:
17+
"Sarah Johnson is a talented marine biologist working at the Oceanographic Institute. Her groundbreaking research on coral reef ecosystems has garnered international attention and numerous accolades.",
18+
},
19+
{
20+
index: {
21+
_index: "jinaai-index",
22+
_id: "2",
23+
},
24+
},
25+
{
26+
content:
27+
"She spends months at a time diving in remote locations, meticulously documenting the intricate relationships between various marine species. ",
28+
},
29+
{
30+
index: {
31+
_index: "jinaai-index",
32+
_id: "3",
33+
},
34+
},
35+
{
36+
content:
37+
"Her dedication to preserving these delicate underwater environments has inspired a new generation of conservationists.",
38+
},
39+
],
40+
});
41+
console.log(response);
42+
----
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.inference.put({
7+
task_type: "rerank",
8+
inference_id: "jinaai-rerank",
9+
inference_config: {
10+
service: "jinaai",
11+
service_settings: {
12+
api_key: "<api_key>",
13+
model_id: "jina-reranker-v2-base-multilingual",
14+
},
15+
task_settings: {
16+
top_n: 10,
17+
return_documents: true,
18+
},
19+
},
20+
});
21+
console.log(response);
22+
----
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
query: {
8+
intervals: {
9+
my_text: {
10+
all_of: {
11+
ordered: true,
12+
max_gaps: 1,
13+
intervals: [
14+
{
15+
match: {
16+
query: "my favorite food",
17+
max_gaps: 0,
18+
ordered: true,
19+
},
20+
},
21+
{
22+
match: {
23+
query: "cold porridge",
24+
max_gaps: 4,
25+
ordered: true,
26+
},
27+
},
28+
],
29+
},
30+
},
31+
},
32+
},
33+
});
34+
console.log(response);
35+
----
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.search({
7+
index: "jinaai-index",
8+
retriever: {
9+
text_similarity_reranker: {
10+
retriever: {
11+
standard: {
12+
query: {
13+
semantic: {
14+
field: "content",
15+
query: "who inspired taking care of the sea?",
16+
},
17+
},
18+
},
19+
},
20+
field: "content",
21+
rank_window_size: 100,
22+
inference_id: "jinaai-rerank",
23+
inference_text: "who inspired taking care of the sea?",
24+
},
25+
},
26+
});
27+
console.log(response);
28+
----
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This file is autogenerated, DO NOT EDIT
2+
// Use `node scripts/generate-docs-examples.js` to generate the docs examples
3+
4+
[source, js]
5+
----
6+
const response = await client.inference.put({
7+
task_type: "text_embedding",
8+
inference_id: "jinaai-embeddings",
9+
inference_config: {
10+
service: "jinaai",
11+
service_settings: {
12+
model_id: "jina-embeddings-v3",
13+
api_key: "<api_key>",
14+
},
15+
},
16+
});
17+
console.log(response);
18+
----

0 commit comments

Comments
 (0)