2020 SessionDetail ,
2121 SessionSummary ,
2222 StatsResponse ,
23+ ToolResult ,
2324)
2425
2526DEFAULT_BASE_URL = "http://127.0.0.1:4590"
@@ -124,6 +125,8 @@ def chat(
124125 autonomy : str | None = None ,
125126 cwd : str | None = None ,
126127 agent : str | None = None ,
128+ tools : list [dict [str , Any ]] | None = None ,
129+ tool_results : list [ToolResult ] | None = None ,
127130 ) -> ChatResponse :
128131 """Send a prompt and return the complete response."""
129132 request = ChatRequest (
@@ -134,6 +137,8 @@ def chat(
134137 autonomy = autonomy ,
135138 cwd = cwd ,
136139 agent = agent ,
140+ tools = tools ,
141+ tool_results = tool_results ,
137142 )
138143
139144 def _do () -> ChatResponse :
@@ -156,6 +161,8 @@ def chat_stream(
156161 autonomy : str | None = None ,
157162 cwd : str | None = None ,
158163 agent : str | None = None ,
164+ tools : list [dict [str , Any ]] | None = None ,
165+ tool_results : list [ToolResult ] | None = None ,
159166 ) -> StreamReader :
160167 """Send a prompt and stream the response via SSE."""
161168 request = ChatRequest (
@@ -166,6 +173,8 @@ def chat_stream(
166173 autonomy = autonomy ,
167174 cwd = cwd ,
168175 agent = agent ,
176+ tools = tools ,
177+ tool_results = tool_results ,
169178 )
170179
171180 def _do () -> StreamReader :
@@ -190,12 +199,18 @@ def _do() -> StreamReader:
190199 def create_session (
191200 self ,
192201 name : str | None = None ,
202+ model : str | None = None ,
203+ cwd : str | None = None ,
193204 metadata : dict [str , Any ] | None = None ,
194205 ) -> SessionDetail :
195206 """Create a new session."""
196207 body : dict [str , Any ] = {}
197208 if name is not None :
198209 body ["name" ] = name
210+ if model is not None :
211+ body ["model" ] = model
212+ if cwd is not None :
213+ body ["cwd" ] = cwd
199214 if metadata is not None :
200215 body ["metadata" ] = metadata
201216
@@ -333,6 +348,8 @@ async def chat(
333348 autonomy : str | None = None ,
334349 cwd : str | None = None ,
335350 agent : str | None = None ,
351+ tools : list [dict [str , Any ]] | None = None ,
352+ tool_results : list [ToolResult ] | None = None ,
336353 ) -> ChatResponse :
337354 """Send a prompt and return the complete response."""
338355 request = ChatRequest (
@@ -343,6 +360,8 @@ async def chat(
343360 autonomy = autonomy ,
344361 cwd = cwd ,
345362 agent = agent ,
363+ tools = tools ,
364+ tool_results = tool_results ,
346365 )
347366
348367 async def _do () -> ChatResponse :
@@ -365,6 +384,8 @@ async def chat_stream(
365384 autonomy : str | None = None ,
366385 cwd : str | None = None ,
367386 agent : str | None = None ,
387+ tools : list [dict [str , Any ]] | None = None ,
388+ tool_results : list [ToolResult ] | None = None ,
368389 ) -> AsyncStreamReader :
369390 """Send a prompt and stream the response via SSE."""
370391 request = ChatRequest (
@@ -375,6 +396,8 @@ async def chat_stream(
375396 autonomy = autonomy ,
376397 cwd = cwd ,
377398 agent = agent ,
399+ tools = tools ,
400+ tool_results = tool_results ,
378401 )
379402
380403 async def _do () -> AsyncStreamReader :
@@ -399,12 +422,18 @@ async def _do() -> AsyncStreamReader:
399422 async def create_session (
400423 self ,
401424 name : str | None = None ,
425+ model : str | None = None ,
426+ cwd : str | None = None ,
402427 metadata : dict [str , Any ] | None = None ,
403428 ) -> SessionDetail :
404429 """Create a new session."""
405430 body : dict [str , Any ] = {}
406431 if name is not None :
407432 body ["name" ] = name
433+ if model is not None :
434+ body ["model" ] = model
435+ if cwd is not None :
436+ body ["cwd" ] = cwd
408437 if metadata is not None :
409438 body ["metadata" ] = metadata
410439
0 commit comments