import xpander_utils# Use with various frameworksfrom xpander_utils.integrations import langgraph_connectorgraph = langgraph_connector.create_xpander_graph("my-agent-id")
from xpander_utils.integrations import langgraph_connector# Create a graph that uses a xpander.ai agentgraph = langgraph_connector.create_xpander_graph("my-agent-id")# Set up nodes and edgesgraph.add_node("start", lambda x: x)graph.add_node("xpander_agent", langgraph_connector.call_agent)graph.add_node("process_result", lambda x: {"result": x.get("output")})# Add edgesgraph.add_edge("start", "xpander_agent")graph.add_edge("xpander_agent", "process_result")# Run the graphresult = graph.invoke({"input": "Hello, world!"})
from xpander_utils.integrations import crewai_connectorfrom crewai import Crew, Agent, Task# Create an agent that uses xpander.aixpander_agent = crewai_connector.create_xpander_agent( "my-agent-id", name="Data Analyst", goal="Analyze the provided data")# Create a tasktask = Task( description="Analyze the customer data and provide insights", agent=xpander_agent)# Create and run the crewcrew = Crew(agents=[xpander_agent], tasks=[task])result = crew.run("Here is the customer data: ...")