Skip to content

Commit de59078

Browse files
chore: Update commons.py (#3212)
Co-authored-by: Wendong-Fan <133094783+Wendong-Fan@users.noreply.github.com> Co-authored-by: Wendong-Fan <w3ndong.fan@gmail.com>
1 parent fb3ed9f commit de59078

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ body:
2626
attributes:
2727
label: What version of camel are you using?
2828
description: Run command `python3 -c 'print(__import__("camel").__version__)'` in your shell and paste the output here.
29-
placeholder: E.g., 0.2.76a11
29+
placeholder: E.g., 0.2.76a12
3030
validations:
3131
required: true
3232

camel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from camel.logger import disable_logging, enable_logging, set_log_level
1616

17-
__version__ = '0.2.76a11'
17+
__version__ = '0.2.76a12'
1818

1919
__all__ = [
2020
'__version__',

camel/utils/commons.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,19 @@ def wrapper(*args, **kwargs):
10151015
if effective_timeout is None:
10161016
return func(*args, **kwargs)
10171017

1018+
# If current thread has a running asyncio event loop, avoid
1019+
# switching threads to preserve asyncio context (e.g., for
1020+
# asyncio.create_task). Execute inline without enforcing a
1021+
# sync timeout to keep event loop semantics intact.
1022+
try:
1023+
asyncio.get_running_loop()
1024+
loop_running = True
1025+
except RuntimeError:
1026+
loop_running = False
1027+
1028+
if loop_running:
1029+
return func(*args, **kwargs)
1030+
10181031
# Container to hold the result of the function call
10191032
result_container = []
10201033

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
project = 'CAMEL'
2828
copyright = '2024, CAMEL-AI.org'
2929
author = 'CAMEL-AI.org'
30-
release = '0.2.76a11'
30+
release = '0.2.76a12'
3131

3232
html_favicon = (
3333
'https://raw.githubusercontent.com/camel-ai/camel/master/misc/favicon.png'

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "camel-ai"
7-
version = "0.2.76a11"
7+
version = "0.2.76a12"
88
description = "Communicative Agents for AI Society Study"
99
authors = [{ name = "CAMEL-AI.org" }]
1010
requires-python = ">=3.10,<3.13"

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)