poe-platform / server-bot-quick-start

Tutorial for Poe server bots
1.31k stars 192 forks source link

Error when running function_calling_bot (0 or undefined call count in settings) #87

Open elifiner opened 1 month ago

elifiner commented 1 month ago

I'm running function_calling_bot.py unmodified via a custom Poe bot and getting the error below. Getting the same error with turbo_allcapsbot.py as well.

Looks like I should be supplying the expected call count to external bots via SettingsResponse, but there's no argument set up for that.

What am I missing?

Error in Poe bot: Bot request to GPT-3.5-Turbo failed on try 0
 BotError('{"allow_retry": true, "text": "Message m-000000xy92nqlva9wbmbul5ugqbtfqos called on bot that has 0 or undefined call count in settings."}')
Error in Poe bot: Bot request to GPT-3.5-Turbo failed on try 1
 BotError('{"allow_retry": true, "text": "Message m-000000xy92nqlva9wbmbul5ugqbtfqos called on bot that has 0 or undefined call count in settings."}')
Error responding to query
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/fastapi_poe/base.py", line 703, in handle_query
    async for event in self.get_response_with_context(request, context):
  File "/usr/local/lib/python3.12/site-packages/fastapi_poe/base.py", line 182, in get_response_with_context
    async for event in self.get_response(request):
  File "/root/function_calling_bot.py", line 59, in get_response
    async for msg in fp.stream_request(
  File "/usr/local/lib/python3.12/site-packages/fastapi_poe/client.py", line 334, in stream_request
    tool_calls = await _get_tool_calls(
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi_poe/client.py", line 410, in _get_tool_calls
    async for message in stream_request_base(
  File "/usr/local/lib/python3.12/site-packages/fastapi_poe/client.py", line 483, in stream_request_base
    async for message in ctx.perform_query_request(
  File "/usr/local/lib/python3.12/site-packages/fastapi_poe/client.py", line 229, in perform_query_request
    raise BotError(event.data)
fastapi_poe.client.BotError: {"allow_retry": true, "text": "Message m-000000xy92nqlva9wbmbul5ugqbtfqos called on bot that has 0 or undefined call count in settings."}
elifiner commented 1 month ago

Figured it out - needed to sync the settings as per https://creator.poe.com/docs/server-bots-functional-guides#updating-bot-settings.