Realtime AI, call external URL to retrieve data. -- Tool

Hi Guys,

I’m trying to figure the correct request where the AI call external URL for information ?
But no luck on this one ?
>

  {  tools := []*genai.Tool{
  	FunctionDeclarations: []*genai.FunctionDeclaration{
  		{
  			Name:        "room_service",
  			Description: "Used to determine how many available rooms associated to category fetch from https://hook.eu1.make.com/4iw4ste3dp4g334xoqwjgoh7xuv9735u",
  			Parameters: &genai.Schema{
  				Type: genai.TypeObject,
  				Properties: map[string]*genai.Schema{
  					"category": {
  						Type:        genai.TypeString,
  						Description: "The room category to check availability",
  						Enum:        []string{"standard", "deluxe", "suite"},
  					},
  				},
  				Required: []string{"category"},
  			},
  		},
  	},
  },}

where to define the URL ?

1 Like

Hi @mtagab , Welcome to the forum.

When you directly pass URL to a model, the model doesn’t have the capability to extract content from the given URL.

Instead, you can define a custom tool to extract the content.

Thanks, I’m not able to find a sample code on the repo, do you have link to sample code that shows realtime with with tools that includes URL ?

Created a sample colab gist, please take a look.