-
Notifications
You must be signed in to change notification settings - Fork 727
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa7d327
commit 804ccf7
Showing
28 changed files
with
2,141 additions
and
330 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
docs/doc_examples/120fcf9f55128d6a81d5e87a9c235bbd.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.transport.request({ | ||
method: "POST", | ||
path: "/_inference/chat_completion/openai-completion/_stream", | ||
body: { | ||
model: "gpt-4o", | ||
messages: [ | ||
{ | ||
role: "user", | ||
content: "What is Elastic?", | ||
}, | ||
], | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
docs/doc_examples/31bc93e429ad0de11dd2dd231e8f2c5e.asciidoc
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
docs/doc_examples/45954b8aaedfed57012be8b6538b0a24.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.transport.request({ | ||
method: "POST", | ||
path: "/_inference/chat_completion/openai-completion/_stream", | ||
body: { | ||
messages: [ | ||
{ | ||
role: "user", | ||
content: [ | ||
{ | ||
type: "text", | ||
text: "What's the price of a scarf?", | ||
}, | ||
], | ||
}, | ||
], | ||
tools: [ | ||
{ | ||
type: "function", | ||
function: { | ||
name: "get_current_price", | ||
description: "Get the current price of a item", | ||
parameters: { | ||
type: "object", | ||
properties: { | ||
item: { | ||
id: "123", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
tool_choice: { | ||
type: "function", | ||
function: { | ||
name: "get_current_price", | ||
}, | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
20 changes: 20 additions & 0 deletions
20
docs/doc_examples/519e46350316a33162740e5d7968aa2c.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.search({ | ||
index: "image-index", | ||
knn: { | ||
field: "image-vector", | ||
query_vector: [-5, 9, -12], | ||
k: 10, | ||
num_candidates: 100, | ||
rescore_vector: { | ||
oversample: 2, | ||
}, | ||
}, | ||
fields: ["title", "file-type"], | ||
}); | ||
console.log(response); | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
docs/doc_examples/82bb6c61dab959f4446dc5ecab7ecbdf.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This file is autogenerated, DO NOT EDIT | ||
// Use `node scripts/generate-docs-examples.js` to generate the docs examples | ||
|
||
[source, js] | ||
---- | ||
const response = await client.transport.request({ | ||
method: "POST", | ||
path: "/_inference/chat_completion/openai-completion/_stream", | ||
body: { | ||
messages: [ | ||
{ | ||
role: "assistant", | ||
content: "Let's find out what the weather is", | ||
tool_calls: [ | ||
{ | ||
id: "call_KcAjWtAww20AihPHphUh46Gd", | ||
type: "function", | ||
function: { | ||
name: "get_current_weather", | ||
arguments: '{"location":"Boston, MA"}', | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
role: "tool", | ||
content: "The weather is cold", | ||
tool_call_id: "call_KcAjWtAww20AihPHphUh46Gd", | ||
}, | ||
], | ||
}, | ||
}); | ||
console.log(response); | ||
---- |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.