Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Cleanup
Tomas Valenta293a2d440258
diff --git a/api-service/codegen/agent/base.py b/api-service/codegen/agent/base.pyindex 668a53b91..1b6ad6d69 100644--- a/api-service/codegen/agent/base.py+++ b/api-service/codegen/agent/base.py@@ -1,17 +1,17 @@-from typing import Optional, Tuple, List, Dict, Union-from html import unescapeimport xml.etree.ElementTree as ETimport reimport traceback-from lxml import etree-import cchardet+from typing import Optional, Tuple, List, Dict, Union+from html import unescape+from lxml import etreefrom langchain.agents.tools import InvalidToolfrom langchain.agents import AgentExecutorfrom langchain.agents.chat.base import ChatAgentfrom langchain.schema import AgentAction, AgentFinishfrom langchain.tools.base import BaseTool+FINAL_ANSWER_ACTION = "Final Answer:"ACTIONS_QUEUE = "action_queue"MALFORMED_ANSWER = "malformed_answer"diff --git a/api-service/codegen/callbacks/logs.py b/api-service/codegen/callbacks/logs.pyindex 401dbff53..932a92db1 100644--- a/api-service/codegen/callbacks/logs.py+++ b/api-service/codegen/callbacks/logs.py@@ -1,6 +1,5 @@-from typing import Dict, Any, List, Unionimport datetime-+from typing import Dict, Any, List, Unionfrom pydantic import PrivateAttrfrom langchain.callbacks.base import BaseCallbackHandlerfrom langchain.schema import AgentAction, AgentFinish, LLMResult@@ -36,7 +35,7 @@ class LogStreamParser:)self._parse()- # If we received output for the last tool we save the buffered logs to logs and reset all buffers.+ # If we received output for the last tool in the buffered logs we save the buffered logs to logs and reset all buffers.# We know this is is the output for the last tool if the number of tool logs in buffered logs is equal to the number of buffered outputs.if len(self._tools_output_buffer) == len([log for log in self._logs_buffer if log["type"] == "tool"]diff --git a/api-service/poetry.lock b/api-service/poetry.lockindex 8783eef5c..f8a0fc287 100644--- a/api-service/poetry.lock+++ b/api-service/poetry.lock@@ -1,4 +1,4 @@-# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand.+# This file is automatically @generated by Poetry and should not be changed by hand.[[package]]name = "aenum"@@ -222,45 +222,6 @@ webencodings = "*"[package.extras]css = ["tinycss2 (>=1.1.0,<1.2)"]-[[package]]-name = "cchardet"-version = "2.1.7"-description = "cChardet is high speed universal character encoding detector."-category = "main"-optional = false-python-versions = "*"-files = [- {file = "cchardet-2.1.7-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:c6f70139aaf47ffb94d89db603af849b82efdf756f187cdd3e566e30976c519f"},- {file = "cchardet-2.1.7-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:5a25f9577e9bebe1a085eec2d6fdd72b7a9dd680811bba652ea6090fb2ff472f"},- {file = "cchardet-2.1.7-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:6b6397d8a32b976a333bdae060febd39ad5479817fabf489e5596a588ad05133"},- {file = "cchardet-2.1.7-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:228d2533987c450f39acf7548f474dd6814c446e9d6bd228e8f1d9a2d210f10b"},- {file = "cchardet-2.1.7-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:54341e7e1ba9dc0add4c9d23b48d3a94e2733065c13920e85895f944596f6150"},- {file = "cchardet-2.1.7-cp36-cp36m-win32.whl", hash = "sha256:eee4f5403dc3a37a1ca9ab87db32b48dc7e190ef84601068f45397144427cc5e"},- {file = "cchardet-2.1.7-cp36-cp36m-win_amd64.whl", hash = "sha256:f86e0566cb61dc4397297696a4a1b30f6391b50bc52b4f073507a48466b6255a"},- {file = "cchardet-2.1.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:302aa443ae2526755d412c9631136bdcd1374acd08e34f527447f06f3c2ddb98"},- {file = "cchardet-2.1.7-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:70eeae8aaf61192e9b247cf28969faef00578becd2602526ecd8ae7600d25e0e"},- {file = "cchardet-2.1.7-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:a39526c1c526843965cec589a6f6b7c2ab07e3e56dc09a7f77a2be6a6afa4636"},- {file = "cchardet-2.1.7-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:b154effa12886e9c18555dfc41a110f601f08d69a71809c8d908be4b1ab7314f"},- {file = "cchardet-2.1.7-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:ec3eb5a9c475208cf52423524dcaf713c394393e18902e861f983c38eeb77f18"},- {file = "cchardet-2.1.7-cp37-cp37m-win32.whl", hash = "sha256:50ad671e8d6c886496db62c3bd68b8d55060688c655873aa4ce25ca6105409a1"},- {file = "cchardet-2.1.7-cp37-cp37m-win_amd64.whl", hash = "sha256:54d0b26fd0cd4099f08fb9c167600f3e83619abefeaa68ad823cc8ac1f7bcc0c"},- {file = "cchardet-2.1.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b59ddc615883835e03c26f81d5fc3671fab2d32035c87f50862de0da7d7db535"},- {file = "cchardet-2.1.7-cp38-cp38-manylinux1_i686.whl", hash = "sha256:27a9ba87c9f99e0618e1d3081189b1217a7d110e5c5597b0b7b7c3fedd1c340a"},- {file = "cchardet-2.1.7-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:90086e5645f8a1801350f4cc6cb5d5bf12d3fa943811bb08667744ec1ecc9ccd"},- {file = "cchardet-2.1.7-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:45456c59ec349b29628a3c6bfb86d818ec3a6fbb7eb72de4ff3bd4713681c0e3"},- {file = "cchardet-2.1.7-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:f16517f3697569822c6d09671217fdeab61dfebc7acb5068634d6b0728b86c0b"},- {file = "cchardet-2.1.7-cp38-cp38-win32.whl", hash = "sha256:0b859069bbb9d27c78a2c9eb997e6f4b738db2d7039a03f8792b4058d61d1109"},- {file = "cchardet-2.1.7-cp38-cp38-win_amd64.whl", hash = "sha256:273699c4e5cd75377776501b72a7b291a988c6eec259c29505094553ee505597"},- {file = "cchardet-2.1.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:48ba829badef61441e08805cfa474ccd2774be2ff44b34898f5854168c596d4d"},- {file = "cchardet-2.1.7-cp39-cp39-manylinux1_i686.whl", hash = "sha256:bd7f262f41fd9caf5a5f09207a55861a67af6ad5c66612043ed0f81c58cdf376"},- {file = "cchardet-2.1.7-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:fdac1e4366d0579fff056d1280b8dc6348be964fda8ebb627c0269e097ab37fa"},- {file = "cchardet-2.1.7-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:80e6faae75ecb9be04a7b258dc4750d459529debb6b8dee024745b7b5a949a34"},- {file = "cchardet-2.1.7-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:c96aee9ebd1147400e608a3eff97c44f49811f8904e5a43069d55603ac4d8c97"},- {file = "cchardet-2.1.7-cp39-cp39-win32.whl", hash = "sha256:2309ff8fc652b0fc3c0cff5dbb172530c7abb92fe9ba2417c9c0bcf688463c1c"},- {file = "cchardet-2.1.7-cp39-cp39-win_amd64.whl", hash = "sha256:24974b3e40fee9e7557bb352be625c39ec6f50bc2053f44a3d1191db70b51675"},- {file = "cchardet-2.1.7.tar.gz", hash = "sha256:c428b6336545053c2589f6caf24ea32276c6664cb86db817e03a94c60afa0eaf"},-]-[[package]]name = "certifi"version = "2022.12.7"@@ -2020,7 +1981,7 @@ files = [][package.dependencies]-greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and platform_machine == \"aarch64\" or python_version >= \"3\" and platform_machine == \"ppc64le\" or python_version >= \"3\" and platform_machine == \"x86_64\" or python_version >= \"3\" and platform_machine == \"amd64\" or python_version >= \"3\" and platform_machine == \"AMD64\" or python_version >= \"3\" and platform_machine == \"win32\" or python_version >= \"3\" and platform_machine == \"WIN32\""}+greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"}[package.extras]aiomysql = ["aiomysql", "greenlet (!=0.4.17)"]@@ -2473,4 +2434,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more[metadata]lock-version = "2.0"python-versions = ">=3.8.1,<4.0"-content-hash = "74f63cc1631aab2dd3314c05254b654e9f6f802eae2335729cee9eda5d6f51ae"+content-hash = "ebfa4537125ef05ad53266a7e5ff831f42be97b097920373aa2023e073d35b86"diff --git a/api-service/pyproject.toml b/api-service/pyproject.tomlindex fb730a1a0..254337669 100644--- a/api-service/pyproject.toml+++ b/api-service/pyproject.toml@@ -18,7 +18,6 @@ python-dotenv = "^1.0.0"openai = "^0.27.0"pytest = "^7.2.2"lxml = "^4.9.2"-cchardet = "^2.1.7"flask = "^2.2.3"asyncio = "^3.4.3"postgrest-py = "^0.10.6"