Skip to content

Commit

Permalink
Merge branch 'main' into anthropic-system-messages-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkall authored Sep 3, 2024
2 parents 2386763 + ca1a89c commit d39f414
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
15 changes: 13 additions & 2 deletions autogen/coding/local_commandline_code_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,12 @@ def _setup_functions(self) -> None:
cmd = [py_executable, "-m", "pip", "install"] + required_packages
try:
result = subprocess.run(
cmd, cwd=self._work_dir, capture_output=True, text=True, timeout=float(self._timeout)
cmd,
cwd=self._work_dir,
capture_output=True,
text=True,
timeout=float(self._timeout),
encoding="utf-8",
)
except subprocess.TimeoutExpired as e:
raise ValueError("Pip install timed out") from e
Expand Down Expand Up @@ -303,7 +308,13 @@ def _execute_code_dont_check_setup(self, code_blocks: List[CodeBlock]) -> Comman

try:
result = subprocess.run(
cmd, cwd=self._work_dir, capture_output=True, text=True, timeout=float(self._timeout), env=env
cmd,
cwd=self._work_dir,
capture_output=True,
text=True,
timeout=float(self._timeout),
env=env,
encoding="utf-8",
)
except subprocess.TimeoutExpired:
logs_all += "\n" + TIMEOUT_MSG
Expand Down
14 changes: 13 additions & 1 deletion samples/apps/autogen-studio/autogenstudio/datamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@
Enum as SqlEnum,
)

SQLModel.model_config["protected_namespaces"] = ()
# added for python3.11 and sqlmodel 0.0.22 incompatibility
if hasattr(SQLModel, "model_config"):
SQLModel.model_config["protected_namespaces"] = ()
elif hasattr(SQLModel, "Config"):

class CustomSQLModel(SQLModel):
class Config:
protected_namespaces = ()

SQLModel = CustomSQLModel
else:
print("Warning: Unable to set protected_namespaces.")

# pylint: disable=protected-access


Expand Down

0 comments on commit d39f414

Please sign in to comment.