1+ import inspect
2+ import json
3+ import os
4+ from pathlib import Path
5+
16from typing import Literal
27from agentex .lib .sdk .fastacp .base .base_acp_server import BaseACPServer
38from agentex .lib .sdk .fastacp .impl .agentic_base_acp import AgenticBaseACP
813 BaseACPConfig ,
914 SyncACPConfig ,
1015)
16+ from agentex .lib .utils .logging import make_logger
1117
1218# Add new mappings between ACP types and configs here
1319# Add new mappings between ACP types and implementations here
1622 "base" : AgenticBaseACP ,
1723}
1824
25+ logger = make_logger (__name__ )
1926
2027class FastACP :
2128 """Factory for creating FastACP instances
@@ -51,6 +58,14 @@ def create_agentic_acp(config: AgenticACPConfig, **kwargs) -> BaseACPServer:
5158 else :
5259 return implementation_class .create (** kwargs )
5360
61+ @staticmethod
62+ def locate_build_info_path () -> None :
63+ """If a build-info.json file is present, set the BUILD_INFO_PATH environment variable"""
64+ acp_root = Path (inspect .stack ()[2 ].filename ).resolve ().parents [0 ]
65+ build_info_path = acp_root / "build-info.json"
66+ if build_info_path .exists ():
67+ os .environ ["BUILD_INFO_PATH" ] = str (build_info_path )
68+
5469 @staticmethod
5570 def create (
5671 acp_type : Literal ["sync" , "agentic" ], config : BaseACPConfig | None = None , ** kwargs
@@ -63,6 +78,8 @@ def create(
6378 **kwargs: Additional configuration parameters
6479 """
6580
81+ FastACP .locate_build_info_path ()
82+
6683 if acp_type == "sync" :
6784 sync_config = config if isinstance (config , SyncACPConfig ) else None
6885 return FastACP .create_sync_acp (sync_config , ** kwargs )
0 commit comments