mhaowork / amblegpt

Video surveilance footage analyst powered by GPT-4o
MIT License
112 stars 21 forks source link

GPT response Issues json? #11

Open dborup opened 9 months ago

dborup commented 9 months ago

I get this error when trying to run mqtt_client

Process-6: GPT response {'id': 'chatcmpl-8czygzVl7Lj5qCTxZgonYcBVxwzQQ', 'object': 'chat.completion', 'created': 1704305398, 'model': 'gpt-4-1106-vision-preview', 'usage': {'prompt_tokens': 623, 'completion_tokens': 147, 'total_tokens': 770}, 'choices': [{'message': {'role': 'assistant', 'content': "It appears that you've shown a series of images that seem to be captured from a security camera or a webcam, with timestamps indicating they're from January 3, 2024. The scene is of an interior room that includes items such as a couch, television, and decorative items like a vase with flowers. There's also a person in what seems to be casual attire, who appears to be engaged in some sort of activity, possibly on a phone or another handheld device. The person is situated to the right in the frame, and their actions don't seem to vary much across the different images. The room is primarily lit by artificial lighting from the ceiling and maybe some natural light coming from the adjacent room visible through the doorway."}, 'finish_reason': 'stop', 'index': 0}]} Process-6: Error processing video for event 1704305371.856069-gdkc6c Traceback (most recent call last): File "/home/dborup/./mqtt_client.py", line 304, in process_message result = json.loads(json_str) File "/usr/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

mhaowork commented 9 months ago

Thanks for reporting the issue. This should be an transient error. Retrying usually fixes it. I will improve on the error message to make it clearer.

ttopholm commented 8 months ago

@dborup delete the prompt from the config.yml and try again.