mirror of https://github.com/hwchase17/langchain
Add Environment Info to Run (#4691)
Store the environment info within the `extra` fields of the Runpull/4732/head
parent
d3300bd799
commit
97434a64c5
@ -0,0 +1,16 @@
|
|||||||
|
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(),
|
||||||
|
}
|
Loading…
Reference in New Issue