Metadata-Version: 2.4
Name: drishti-ai-sdk
Version: 0.1.1
Summary: India's AI agent observability SDK — INR-native, 2 lines of code
Project-URL: Homepage, https://drishti.dev
Project-URL: Documentation, https://docs.drishti.dev
Project-URL: Repository, https://github.com/Harsh-0602/Drishti
Project-URL: Bug Tracker, https://github.com/Harsh-0602/Drishti/issues
License: MIT License
        
        Copyright (c) 2024 Drishti AI
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: agents,ai,anthropic,india,langchain,llm,monitoring,observability,openai,tracing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# drishti-ai-sdk

> **India's AI Agent Observability SDK** — See inside your AI agent. 2 lines of code. INR-native. Zero config.

[![PyPI](https://img.shields.io/pypi/v/drishti-ai-sdk)](https://pypi.org/project/drishti-ai-sdk/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

---

## Installation

```bash
pip install drishti-ai-sdk
```

## Quick Start

```python
from drishti import Drishti

drishti = Drishti(api_key="dk_live_...")

with drishti.trace("handle_user_query", input=user_query) as trace:
    result = agent.run(user_query)
    trace.set_output(result)
# Done! Trace appears in your dashboard at drishti.dev
```

## Step-by-Step Tracing

```python
with drishti.trace("rag_pipeline", input=question) as trace:
    
    with trace.step("memory_lookup", "memory") as step:
        context = vector_db.search(question, top_k=5)
        step.set_output({"chunks": len(context)})
    
    with trace.step("llm_call", "llm") as step:
        response = openai.chat.completions.create(
            model="gpt-4o-mini",
            messages=[{"role": "user", "content": question}]
        )
        step.record_llm(
            "gpt-4o-mini",
            tokens_input=response.usage.prompt_tokens,
            tokens_output=response.usage.completion_tokens,
        )
    
    trace.set_output(response.choices[0].message.content)
```

## Decorator Pattern

```python
@drishti.watch
def run_agent(query: str) -> str:
    return agent.run(query)

# Auto-traced on every call
result = run_agent("What is the weather in Mumbai?")
```

## INR Cost Tracking

Every trace automatically shows cost in ₹ — no manual calculation needed.

Supported models:
- **OpenAI**: GPT-4o, GPT-4o-mini, O1, O3-mini, and more
- **Anthropic**: Claude Opus 4, Claude Sonnet 4, Claude Haiku 4
- **Google**: Gemini 2.0 Flash, Gemini 2.5 Pro
- **DeepSeek**: DeepSeek V3, R1
- **Meta**: Llama 3.3, 3.1 series
- **Mistral**: Mistral Large, Small, Mixtral

## Environment Variables

```env
DRISHTI_API_KEY=dk_live_your_key_here
DRISHTI_ENDPOINT=https://drishti-backend.3fks.onrender.com  # optional
```

## Graceful Failure

If Drishti's server is down, **your agent keeps working**. All sends are async in a background thread and never block your code.

## Dashboard

Get your API key at [drishti.dev](https://drishti.dev)

---

Built with ❤️ for Indian developers.
