openai-cookbook
openai-cookbook copied to clipboard
(BUGFIX) Use labels in generate_functions
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.
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.
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.
This PR was closed because it has been stalled for 10 days with no activity.