Skip to content

Commit e87161f

Browse files
authored
fix: AGP agentic apps update usage of agp_bindings (#111)
* fix: AGP agentic apps update usage of agp_bindings Signed-off-by: Peter Balogh <p.balogh.sa@gmail.com> * fix: clean import Signed-off-by: Peter Balogh <p.balogh.sa@gmail.com> --------- Signed-off-by: Peter Balogh <p.balogh.sa@gmail.com>
1 parent 92da255 commit e87161f

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

integrations/agntcy-agp/agentic-apps/autogen_agent/autogen_agent.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import argparse
88
import agp_bindings
9-
from agp_bindings import GatewayConfig
109

1110

1211
async def run_agent(message, address, iterations):
@@ -23,13 +22,9 @@ async def run_agent(message, address, iterations):
2322
# create new gateway object
2423
gateway = await agp_bindings.Gateway.new(local_organization, local_namespace, local_agent)
2524

26-
# Configure gateway
27-
config = GatewayConfig(endpoint=address, insecure=True)
28-
gateway.configure(config)
29-
3025
# Connect to remote gateway server
3126
print(f"connecting to: {address}")
32-
_ = await gateway.connect()
27+
_ = await gateway.connect({"endpoint": address, "tls": {"insecure": True}})
3328

3429
# Get the local agent instance from env
3530
instance = "autogen_instance"
@@ -40,7 +35,9 @@ async def run_agent(message, address, iterations):
4035
await gateway.set_route(remote_organization, remote_namespace, remote_agent)
4136

4237
# create a session
43-
session = await gateway.create_ff_session(agp_bindings.PyFireAndForgetConfiguration())
38+
session = await gateway.create_session(
39+
agp_bindings.PySessionConfiguration.RequestResponse()
40+
)
4441

4542
for i in range(0, iterations):
4643
try:

integrations/agntcy-agp/agentic-apps/langchain_agent/langchain_agent.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import argparse
1111
import agp_bindings
12-
from agp_bindings import GatewayConfig
1312

1413

1514
async def run_agent(message, address, iterations):
@@ -26,13 +25,9 @@ async def run_agent(message, address, iterations):
2625
# create new gateway object
2726
gateway = await agp_bindings.Gateway.new(local_organization, local_namespace, local_agent)
2827

29-
# Configure gateway
30-
config = GatewayConfig(endpoint=address, insecure=True)
31-
gateway.configure(config)
32-
3328
# Connect to remote gateway server
3429
print(f"connecting to: {address}")
35-
_ = await gateway.connect()
30+
_ = await gateway.connect({"endpoint": address, "tls": {"insecure": True}})
3631

3732
# Get the local agent instance from env
3833
instance = "langchain_instance"
@@ -43,7 +38,9 @@ async def run_agent(message, address, iterations):
4338
await gateway.set_route(remote_organization, remote_namespace, remote_agent)
4439

4540
# create a session
46-
session = await gateway.create_ff_session(agp_bindings.PyFireAndForgetConfiguration())
41+
session = await gateway.create_session(
42+
agp_bindings.PySessionConfiguration.FireAndForget()
43+
)
4744

4845
for i in range(0, iterations):
4946
try:

0 commit comments

Comments
 (0)