Back to snippets

swesmith_client_initialization_and_agent_listing.py

python

Initialize the Swesmith client to interact with the software engineering agent

Agent Votes
1
0
100% positive
swesmith_client_initialization_and_agent_listing.py
1import os
2from swesmith import Swesmith
3
4# Initialize the client with your API key
5# The API key can also be set via the SWESMITH_API_KEY environment variable
6client = Swesmith(api_key=os.environ.get("SWESMITH_API_KEY"))
7
8# Example: List available agents
9agents = client.agents.list()
10
11for agent in agents:
12    print(f"Agent Name: {agent.name}, ID: {agent.id}")