
    _j?                         d Z ddlmZmZmZ ddlZddlZddlmZ dee	         fdZ
dee	ee	e	f         f         fdZdee	         fd	ZdS )
z
Schema Registry for Embedding Functions

This module provides a registry of all available schemas for embedding functions.
It can be used to get information about available schemas and their versions.
    )DictListSetN   )SCHEMAS_DIRreturnc                      g } t          j        t                    D ]:}|                    d          r#|dk    r|                     |dd                    ;| S )zu
    Get a list of all available schemas.

    Returns:
        A list of schema names (without .json extension)
    .jsonzbase_schema.jsonN)oslistdirr   endswithappend)schemasfilenames     p/var/www/FlaskApp/flask-venv/lib/python3.11/site-packages/chromadb/utils/embedding_functions/schemas/registry.pyget_available_schemasr      sc     GJ{++ * *W%% 	*(6H*H*HNN8CRC=)))N    c                  ~   i } t                      D ]}t          j                            t          | d          }t          |d          5 }t          j        |          }|                    dd          |                    dd          |                    dd          d| |<   d	d	d	           n# 1 swxY w Y   | S )
z
    Get information about all available schemas.

    Returns:
        A dictionary mapping schema names to information about the schema
    r
   rversionz1.0.0title description)r   r   r   N)	r   r   pathjoinr   openjsonloadget)schema_infoschema_nameschema_pathfschemas        r   get_schema_infor&      s     K,..  gll;;0E0E0EFF+s## 	qYq\\F!::i99GR00%zz-<<( (K$	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 s   AB11B5	8B5	c                  8    t          t                                S )z~
    Get a set of all embedding function names that have schemas.

    Returns:
        A set of embedding function names
    )setr    r   r   get_embedding_function_namesr*   0   s     $&&'''r   )__doc__typingr   r   r   r   r   schema_utilsr   strr   r&   r*   r)   r   r   <module>r/      s     # " " " " " " " " " 				  % % % % % %tCy    c4S>12    ((c#h ( ( ( ( ( (r   