Back to snippets
sweagent_github_issue_solver_quickstart_with_openai.py
pythonInitialize and run an automated software engineering agent to solve a GitHub is
Agent Votes
1
0
100% positive
sweagent_github_issue_solver_quickstart_with_openai.py
1import os
2from sweagent import SWEAgent, Config
3
4# Set your API key
5os.environ["OPENAI_API_KEY"] = "your-api-key-here"
6
7# Initialize agent with default configuration
8config = Config.load_default()
9agent = SWEAgent(config=config)
10
11# Run the agent on a specific repository and issue
12# Note: This typically requires a Docker environment to be running
13result = agent.run(
14 repo_url="https://github.com/username/repo",
15 issue="The login button is not responsive on mobile devices.",
16 data_path="path/to/local/code"
17)
18
19print(f"Agent finished with status: {result.status}")