23
23
24
24
def heading (text ):
25
25
print (text )
26
- print ('=' * (len (text ) + 3 ))
26
+ print ('=' * (len (text ) + 3 ))
27
27
28
28
29
29
async def _browser_search_async (query : str , topn : int = 10 , source : str | None = None ) -> str :
@@ -44,14 +44,7 @@ async def _browser_search_async(query: str, topn: int = 10, source: str | None =
44
44
45
45
46
46
async def _browser_open_async (id : int | str = - 1 , cursor : int = - 1 , loc : int = - 1 , num_lines : int = - 1 , * , view_source : bool = False , source : str | None = None ) -> str :
47
- payload = {
48
- 'id' : id ,
49
- 'cursor' : cursor ,
50
- 'loc' : loc ,
51
- 'num_lines' : num_lines ,
52
- 'view_source' : view_source ,
53
- 'source' : source
54
- }
47
+ payload = {'id' : id , 'cursor' : cursor , 'loc' : loc , 'num_lines' : num_lines , 'view_source' : view_source , 'source' : source }
55
48
56
49
harmony_message = HarmonyMessage (
57
50
author = Author (role = Role .USER ),
@@ -98,7 +91,6 @@ def browser_find(pattern: str, cursor: int = -1) -> str:
98
91
return asyncio .run (_browser_find_async (pattern = pattern , cursor = cursor ))
99
92
100
93
101
-
102
94
# Schema definitions for each browser tool
103
95
browser_search_schema = {
104
96
'type' : 'function' ,
@@ -141,7 +133,7 @@ def browser_find(pattern: str, cursor: int = -1) -> str:
141
133
model = model ,
142
134
messages = messages ,
143
135
tools = [browser_search_schema , browser_open_schema , browser_find_schema ],
144
- options = {'num_ctx' : 32000 } # 8192 is the recommended lower limit for the context window
136
+ options = {'num_ctx' : 8192 }, # 8192 is the recommended lower limit for the context window
145
137
)
146
138
147
139
if hasattr (response .message , 'thinking' ) and response .message .thinking :
0 commit comments