add version (#807)

### What problem does this PR solve?
#709 
### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
KevinHuSh
2024-05-16 16:17:48 +08:00
committed by GitHub
parent 63ca15c595
commit d6772f5dd7
3 changed files with 5 additions and 73 deletions

View File

@ -14,17 +14,15 @@
# limitations under the License.
#
import os
import dotenv
import typing
from api.utils.file_utils import get_project_base_directory
def get_versions() -> typing.Mapping[str, typing.Any]:
return dotenv.dotenv_values(
dotenv_path=os.path.join(get_project_base_directory(), "rag.env")
)
dotenv.load_dotenv(dotenv.find_dotenv())
return dotenv.dotenv_values()
def get_rag_version() -> typing.Optional[str]:
return get_versions().get("RAG")
return get_versions().get("RAGFLOW_VERSION", "dev")