// 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.chatCompletionUnified({
  inference_id: "openai-completion",
  chat_completion_request: {
    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);
----
