Skip to content

.Net: Function names are triggering errors on Azure OpenAI #5825

@brandonh-msft

Description

@brandonh-msft

Describe the bug
When I am using Plugins & Function Calling w/in my setup, I am getting occasional errors from Azure OpenAI:

'functions.TBAAgent-GetEventsByDateRange' does not match '^[a-zA-Z0-9_-]{1,64}$' - 'messages.4.tool_calls.0.function.name' Status: 400 (model_error)  Content: {
  "error": {
    "message": "'functions.TBAAgent-GetEventsByDateRange' does not match '^[a-zA-Z0-9_-]{1,64}$' - 'messages.4.tool_calls.0.function.name'",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

To Reproduce
Steps to reproduce the behavior:

  1. Add a Plugin from a Class that defines multiple [KernelFunction]-decorated methods.
  2. Run a Chat session that executes one/more of the functions in the defined plugin against an Azure OpenAI model - I am using gpt-4-32k v01613

Expected behavior
Functions should execute as required by the LLM based on the prompt

Platform

  • OS: Windows
  • IDE: Visual Studio
  • Language: C#,
  • Source: Nuget v1.7.1

Metadata

Metadata

Labels

.NETIssue or Pull requests regarding .NET code

Type

No type

Projects

Status

Sprint: Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions