openai-cookbook icon indicating copy to clipboard operation
openai-cookbook copied to clipboard

(BUGFIX) Use labels in generate_functions

Open scottrblock opened this issue 1 year ago • 1 comments

Summary

The existing code has "r'^(?:' + '|'.join({labels}) + ')$'", which is presumably trying to join the labels passed into the function, but the string interpolation does not appear to be correct python. It's not clear to me how important "correctness" is in these functions, but it seems like it would all work better if it was valid python.

My change uses pattern = r'^(?:' + '|'.join(labels.keys()) + ')$'\n",

Motivation

I was looking into how to use functions API and realized there appeared to be a bug in the cookbook example.

scottrblock avatar Feb 17 '24 02:02 scottrblock

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Apr 18 '24 01:04 github-actions[bot]

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Jun 19 '24 01:06 github-actions[bot]

This PR was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Jun 30 '24 01:06 github-actions[bot]