File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
volcenginesdkarkruntime/resources/responses Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1818)
1919
2020import httpx
21+ import asyncio
2122from typing_extensions import Literal
2223from urllib .parse import urlparse , unquote_plus
2324from ..._types import Body , Query , Headers
3839from ...types .responses .tool_param import ToolParam
3940from ...types .responses .response_input_param import (
4041 ResponseInputParam ,
42+ ResponseInputItemParam ,
4143)
4244from ...types .responses .response_input_message_content_list_param import (
4345 ResponseInputContentParam ,
@@ -325,6 +327,7 @@ async def delete(
325327 )
326328
327329 async def _prepare_responses_input (self , input : ResponseInputParam ):
330+ tasks = []
328331 for input_item in input : # type: ResponseInputItemParam
329332 if "content" not in input_item : # skip non-content message
330333 continue
@@ -334,7 +337,9 @@ async def _prepare_responses_input(self, input: ResponseInputParam):
334337 continue
335338
336339 for content in content_list : # type: ResponseInputContentParam
337- await self ._prepare_responses_input_file (content = content )
340+ tasks .append (self ._prepare_responses_input_file (content = content ))
341+
342+ await asyncio .gather (* tasks )
338343
339344 async def _prepare_responses_input_file (self , content : ResponseInputContentParam ):
340345 if "type" not in content : # skip non-type content
You can’t perform that action at this time.
0 commit comments