// 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",
  model: "gpt-4o",
  messages: [
    {
      role: "user",
      content: "What is Elastic?",
    },
  ],
});
console.log(response);
----
