{"id":31953236,"url":"https://github.com/asyncfuncai/jules-agent-sdk-python","last_synced_at":"2025-10-14T13:42:32.749Z","repository":{"id":317952414,"uuid":"1069490883","full_name":"AsyncFuncAI/jules-agent-sdk-python","owner":"AsyncFuncAI","description":"Jules API Agent SDK for Python","archived":false,"fork":false,"pushed_at":"2025-10-04T03:44:36.000Z","size":2099,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-04T05:42:23.845Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AsyncFuncAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-04T03:19:26.000Z","updated_at":"2025-10-04T05:27:47.000Z","dependencies_parsed_at":"2025-10-04T05:42:25.172Z","dependency_job_id":"a8c53b40-20f3-4f03-a4ad-bda30b315941","html_url":"https://github.com/AsyncFuncAI/jules-agent-sdk-python","commit_stats":null,"previous_names":["asyncfuncai/jules-agent-sdk-python"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/AsyncFuncAI/jules-agent-sdk-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsyncFuncAI%2Fjules-agent-sdk-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsyncFuncAI%2Fjules-agent-sdk-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsyncFuncAI%2Fjules-agent-sdk-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsyncFuncAI%2Fjules-agent-sdk-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AsyncFuncAI","download_url":"https://codeload.github.com/AsyncFuncAI/jules-agent-sdk-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsyncFuncAI%2Fjules-agent-sdk-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018720,"owners_count":26086613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-14T13:42:30.636Z","updated_at":"2025-10-14T13:42:32.742Z","avatar_url":"https://github.com/AsyncFuncAI.png","language":"Python","readme":"# Jules Agent SDK for Python\n\n\u003e **Disclaimer**: This is an open source implementation of Jules API SDK wrapper in Python and does not have any association with Google. For the official API, please visit: https://developers.google.com/jules/api/\n\nA Python SDK for the Jules API. Simple interface for working with Jules sessions, activities, and sources.\n\n![Jules](jules.png)\n\n## Quick Start\n\n### Installation\n\n```bash\npip install jules-agent-sdk\n```\n\n### Basic Usage\n\n```python\nfrom jules_agent_sdk import JulesClient\n\n# Initialize with your API key\nclient = JulesClient(api_key=\"your-api-key\")\n\n# List sources\nsources = client.sources.list_all()\nprint(f\"Found {len(sources)} sources\")\n\n# Create a session\nsession = client.sessions.create(\n    prompt=\"Add error handling to the authentication module\",\n    source=sources[0].name,\n    starting_branch=\"main\"\n)\n\nprint(f\"Session created: {session.id}\")\nprint(f\"View at: {session.url}\")\n\nclient.close()\n```\n\n## Configuration\n\nSet your API key as an environment variable:\n\n```bash\nexport JULES_API_KEY=\"your-api-key-here\"\n```\n\nGet your API key from the [Jules dashboard](https://jules.google.com).\n\n## Features\n\n### API Coverage\n- **Sessions**: create, get, list, approve plans, send messages, wait for completion\n- **Activities**: get, list with automatic pagination\n- **Sources**: get, list with automatic pagination\n\n\n## Documentation\n\n- **[Quick Start](docs/QUICKSTART.md)** - Get started guide\n- **[Full Documentation](docs/README.md)** - Complete API reference\n- **[Development Guide](docs/DEVELOPMENT.md)** - For contributors\n\n## Usage Examples\n\n### Context Manager (Recommended)\n\n```python\nfrom jules_agent_sdk import JulesClient\n\nwith JulesClient(api_key=\"your-api-key\") as client:\n    sources = client.sources.list_all()\n\n    session = client.sessions.create(\n        prompt=\"Fix authentication bug\",\n        source=sources[0].name,\n        starting_branch=\"main\"\n    )\n\n    print(f\"Created: {session.id}\")\n```\n\n### Async/Await Support\n\n```python\nimport asyncio\nfrom jules_agent_sdk import AsyncJulesClient\n\nasync def main():\n    async with AsyncJulesClient(api_key=\"your-api-key\") as client:\n        sources = await client.sources.list_all()\n\n        session = await client.sessions.create(\n            prompt=\"Add unit tests\",\n            source=sources[0].name,\n            starting_branch=\"main\"\n        )\n\n        # Wait for completion\n        completed = await client.sessions.wait_for_completion(session.id)\n        print(f\"Done: {completed.state}\")\n\nasyncio.run(main())\n```\n\n### Error Handling\n\n```python\nfrom jules_agent_sdk import JulesClient\nfrom jules_agent_sdk.exceptions import (\n    JulesAuthenticationError,\n    JulesNotFoundError,\n    JulesValidationError,\n    JulesRateLimitError\n)\n\ntry:\n    client = JulesClient(api_key=\"your-api-key\")\n    session = client.sessions.create(\n        prompt=\"My task\",\n        source=\"sources/invalid-id\"\n    )\nexcept JulesAuthenticationError:\n    print(\"Invalid API key\")\nexcept JulesNotFoundError:\n    print(\"Source not found\")\nexcept JulesValidationError as e:\n    print(f\"Validation error: {e.message}\")\nexcept JulesRateLimitError as e:\n    retry_after = e.response.get(\"retry_after_seconds\", 60)\n    print(f\"Rate limited. Retry after {retry_after} seconds\")\nfinally:\n    client.close()\n```\n\n### Custom Configuration\n\n```python\nclient = JulesClient(\n    api_key=\"your-api-key\",\n    timeout=60,              # Request timeout in seconds (default: 30)\n    max_retries=5,           # Max retry attempts (default: 3)\n    retry_backoff_factor=2.0 # Backoff multiplier (default: 1.0)\n)\n```\n\nRetries happen automatically for:\n- Network errors (connection issues, timeouts)\n- Server errors (5xx status codes)\n\nNo retries for:\n- Client errors (4xx status codes)\n- Authentication errors\n\n## API Reference\n\n### Sessions\n\n```python\n# Create session\nsession = client.sessions.create(\n    prompt=\"Task description\",\n    source=\"sources/source-id\",\n    starting_branch=\"main\",\n    title=\"Optional title\",\n    require_plan_approval=False\n)\n\n# Get session\nsession = client.sessions.get(\"session-id\")\n\n# List sessions\nresult = client.sessions.list(page_size=10)\nsessions = result[\"sessions\"]\n\n# Approve plan\nclient.sessions.approve_plan(\"session-id\")\n\n# Send message\nclient.sessions.send_message(\"session-id\", \"Additional instructions\")\n\n# Wait for completion\ncompleted = client.sessions.wait_for_completion(\n    \"session-id\",\n    poll_interval=5,\n    timeout=600\n)\n```\n\n### Activities\n\n```python\n# Get activity\nactivity = client.activities.get(\"session-id\", \"activity-id\")\n\n# List activities (paginated)\nresult = client.activities.list(\"session-id\", page_size=20)\n\n# List all activities (auto-pagination)\nall_activities = client.activities.list_all(\"session-id\")\n```\n\n### Sources\n\n```python\n# Get source\nsource = client.sources.get(\"source-id\")\n\n# List sources (paginated)\nresult = client.sources.list(page_size=10)\n\n# List all sources (auto-pagination)\nall_sources = client.sources.list_all()\n```\n\n## Logging\n\nEnable logging to see request details:\n\n```python\nimport logging\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(\"jules_agent_sdk\")\n```\n\n## Testing\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=jules_agent_sdk\n\n# Run specific test\npytest tests/test_client.py -v\n```\n\n## Project Structure\n\n```\njules-api-python-sdk/\n├── src/jules_agent_sdk/\n│   ├── client.py              # Main client\n│   ├── async_client.py        # Async client\n│   ├── base.py                # HTTP client with retries\n│   ├── models.py              # Data models\n│   ├── sessions.py            # Sessions API\n│   ├── activities.py          # Activities API\n│   ├── sources.py             # Sources API\n│   └── exceptions.py          # Custom exceptions\n├── tests/                     # Test suite\n├── examples/                  # Usage examples\n│   ├── simple_test.py         # Quick start\n│   ├── interactive_demo.py    # Full demo\n│   ├── async_example.py       # Async usage\n│   └── plan_approval_example.py\n├── docs/                      # Documentation\n└── README.md\n```\n\n## Contributing\n\nSee [DEVELOPMENT.md](docs/DEVELOPMENT.md) for development setup and guidelines.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Support\n\n- **Documentation**: See [docs/](docs/) folder\n- **Examples**: See [examples/](examples/) folder\n- **Issues**: Open a GitHub issue\n\n## Next Steps\n\n1. Run `python examples/simple_test.py` to try it out\n2. Read [docs/QUICKSTART.md](docs/QUICKSTART.md) for more details\n3. Check [examples/](examples/) folder for more use cases\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasyncfuncai%2Fjules-agent-sdk-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasyncfuncai%2Fjules-agent-sdk-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasyncfuncai%2Fjules-agent-sdk-python/lists"}