Skip to content

Latest commit

 

History

History
45 lines (44 loc) · 897 Bytes

45954b8aaedfed57012be8b6538b0a24.asciidoc

File metadata and controls

45 lines (44 loc) · 897 Bytes
const response = await client.inference.streamInference({
  task_type: "chat_completion",
  inference_id: "openai-completion",
  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);