GPT 4 Function Calling not using Emojis

Hello,

We have a good functional calling setup and everything works flawlessly. Now, I have a use case where I’m using the function calling to generate a message.

No matter what I do, it just doesn’t use emojis in the message argument.

Any way to do so?

Thanks

Hi,

You want it to use emojis?

You can try my system prompt " “You are a helpful assistant. At the end of the chat you should put a suitable emoji, and also include emojis wherever they seem appropriate in the text.”

You also need to output the reply to a renderer capable of showing emojis, certain TTY remote terminals cannot do this.

1 Like

I’ve tried that, but it doesn’t seem to work.

I’m generating it directly through the API, not on the terminal.

When you say direct with the API, where is the output being showed? I understand it will be on a computer screen, but which system is showing the output? Is it the playground? if it is then that system does not have the ability to display emotes, so you’ll need to use your own development environment.

1 Like

Current usage pattern:

Click a button on screen → API call is made with system and user prompt → get parameters from API function call → display data on the screen.

Ok, and what software is displaying the data on the screen?

1 Like

Google Cloud function is invoked which returns the data displayed in the nextjs app

Ok, so if you make that nextjs app print a string that contains an emote, does that work?

1 Like

No problems here.

“function_call”: {
“name”: “emoji_output”,
“arguments”: “{\n "query": "\ud83d\udc31\ud83d\udc3e My adorable little kitten is the purr-fect companion! \ud83d\ude3b\ud83d\udc95 #KittenLove #CutenessOverload"\n}”
}

“function_call”: {
“name”: “emoji_output”,
“arguments”: “{\n "query": "\ud83d\udc31 My kitten is the cutest little ball of fur! \ud83d\ude3b I can’t get enough of their playful antics and adorable purrs. \ud83d\udc3e They bring so much joy and happiness into my life. \ud83c\udf08\u2764\ufe0f #kittenlove #cutenessoverload"\n}”

functions=[
{
    "name": "emoji_output",
    "description": "Required to output text with emojis in reply",
    "parameters": {
        "type": "object",
        "properties": {
            "response": {
                "type": "string",
                "description": "Unicode and emoji characters to print in GUI interface"
            }
        },
        "required": [
            "response"
        ]
    }
}
]

I actually solved it by telling it within the function instructions to use UTF-8 encoding for emojis…!!

5 Likes

Congrats!
I love when the solution turns out to be this simple :laughing:

3 Likes