Below is an example that partially works. Observations and questions are in the next section:
Description: Test assistant to retrieve red light camera information.
Assistant includes one file.
Observations:
Message itself should include reference to file
{
“role”: “user”,
“content”: “get camera near Sheridan-Hollywood intersection”,
“file_ids”:[“file-FXfkSUPUfyDll7UMcROEqwjR”]
}
Not clear why both message and assistant should have reference to the same file
While GPT seemingly trying to use file as a source of data, responses are different (even number of steps are different)
Sometimes i see some references like 【10†source】? how to interpret those references?
Any help would be appreciated
YK
Below are steps (responses are shorted )
Create thread
{
“id”: “thread_churWWbHyP7bo2lmKBq3dqzl”,
“object”: “thread”,
“created_at”: 1706028709,
“metadata”: {}
}
submit message
{
“role”: “user”,
“content”: “get camera near Sheridan-Hollywood intersection”,
“file_ids”:[“file-FXfkSUPUfyDll7UMcROEqwjR”]
}
Response
{
{
“id”: “msg_MhsoRPKZ7iFBKSA3qNvfciqQ”,
“object”: “thread.message”,
“created_at”: 1706038769,
“thread_id”: “thread_90DxfpEoiuUt6Jsn8OF567vF”,
“role”: “user”,
“content”: [
{
“type”: “text”,
“text”: {
“value”: “get camera near Sheridan-Hollywood intersection”,
“annotations”:
}
}
],
“file_ids”: [
“file-FXfkSUPUfyDll7UMcROEqwjR”
],
“assistant_id”: null,
“run_id”: null,
“metadata”: {}
}
Create run
Response:
{
“id”: “run_Lvz3PYXQqbJMdwcww9HMguOu”,
“object”: “thread.run”,
“created_at”: 1706028858,
“assistant_id”: “asst_TPoYSn8cBzKYKfWCGPsqtWJv”,
“thread_id”: “thread_churWWbHyP7bo2lmKBq3dqzl”,
“status”: “queued”,
“started_at”: null,
“expires_at”: 1706029458,
“cancelled_at”: null,
“failed_at”: null,
“completed_at”: null,
“last_error”: null,
“model”: “gpt-3.5-turbo-1106”,
“instructions”: “Retrieves red light camera data.”,
“tools”: [
{
“type”: “retrieval”
}
],
“file_ids”: [
“file-FXfkSUPUfyDll7UMcROEqwjR”
],
“metadata”: {},
“usage”: null
}
Get run steps
"step_details": {
"type": "message_creation",
"message_creation": {
"message_id": "msg_318EROhBkW7UagqrAKI5aZZn"
}
},
"step_details": {
"type": "tool_calls",
"tool_calls": [
{
"id": "call_ybeCFaFJXq9EUsBlkGAvTaQB",
"type": "retrieval",
"retrieval": {}
}
]
"step_details": {
"type": "message_creation",
"message_creation": {
"message_id": "msg_tl8nasctSIyPbTmCYssUo62d"
}
},
"step_details": {
"type": "tool_calls",
"tool_calls": [
{
"id": "call_FSBY2xm2cgBCdNb91wkONPqt",
"type": "retrieval",
"retrieval": {}
}
]
Get messages
{
“value”: “The data indicates that there is a red light camera at the intersection of Broadway, Sheridan, and Devon, monitoring southbound traffic approaching the intersection. This should cover the vicinity of the Sheridan-Hollywood intersection as well【15†source】.”,
"value": "The file contains a dataset of red light camera locations in the City of Chicago. The \"INTERSECTION\" column provides the names of the intersections where the cameras are located, and the \"FIRST APPROACH\" column indicates the originating direction of travel that is monitored by a red light camera.\n\nTo find the red light camera data for the Sheridan-Hollywood intersection, I will extract the relevant information from the dataset【10†source】.",
"value": "I will start by examining the content of the file to find the red light camera data for the Sheridan-Hollywood intersection.",