diff --git a/07_assistants_knowledge_retrieval/assistants_knowledge_retrieval.ipynb b/07_assistants_knowledge_retrieval/assistants_knowledge_retrieval.ipynb index 66f98d90..9a17e7ad 100644 --- a/07_assistants_knowledge_retrieval/assistants_knowledge_retrieval.ipynb +++ b/07_assistants_knowledge_retrieval/assistants_knowledge_retrieval.ipynb @@ -27,6 +27,17 @@ "\n" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Alt text](ret.jpg \"Assistants\")\n", + "\n", + "![Alt text](objects.jpeg \"Assistants_Objects\")\n", + "\n", + "https://cobusgreyling.medium.com/openai-assistant-with-retriever-tool-08e9158ca900 " + ] + }, { "cell_type": "code", "execution_count": 2, @@ -86,14 +97,14 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "FileObject(id='file-2p7oFAVPX1IPQzOW35mP3SLI', bytes=48802, created_at=1700047815, filename='zia_profile.pdf', object='file', purpose='assistants', status='processed', status_details=None)\n" + "FileObject(id='file-kCbiOyEy7YInespbVKjd3CGC', bytes=48802, created_at=1700222301, filename='zia_profile.pdf', object='file', purpose='assistants', status='processed', status_details=None)\n" ] } ], @@ -112,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -134,14 +145,14 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Thread(id='thread_UrU3fNWx1yMPGDMUoEuYDpbQ', created_at=1700048142, metadata={}, object='thread')\n" + "Thread(id='thread_PWEJVnptC835VBdF5njsY6Qj', created_at=1700222303, metadata={}, object='thread')\n" ] } ], @@ -162,7 +173,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -184,7 +195,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -206,14 +217,14 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Run(id='run_2yATUyChhncfYC7AQh1MfGMt', assistant_id='asst_WZFG0ig0aVAGWMWfHrw3k5Ze', cancelled_at=None, completed_at=None, created_at=1700048421, expires_at=None, failed_at=1700048433, file_ids=['file-2p7oFAVPX1IPQzOW35mP3SLI'], instructions='Please address the user as Pakistani. The user is the student of PIAIC.', last_error=LastError(code='rate_limit_exceeded', message='Rate limit reached for gpt-3.5-turbo-1106 in organization org-9oP4S86HpNNbJMudY026ckbW on requests per min (RPM): Limit 3, Used 3, Requested 1. Please try again in 20s. Visit https://platform.openai.com/account/rate-limits to learn more. You can increase your rate limit by adding a payment method to your account at https://platform.openai.com/account/billing.'), metadata={}, model='gpt-3.5-turbo-1106', object='thread.run', required_action=None, started_at=1700048421, status='failed', thread_id='thread_UrU3fNWx1yMPGDMUoEuYDpbQ', tools=[ToolAssistantToolsRetrieval(type='retrieval')])\n" + "Run(id='run_mVymK7OEfpxoFYHV6b96GxQS', assistant_id='asst_AWrPlj801RKMzIf2OnpFzgFJ', cancelled_at=None, completed_at=1700222308, created_at=1700222304, expires_at=None, failed_at=None, file_ids=['file-kCbiOyEy7YInespbVKjd3CGC'], instructions='Please address the user as Pakistani. The user is the student of PIAIC.', last_error=None, metadata={}, model='gpt-3.5-turbo-1106', object='thread.run', required_action=None, started_at=1700222304, status='completed', thread_id='thread_PWEJVnptC835VBdF5njsY6Qj', tools=[ToolAssistantToolsRetrieval(type='retrieval')])\n" ] } ], @@ -235,7 +246,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -243,7 +254,7 @@ "output_type": "stream", "text": [ "user: When and which city Zia U. Khan was born?\n", - "assistant: I'll need to open the file to find this information. Let me do that now.\n" + "assistant: Zia U. Khan was born in Sialkot in 1961【7†source】.\n" ] } ], diff --git a/07_assistants_knowledge_retrieval/objects.jpeg b/07_assistants_knowledge_retrieval/objects.jpeg new file mode 100644 index 00000000..6fd4844f Binary files /dev/null and b/07_assistants_knowledge_retrieval/objects.jpeg differ diff --git a/07_assistants_knowledge_retrieval/ret.jpg b/07_assistants_knowledge_retrieval/ret.jpg new file mode 100644 index 00000000..42db72b7 Binary files /dev/null and b/07_assistants_knowledge_retrieval/ret.jpg differ