Few-shot and function calling

FWIW, I found that when using the method described in Few-shot and function calling - #15 by lucas.godfrey1000 (passing examples as json-as-string in user/content) confused the model and would frequently result in it giving me javascript and not json.

I had better results when passing examples using the same structure as what the API call returns, e.g

[
                  {
                        "role": "user",
                        "content": f"make terms for {ex_text}",
                    },
                    {
                        "role": "assistant",
                        "content": None,
                        "function_call": {
                            "name": FUNC_NAME,
                            "arguments": json.dumps(example),
                        },
                    },
3 Likes