Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion google/genai/_extra_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

"""Extra utils depending on types that are shared between sync and async modules."""

import asyncio
import inspect
import io
import logging
Expand Down Expand Up @@ -371,7 +372,9 @@ async def get_function_response_parts_async(
}
else:
func_response = {
'result': invoke_function_from_dict_args(args, func)
'result': await asyncio.to_thread(
invoke_function_from_dict_args, args, func
)
}
except Exception as e: # pylint: disable=broad-except
func_response = {'error': str(e)}
Expand Down