Force function to default value

I have the following function:

     "name": "complement_the_typeface",
     "description": "Find a complementary font to a given font.",
     "parameters": {
         "type": "object",
         "properties": {
             "to_card_list": {
             "type": "string",
             "description": "A list indicating which cards need to be updated. Always use at least one of the default values.",
             "enum" : CARD_INFO['cards'] + ['None'],

Based on the prompt ‘Add a complementary font to the display font’

GPT response was: {'to_card_list': ['displayTypeface']}.

However, ‘displayTypeface’ is not in the default values. Can I force it to choose a default value? Since I added ‘None’ to the default values, I expected it to return ‘None’

I’d maybe try to be a little more explicit about the default value.
Something like “if no card needs to be updated, return ‘None’” (you can probably try to play with it to make it more concise).

This whole function is phrased strangely, so it is likely that the AI won’t be able to figure out what to do with “cards”.

For the enum, each string option that can be selected must actually be a string and the AI is told to output a string. It shall not do anything but pick one of the strings in a list. But it is an unreliable AI, also.

"string_enum": {"type": "string", "enum": ["Happy", "Sad"]

I would check what’s actually being appended and see that the strings are clear and don’t have strange characters, objects, and that the list isn’t miles long.

And then your function ‘get_complementary_font_face’, (which describes what complementary means), can tell the AI by property “font_request_options” (which describes it the purpose of selection one option) why it should pick one of the strings shown to the AI, and what results are expected to be returned.

The enum is fine; that is a short list with strings. I changed the function title to your suggestion though. Thanks

Thanks for your reply. The point is not that no card needs to be updated, the point is that someone might have mentioned the card in a previous prompt. So that if no card is mentioned, this function will search in history.

Ok, I guess I didn’t understand what you were referring to with “default value” (what did you mean btw?).
Anyway to your question, I guess you can have your function templated and add custom values according to the chat history. This is of course assuming you somehow manage this context yourself (what’s considered a card). You’d possibly also/alternatively need to provide the history chat completion prompt of course.
(I hope I understand your question correctly now, though I’m not sure, so sorry in advance if I haven’t)

Hi, sorry for my late response. With default values, I meant the ‘enum’ parameter.