File tree 1 file changed +3
-2
lines changed
python/packages/autogen-ext/src/autogen_ext/agents/web_surfer
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 65
65
from ._types import InteractiveRegion , UserContent
66
66
from .playwright_controller import PlaywrightController
67
67
68
+ DEFAULT_CONTEXT_SIZE = 128000
68
69
69
70
class MultimodalWebSurferConfig (BaseModel ):
70
71
name : str
@@ -863,8 +864,8 @@ async def _summarize_page(
863
864
try :
864
865
remaining = self ._model_client .remaining_tokens (messages + [trial_message ])
865
866
except KeyError :
866
- # Default to 128k if the model isn't found
867
- remaining = 128000 - self ._model_client .count_tokens (messages + [trial_message ])
867
+ # Use the default if the model isn't found
868
+ remaining = DEFAULT_CONTEXT_SIZE - self ._model_client .count_tokens (messages + [trial_message ])
868
869
869
870
if self ._model_client .model_info ["vision" ] and remaining <= 0 :
870
871
break
You can’t perform that action at this time.
0 commit comments