Discourse Chatbot 🤖

It’s working for me either via Serp API or Jina.ai.

Can you provide the bots “inner thoughts” from the PM please?

Inner Thoughts
[
  {
    "role": "assistant",
    "content": "",
    "tool_calls": [
      {
        "id": "call_mKY7pfG54xRduRKCz5xee9E0",
        "type": "function",
        "function": {
          "name": "web_search",
          "arguments": "{\"query\":\"list of English butterflies\"}"
        }
      }
    ]
  },
  {
    "role": "tool",
    "tool_call_id": "call_mKY7pfG54xRduRKCz5xee9E0",
    "content": "A-Z of butterflies · A. Adonis Blue · B Black Hairstreak · Brimstone · Brown Argus · Brown Hairstreak · C Chalk Hill Blue · Chequered Skipper · Clouded Yellow · D."
  }
]
1 Like

Should we do this using PM? We are now just polluting this topic.

But:

[
  {
    "role": "assistant",
    "content": "",
    "tool_calls": [
      {
        "id": "call_4xitHqRBJ8Wc1HI546r3Wj1U",
        "type": "function",
        "function": {
          "name": "web_search",
          "arguments": "{\"query\":\"International Dog Day date and history\"}"
        }
      }
    ]
  },
  {
    "role": "tool",
    "tool_call_id": "call_4xitHqRBJ8Wc1HI546r3Wj1U",
    "content": "International Dog Day date and history: my search for this on the internet failed."
  }
]

We can. So that failure is interesting.

Is your account in good order with serp API? Do you have capacity left? Have you still got quota left?

Yes and yes. My account shows that request is done, no errors, no nothing. Well, nothing I can see.

1 Like

Improved Serp API web search

2 Likes

The problem was not old or new user. New users also had the error. Today I got errors again. The error image is as follows. There is also a warning about the characters.

Chatbot: There was a problem with Chat Completion: status: 400, message: Invalid ‘messages[1].name’: string does not match pattern. Expected a string that matches the pattern ‘+$’.

Suspect you are not using Open AI?

The model needs to conform to Open AI API standards that includes the name attribute (which has been around for ~ a year?)

If you are using a proxy and they claim to provide open AI standards they are not telling you the truth :slight_smile:

The change was made here:

You could always fork the plugin and change the commit to just prior to this change but you will have to manage other improvements

1 Like

I am using Azure. Could my settings be wrong?

Sounds like you are using a very old model

Here is the current API

https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages

I would make sure you’ve deployed one of the latest models.

gpt-4o-mini definitely supports this.

Should we not change the following separately for the API version?

1 Like

That’s probably way too old :).

If you need more detailed help marketplace. I cannot support this level of detail for free :).

1 Like

Thank you for your help @merefield

1 Like

My closing remark on this: Try deploying a much newer version of the API from 2024 at least.

1 Like

I did the solution suggestions you suggested, my problem continues. I have been following the problem since I last wrote. I discovered that the users who have this problem have non-English characters in their usernames. Could there be a problem with this? There is no problem with the other usernames that have English characters.

Error: Chatbot: There was a problem with Chat Completion: status: 400, message: Invalid 'messages[1].name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.

unicode usernames → This setting is on

you need to take this up with Azure support as they should support the latest features of the Open AI API (by proxy). If not, they need to update.

I’m just using a standard feature of the OpenAI API.

Meantime you could try to checkout a prior commit of the plugin

1 Like

How can I install the old commit of this plugin?@merefield

Write a tiny script in app.yml to clone, enter the directory and checkout the commit prior to the change.

But really you should solve this with azure support.

1 Like

Sorry just reread your error message.

So it looks now like the API is complaining about at least one of your usernames having the right format?

Btw you can also fork the plugin, checkout the earlier commit, create a new branch, push it to GitHub and then clone witn -b <branch name>

It would be a great learning exercise to do this yourself but you might hire someone to help you if needed in marketplace

1 Like

Yes, it gives error because of usernames. If the username contains non-English letters such as ş, i, ü, ö, etc., it gives an error. As a bot error:

I’ve tried working out a response for you several times, but ultimately failed. Please contact the admin if this persists, thank you!

It writes the message. In the log screen, one of the errors is related to characters.

I edit the username of the user who published the post that I got the error and make it English characters. Then I tag the bot in the post that got the error, the bot responds without getting an error.

But if I do not edit the username and tag the bot in the post, the bot does not respond again and writes the same error.

I will try your suggestion.

I’ve introduced a setting (default OFF) to enable the name attribute.

If you update to the latest version, you should not need to do anything.

Others can optionally switch it on to use it.

I can’t always provide such a service for free, but I was convinced of the merit of keeping Chatbot more language agnostic.

1 Like