Files
elasticsearch-js/docs/doc_examples/82bb6c61dab959f4446dc5ecab7ecbdf.asciidoc
2025-03-24 17:55:18 +00:00

33 lines
786 B
Plaintext

// 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.inference.streamInference({
task_type: "chat_completion",
inference_id: "openai-completion",
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);
----