Skip to content

Manual function call won't work #8

Open
@xpellarin

Description

@xpellarin

I am trying to add manual function call, as described in the section "Manually using tools" here: https://github.com/openai/openai-realtime-api-beta/blob/main/README.md

I cloned the svelte-openai-realtime-api repo, added the following code on line 71 (right after the last client.updatesession):

client.updateSession({
  tools: [
    {
      type: 'function',
      name: 'get_weather',
      description:
        'Retrieves the weather for a given lat, lng coordinate pair. Specify a label for the location.',
      parameters: {
        type: 'object',
        properties: {
          lat: {
            type: 'number',
            description: 'Latitude',
          },
          lng: {
            type: 'number',
            description: 'Longitude',
          },
          location: {
            type: 'string',
            description: 'Name of the location',
          },
        },
        required: ['lat', 'lng', 'location'],
      },
    },
  ],
});

When I try asking the weather for a given location, the model never trigger a function_call item type and I am getting a random answer..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions