@@ -794,3 +794,49 @@ async def embeddings(
794794 logger .debug (f"Generating embeddings with input: { input } , payload: { payload } " )
795795 payload = {** (payload or {}), "input" : input }
796796 return await self ._request (payload = payload , headers = headers )
797+
798+
799+ def get_httpx_client (** kwargs : Any ) -> httpx .Client :
800+ """
801+ Creates and returns a synchronous httpx Client configured with OCI authentication.
802+
803+ This function checks if an 'auth' keyword argument is provided. If not, it instantiates
804+ the default OCI authentication (HttpxOCIAuth) and injects it into the client configuration.
805+ Any additional keyword arguments are passed directly to the httpx.Client constructor.
806+
807+ Parameters
808+ ----------
809+ **kwargs : Any
810+ Arbitrary keyword arguments for configuring the httpx.Client. An optional 'auth'
811+ argument can be provided to override the default OCI authentication.
812+
813+ Returns
814+ -------
815+ Client
816+ A configured synchronous httpx Client instance.
817+ """
818+ kwargs ["auth" ] = kwargs .get ("auth" ) or HttpxOCIAuth ()
819+ return httpx .Client (** kwargs )
820+
821+
822+ def get_async_httpx_client (** kwargs : Any ) -> httpx .AsyncClient :
823+ """
824+ Creates and returns an asynchronous httpx AsyncClient configured with OCI authentication.
825+
826+ This function checks if an 'auth' keyword argument is provided. If not, it instantiates
827+ the default OCI authentication (HttpxOCIAuth) and injects it into the client configuration.
828+ Any additional keyword arguments are passed directly to the httpx.AsyncClient constructor.
829+
830+ Parameters
831+ ----------
832+ **kwargs : Any
833+ Arbitrary keyword arguments for configuring the httpx.AsyncClient. An optional 'auth'
834+ argument can be provided to override the default OCI authentication.
835+
836+ Returns
837+ -------
838+ AsyncClient
839+ A configured asynchronous httpx AsyncClient instance.
840+ """
841+ kwargs ["auth" ] = kwargs .get ("auth" ) or HttpxOCIAuth ()
842+ return httpx .AsyncClient (** kwargs )
0 commit comments