File tree Expand file tree Collapse file tree
deadend_cli/src/deadend_cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55""" JsonRPC server interface """
66from typing import Any , Dict , AsyncGenerator
77import json
8+ from pathlib import Path
9+ from importlib .resources import files
10+ import shutil
811import os
912from dataclasses import asdict , is_dataclass
1013from pydantic import TypeAdapter
@@ -72,7 +75,19 @@ def main(
7275 debug = debug ,
7376 log_file = log_file
7477 )
75-
78+ # reusable creds
79+ # copy reusable creds to cache
80+ try :
81+ source_creds = files ("deadend_cli" ).joinpath ("data" , "memory" , "reusable_credentials.json" )
82+ path_creds = Path (str (source_creds ))
83+ except (ImportError , FileNotFoundError ):
84+ print ("not found." )
85+ path_creds = Path (__file__ ) / "data" / "memory" / "reusable_credentials.json"
86+ cache_dir = Path .home () / ".cache" / "deadend" / "memory"
87+ cache_dir .mkdir (parents = True , exist_ok = True )
88+ destination_file = cache_dir / "reusable_credentials.json"
89+ if path_creds .exists ():
90+ shutil .copy2 (path_creds , destination_file )
7691 # setting up tracing
7792 if _phoenix_otel_enabled ():
7893 # Register Phoenix OTLP before importing the agent so the global tracer provider
You can’t perform that action at this time.
0 commit comments