mirror of
https://github.com/kennethreitz/langchain.git
synced 2026-06-05 23:00:18 +00:00
97434a64c5
Store the environment info within the `extra` fields of the Run
17 lines
426 B
Python
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(),
|
|
}
|