# -*- coding: utf-8 -*-
from setuptools import setup

package_dir = \
{'': 'src'}

packages = \
['acceldata_aio_tracer', 'acceldata_aio_tracer.integrations']

package_data = \
{'': ['*']}

install_requires = \
['httpx', 'opik==1.11.3']

setup_kwargs = {
    'name': 'acceldata-aio-tracer',
    'version': '0.1.0.dev1',
    'description': 'Acceldata LLM observability SDK',
    'long_description': '# acceldata-aio-tracer\n\nLLM observability SDK by Acceldata, built on top of [Opik](https://github.com/comet-ml/opik). It:\n\n- Adds Acceldata `accessKey` / `secretKey` authentication to every Opik HTTP call via an httpx auth hook.\n- Re-exports the full Opik public API under the `acceldata_aio_tracer` namespace.\n- Mirrors all Opik integrations under `acceldata_aio_tracer.integrations.<framework>` so customer code never imports from `opik` directly.\n\n## Index\n\n- [Installation](#installation)\n- [Quick start](#quick-start)\n- [Configuration](#configuration)\n  - [Signature stability](#signature-stability)\n  - [Programmatic (`configure`)](#programmatic-configure)\n  - [Explicit client (`AcceldataTracer`)](#explicit-client-acceldatatracer)\n  - [Environment variables](#environment-variables)\n  - [Auto-init from env](#auto-init-from-env)\n- [Authentication](#authentication)\n- [Integrations](#integrations)\n  - [Decorator-style integrations](#decorator-style-integrations)\n  - [Callback / handler-style integrations](#callback--handler-style-integrations)\n  - [Integration reference](#integration-reference)\n- [Adding a new integration](#adding-a-new-integration)\n- [Debugging](#debugging)\n- [License](#license)\n\n## Installation\n\n```bash\npip install acceldata-aio-tracer\n```\n\nRequires Python 3.10+. A pinned `opik` version is pulled transitively — do not install `opik` separately at a different version.\n\n## Quick start\n\n```python\nimport acceldata_aio_tracer as aio\n\naio.configure(\n    url="https://acme.acceldata.local:5443/aio",\n    access_key="...",\n    secret_key="...",\n    project_name="default",\n)\n\n@aio.track\ndef summarize(text: str) -> str:\n    # call an LLM, return the summary\n    ...\n\nsummarize("hello world")  # traced and sent to Acceldata\n```\n\n`aio.track` is the standard Opik `@track` decorator re-exported under the wrapper namespace. All other top-level Opik APIs (`opik.Opik`, `opik.flush`, etc.) are also available as `aio.Opik`, `aio.flush`, and so on.\n\n## Configuration\n\nThere are two configuration entry points; pick based on usage style.\n\n### Signature stability\n\nBoth `configure()` and `AcceldataTracer()` follow the same shape — three required positional-or-keyword args followed by keyword-only options:\n\n```python\ndef configure(\n    url: str,                             # required, stable public name\n    access_key: str,                      # required, stable public name\n    secret_key: str,                      # required, stable public name\n    *,                                    # everything below is keyword-only\n    project_name: Optional[str] = None,   # may evolve across releases\n    debug: bool = False,                  # may evolve across releases\n    check_tls_certificate: bool = True,   # may evolve across releases\n) -> None: ...\n```\n\nWhat this means in practice:\n\n- **`url`, `access_key`, `secret_key` are required and will not be renamed.** Pass them positionally or by name — both forms are supported indefinitely.\n\n```python\n# Both calls are equivalent:\naio.configure("https://acme.acceldata.local:5443/aio", "ak", "sk")\naio.configure(url="https://acme.acceldata.local:5443/aio", access_key="ak", secret_key="sk")\n```\n\n- **All other options are keyword-only.** New options may be added, deprecated, or removed across releases without breaking existing call sites. Always pass them by name (`debug=True`, not `True`).\n- **No partial calls.** All three required args must be supplied on every call. To change only a kwarg later (e.g. project name), either call `configure()` again with the full triple, or set the underlying env var directly (`os.environ["OPIK_PROJECT_NAME"] = "..."`).\n\n### Programmatic (`configure`)\n\nUse this for workflows that rely on `@track` decorators or framework integrations — anything that creates the Opik client lazily.\n\n```python\nimport acceldata_aio_tracer as aio\n\naio.configure(\n    url="https://acme.acceldata.local:5443/aio",\n    access_key="...",\n    secret_key="...",\n    project_name="default",       # optional\n    debug=False,                  # optional, see Debugging\n    check_tls_certificate=True,   # set False only for self-signed dev gateways\n)\n```\n\n`configure()` sets the env vars Opik reads natively (`OPIK_URL_OVERRIDE`, `OPIK_ACCESS_KEY`, `OPIK_SECRET_KEY`, `OPIK_PROJECT_NAME`) and registers the Acceldata auth hook so every subsequent Opik client carries the auth headers.\n\n### Explicit client (`AcceldataTracer`)\n\nUse this when you want a directly-constructed client (e.g. for non-decorator usage or to hold a per-request client).\n\n```python\nfrom acceldata_aio_tracer import AcceldataTracer\n\nclient = AcceldataTracer(\n    url="https://acme.acceldata.local:5443/aio",\n    access_key="...",\n    secret_key="...",\n)\n# `client` is a fully-configured `opik.Opik` instance.\n```\n\nCalling `AcceldataTracer(...)` also registers the auth hook globally, so any other Opik client created later in the process (including those used by integrations) inherits the auth.\n\n### Environment variables\n\n| Variable | Purpose |\n|---|---|\n| `ACCELDATA_AIO_URL` | Acceldata gateway URL, e.g. `https://acme.acceldata.local:5443/aio` |\n| `ACCELDATA_AIO_ACCESS_KEY` | Acceldata access key |\n| `ACCELDATA_AIO_SECRET_KEY` | Acceldata secret key |\n| `ACCELDATA_AIO_PROJECT_NAME` | Default project name for traces |\n| `ACCELDATA_AIO_CHECK_TLS_CERTIFICATE` | `false` disables TLS verify on outbound Opik calls (dev / self-signed gateways only) |\n| `ACCELDATA_AIO_DEBUG` | `true` / `1` / `yes` / `on` (case-insensitive) installs the HTTP debug interceptor at import time. Off by default. Wrapper-specific — no upstream fallback. |\n\nThe wrapper also respects the upstream Opik names (`OPIK_URL_OVERRIDE`, `OPIK_ACCESS_KEY`, `OPIK_SECRET_KEY`, `OPIK_PROJECT_NAME`, `OPIK_CHECK_TLS_CERTIFICATE`) as a fallback. If both an `ACCELDATA_AIO_*` and its `OPIK_*` counterpart are set, the `OPIK_*` value wins — useful as an escape hatch for migration, power-user overrides, or ops scripts that already reference Opik names.\n\nAt import time the wrapper prints a one-line summary to `stderr` listing which logical setting was picked from which env var name (names only, never values):\n\n```\n[acceldata_aio_tracer] env init: URL<-ACCELDATA_AIO_URL, ACCESS_KEY<-ACCELDATA_AIO_ACCESS_KEY, SECRET_KEY<-ACCELDATA_AIO_SECRET_KEY\n```\n\n### Auto-init from env\n\nIf both `ACCELDATA_AIO_ACCESS_KEY` and `ACCELDATA_AIO_SECRET_KEY` (or their `OPIK_*` fallbacks) are present when the package is imported, the Acceldata auth hook is registered automatically — no `configure()` call needed.\n\n```bash\nexport ACCELDATA_AIO_URL="https://acme.acceldata.local:5443/aio"\nexport ACCELDATA_AIO_ACCESS_KEY="..."\nexport ACCELDATA_AIO_SECRET_KEY="..."\n```\n\n```python\nimport acceldata_aio_tracer  # auth hook registered, env-init summary printed to stderr\n```\n\n## Authentication\n\nAcceldata uses `accessKey` and `secretKey` HTTP headers instead of bearer tokens. The auth hook attaches these headers to every Opik HTTP request and removes any pre-existing `Authorization` header to avoid conflicts:\n\n```\naccessKey: <ACCESS_KEY>\nsecretKey: <SECRET_KEY>\n```\n\nThe hook is installed once per process and applies to every `httpx.Client` Opik creates afterward.\n\n## Integrations\n\nEvery Opik integration is mirrored under `acceldata_aio_tracer.integrations.<framework>`. Two usage styles exist depending on the framework — pick based on the [reference table](#integration-reference) below.\n\n### Decorator-style integrations\n\nWrap an SDK client with `track_<framework>(...)`. Tracing is automatic from that point on.\n\n```python\nfrom openai import OpenAI\nfrom acceldata_aio_tracer.integrations.openai import track_openai\n\nclient = track_openai(OpenAI())\nclient.chat.completions.create(\n    model="gpt-4o-mini",\n    messages=[{"role": "user", "content": "hi"}],\n)  # automatically traced\n```\n\nThe same shape applies to Anthropic, AWS Bedrock, Google GenAI, AISuite, LiteLLM, CrewAI, Guardrails AI, and Harbor — substitute the framework name in both the import and the function call.\n\n### Callback / handler-style integrations\n\nInstantiate a tracer / callback / connector and pass it to the framework\'s callback machinery.\n\n```python\n# LangChain / LangGraph\nfrom acceldata_aio_tracer.integrations.langchain import LangChainTracer\n\ntracer = LangChainTracer()\nchain.invoke({"input": "..."}, config={"callbacks": [tracer]})\n```\n\n```python\n# Google ADK\nfrom acceldata_aio_tracer.integrations.adk import ADKTracer, track_adk_agent_recursive\n\ntracer = ADKTracer()\ntrack_adk_agent_recursive(my_agent, tracer)\n```\n\n```python\n# DSPy\nimport dspy\nfrom acceldata_aio_tracer.integrations.dspy import DSPyCallback\n\ndspy.configure(callbacks=[DSPyCallback()])\n```\n\n```python\n# Haystack\nfrom acceldata_aio_tracer.integrations.haystack import HaystackConnector\n\npipeline.add_component("opik", HaystackConnector())\n```\n\n```python\n# LlamaIndex\nfrom llama_index.core.callbacks import CallbackManager\nfrom acceldata_aio_tracer.integrations.llama_index import LlamaIndexCallbackHandler\n\nmanager = CallbackManager([LlamaIndexCallbackHandler()])\n```\n\n### Integration reference\n\n15 Opik integrations exist; 14 are mirrored here. Sagemaker is intentionally not exposed (upstream is an internal AWS auth helper with no public API).\n\n| Integration | Import path | Exported names | Style | Renamed from upstream |\n|---|---|---|---|---|\n| LangChain / LangGraph | `acceldata_aio_tracer.integrations.langchain` | `LangChainTracer`, `track_langgraph`, `extract_current_langgraph_span_data`, `LANGGRAPH_INTERRUPT_OUTPUT_KEY`, `LANGGRAPH_RESUME_INPUT_KEY`, `LANGGRAPH_INTERRUPT_METADATA_KEY`, `LANGGRAPH_PARENT_COMMAND_METADATA_KEY` | Callback | `OpikTracer` -> `LangChainTracer` |\n| Google ADK | `acceldata_aio_tracer.integrations.adk` | `ADKTracer`, `track_adk_agent_recursive`, `build_mermaid_graph_definition` | Callback | `OpikTracer` -> `ADKTracer` |\n| DSPy | `acceldata_aio_tracer.integrations.dspy` | `DSPyCallback` | Callback | `OpikCallback` -> `DSPyCallback` |\n| Haystack | `acceldata_aio_tracer.integrations.haystack` | `HaystackConnector` | Component | `OpikConnector` -> `HaystackConnector` |\n| LlamaIndex | `acceldata_aio_tracer.integrations.llama_index` | `LlamaIndexCallbackHandler` | Callback | (already framework-named) |\n| OpenAI | `acceldata_aio_tracer.integrations.openai` | `track_openai` | Decorator | (no rename) |\n| Anthropic | `acceldata_aio_tracer.integrations.anthropic` | `track_anthropic` | Decorator | (no rename) |\n| AWS Bedrock | `acceldata_aio_tracer.integrations.bedrock` | `track_bedrock` | Decorator | (no rename) |\n| Google GenAI | `acceldata_aio_tracer.integrations.genai` | `track_genai` | Decorator | (no rename) |\n| AISuite | `acceldata_aio_tracer.integrations.aisuite` | `track_aisuite` | Decorator | (no rename) |\n| LiteLLM | `acceldata_aio_tracer.integrations.litellm` | `track_completion` | Decorator | (no rename) |\n| CrewAI | `acceldata_aio_tracer.integrations.crewai` | `track_crewai` | Decorator | (no rename) |\n| Guardrails AI | `acceldata_aio_tracer.integrations.guardrails` | `track_guardrails` | Decorator | (no rename) |\n| Harbor | `acceldata_aio_tracer.integrations.harbor` | `track_harbor`, `reset_harbor_tracking` | Decorator | (no rename) |\n\nFor per-integration usage details (model versions, async patterns, edge cases, advanced config), refer to the [Opik documentation](https://www.comet.com/docs/opik/) — wrapper imports are drop-in equivalents.\n\n## Adding a new integration\n\nWhen upstream Opik (`opik.integrations.<name>`) ships a new integration, mirror it here:\n\n1. Inspect the upstream `__init__.py` for the public exports.\n2. Create `src/acceldata_aio_tracer/integrations/<name>.py`:\n   - **Decorator-style** (`track_<name>` function): `from opik.integrations.<name> import track_<name>` + `__all__ = ("track_<name>",)`.\n   - **Class-style with Opik prefix** (`OpikTracer`, `OpikCallback`, `OpikConnector`): rename to a framework-named class. E.g. `from opik.integrations.<name> import OpikTracer as <Framework>Tracer`.\n   - **Class-style with framework prefix** (already framework-named): pass-through re-export.\n3. Add a row to the [Integration reference](#integration-reference) table above.\n4. Smoke-test: `python -c "from acceldata_aio_tracer.integrations.<name> import *"`.\n\nThe wrapper does not auto-mirror — every new upstream integration needs an explicit file.\n\n## Debugging\n\nTo trace every Opik HTTP call (including a copy-paste `curl` reproducer for any 4xx/5xx response), enable debug mode:\n\n```python\naio.configure(url=..., access_key=..., secret_key=..., debug=True)\n# or\nclient = AcceldataTracer(url=..., access_key=..., secret_key=..., debug=True)\n```\n\nOn a failed request, the request body is dumped to `/tmp/acceldata-aio-tracer-last-failed-request.bin` and a replay-ready `curl` command is printed to the `acceldata_aio_tracer.http_trace` logger.\n\n## License\n\nApache-2.0. This SDK is a thin wrapper around [Opik](https://github.com/comet-ml/opik), which is also Apache-2.0 licensed.',
    'author': 'Acceldata',
    'author_email': 'None',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'None',
    'package_dir': package_dir,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.10,<4.0',
}


setup(**setup_kwargs)
