File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
openhands-sdk/openhands/sdk/llm Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -822,6 +822,16 @@ def _init_model_info_and_caps(self) -> None:
822822 elif isinstance (self ._model_info .get ("max_tokens" ), int ):
823823 self .max_output_tokens = self ._model_info .get ("max_tokens" )
824824
825+ if "o3" in self .model :
826+ o3_limit = 100000
827+ if self .max_output_tokens is None or self .max_output_tokens > o3_limit :
828+ self .max_output_tokens = o3_limit
829+ logger .debug (
830+ "Clamping max_output_tokens to %s for %s" ,
831+ self .max_output_tokens ,
832+ self .model ,
833+ )
834+
825835 def vision_is_active (self ) -> bool :
826836 with warnings .catch_warnings ():
827837 warnings .simplefilter ("ignore" )
Original file line number Diff line number Diff line change @@ -69,8 +69,9 @@ class ModelFeatures:
6969]
7070
7171SUPPORTS_STOP_WORDS_FALSE_PATTERNS : list [str ] = [
72- # o1 family doesn 't support stop words
72+ # o-series families don 't support stop words
7373 "o1" ,
74+ "o3" ,
7475 # grok-4 specific model name (basename)
7576 "grok-4-0709" ,
7677 "grok-code-fast-1" ,
You can’t perform that action at this time.
0 commit comments