Skip to content

Commit

Permalink
Fixed examples
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieG committed Jun 4, 2024
1 parent 5226270 commit 9a34eb7
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 148 deletions.
69 changes: 37 additions & 32 deletions examples/multion_example_browse.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"\u001b[?25h Checking if build backend supports build_editable ... \u001b[?25ldone\n",
"\u001b[?25h Getting requirements to build editable ... \u001b[?25ldone\n",
"\u001b[?25h Preparing editable metadata (pyproject.toml) ... \u001b[?25ldone\n",
"\u001b[?25hRequirement already satisfied: agentops<0.3.0,>=0.2.0 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from multion==1.2.0) (0.2.0)\n",
"\u001b[?25hRequirement already satisfied: agentops<0.3.0,>=0.2.0 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from multion==1.2.0) (0.2.1)\n",
"Requirement already satisfied: httpx>=0.21.2 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from multion==1.2.0) (0.27.0)\n",
"Requirement already satisfied: httpx-sse==0.4.0 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from multion==1.2.0) (0.4.0)\n",
"Requirement already satisfied: pydantic>=1.9.2 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from multion==1.2.0) (2.7.2)\n",
Expand All @@ -36,7 +36,7 @@
"Building wheels for collected packages: multion\n",
" Building editable for multion (pyproject.toml) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for multion: filename=multion-1.2.0-py3-none-any.whl size=2792 sha256=142c67040af03f6fd4e406d67bc5cdcf78f025c5b289ffe58f887de2f60c0b9c\n",
" Stored in directory: /private/var/folders/jb/71y2z4v178jdr5xcgbxfm0gc0000gp/T/pip-ephem-wheel-cache-z0mo7tvu/wheels/df/4b/d9/cccd5ceada6ca92256cee7f065c3e64e9c91b3d307977e2bba\n",
" Stored in directory: /private/var/folders/jb/71y2z4v178jdr5xcgbxfm0gc0000gp/T/pip-ephem-wheel-cache-b7qk12t7/wheels/df/4b/d9/cccd5ceada6ca92256cee7f065c3e64e9c91b3d307977e2bba\n",
"Successfully built multion\n",
"Installing collected packages: multion\n",
" Attempting uninstall: multion\n",
Expand All @@ -45,37 +45,36 @@
" Successfully uninstalled multion-1.2.0\n",
"Successfully installed multion-1.2.0\n",
"Note: you may need to restart the kernel to use updated packages.\n",
"Obtaining file:///Users/howardgil/Desktop/agentops/AgentOps-AI/agentops\n",
"Processing /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops\n",
" Installing build dependencies ... \u001b[?25ldone\n",
"\u001b[?25h Checking if build backend supports build_editable ... \u001b[?25ldone\n",
"\u001b[?25h Getting requirements to build editable ... \u001b[?25ldone\n",
"\u001b[?25h Preparing editable metadata (pyproject.toml) ... \u001b[?25ldone\n",
"\u001b[?25hRequirement already satisfied: requests==2.31.0 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from agentops==0.2.0) (2.31.0)\n",
"Requirement already satisfied: psutil==5.9.8 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from agentops==0.2.0) (5.9.8)\n",
"Requirement already satisfied: packaging==23.2 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from agentops==0.2.0) (23.2)\n",
"Requirement already satisfied: termcolor==2.4.0 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from agentops==0.2.0) (2.4.0)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from requests==2.31.0->agentops==0.2.0) (3.3.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from requests==2.31.0->agentops==0.2.0) (3.7)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from requests==2.31.0->agentops==0.2.0) (2.2.1)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from requests==2.31.0->agentops==0.2.0) (2024.2.2)\n",
"\u001b[?25h Getting requirements to build wheel ... \u001b[?25ldone\n",
"\u001b[?25h Preparing metadata (pyproject.toml) ... \u001b[?25ldone\n",
"\u001b[?25hRequirement already satisfied: requests==2.31.0 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from agentops==0.2.1) (2.31.0)\n",
"Requirement already satisfied: psutil==5.9.8 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from agentops==0.2.1) (5.9.8)\n",
"Requirement already satisfied: packaging==23.2 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from agentops==0.2.1) (23.2)\n",
"Requirement already satisfied: termcolor==2.4.0 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from agentops==0.2.1) (2.4.0)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from requests==2.31.0->agentops==0.2.1) (3.3.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from requests==2.31.0->agentops==0.2.1) (3.7)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from requests==2.31.0->agentops==0.2.1) (2.2.1)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /Users/howardgil/Desktop/agentops/AgentOps-AI/agentops/env/lib/python3.12/site-packages (from requests==2.31.0->agentops==0.2.1) (2024.2.2)\n",
"Building wheels for collected packages: agentops\n",
" Building editable for agentops (pyproject.toml) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for agentops: filename=agentops-0.2.0-0.editable-py3-none-any.whl size=7475 sha256=7dadfe129d65306c91e9b497870f49413f095d4014d15cf69927bf2b2e3ddbfd\n",
" Stored in directory: /private/var/folders/jb/71y2z4v178jdr5xcgbxfm0gc0000gp/T/pip-ephem-wheel-cache-oevvs0lr/wheels/43/52/53/9286c77226c557a85392056462580d0d7db8d733d3a9c9be69\n",
" Building wheel for agentops (pyproject.toml) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for agentops: filename=agentops-0.2.1-py3-none-any.whl size=43115 sha256=e154480cfde179a77da859a210dbedc77feade7b01cf68ff97d40e271d930b57\n",
" Stored in directory: /private/var/folders/jb/71y2z4v178jdr5xcgbxfm0gc0000gp/T/pip-ephem-wheel-cache-z07zsgac/wheels/43/52/53/9286c77226c557a85392056462580d0d7db8d733d3a9c9be69\n",
"Successfully built agentops\n",
"Installing collected packages: agentops\n",
" Attempting uninstall: agentops\n",
" Found existing installation: agentops 0.2.0\n",
" Uninstalling agentops-0.2.0:\n",
" Successfully uninstalled agentops-0.2.0\n",
"Successfully installed agentops-0.2.0\n",
" Found existing installation: agentops 0.2.1\n",
" Uninstalling agentops-0.2.1:\n",
" Successfully uninstalled agentops-0.2.1\n",
"Successfully installed agentops-0.2.1\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"%pip install -e ../../../HowieG/multion-python\n",
"%pip install -e .."
"%pip install .."
]
},
{
Expand All @@ -84,16 +83,22 @@
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "SessionsClient.__init__() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[2], line 6\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mmultion\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcore\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mrequest_options\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m RequestOptions\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mos\u001b[39;00m\n\u001b[0;32m----> 6\u001b[0m multion \u001b[38;5;241m=\u001b[39m \u001b[43mMultiOn\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 7\u001b[0m \u001b[43m \u001b[49m\u001b[43mapi_key\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mos\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43menviron\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mMULTION_API_KEY\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 8\u001b[0m \u001b[43m \u001b[49m\u001b[43magentops_api_key\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mos\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43menviron\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mAGENTOPS_API_KEY\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 9\u001b[0m \u001b[43m)\u001b[49m\n\u001b[1;32m 10\u001b[0m cmd \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mwhat three things do i get with agentops\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 11\u001b[0m request_options \u001b[38;5;241m=\u001b[39m RequestOptions(\n\u001b[1;32m 12\u001b[0m timeout_in_seconds\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m60\u001b[39m, max_retries\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m4\u001b[39m, additional_headers\u001b[38;5;241m=\u001b[39m{\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtest\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124ming\u001b[39m\u001b[38;5;124m\"\u001b[39m}\n\u001b[1;32m 13\u001b[0m )\n",
"File \u001b[0;32m~/Desktop/agentops/HowieG/multion-python/src/multion/client.py:54\u001b[0m, in \u001b[0;36mMultiOn.__init__\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 52\u001b[0m agentops_api_key \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124magentops_api_key\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[1;32m 53\u001b[0m \u001b[38;5;28msuper\u001b[39m()\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__init__\u001b[39m(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m---> 54\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msessions \u001b[38;5;241m=\u001b[39m \u001b[43mWrappedSessionsClient\u001b[49m\u001b[43m(\u001b[49m\u001b[43mclient_wrapper\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_client_wrapper\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 55\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m agentops_api_key \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 56\u001b[0m agentops\u001b[38;5;241m.\u001b[39minit(api_key\u001b[38;5;241m=\u001b[39magentops_api_key, auto_start_session\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m)\n",
"File \u001b[0;32m~/Desktop/agentops/HowieG/multion-python/src/multion/sessions/wrapped_client.py:46\u001b[0m, in \u001b[0;36mWrappedSessionsClient.__init__\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 45\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__init__\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m---> 46\u001b[0m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;21;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"\u001b[0;31mTypeError\u001b[0m: SessionsClient.__init__() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given"
"name": "stderr",
"output_type": "stream",
"text": [
"🖇 AgentOps: Cannot record event - no current session\n",
"🖇 AgentOps: \u001b[34m\u001b[34mSession Replay: https://app.agentops.ai/drilldown?session_id=6f01ccad-23a3-4d34-a497-e61ebafad847\u001b[0m\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Memorizing the following information: The features provided by AgentOps:\n",
"1. Agent Agnostic SDK\n",
"2. LLM Cost (OpenAI, etc)\n",
"3. Replay Analytics\n",
"\n"
]
}
],
Expand Down
113 changes: 0 additions & 113 deletions examples/multion_example_not_integrated.ipynb

This file was deleted.

2 changes: 1 addition & 1 deletion examples/multion_example_retrieve.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"outputs": [],
"source": [
"%pip install -e ../../../HowieG/multion-python\n",
"%pip install agentops"
"%pip install .."
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/multion_example_step_session.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"source": [
"import multion\n",
"from multion.client import MultiOn\n",
"from multion.sessions.types.sessions_step_stream_request_browser_params import (\n",
"from multion.sessions.types.sessions_step_request_browser_params import (\n",
" SessionsStepRequestBrowserParams,\n",
")\n",
"from multion.core.request_options import RequestOptions\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/multion_example_step_stream.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
" print(\"task completed\")\n",
"\n",
"get_screenshot = multion.sessions.screenshot(session_id=session_id)\n",
"close_session_response = multion.sessions.close(session_id=session_id)s"
"close_session_response = multion.sessions.close(session_id=session_id)"
]
}
],
Expand Down

0 comments on commit 9a34eb7

Please sign in to comment.