// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.mjs` to generate the docs examples

[source, js]
----
const response = await client.inference.chatCompletionUnified({
  inference_id: "openai-completion",
  chat_completion_request: {
    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);
----
