Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
17d5eda8
Unverified
Commit
17d5eda8
authored
Aug 25, 2025
by
Yuhao Zhou
Committed by
GitHub
Aug 25, 2025
Browse files
bugfix for undefined logging functions in HarmonyBrowserTool & HarmonyPythonTool (#9229)
parent
71a7f1d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
python/sglang/srt/entrypoints/tool.py
python/sglang/srt/entrypoints/tool.py
+7
-7
No files found.
python/sglang/srt/entrypoints/tool.py
View file @
17d5eda8
...
...
@@ -4,6 +4,8 @@ import os
from
abc
import
ABC
,
abstractmethod
from
typing
import
TYPE_CHECKING
,
Any
from
sglang.srt.utils
import
print_info_once
,
print_warning_once
if
TYPE_CHECKING
:
# Avoid circular import.
from
sglang.srt.entrypoints.context
import
ConversationContext
...
...
@@ -25,7 +27,7 @@ class HarmonyBrowserTool(Tool):
exa_api_key
=
os
.
getenv
(
"EXA_API_KEY"
)
if
not
exa_api_key
:
self
.
enabled
=
False
logger
.
warning_once
(
"EXA_API_KEY is not set, browsing is disabled"
)
print_
warning_once
(
"EXA_API_KEY is not set, browsing is disabled"
)
return
try
:
...
...
@@ -33,12 +35,12 @@ class HarmonyBrowserTool(Tool):
from
gpt_oss.tools.simple_browser.backend
import
ExaBackend
except
ImportError
:
self
.
enabled
=
False
logger
.
warning_once
(
"gpt_oss is not installed, browsing is disabled"
)
print_
warning_once
(
"gpt_oss is not installed, browsing is disabled"
)
return
browser_backend
=
ExaBackend
(
source
=
"web"
,
api_key
=
exa_api_key
)
self
.
browser_tool
=
SimpleBrowserTool
(
backend
=
browser_backend
)
logger
.
info_once
(
"Browser tool initialized"
)
print_
info_once
(
"Browser tool initialized"
)
async
def
get_result
(
self
,
context
:
"ConversationContext"
)
->
Any
:
from
sglang.srt.entrypoints.context
import
HarmonyContext
...
...
@@ -64,13 +66,11 @@ class HarmonyPythonTool(Tool):
from
gpt_oss.tools.python_docker.docker_tool
import
PythonTool
except
ImportError
:
self
.
enabled
=
False
logger
.
warning_once
(
"gpt_oss is not installed, code interpreter is disabled"
)
print_warning_once
(
"gpt_oss is not installed, code interpreter is disabled"
)
return
self
.
python_tool
=
PythonTool
()
logger
.
info_once
(
"Code interpreter tool initialized"
)
print_
info_once
(
"Code interpreter tool initialized"
)
async
def
get_result
(
self
,
context
:
"ConversationContext"
)
->
Any
:
from
sglang.srt.entrypoints.context
import
HarmonyContext
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment