Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual function call won't work #8

Open
xpellarin opened this issue Feb 1, 2025 · 0 comments
Open

Manual function call won't work #8

xpellarin opened this issue Feb 1, 2025 · 0 comments

Comments

@xpellarin
Copy link

xpellarin commented Feb 1, 2025

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant