Find answers from the community

Updated 5 months ago

Earlier it used to come in this format

Earlier it used to come in this format

{'id': 'chatcmpl-9osUnurZj4vwCnzszSpsYpS3ljbJf', 'choices': [Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='{\n "result": "Show me open vulnerabilities",\n "date_detected": false,\n "from_date": "",\n "to_date": "",\n "from_now": false,\n "duration": ""\n}', role='assistant', function_call=None, tool_calls=None), content_filter_results={'hate': {'filtered': False, 'severity': 'safe'}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': False, 'severity': 'safe'}})], 'created': 1721912909, 'model': 'gpt-35-turbo-16k', 'object': 'chat.completion', 'system_fingerprint': None, 'usage': CompletionUsage(completion_tokens=43, prompt_tokens=755, total_tokens=798), 'prompt_filter_results': [{'prompt_index': 0, 'content_filter_results': {'hate': {'filtered': False, 'severity': 'safe'}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': False, 'severity': 'safe'}}}]}
L
S
4 comments
its the same format, one is a dict version of the other

Some tying got changed, and it no longer forces the top level to be a dict
Hey @Logan M can you help me on how I can make it dict, because I didn't changed anything in the code
or since its a pydantic object, the more correct thing is using thing.dict()
Add a reply
Sign up and join the conversation on Discord