From f10383ffffe53891212341c4f0d731771386f200 Mon Sep 17 00:00:00 2001 From: wuyiqunLu Date: Fri, 20 Sep 2024 00:37:32 +0800 Subject: [PATCH 1/3] fix: address second conversation issue --- pyproject.toml | 2 +- vision_agent/agent/vision_agent.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 78dedd8d..93dbb50a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ requests = "2.*" tqdm = ">=4.64.0,<5.0.0" pandas = "2.*" openai = "1.*" +flake8 = "^7.0.0" typing_extensions = "4.*" opencv-python = "4.*" tabulate = "^0.9.0" @@ -47,7 +48,6 @@ av = "^11.0.0" autoflake = "1.*" pytest = "7.*" black = ">=23,<25" -flake8 = "5.*" isort = "5.*" responses = "^0.23.1" mypy = "<1.8.0" diff --git a/vision_agent/agent/vision_agent.py b/vision_agent/agent/vision_agent.py index fa68e6b9..1e1abbe6 100644 --- a/vision_agent/agent/vision_agent.py +++ b/vision_agent/agent/vision_agent.py @@ -276,8 +276,11 @@ def chat_with_code( # sometimes it gets stuck in a loop, so we force it to exit if last_response == response: response["let_user_respond"] = True - - self.streaming_message({"role": "assistant", "content": response}) + self.streaming_message( + {"role": "assistant", "error": "Stuck in loop"} + ) + else: + self.streaming_message({"role": "assistant", "content": response}) if response["let_user_respond"]: break From 9871cf4353305ca2bf1ad31ca59a86c31da8918f Mon Sep 17 00:00:00 2001 From: wuyiqunLu Date: Fri, 20 Sep 2024 00:44:46 +0800 Subject: [PATCH 2/3] update poetry lock --- poetry.lock | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/poetry.lock b/poetry.lock index b6356fcf..e03f8871 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "annotated-types" @@ -108,17 +108,17 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p [[package]] name = "autoflake" -version = "1.7.8" +version = "1.7.7" description = "Removes unused imports and unused variables" optional = false python-versions = ">=3.7" files = [ - {file = "autoflake-1.7.8-py3-none-any.whl", hash = "sha256:46373ef69b6714f5064c923bb28bd797c4f8a9497f557d87fc36665c6d956b39"}, - {file = "autoflake-1.7.8.tar.gz", hash = "sha256:e7e46372dee46fa1c97acf310d99d922b63d369718a270809d7c278d34a194cf"}, + {file = "autoflake-1.7.7-py3-none-any.whl", hash = "sha256:a9b43d08f8e455824e4f7b3f078399f59ba538ba53872f466c09e55c827773ef"}, + {file = "autoflake-1.7.7.tar.gz", hash = "sha256:c8e4fc41aa3eae0f5c94b939e3a3d50923d7a9306786a6cbf4866a077b8f6832"}, ] [package.dependencies] -pyflakes = ">=1.1.0,<3" +pyflakes = ">=1.1.0" tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} [[package]] @@ -651,19 +651,19 @@ typing = ["typing-extensions (>=4.12.2)"] [[package]] name = "flake8" -version = "5.0.4" +version = "7.1.1" description = "the modular source code checker: pep8 pyflakes and co" optional = false -python-versions = ">=3.6.1" +python-versions = ">=3.8.1" files = [ - {file = "flake8-5.0.4-py2.py3-none-any.whl", hash = "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248"}, - {file = "flake8-5.0.4.tar.gz", hash = "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db"}, + {file = "flake8-7.1.1-py2.py3-none-any.whl", hash = "sha256:597477df7860daa5aa0fdd84bf5208a043ab96b8e96ab708770ae0364dd03213"}, + {file = "flake8-7.1.1.tar.gz", hash = "sha256:049d058491e228e03e67b390f311bbf88fce2dbaa8fa673e7aea87b7198b8d38"}, ] [package.dependencies] mccabe = ">=0.7.0,<0.8.0" -pycodestyle = ">=2.9.0,<2.10.0" -pyflakes = ">=2.5.0,<2.6.0" +pycodestyle = ">=2.12.0,<2.13.0" +pyflakes = ">=3.2.0,<3.3.0" [[package]] name = "fsspec" @@ -2271,13 +2271,13 @@ tests = ["pytest"] [[package]] name = "pycodestyle" -version = "2.9.1" +version = "2.12.1" description = "Python style guide checker" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "pycodestyle-2.9.1-py2.py3-none-any.whl", hash = "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b"}, - {file = "pycodestyle-2.9.1.tar.gz", hash = "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785"}, + {file = "pycodestyle-2.12.1-py2.py3-none-any.whl", hash = "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3"}, + {file = "pycodestyle-2.12.1.tar.gz", hash = "sha256:6838eae08bbce4f6accd5d5572075c63626a15ee3e6f842df996bf62f6d73521"}, ] [[package]] @@ -2423,13 +2423,13 @@ yaml = ["pyyaml (>=6.0.1)"] [[package]] name = "pyflakes" -version = "2.5.0" +version = "3.2.0" description = "passive checker of Python programs" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "pyflakes-2.5.0-py2.py3-none-any.whl", hash = "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2"}, - {file = "pyflakes-2.5.0.tar.gz", hash = "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3"}, + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, ] [[package]] @@ -3603,4 +3603,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "bead91bd0ca1f1b9ecca03980370fbf63bcd345599e89bbd4b5b412c53de3b9f" +content-hash = "5014a9fd241fb625394843263c73feb27ba35b31d13199db45b06985d9e1fbeb" From 904c72052980277ac589346d393d617d8475c099 Mon Sep 17 00:00:00 2001 From: wuyiqunLu Date: Fri, 20 Sep 2024 01:06:09 +0800 Subject: [PATCH 3/3] fix --- vision_agent/utils/execute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vision_agent/utils/execute.py b/vision_agent/utils/execute.py index be29394a..99159b5f 100644 --- a/vision_agent/utils/execute.py +++ b/vision_agent/utils/execute.py @@ -104,7 +104,7 @@ class Result: latex: Optional[str] = None json: Optional[Dict[str, Any]] = None javascript: Optional[str] = None - artifact_name: Optional[str] = None + artifact: Optional[str] = None extra: Optional[Dict[str, Any]] = None "Extra data that can be included. Not part of the standard types."