gpt_graph.utils.resolve_rel_path

gpt_graph.utils.resolve_rel_path(path: str) str[source]

Resolve a relative path to an absolute path.

If the input is an absolute path, return it unchanged. If it’s a relative path, prepend it with the GPT_GRAPH_FOLDER environment variable. If GPT_GRAPH_FOLDER is not set, attempt to load it from a .env file.

Args:

path (str): The input path to resolve.

Returns:

str: The resolved absolute path.