
    kKj                    |    d Z ddlmZ ddlZddlmZ ddlZddlmZ ddl	m
Z
mZmZmZ ddlmZ  G d d	e      Zd	gZy)
a  FastMCPOpenAPI - backwards compatibility wrapper.

This class is deprecated. Use FastMCP with OpenAPIProvider instead:

    from fastmcp import FastMCP
    from fastmcp.server.providers.openapi import OpenAPIProvider
    import httpx

    client = httpx.AsyncClient(base_url="https://api.example.com")
    provider = OpenAPIProvider(openapi_spec=spec, client=client)
    mcp = FastMCP("My API Server", providers=[provider])
    )annotationsN)Any)FastMCPDeprecationWarning)ComponentFnOpenAPIProviderRouteMap
RouteMapFn)FastMCPc                  V     e Zd ZdZ	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZ xZS )FastMCPOpenAPIaB  FastMCP server implementation that creates components from an OpenAPI schema.

    .. deprecated::
        Use FastMCP with OpenAPIProvider instead. This class will be
        removed in a future version.

    Example (deprecated):
        ```python
        from fastmcp.server.openapi import FastMCPOpenAPI
        import httpx

        server = FastMCPOpenAPI(
            openapi_spec=spec,
            client=httpx.AsyncClient(),
        )
        ```

    New approach:
        ```python
        from fastmcp import FastMCP
        from fastmcp.server.providers.openapi import OpenAPIProvider
        import httpx

        client = httpx.AsyncClient(base_url="https://api.example.com")
        provider = OpenAPIProvider(openapi_spec=spec, client=client)
        mcp = FastMCP("API Server", providers=[provider])
        ```
    c	           	        t        j                  dt        d       t        |   dd|xs di|	 || _        || _        t        |||||||      }
| j                  |
       |
j                  | _	        |
j                  | _
        y)	aK  Initialize a FastMCP server from an OpenAPI schema.

        .. deprecated::
            Use FastMCP with OpenAPIProvider instead.

        Args:
            openapi_spec: OpenAPI schema as a dictionary
            client: Optional httpx AsyncClient for making HTTP requests.
                If not provided, a default client is created from the spec.
            name: Optional name for the server
            route_maps: Optional list of RouteMap objects defining route mappings
            route_map_fn: Optional callable for advanced route type mapping
            mcp_component_fn: Optional callable for component customization
            mcp_names: Optional dictionary mapping operationId to component names
            tags: Optional set of tags to add to all components
            **settings: Additional settings for FastMCP
        zFastMCPOpenAPI is deprecated. Use FastMCP with OpenAPIProvider instead:
    provider = OpenAPIProvider(openapi_spec=spec, client=client)
    mcp = FastMCP('name', providers=[provider])   )
stacklevelnamezOpenAPI FastMCP)openapi_specclient
route_mapsroute_map_fnmcp_component_fn	mcp_namestagsN )warningswarnr   super__init___client_mcp_component_fnr   add_provider_spec	_director)selfr   r   r   r   r   r   r   r   settingsprovider	__class__s              n/Users/ahmed/devFolder/Ultron/claude-voice/.venv/lib/python3.12/site-packages/fastmcp/server/openapi/server.pyr   zFastMCPOpenAPI.__init__=   s    : 	> &	
 	Dd7&7D8D !1 #%!%-
 	(# ^^
!++    )NNNNNNN)r   zdict[str, Any]r   zhttpx.AsyncClient | Noner   z
str | Noner   zlist[RouteMap] | Noner   zRouteMapFn | Noner   zComponentFn | Noner   zdict[str, str] | Noner   zset[str] | Noner#   r   )__name__
__module____qualname____doc__r   __classcell__)r%   s   @r&   r   r      s    @ ,0,0*./3+/ $:,$:, ):, 	:,
 *:, (:, -:, ):, :, :, :,r'   r   )r+   
__future__r   r   typingr   httpxfastmcp.exceptionsr    fastmcp.server.providers.openapir   r   r   r	   fastmcp.server.serverr
   r   __all__r   r'   r&   <module>r4      sE    #    8  *X,W X,z r'   