File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 22# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
33import os
44from abc import ABC , abstractmethod
5- from typing import TYPE_CHECKING , Any
5+ from typing import TYPE_CHECKING , Any , Optional
6+
7+ from openai_harmony import Message
68
79from vllm .logger import init_logger
810
@@ -70,7 +72,16 @@ def __init__(self):
7072 "gpt_oss is not installed, code interpreter is disabled" )
7173 return
7274
73- self .python_tool = PythonTool ()
75+ # NOTE (Chen): as of gpt-oss 0.0.2, there is a bug in _make_response
76+ # and we do the following monkey patch to fix it.
77+ class PatchedGptOssPythonToolPatch (PythonTool ):
78+
79+ def _make_response (self ,
80+ output : str ,
81+ channel : Optional [str ] = None ) -> Message :
82+ return super ()._make_response (output )
83+
84+ self .python_tool = PatchedGptOssPythonToolPatch ()
7485 logger .info_once ("Code interpreter tool initialized" )
7586
7687 async def get_result (self , context : "ConversationContext" ) -> Any :
You can’t perform that action at this time.
0 commit comments