{"id":7302,"library":"indent","title":"Indent AI Pair Programmer","description":"Indent is an AI Pair Programmer offering conversational code generation, modification, and explanation. It provides a Python SDK to interact with its services, leveraging an OpenAI-compatible API structure. Currently in early development, its latest version is 0.1.61, with a rapid release cadence due to ongoing development.","status":"active","version":"0.1.61","language":"en","source_language":"en","source_url":"https://github.com/indent-inc/python-sdk","tags":["AI","code generation","pair programming","developer tools","LLM"],"install":[{"cmd":"pip install indent","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"HTTP client for making requests to the Indent API.","package":"httpx"},{"reason":"Provides the OpenAI-compatible API structure and functionality for interacting with Indent services.","package":"openai-v1"},{"reason":"Data validation and settings management, likely for API request/response models.","package":"pydantic"}],"imports":[{"note":"The primary client class is directly exposed from the top-level package, not nested.","wrong":"import indent","symbol":"IndentClient","correct":"from indent import IndentClient"}],"quickstart":{"code":"import os\nfrom indent import IndentClient\n\n# Ensure your INDENT_API_KEY is set as an environment variable\n# Example: export INDENT_API_KEY='your_api_key_here'\napi_key = os.environ.get(\"INDENT_API_KEY\", \"\")\n\nif not api_key:\n    raise ValueError(\"INDENT_API_KEY environment variable not set.\")\n\nclient = IndentClient(api_key=api_key)\n\n# Example: Generate code using the chat completions API\ntry:\n    response = client.chat.completions.create(\n        messages=[\n            {\"role\": \"user\", \"content\": \"Write a Python function to reverse a string.\"}\n        ]\n    )\n    print(\"Generated code:\\n\", response.choices[0].message.content)\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize the IndentClient with your API key and use the chat completions endpoint to generate code. It expects the API key to be set as an environment variable `INDENT_API_KEY`."},"warnings":[{"fix":"Always consult the latest GitHub README and documentation before upgrading. Pin exact versions in production environments to avoid unexpected breaks.","message":"The Indent Python SDK is explicitly stated to be 'still in early development.' This implies that breaking changes, API alterations, and functional instability should be expected across minor versions.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Refer to the Indent SDK documentation or examples for the correct method calls, especially for `client.chat.completions.create` and its parameters. Do not assume direct compatibility with pre-1.0 OpenAI code.","message":"Indent's API client (IndentClient) uses an interface highly similar to the OpenAI Python SDK v1. Users familiar with older OpenAI SDK versions (pre-1.0) or other LLM libraries might encounter unexpected method signatures or behaviors.","severity":"gotcha","affected_versions":"All current versions"},{"fix":"Ensure `INDENT_API_KEY` is set as an environment variable or passed directly to `IndentClient(api_key='your_key')`. Always include error handling around API calls to catch authentication or network issues.","message":"Authentication requires an `INDENT_API_KEY` which must be provided to the `IndentClient`. If this key is missing or invalid, API calls will fail, often with unhandled exceptions if not properly caught.","severity":"gotcha","affected_versions":"All current versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Set the `INDENT_API_KEY` environment variable (e.g., `export INDENT_API_KEY='your_key'`) or pass your API key directly: `client = IndentClient(api_key='your_key')`.","cause":"The IndentClient was initialized without an API key, and the quickstart code explicitly checks for this and raises an error.","error":"ValueError: INDENT_API_KEY environment variable not set."},{"fix":"Use `client.chat.completions.create(...)` as per the OpenAI SDK v1 and Indent's compatible API structure.","cause":"Attempting to call `.completions` directly on the `IndentClient` object instead of using the chat sub-object, a common pattern from older OpenAI SDKs.","error":"AttributeError: 'IndentClient' object has no attribute 'completions'"}]}