Hello,
Are there any admins that could give us an update about retrieving the content of each chunk during the ThreadRunStepCompleted event? I rather get the content at the beginning than at the end of the thread run since I could probably do a regex match in order to replace the source links within the streaming text once they are created.
Also, it would be helpful to get metadata about the page where the chunk was found, that way I could go straight to page of the pdf. It we could give metadata as dict to each file then it would be awesome . I hope we get this by DevDay.
2024-09-30 20:02:57.077 | INFO | utils.llms.openai_interface:fetch_async_completion_ui_assistant_cognition:2095 - ThreadRunStepCompleted(data=RunStep(id='step_eIaChGmuYbR0sOcQwyq72o6c', assistant_id='asst_8yeN71uoMRlgfJCwWU5DqxhO', cancelled_at=None, completed_at=1727726576, created_at=1727726574, expired_at=None, failed_at=None, last_error=None, metadata=None, object='thread.run.step', run_id='run_1CbVa6LDLuzwQFir4At8M99P', status='completed', step_details=ToolCallsStepDetails(tool_calls=[FileSearchToolCall(id='call_0ba5Sgahn5CFHSKlCekf2NqZ', file_search=FileSearch(ranking_options=FileSearchRankingOptions(ranker='default_2024_08_21', score_threshold=0.0), results=[FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.7672119866780243, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.7528088810427128, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.7070330827631971, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.6966345728271346, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.6847471420043809, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.6629569015698628, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.6502266373159689, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.5404488313553234, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.49091998719388624, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.4793617847415654, content=None), FileSearchResult(file_id='file-IAkpJoqkzB4lnIrawSb9CIdx', file_name='IBD_MODULE1_UNIT2_SPECIALTY MALT AND ADJUNTS.pdf', score=0.4671717504211161, content=None), FileSearchResult(file_id='file-BYW7yXomGlfUIWEMPAOE5sqe', file_name='6.Topics in Brewing - Malting by JDH.pdf', score=0.448181745750499, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.4390744436618422, content=None), FileSearchResult(file_id='file-BYW7yXomGlfUIWEMPAOE5sqe', file_name='6.Topics in Brewing - Malting by JDH.pdf', score=0.4352800081354829, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.42263067872356186, content=None), FileSearchResult(file_id='file-BYW7yXomGlfUIWEMPAOE5sqe', file_name='6.Topics in Brewing - Malting by JDH.pdf', score=0.4163856419064138, content=None), FileSearchResult(file_id='file-qizfNbj0tjVHWVH9mBlJU1yu', file_name='IBD_MODULE1_UNIT5_MILLING.pdf', score=0.38283591224989805, content=None), FileSearchResult(file_id='file-BYW7yXomGlfUIWEMPAOE5sqe', file_name='6.Topics in Brewing - Malting by JDH.pdf', score=0.34261438776851033, content=None), FileSearchResult(file_id='file-DQSCVlYRDexNK4zwxEpc7LJh', file_name='IBD_MODULE1_UNIT6_MASHING.pdf', score=0.3397802682377875, content=None), FileSearchResult(file_id='file-BYW7yXomGlfUIWEMPAOE5sqe', file_name='6.Topics in Brewing - Malting by JDH.pdf', score=0.33443454299859265, content=None)]), type='file_search')], type='tool_calls'), thread_id='thread_YETamtwz8vTjivRY0FaqqNdM', type='tool_calls', usage=Usage(completion_tokens=18, prompt_tokens=1856, total_tokens=1874), expires_at=1727727172), event='thread.run.step.completed')
2024-09-30 20:02:57.078 | INFO | utils.llms.openai_interface:fetch_async_completion_ui_assistant_cognition:2394 - Usage: {'completion_tokens': 18, 'prompt_tokens': 1856, 'total_tokens': 1874}