diff --git a/Google-colab/Agentsims4colab-more-method.ipynb b/Google-colab/Agentsims4colab-more-method.ipynb
new file mode 100644
index 0000000..d34d878
--- /dev/null
+++ b/Google-colab/Agentsims4colab-more-method.ipynb
@@ -0,0 +1,711 @@
+{
+ "nbformat": 4,
+ "nbformat_minor": 0,
+ "metadata": {
+ "colab": {
+ "provenance": [],
+ "authorship_tag": "ABX9TyMkXk6SXQ9vC+Vr1v34fQhX",
+ "include_colab_link": true
+ },
+ "kernelspec": {
+ "name": "python3",
+ "display_name": "Python 3"
+ },
+ "language_info": {
+ "name": "python"
+ }
+ },
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "view-in-github",
+ "colab_type": "text"
+ },
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "# This is for testing [Agentsims](https://github.com/py499372727/AgentSims)\n",
+ " is in Google colab environment"
+ ],
+ "metadata": {
+ "id": "sF6qesMSCjjS"
+ }
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "## By the help of AI we install it here:\n",
+ "![enter image description here][1]\n",
+ "\n",
+ "Link of request is available here:\n",
+ "\n",
+ "https://www.phind.com/agent?cache=clluk1wb00001l608xr8cv86w\n",
+ "\n",
+ " [1]: https://i.stack.imgur.com/vKKiZ.jpg"
+ ],
+ "metadata": {
+ "id": "EhpXJ63mC9a9"
+ }
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "lP_MRsDNCYpb",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "outputId": "45297bdc-2df5-48be-f501-925be89386b5"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Cloning into 'AgentSims'...\n",
+ "remote: Enumerating objects: 163, done.\u001b[K\n",
+ "remote: Counting objects: 100% (163/163), done.\u001b[K\n",
+ "remote: Compressing objects: 100% (127/127), done.\u001b[K\n",
+ "remote: Total 163 (delta 37), reused 152 (delta 29), pack-reused 0\u001b[K\n",
+ "Receiving objects: 100% (163/163), 33.23 MiB | 7.09 MiB/s, done.\n",
+ "Resolving deltas: 100% (37/37), done.\n"
+ ]
+ }
+ ],
+ "source": [
+ "!git clone https://github.com/py499372727/AgentSims.git"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "%cd AgentSims"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "Zq_1ZK_4DjHB",
+ "outputId": "39de6be5-1791-47e3-cba6-a01bf0e21cdf"
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "/content/AgentSims/AgentSims\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "So I combined some of the main github install instruction too, here . Thr github install instructions is avaible [here][1].\n",
+ "\n",
+ "![enter image description here][2]\n",
+ "\n",
+ "\n",
+ " [1]: https://github.com/py499372727/AgentSims\n",
+ " [2]: https://i.stack.imgur.com/DtFBH.jpg"
+ ],
+ "metadata": {
+ "id": "rge4w4tfFHlq"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!pip install tornado\n",
+ "!pip install mysql-connector-python\n",
+ "!pip install websockets\n",
+ "!pip install openai_async"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "KovcD2GMEmSG",
+ "outputId": "26120fc4-c693-4aa8-a476-b43d13a40004"
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Requirement already satisfied: tornado in /usr/local/lib/python3.10/dist-packages (6.3.2)\n",
+ "Requirement already satisfied: mysql-connector-python in /usr/local/lib/python3.10/dist-packages (8.0.31)\n",
+ "Requirement already satisfied: protobuf<=3.20.1,>=3.11.0 in /usr/local/lib/python3.10/dist-packages (from mysql-connector-python) (3.20.1)\n",
+ "Requirement already satisfied: websockets in /usr/local/lib/python3.10/dist-packages (11.0.3)\n",
+ "Requirement already satisfied: openai_async in /usr/local/lib/python3.10/dist-packages (0.0.3)\n",
+ "Requirement already satisfied: httpx in /usr/local/lib/python3.10/dist-packages (from openai_async) (0.24.1)\n",
+ "Requirement already satisfied: pytest in /usr/local/lib/python3.10/dist-packages (from openai_async) (7.4.0)\n",
+ "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async) (2023.7.22)\n",
+ "Requirement already satisfied: httpcore<0.18.0,>=0.15.0 in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async) (0.17.3)\n",
+ "Requirement already satisfied: idna in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async) (3.4)\n",
+ "Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async) (1.3.0)\n",
+ "Requirement already satisfied: iniconfig in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async) (2.0.0)\n",
+ "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async) (23.1)\n",
+ "Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async) (1.2.0)\n",
+ "Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async) (1.1.3)\n",
+ "Requirement already satisfied: tomli>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async) (2.0.1)\n",
+ "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.10/dist-packages (from httpcore<0.18.0,>=0.15.0->httpx->openai_async) (0.14.0)\n",
+ "Requirement already satisfied: anyio<5.0,>=3.0 in /usr/local/lib/python3.10/dist-packages (from httpcore<0.18.0,>=0.15.0->httpx->openai_async) (3.7.1)\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!pip install -r requirements.txt"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "-oEmP57YD8RH",
+ "outputId": "09626290-5f7a-43a1-b38f-947ac3eb20c4"
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Requirement already satisfied: tornado==6.3.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 1)) (6.3.2)\n",
+ "Requirement already satisfied: mysql-connector-python==8.0.31 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 2)) (8.0.31)\n",
+ "Requirement already satisfied: openai_async==0.0.3 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 3)) (0.0.3)\n",
+ "Requirement already satisfied: websockets==11.0.3 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 4)) (11.0.3)\n",
+ "Requirement already satisfied: protobuf<=3.20.1,>=3.11.0 in /usr/local/lib/python3.10/dist-packages (from mysql-connector-python==8.0.31->-r requirements.txt (line 2)) (3.20.1)\n",
+ "Requirement already satisfied: httpx in /usr/local/lib/python3.10/dist-packages (from openai_async==0.0.3->-r requirements.txt (line 3)) (0.24.1)\n",
+ "Requirement already satisfied: pytest in /usr/local/lib/python3.10/dist-packages (from openai_async==0.0.3->-r requirements.txt (line 3)) (7.4.0)\n",
+ "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (2023.7.22)\n",
+ "Requirement already satisfied: httpcore<0.18.0,>=0.15.0 in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (0.17.3)\n",
+ "Requirement already satisfied: idna in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (3.4)\n",
+ "Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (1.3.0)\n",
+ "Requirement already satisfied: iniconfig in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async==0.0.3->-r requirements.txt (line 3)) (2.0.0)\n",
+ "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async==0.0.3->-r requirements.txt (line 3)) (23.1)\n",
+ "Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async==0.0.3->-r requirements.txt (line 3)) (1.2.0)\n",
+ "Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async==0.0.3->-r requirements.txt (line 3)) (1.1.3)\n",
+ "Requirement already satisfied: tomli>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async==0.0.3->-r requirements.txt (line 3)) (2.0.1)\n",
+ "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.10/dist-packages (from httpcore<0.18.0,>=0.15.0->httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (0.14.0)\n",
+ "Requirement already satisfied: anyio<5.0,>=3.0 in /usr/local/lib/python3.10/dist-packages (from httpcore<0.18.0,>=0.15.0->httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (3.7.1)\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!chmod +x restart.sh\n",
+ "#!python server.py"
+ ],
+ "metadata": {
+ "id": "nQP38oKzGIvB"
+ },
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!apt-get install mysql-server -y && \\\n",
+ "service mysql start && \\\n",
+ "mysql -e \"ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';\" && \\\n",
+ "service mysql restart && \\\n",
+ "mysql -e \"CREATE DATABASE llm_account DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\" && \\\n",
+ "mysql -e \"CREATE DATABASE llm_game DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\" && \\\n",
+ "mysql -e \"CREATE DATABASE llm_game0001 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\" && \\\n",
+ "mysql -e \"CREATE DATABASE llm_game0002 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\""
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "1QtQifwfG6Lv",
+ "outputId": "33809369-8268-4689-a3ee-5e025989f87a"
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Reading package lists... Done\n",
+ "Building dependency tree... Done\n",
+ "Reading state information... Done\n",
+ "mysql-server is already the newest version (8.0.34-0ubuntu0.22.04.1).\n",
+ "0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.\n",
+ " * Starting MySQL database server mysqld\n",
+ " ...done.\n",
+ " * Stopping MySQL database server mysqld\n",
+ " ...done.\n",
+ " * Starting MySQL database server mysqld\n",
+ "su: warning: cannot change directory to /nonexistent: No such file or directory\n",
+ " ...done.\n",
+ "ERROR 1007 (HY000) at line 1: Can't create database 'llm_account'; database exists\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "\n",
+ "!nohup bash ./restart.sh > restart.log 2>&1 &\n",
+ "#!bash ./restart.sh"
+ ],
+ "metadata": {
+ "id": "V7Ml2Wx4FRuc"
+ },
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "And for showing the result in graphic mode we can use this ChatGPT help ([webpage link][1]):\n",
+ "\n",
+ "![enter image description here][2]\n",
+ "\n",
+ "\n",
+ " [1]: https://www.phind.com/agent?cache=clluk1wb00001l608xr8cv86w\n",
+ " [2]: https://i.stack.imgur.com/QWxo5.jpg"
+ ],
+ "metadata": {
+ "id": "HYr9NLn7SV4x"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ " from IPython.display import display, HTML\n",
+ "\n",
+ " with open('/content/AgentSims/client/index.html') as file:\n",
+ " html_content = file.read()\n",
+ "\n",
+ " display(HTML(html_content))"
+ ],
+ "metadata": {
+ "colab": {
+ "resources": {
+ "http://localhost:8080/TemplateData/style.css": {
+ "data": "CjwhRE9DVFlQRSBodG1sPgo8aHRtbCBsYW5nPWVuPgogIDxtZXRhIGNoYXJzZXQ9dXRmLTg+CiAgPG1ldGEgbmFtZT12aWV3cG9ydCBjb250ZW50PSJpbml0aWFsLXNjYWxlPTEsIG1pbmltdW0tc2NhbGU9MSwgd2lkdGg9ZGV2aWNlLXdpZHRoIj4KICA8dGl0bGU+RXJyb3IgNDA0IChOb3QgRm91bmQpISExPC90aXRsZT4KICA8c3R5bGU+CiAgICAqe21hcmdpbjowO3BhZGRpbmc6MH1odG1sLGNvZGV7Zm9udDoxNXB4LzIycHggYXJpYWwsc2Fucy1zZXJpZn1odG1se2JhY2tncm91bmQ6I2ZmZjtjb2xvcjojMjIyO3BhZGRpbmc6MTVweH1ib2R5e21hcmdpbjo3JSBhdXRvIDA7bWF4LXdpZHRoOjM5MHB4O21pbi1oZWlnaHQ6MTgwcHg7cGFkZGluZzozMHB4IDAgMTVweH0qID4gYm9keXtiYWNrZ3JvdW5kOnVybCgvL3d3dy5nb29nbGUuY29tL2ltYWdlcy9lcnJvcnMvcm9ib3QucG5nKSAxMDAlIDVweCBuby1yZXBlYXQ7cGFkZGluZy1yaWdodDoyMDVweH1we21hcmdpbjoxMXB4IDAgMjJweDtvdmVyZmxvdzpoaWRkZW59aW5ze2NvbG9yOiM3Nzc7dGV4dC1kZWNvcmF0aW9uOm5vbmV9YSBpbWd7Ym9yZGVyOjB9QG1lZGlhIHNjcmVlbiBhbmQgKG1heC13aWR0aDo3NzJweCl7Ym9keXtiYWNrZ3JvdW5kOm5vbmU7bWFyZ2luLXRvcDowO21heC13aWR0aDpub25lO3BhZGRpbmctcmlnaHQ6MH19I2xvZ297YmFja2dyb3VuZDp1cmwoLy93d3cuZ29vZ2xlLmNvbS9pbWFnZXMvbG9nb3MvZXJyb3JwYWdlL2Vycm9yX2xvZ28tMTUweDU0LnBuZykgbm8tcmVwZWF0O21hcmdpbi1sZWZ0Oi01cHh9QG1lZGlhIG9ubHkgc2NyZWVuIGFuZCAobWluLXJlc29sdXRpb246MTkyZHBpKXsjbG9nb3tiYWNrZ3JvdW5kOnVybCgvL3d3dy5nb29nbGUuY29tL2ltYWdlcy9sb2dvcy9lcnJvcnBhZ2UvZXJyb3JfbG9nby0xNTB4NTQtMngucG5nKSBuby1yZXBlYXQgMCUgMCUvMTAwJSAxMDAlOy1tb3otYm9yZGVyLWltYWdlOnVybCgvL3d3dy5nb29nbGUuY29tL2ltYWdlcy9sb2dvcy9lcnJvcnBhZ2UvZXJyb3JfbG9nby0xNTB4NTQtMngucG5nKSAwfX1AbWVkaWEgb25seSBzY3JlZW4gYW5kICgtd2Via2l0LW1pbi1kZXZpY2UtcGl4ZWwtcmF0aW86Mil7I2xvZ297YmFja2dyb3VuZDp1cmwoLy93d3cuZ29vZ2xlLmNvbS9pbWFnZXMvbG9nb3MvZXJyb3JwYWdlL2Vycm9yX2xvZ28tMTUweDU0LTJ4LnBuZykgbm8tcmVwZWF0Oy13ZWJraXQtYmFja2dyb3VuZC1zaXplOjEwMCUgMTAwJX19I2xvZ297ZGlzcGxheTppbmxpbmUtYmxvY2s7aGVpZ2h0OjU0cHg7d2lkdGg6MTUwcHh9CiAgPC9zdHlsZT4KICA8YSBocmVmPS8vd3d3Lmdvb2dsZS5jb20vPjxzcGFuIGlkPWxvZ28gYXJpYS1sYWJlbD1Hb29nbGU+PC9zcGFuPjwvYT4KICA8cD48Yj40MDQuPC9iPiA8aW5zPlRoYXTigJlzIGFuIGVycm9yLjwvaW5zPgogIDxwPiAgPGlucz5UaGF04oCZcyBhbGwgd2Uga25vdy48L2lucz4K",
+ "ok": false,
+ "headers": [
+ [
+ "content-length",
+ "1449"
+ ],
+ [
+ "content-type",
+ "text/html; charset=utf-8"
+ ]
+ ],
+ "status": 404,
+ "status_text": ""
+ },
+ "http://localhost:8080/Build/Builds.loader.js": {
+ "data": "CjwhRE9DVFlQRSBodG1sPgo8aHRtbCBsYW5nPWVuPgogIDxtZXRhIGNoYXJzZXQ9dXRmLTg+CiAgPG1ldGEgbmFtZT12aWV3cG9ydCBjb250ZW50PSJpbml0aWFsLXNjYWxlPTEsIG1pbmltdW0tc2NhbGU9MSwgd2lkdGg9ZGV2aWNlLXdpZHRoIj4KICA8dGl0bGU+RXJyb3IgNDA0IChOb3QgRm91bmQpISExPC90aXRsZT4KICA8c3R5bGU+CiAgICAqe21hcmdpbjowO3BhZGRpbmc6MH1odG1sLGNvZGV7Zm9udDoxNXB4LzIycHggYXJpYWwsc2Fucy1zZXJpZn1odG1se2JhY2tncm91bmQ6I2ZmZjtjb2xvcjojMjIyO3BhZGRpbmc6MTVweH1ib2R5e21hcmdpbjo3JSBhdXRvIDA7bWF4LXdpZHRoOjM5MHB4O21pbi1oZWlnaHQ6MTgwcHg7cGFkZGluZzozMHB4IDAgMTVweH0qID4gYm9keXtiYWNrZ3JvdW5kOnVybCgvL3d3dy5nb29nbGUuY29tL2ltYWdlcy9lcnJvcnMvcm9ib3QucG5nKSAxMDAlIDVweCBuby1yZXBlYXQ7cGFkZGluZy1yaWdodDoyMDVweH1we21hcmdpbjoxMXB4IDAgMjJweDtvdmVyZmxvdzpoaWRkZW59aW5ze2NvbG9yOiM3Nzc7dGV4dC1kZWNvcmF0aW9uOm5vbmV9YSBpbWd7Ym9yZGVyOjB9QG1lZGlhIHNjcmVlbiBhbmQgKG1heC13aWR0aDo3NzJweCl7Ym9keXtiYWNrZ3JvdW5kOm5vbmU7bWFyZ2luLXRvcDowO21heC13aWR0aDpub25lO3BhZGRpbmctcmlnaHQ6MH19I2xvZ297YmFja2dyb3VuZDp1cmwoLy93d3cuZ29vZ2xlLmNvbS9pbWFnZXMvbG9nb3MvZXJyb3JwYWdlL2Vycm9yX2xvZ28tMTUweDU0LnBuZykgbm8tcmVwZWF0O21hcmdpbi1sZWZ0Oi01cHh9QG1lZGlhIG9ubHkgc2NyZWVuIGFuZCAobWluLXJlc29sdXRpb246MTkyZHBpKXsjbG9nb3tiYWNrZ3JvdW5kOnVybCgvL3d3dy5nb29nbGUuY29tL2ltYWdlcy9sb2dvcy9lcnJvcnBhZ2UvZXJyb3JfbG9nby0xNTB4NTQtMngucG5nKSBuby1yZXBlYXQgMCUgMCUvMTAwJSAxMDAlOy1tb3otYm9yZGVyLWltYWdlOnVybCgvL3d3dy5nb29nbGUuY29tL2ltYWdlcy9sb2dvcy9lcnJvcnBhZ2UvZXJyb3JfbG9nby0xNTB4NTQtMngucG5nKSAwfX1AbWVkaWEgb25seSBzY3JlZW4gYW5kICgtd2Via2l0LW1pbi1kZXZpY2UtcGl4ZWwtcmF0aW86Mil7I2xvZ297YmFja2dyb3VuZDp1cmwoLy93d3cuZ29vZ2xlLmNvbS9pbWFnZXMvbG9nb3MvZXJyb3JwYWdlL2Vycm9yX2xvZ28tMTUweDU0LTJ4LnBuZykgbm8tcmVwZWF0Oy13ZWJraXQtYmFja2dyb3VuZC1zaXplOjEwMCUgMTAwJX19I2xvZ297ZGlzcGxheTppbmxpbmUtYmxvY2s7aGVpZ2h0OjU0cHg7d2lkdGg6MTUwcHh9CiAgPC9zdHlsZT4KICA8YSBocmVmPS8vd3d3Lmdvb2dsZS5jb20vPjxzcGFuIGlkPWxvZ28gYXJpYS1sYWJlbD1Hb29nbGU+PC9zcGFuPjwvYT4KICA8cD48Yj40MDQuPC9iPiA8aW5zPlRoYXTigJlzIGFuIGVycm9yLjwvaW5zPgogIDxwPiAgPGlucz5UaGF04oCZcyBhbGwgd2Uga25vdy48L2lucz4K",
+ "ok": false,
+ "headers": [
+ [
+ "content-length",
+ "1449"
+ ],
+ [
+ "content-type",
+ "text/html; charset=utf-8"
+ ]
+ ],
+ "status": 404,
+ "status_text": ""
+ }
+ },
+ "base_uri": "https://localhost:8080/",
+ "height": 1000
+ },
+ "id": "9B7kmS2_SZIr",
+ "outputId": "87ce7978-5aa1-4766-a6ee-3500cd48deb7"
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ ""
+ ],
+ "text/html": [
+ "\n",
+ "\n",
+ " \n",
+ " \n",
+ " \n",
+ " Unity WebGL Player | AgentSims\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
\n",
+ "
\n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ "\n"
+ ]
+ },
+ "metadata": {}
+ }
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "source": [
+ "## And Another way of running a publicly accessible server using ngrok [(link)][1]:\n",
+ "\n",
+ "![enter image description here][2]\n",
+ "\n",
+ "\n",
+ " [1]: https://stackoverflow.com/questions/60571301/run-localhost-server-in-google-colab-notebook\n",
+ " [2]: https://i.stack.imgur.com/HpkRh.jpg"
+ ],
+ "metadata": {
+ "id": "4_vnDEa5adlL"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!curl http://0.0.0.0:8080/index.html"
+ ],
+ "metadata": {
+ "id": "XbNkmxS_lPbu"
+ },
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!pip install pyngrok --quiet\n",
+ "from pyngrok import ngrok\n",
+ "\n",
+ "# Terminate open tunnels if exist\n",
+ "ngrok.kill()\n",
+ "\n",
+ "# Setting the authtoken (optional)\n",
+ "# Get your authtoken from https://dashboard.ngrok.com/auth\n",
+ "NGROK_AUTH_TOKEN = \"2UbhKWGczPDyiiOBadQl7nd6ddY_tSyPVuGiYpU8dcum4Htw\"\n",
+ "ngrok.set_auth_token(NGROK_AUTH_TOKEN)\n",
+ "\n",
+ "# Open an HTTPs tunnel on port 80 for http://localhost:80\n",
+ "public_url = ngrok.connect(addr=\"http://0.0.0.0:8000\")#, hostname='http://:8000/index.html')\n",
+ "print(\"Tracking URL:\", public_url)"
+ ],
+ "metadata": {
+ "id": "9X8eKd5AagG3",
+ "outputId": "2a2619d0-7c3c-480d-ee22-b90f288c3fbb",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stderr",
+ "text": [
+ "WARNING:pyngrok.process.ngrok:t=2023-08-28T10:15:19+0000 lvl=warn msg=\"ngrok config file found at legacy location, move to XDG location\" xdg_path=/root/.config/ngrok/ngrok.yml legacy_path=/root/.ngrok2/ngrok.yml\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Tracking URL: NgrokTunnel: \"https://4caa-35-184-175-231.ngrok-free.app\" -> \"http://0.0.0.0:8000\"\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!apt-get install net-tools"
+ ],
+ "metadata": {
+ "id": "i3zd_SZ3cgjq",
+ "outputId": "29534db4-79e2-4f45-aebe-1bd8c86f31fa",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Reading package lists... Done\n",
+ "Building dependency tree... Done\n",
+ "Reading state information... Done\n",
+ "net-tools is already the newest version (1.60+git20181103.0eebece-1ubuntu5).\n",
+ "0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!netstat -tuln #| grep 8000"
+ ],
+ "metadata": {
+ "id": "QahGWmebdX0H",
+ "outputId": "c70fa5fe-9bc2-4357-d6c2-3b7ea0015b0c",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Active Internet connections (only servers)\n",
+ "Proto Recv-Q Send-Q Local Address Foreign Address State \n",
+ "tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN \n",
+ "tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN \n",
+ "tcp 0 0 127.0.0.1:3453 0.0.0.0:* LISTEN \n",
+ "tcp 0 0 127.0.0.1:4040 0.0.0.0:* LISTEN \n",
+ "tcp 0 0 127.0.0.1:35831 0.0.0.0:* LISTEN \n",
+ "tcp 0 0 127.0.0.1:42429 0.0.0.0:* LISTEN \n",
+ "tcp 0 0 127.0.0.1:59231 0.0.0.0:* LISTEN \n",
+ "tcp 0 0 172.28.0.12:9000 0.0.0.0:* LISTEN \n",
+ "tcp 0 0 127.0.0.1:33060 0.0.0.0:* LISTEN \n",
+ "tcp 0 0 172.28.0.12:6000 0.0.0.0:* LISTEN \n",
+ "tcp 0 0 127.0.0.11:37245 0.0.0.0:* LISTEN \n",
+ "tcp6 0 0 :::8080 :::* LISTEN \n",
+ "udp 0 0 127.0.0.11:56336 0.0.0.0:* \n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "#!/bin/bash\n",
+ "\n",
+ "# Stop the server if it is already running\n",
+ "pkill -f server.py\n",
+ "\n",
+ "# Start the server in the background\n",
+ "nohup bash ./restart.sh > server.log 2>&1 &"
+ ],
+ "metadata": {
+ "id": "_vbblFQZel3u"
+ },
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!npm install -g localtunnel\n",
+ "!curl ipv4.icanhazip.com\n",
+ "!nohup lt --host http://0.0.0.0:8000/index.html --port 8000 > index-on-internet.log 2>&1 &"
+ ],
+ "metadata": {
+ "id": "TZctgM5fdvTJ",
+ "outputId": "b37ccd8c-ccc4-4ea3-e968-df66bfbd0d93",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "\u001b[K\u001b[?25h/tools/node/bin/lt -> /tools/node/lib/node_modules/localtunnel/bin/lt.js\n",
+ "+ localtunnel@2.0.2\n",
+ "updated 1 package in 0.776s\n",
+ "35.184.175.231\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!lt --host http://0.0.0.0 --port 8080"
+ ],
+ "metadata": {
+ "id": "GETu_GS0iCzr",
+ "outputId": "74563906-860b-4c76-a1b9-fdf225c8ed87",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "execution_count": null,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "^C\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "#!python -u tick.py\n",
+ "#!python -u mayor.py"
+ ],
+ "metadata": {
+ "id": "AK83lgfCQPop"
+ },
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "#!/bin/bash\n",
+ "\n",
+ "# Stop any existing instances of the processes\n",
+ "!pkill -f tick\n",
+ "!pkill -f mayor\n",
+ "\n",
+ "# Start the first process in the background\n",
+ "!nohup python -u tick.py > tick.log 2>&1 &\n",
+ "\n",
+ "# Start the second process in the background\n",
+ "!nohup python -u mayor.py > mayor.log 2>&1 &"
+ ],
+ "metadata": {
+ "id": "_s-T5qXDgEll"
+ },
+ "execution_count": null,
+ "outputs": []
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Google-colab/Agentsims4colab.ipynb b/Google-colab/Agentsims4colab.ipynb
new file mode 100644
index 0000000..eba1fcb
--- /dev/null
+++ b/Google-colab/Agentsims4colab.ipynb
@@ -0,0 +1,515 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "view-in-github",
+ "colab_type": "text"
+ },
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "sF6qesMSCjjS"
+ },
+ "source": [
+ "# This is for testing [Agentsims](https://github.com/py499372727/AgentSims)\n",
+ " is in Google colab environment"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "EhpXJ63mC9a9"
+ },
+ "source": [
+ "## By the help of AI we install it here:\n",
+ "![enter image description here][1]\n",
+ "\n",
+ "Link of request is available here:\n",
+ "\n",
+ "https://www.phind.com/agent?cache=clluk1wb00001l608xr8cv86w\n",
+ "\n",
+ " [1]: https://i.stack.imgur.com/vKKiZ.jpg"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "lP_MRsDNCYpb",
+ "outputId": "5f2c191c-b293-4df2-eba7-35c09d95d272"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "fatal: destination path 'AgentSims' already exists and is not an empty directory.\n"
+ ]
+ }
+ ],
+ "source": [
+ "!git clone https://github.com/py499372727/AgentSims.git"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "Zq_1ZK_4DjHB",
+ "outputId": "3ab751fa-45ab-4107-f9ad-fbe24a7f7c9f"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "/content/AgentSims\n"
+ ]
+ }
+ ],
+ "source": [
+ "%cd AgentSims"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "rge4w4tfFHlq"
+ },
+ "source": [
+ "So I combined some of the main github install instruction too, here . Thr github install instructions is avaible [here][1].\n",
+ "\n",
+ "![enter image description here][2]\n",
+ "\n",
+ "\n",
+ " [1]: https://github.com/py499372727/AgentSims\n",
+ " [2]: https://i.stack.imgur.com/DtFBH.jpg"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "KovcD2GMEmSG",
+ "outputId": "66674180-681f-4c95-dfb6-67c64edbe263"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Requirement already satisfied: tornado in /usr/local/lib/python3.10/dist-packages (6.3.2)\n",
+ "Requirement already satisfied: mysql-connector-python in /usr/local/lib/python3.10/dist-packages (8.0.31)\n",
+ "Requirement already satisfied: protobuf<=3.20.1,>=3.11.0 in /usr/local/lib/python3.10/dist-packages (from mysql-connector-python) (3.20.1)\n",
+ "Requirement already satisfied: websockets in /usr/local/lib/python3.10/dist-packages (11.0.3)\n",
+ "Requirement already satisfied: openai_async in /usr/local/lib/python3.10/dist-packages (0.0.3)\n",
+ "Requirement already satisfied: httpx in /usr/local/lib/python3.10/dist-packages (from openai_async) (0.24.1)\n",
+ "Requirement already satisfied: pytest in /usr/local/lib/python3.10/dist-packages (from openai_async) (7.4.0)\n",
+ "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async) (2023.7.22)\n",
+ "Requirement already satisfied: httpcore<0.18.0,>=0.15.0 in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async) (0.17.3)\n",
+ "Requirement already satisfied: idna in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async) (3.4)\n",
+ "Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async) (1.3.0)\n",
+ "Requirement already satisfied: iniconfig in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async) (2.0.0)\n",
+ "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async) (23.1)\n",
+ "Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async) (1.2.0)\n",
+ "Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async) (1.1.3)\n",
+ "Requirement already satisfied: tomli>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async) (2.0.1)\n",
+ "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.10/dist-packages (from httpcore<0.18.0,>=0.15.0->httpx->openai_async) (0.14.0)\n",
+ "Requirement already satisfied: anyio<5.0,>=3.0 in /usr/local/lib/python3.10/dist-packages (from httpcore<0.18.0,>=0.15.0->httpx->openai_async) (3.7.1)\n"
+ ]
+ }
+ ],
+ "source": [
+ "!pip install tornado\n",
+ "!pip install mysql-connector-python\n",
+ "!pip install websockets\n",
+ "!pip install openai_async"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "-oEmP57YD8RH",
+ "outputId": "18369589-a53b-4cb8-8d51-188b08ae533c"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Requirement already satisfied: tornado==6.3.2 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 1)) (6.3.2)\n",
+ "Requirement already satisfied: mysql-connector-python==8.0.31 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 2)) (8.0.31)\n",
+ "Requirement already satisfied: openai_async==0.0.3 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 3)) (0.0.3)\n",
+ "Requirement already satisfied: websockets==11.0.3 in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 4)) (11.0.3)\n",
+ "Requirement already satisfied: protobuf<=3.20.1,>=3.11.0 in /usr/local/lib/python3.10/dist-packages (from mysql-connector-python==8.0.31->-r requirements.txt (line 2)) (3.20.1)\n",
+ "Requirement already satisfied: httpx in /usr/local/lib/python3.10/dist-packages (from openai_async==0.0.3->-r requirements.txt (line 3)) (0.24.1)\n",
+ "Requirement already satisfied: pytest in /usr/local/lib/python3.10/dist-packages (from openai_async==0.0.3->-r requirements.txt (line 3)) (7.4.0)\n",
+ "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (2023.7.22)\n",
+ "Requirement already satisfied: httpcore<0.18.0,>=0.15.0 in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (0.17.3)\n",
+ "Requirement already satisfied: idna in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (3.4)\n",
+ "Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (1.3.0)\n",
+ "Requirement already satisfied: iniconfig in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async==0.0.3->-r requirements.txt (line 3)) (2.0.0)\n",
+ "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async==0.0.3->-r requirements.txt (line 3)) (23.1)\n",
+ "Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async==0.0.3->-r requirements.txt (line 3)) (1.2.0)\n",
+ "Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async==0.0.3->-r requirements.txt (line 3)) (1.1.3)\n",
+ "Requirement already satisfied: tomli>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from pytest->openai_async==0.0.3->-r requirements.txt (line 3)) (2.0.1)\n",
+ "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.10/dist-packages (from httpcore<0.18.0,>=0.15.0->httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (0.14.0)\n",
+ "Requirement already satisfied: anyio<5.0,>=3.0 in /usr/local/lib/python3.10/dist-packages (from httpcore<0.18.0,>=0.15.0->httpx->openai_async==0.0.3->-r requirements.txt (line 3)) (3.7.1)\n"
+ ]
+ }
+ ],
+ "source": [
+ "!pip install -r requirements.txt"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "id": "nQP38oKzGIvB"
+ },
+ "outputs": [],
+ "source": [
+ "!chmod +x restart.sh\n",
+ "#!python server.py"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "1QtQifwfG6Lv",
+ "outputId": "5c50a967-e2a3-4b22-9a1f-4aee9a580365"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Reading package lists... Done\n",
+ "Building dependency tree... Done\n",
+ "Reading state information... Done\n",
+ "mysql-server is already the newest version (8.0.34-0ubuntu0.22.04.1).\n",
+ "0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.\n",
+ " * Starting MySQL database server mysqld\n",
+ " ...done.\n",
+ " * Stopping MySQL database server mysqld\n",
+ " ...done.\n",
+ " * Starting MySQL database server mysqld\n",
+ "su: warning: cannot change directory to /nonexistent: No such file or directory\n",
+ " ...done.\n",
+ "ERROR 1007 (HY000) at line 1: Can't create database 'llm_account'; database exists\n"
+ ]
+ }
+ ],
+ "source": [
+ "!apt-get install mysql-server -y && \\\n",
+ "service mysql start && \\\n",
+ "mysql -e \"ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';\" && \\\n",
+ "service mysql restart && \\\n",
+ "mysql -e \"CREATE DATABASE llm_account DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\" && \\\n",
+ "mysql -e \"CREATE DATABASE llm_game DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\" && \\\n",
+ "mysql -e \"CREATE DATABASE llm_game0001 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\" && \\\n",
+ "mysql -e \"CREATE DATABASE llm_game0002 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!mkdir ./snapshot\n",
+ "!mkdir ./logs"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "Axq6X1LUmpCm",
+ "outputId": "89ef12b9-c674-4488-9f3f-71263630a84f"
+ },
+ "execution_count": 8,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "mkdir: cannot create directory ‘./snapshot’: File exists\n",
+ "mkdir: cannot create directory ‘./logs’: File exists\n"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "import json\n",
+ "\n",
+ "# Define the content of the JSON file\n",
+ "content = {\n",
+ " \"gpt-3.5\": \"xxx\"\n",
+ "}\n",
+ "\n",
+ "# Convert the content to JSON format\n",
+ "json_content = json.dumps(content)\n",
+ "\n",
+ "# Write the JSON content to the file\n",
+ "with open('/content/AgentSims/config/api_key.json', 'w') as file:\n",
+ " file.write(json_content)"
+ ],
+ "metadata": {
+ "id": "s4kkvU-MnZoF"
+ },
+ "execution_count": 9,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "id": "V7Ml2Wx4FRuc"
+ },
+ "outputs": [],
+ "source": [
+ "!nohup bash /content/AgentSims/restart.sh > restart.log 2>&1 &"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "XlMv-b1NYFRX",
+ "outputId": "c8acc787-5859-489b-9b26-45526f3ecd69"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Reading package lists... Done\n",
+ "Building dependency tree... Done\n",
+ "Reading state information... Done\n",
+ "net-tools is already the newest version (1.60+git20181103.0eebece-1ubuntu5).\n",
+ "0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.\n"
+ ]
+ }
+ ],
+ "source": [
+ "!apt-get install net-tools"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "FOFFUNEbYL8F",
+ "outputId": "6a069d5e-0c1a-416b-ad54-4bc85b3fe96c"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Active Internet connections (only servers)\n",
+ "Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name \n",
+ "tcp 0 0 127.0.0.1:45985 0.0.0.0:* LISTEN 2701/python3 \n",
+ "tcp 0 0 127.0.0.1:46525 0.0.0.0:* LISTEN 2666/python3 \n",
+ "tcp 0 0 127.0.0.1:46807 0.0.0.0:* LISTEN 2701/python3 \n",
+ "tcp 0 0 172.28.0.12:9000 0.0.0.0:* LISTEN 80/python3 \n",
+ "tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 3327/python3 \n",
+ "tcp 0 0 127.0.0.1:33060 0.0.0.0:* LISTEN 3246/mysqld \n",
+ "tcp 0 0 127.0.0.11:33489 0.0.0.0:* LISTEN - \n",
+ "tcp 0 0 127.0.0.1:3453 0.0.0.0:* LISTEN 63/python3 \n",
+ "tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 3246/mysqld \n",
+ "tcp 0 0 172.28.0.12:6000 0.0.0.0:* LISTEN 35/kernel_manager_p \n",
+ "tcp6 0 0 :::8080 :::* LISTEN 7/node \n",
+ "udp 0 0 127.0.0.11:34255 0.0.0.0:* - \n"
+ ]
+ }
+ ],
+ "source": [
+ "!netstat -tulpn #| grep 8000"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "id": "GOYmGoMgXLh3"
+ },
+ "outputs": [],
+ "source": [
+ "#!bash ./restart.sh"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "id": "A6LcjWlCPnC8"
+ },
+ "outputs": [],
+ "source": [
+ "#!/bin/bash\n",
+ "\n",
+ "# Stop any existing instances of the processes\n",
+ "!pkill -f tick\n",
+ "!pkill -f mayor\n",
+ "\n",
+ "# Start the first process in the background\n",
+ "!nohup python -u tick.py > tick.log 2>&1 &\n",
+ "\n",
+ "# Start the second process in the background\n",
+ "!nohup python -u mayor.py > mayor.log 2>&1 &"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "#!nohup bash /content/AgentSims/restart.sh > restart.log 2>&1 &"
+ ],
+ "metadata": {
+ "id": "2VabjxTXpjjo"
+ },
+ "execution_count": 15,
+ "outputs": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "_SbWPU0MPcIB",
+ "outputId": "a3a4d3d6-763f-4957-c59c-e3a339c03483"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "404: Not Found404: Not Found"
+ ]
+ }
+ ],
+ "source": [
+ "!curl http://0.0.0.0:8000/client/index.html"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "!curl http://0.0.0.0:8000"
+ ],
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "3NPYzmhdpSUl",
+ "outputId": "07a3a365-7703-4fed-e56c-0a5a91afb864"
+ },
+ "execution_count": 24,
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "404: Not Found404: Not Found"
+ ]
+ }
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "Ruja8Iq3PfEn",
+ "outputId": "56e158bc-cc4f-491c-8362-b480fc0ed4ed"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "\u001b[K\u001b[?25h/tools/node/bin/lt -> /tools/node/lib/node_modules/localtunnel/bin/lt.js\n",
+ "+ localtunnel@2.0.2\n",
+ "updated 1 package in 0.856s\n",
+ "\n",
+ "\u001b[33m\u001b[39m\n",
+ "\u001b[33m ╭───────────────────────────────────────────────────────────────╮\u001b[39m\n",
+ " \u001b[33m│\u001b[39m \u001b[33m│\u001b[39m\n",
+ " \u001b[33m│\u001b[39m New \u001b[31mmajor\u001b[39m version of npm available! \u001b[31m6.14.8\u001b[39m → \u001b[32m9.8.1\u001b[39m \u001b[33m│\u001b[39m\n",
+ " \u001b[33m│\u001b[39m \u001b[33mChangelog:\u001b[39m \u001b[36mhttps://github.com/npm/cli/releases/tag/v9.8.1\u001b[39m \u001b[33m│\u001b[39m\n",
+ " \u001b[33m│\u001b[39m Run \u001b[32mnpm install -g npm\u001b[39m to update! \u001b[33m│\u001b[39m\n",
+ " \u001b[33m│\u001b[39m \u001b[33m│\u001b[39m\n",
+ "\u001b[33m ╰───────────────────────────────────────────────────────────────╯\u001b[39m\n",
+ "\u001b[33m\u001b[39m\n",
+ "34.90.65.190\n"
+ ]
+ }
+ ],
+ "source": [
+ "!npm install -g localtunnel\n",
+ "!curl ipv4.icanhazip.com\n",
+ "#!lt --port 8000 --lcoal-host https://0.0.0.0:8000/client/index.html #/index.html\n",
+ "!nohup lt --port 8000 --lcoal-host https://0.0.0.0:8000/client/index.html > index-on-internet.log 2>&1 &"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "id": "LkOCHonYSs6H"
+ },
+ "outputs": [],
+ "source": [
+ "#!lt --port 8000 #--host http://0.0.0.0"
+ ]
+ }
+ ],
+ "metadata": {
+ "colab": {
+ "provenance": [],
+ "authorship_tag": "ABX9TyPOdAbBQGi86VdoL0nuajlH",
+ "include_colab_link": true
+ },
+ "kernelspec": {
+ "display_name": "Python 3",
+ "name": "python3"
+ },
+ "language_info": {
+ "name": "python"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
\ No newline at end of file
diff --git a/Google-colab/readme.md b/Google-colab/readme.md
new file mode 100644
index 0000000..23e68ef
--- /dev/null
+++ b/Google-colab/readme.md
@@ -0,0 +1,15 @@
+So this is the Google colab install page for the [Agentsims][1], more information is available at the main [Agentsims][1], [this Google colab page][2] and the [below youtube video][3] :
+![enter image description here][4]
+ The below photo is showing the current install results in Google colab page:
+![enter image description here][5]
+
+And it's successful install photo in google colab page is shown at below:
+![enter image description here][6]
+
+
+ [1]: https://github.com/py499372727/AgentSims
+ [2]: https://colab.research.google.com/drive/1Efm4YoF5W5wcaVbW7kEwBJzBQI4bBNT5#scrollTo=nQP38oKzGIvB
+ [3]: https://m.youtube.com/watch?v=buZX6XJiZtE
+ [4]: https://i.stack.imgur.com/8cm3A.jpg
+ [5]: https://i.stack.imgur.com/BZlNw.jpg
+ [6]: https://i.stack.imgur.com/o5FoC.jp