bolna: Getting stuck on loop "Last transmitted timestamp is simply 0 and hence continuing" when calling /call API

bolna-app-1   | future: <Task finished name='Task-33' coro=<write_request_logs() done, defined at /usr/local/lib/python3.10/site-packages/bolna/helpers/utils.py:414> exception=TypeError("object of type 'NoneType' has no len()") created at /usr/local/lib/python3.10/asyncio/tasks.py:337>
bolna-app-1   | source_traceback: Object created at (most recent call last):
bolna-app-1   |   File "/usr/local/bin/uvicorn", line 8, in <module>
bolna-app-1   |     sys.exit(main())
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
bolna-app-1   |     return self.main(*args, **kwargs)
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1078, in main
bolna-app-1   |     rv = self.invoke(ctx)
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
bolna-app-1   |     return ctx.invoke(self.callback, **ctx.params)
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
bolna-app-1   |     return __callback(*args, **kwargs)
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/uvicorn/main.py", line 410, in main
bolna-app-1   |     run(
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/uvicorn/main.py", line 578, in run
bolna-app-1   |     server.run()
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 61, in run
bolna-app-1   |     return asyncio.run(self.serve(sockets=sockets))
bolna-app-1   |   File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
bolna-app-1   |     return loop.run_until_complete(main)
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/bolna/agent_manager/task_manager.py", line 1341, in __first_message
bolna-app-1   |     await self._synthesize(create_ws_data_packet(self.kwargs.get('agent_welcome_message', None), meta_info= meta_info))
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/bolna/agent_manager/task_manager.py", line 1172, in _synthesize
bolna-app-1   |     self.__convert_to_request_log(message = text, meta_info= meta_info, component="synthesizer", direction="response", model = self.synthesizer_provider, is_cached= True, engine=self.tools['synthesizer'].get_engine())
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/bolna/agent_manager/task_manager.py", line 626, in __convert_to_request_log
bolna-app-1   |     asyncio.create_task(write_request_logs(log, self.run_id))
bolna-app-1   |   File "/usr/local/lib/python3.10/asyncio/tasks.py", line 337, in create_task
bolna-app-1   |     task = loop.create_task(coro)
bolna-app-1   | Traceback (most recent call last):
bolna-app-1   |   File "/usr/local/lib/python3.10/site-packages/bolna/helpers/utils.py", line 423, in write_request_logs
bolna-app-1   |     component_details = [message['data'], None, None,len(message['data']), message['cached'], None, message['engine']]
bolna-app-1   | TypeError: object of type 'NoneType' has no len()
bolna-app-1   | 2024-05-19 07:00:31.360 INFO {task_manager} [__check_for_completion] Last transmitted timestamp is simply 0 and hence continuing
bolna-app-1   | 2024-05-19 07:00:33.361 INFO {task_manager} [__check_for_completion] Last transmitted timestamp is simply 0 and hence continuing
bolna-app-1   | 2024-05-19 07:00:35.362 INFO {task_manager} [__check_for_completion] Last transmitted timestamp is simply 0 and hence continuing
bolna-app-1   | 2024-05-19 07:00:37.363 INFO {task_manager} [__check_for_completion] Last transmitted timestamp is simply 0 and hence continuing
bolna-app-1   | 2024-05-19 07:00:38.771 INFO {telephony} [_listen] call stopping
bolna-app-1   | 2024-05-19 07:00:39.363 INFO {task_manager} [__check_for_completion] Last transmitted timestamp is simply 0 and hence continuing
bolna-app-1   | 2024-05-19 07:00:39.364 ERROR {deepgram_transcriber} [transcribe] Error in transcribe:
bolna-app-1   | 2024-05-19 07:00:41.362 INFO {task_manager} [__check_for_completion] Last transmitted timestamp is simply 0 and hence continuing
Gracefully stopping... (press Ctrl+C again to force)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

@saksham003 can you check if the requests from your laptop are reaching Deepgram servers? Try to eliminate any IP blacklisting etc. that might be happening.

@saksham003 Thanks for the logs. Let me check this - this one seems to be a different issue related to transcriber.

@prateeksachan yes I did pull the latest changes. Here’s the agent config I used -

{
  "agent_config": {
    "agent_name": "test",
    "agent_type": "bolna_test",
    "agent_welcome_message": "Hi, my name is Rachel.",
    "tasks": [
      {
        "task_type": "conversation",
        "call_cancellation_prompt": null,
        "hangup_after_LLMCall": false,
        "hangup_after_silence": 10,
        "incremental_delay": 100,
        "interruption_backoff_period": 100,
        "number_of_words_for_interruption": 3,
        "optimize_latency": true,
        "task_config": {
          "hangup_after_silence": 10
        },
        "tools_config": {
          "llm_agent": {
            "max_tokens": 100,
            "family": "openai",
            "model": "gpt-3.5-turbo",
            "agent_flow_type": "streaming",
            "use_fallback": true,
            "temperature": 0.2,
            "base_url": null
          },
          "synthesizer": {
            "audio_format": "wav",
            "buffer_size": 100,
            "provider": "elevenlabs",
            "provider_config": {
                "voice": "Rachel",
                "model": "eleven_multilingual_v2",
                "voice_id": "21m00Tcm4TlvDq8ikWAM"
            },
            "stream": true
          },
          "transcriber": {
            "model": "deepgram",
            "stream": true,
            "language": "en",
            "endpointing": 400,
            "keywords": ""
          },
          "input": {
            "provider": "twilio",
            "format": "wav"
          },
          "output": {
            "provider": "twilio",
            "format": "wav"
          }
        },
        "toolchain": {
          "execution": "parallel",
          "pipelines": [["transcriber", "llm", "synthesizer"]]
        }
      }
    ]
  },
  "agent_prompts": {
    "task_1": {
      "system_prompt": "You will always be very concise and brief with your responses. You will NEVER speak longer than 2 sentences. \nYou are Rachel, an order representative for Pizza Square. You will be very helpful and kind. Customers will call you and give their order. You will follow this script. You will ONLY ask 1 question at a time. Once you get an answer you will move on to the next one. \n 1) You will start your conversation by saying. \"Hi! I am Rachel from Pizza Square. Am I speaking to Michael from 345 Palm Square?\" All your responses should be as long as this one.) \n 2) You will ask the customer what they would like to order. Only ask the next question once you have a clear answer to this question. If the customer wants assistance, you will ask them about their preferences. \n 3) You will ask the customer for the required size - regular, medium, or large. If the customer has follow up questions, you will clarify, that the small is for 1 person and 4 dollars, the medium is for 2 people and 7 dollars and the large is for 4 people and 11 dollars. Only ask the next question once you have a clear answer to this question. \n 4) Once confirmed, you will ask whether the customer wants to pay the amount of for the chosen pizza via card or cash. \n 5) You will then tell the customer that their pizza is in the oven and will reach within 30 minutes. \n You have options of 3 pizzas. You will only give description if the user asks for it.  \n 1) The BBQ Chicken - Which has Chicken, Mushrooms, Olives in a tomato base 2) The Pesto Dominator - Which has Chicken, Bacon and Ham in a green base. This is the best-selling pizza. 3) The Veg Ultimate - Which has tofu, mushrooms, olives, tomatoes in a tomato base. "
    }
  }
}