.... In the AI Settings adding custom AI provider does not connect when using Kimi 2.6 API directly purchased from Kimi. I have tried all the various base-URL combinations such as the following but to no resolve :
I checked their docs and the baseUrl is https://api.moonshot.ai/v1, so that looks fine. Does it still show the error when you have set the options and restarted Wappler?
Yes, the error still persists in Wappler version 7.9.3. However, I have decided to use GitHub Copilot as that seems to have deep integration into Wappler, and it works flawlessly. In my tests, the frontier models work well in Wappler. But Deepseek, Kimi, others from OpenRouter all have throttling issues. Copilot has no issues.
The issues from providers other than Copilot range from 429, 400, 401, Missing Authentication header. Even Gemini has issues.
UPDATE: After updating Wappler to 7.9.4 the Kimi issue has been resolved. The Kimi models list is visible. But sending requests, or trying to invoke results in the error:
400 Invalid request: the message at position 4 with role “assitant” must not be empty.
All other AI providers are still not working as of Wappler 7.9.4.
UPDATE: Using Copilot the following message appears, and the session is stuck, even after restarting wappler, and creating a new task:
400 prompt token count of 128568 exceeds the limit of 128000
400 messages.2.content.0: unexpected tool_use_id found in tool_result blocks: toolu_vrtx_0169qpvgn2ziweQWSvtaPePG. Each tool_result block must have a corresponding tool_use block in the previous message.
This issue still persists. The only AI provider that works is Github Copilot. Ideally I would like to use Kimi 2.6 etc, but whether that is through open router, or added as a Custom AI provider, it continues to produce errors. Use the custom AI provider the following error continues.
400 Invalid request: the message at position 4 with role 'assistant' must not be empty
There is currently not much you can do yourself, I will look into the different errors. You can try using open router or try other models and post any error you get back here.
400 prompt token count of 128568 exceeds the limit of 128000
This error happens when the number of tokens exceeds the token limit of the model. This can happen with a long chat or when a lot of context is being send. For example in Wappler using the chat on a very large code file can exceed the limit.
400 messages.2.content.0: unexpected tool_use_id found in tool_result blocks: toolu_vrtx_0169qpvgn2ziweQWSvtaPePG. Each tool_result block must have a corresponding tool_use block in the previous message.
Not sure when this would happen since we don't use the tool_use option. Copilot endpoint is a proxy which makes some changes to the original request that we send, it is possible that the tool_use is added on their server. We had similar issues with some requests to copilot in the past, will investigate this further.
400 Invalid request: the message at position 4 with role 'assistant' must not be empty
I have to check when this would happen, the error says the message at position 4 was empty. Not sure if perhaps the endpoint returned an empty message or that we stripped something in our client.