@@ -42,6 +42,7 @@ def __init__(
42
42
output_type ,
43
43
config_path : str = None ,
44
44
config_type = None ,
45
+ auth_header : dict = None
45
46
):
46
47
""" Instantiate a Langgraph node encapsulating a remote ACP agent
47
48
@@ -65,6 +66,7 @@ def __init__(
65
66
self .outputType = output_type
66
67
self .configPath = config_path
67
68
self .configType = config_type
69
+ self .auth_header = auth_header
68
70
69
71
def get_name (self ):
70
72
return self .__name__
@@ -118,7 +120,7 @@ def invoke(self, state: Any, config: RunnableConfig) -> Any:
118
120
119
121
run_create = self ._prepare_run_create (state , config )
120
122
121
- api_client = ApiClient (configuration = self .clientConfig )
123
+ api_client = ApiClient (configuration = self .clientConfig , header_name = self . auth_header [ "name" ], header_value = self . auth_header [ "value" ]),
122
124
acp_client = ACPClient (api_client = api_client )
123
125
run : Run = acp_client .create_run (run_create )
124
126
run_output = acp_client .get_run_output (run_id = run .run_id , block_timeout = 120 )
@@ -127,7 +129,7 @@ def invoke(self, state: Any, config: RunnableConfig) -> Any:
127
129
128
130
async def ainvoke (self , state : Any , config : RunnableConfig ) -> Any :
129
131
run_create = self ._prepare_run_create (state , config )
130
- api_client = AsyncApiClient (configuration = self .clientConfig )
132
+ api_client = AsyncApiClient (configuration = self .clientConfig , header_name = self . auth_header [ "name" ], header_value = self . auth_header [ "value" ] )
131
133
acp_client = AsyncACPClient (api_client = api_client )
132
134
133
135
run : Run = await acp_client .create_run (run_create )
0 commit comments