Files
langchain/langchain/env.py
T
Zander Chase 97434a64c5 Add Environment Info to Run (#4691)
Store the environment info within the `extra` fields of the Run
2023-05-15 15:38:49 +00:00

17 lines
426 B
Python

import platform
from functools import lru_cache
@lru_cache(maxsize=1)
def get_runtime_environment() -> dict:
"""Get information about the environment."""
# Lazy import to avoid circular imports
from langchain import __version__
return {
"library_version": __version__,
"platform": platform.platform(),
"runtime": "python",
"runtime_version": platform.python_version(),
}