noveum-trace


Namenoveum-trace JSON
Version 0.3.7 PyPI version JSON
download
home_pageNone
SummaryCloud-first, decorator-based tracing SDK for LLM applications and multi-agent systems
upload_time2025-08-28 17:21:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (which shall not include the header fields of an "Apache-style" license). "Derivative Works" shall mean any work, whether in Source or Object form, that is based upon (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and derivative works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to use, reproduce, modify, display, perform, sublicense, and distribute the Work and its Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, trademark, patent, attribution and other notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright notice to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, LICENSOR PROVIDES THE WORK (AND EACH CONTRIBUTOR PROVIDES ITS CONTRIBUTIONS) ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 7. Limitation of Liability. IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, UNLESS REQUIRED BY APPLICABLE LAW (SUCH AS DELIBERATE AND GROSSLY NEGLIGENT ACTS) OR AGREED TO IN WRITING, SHALL ANY CONTRIBUTOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING AS A RESULT OF THIS LICENSE OR OUT OF THE USE OR INABILITY TO USE THE WORK (INCLUDING BUT NOT LIMITED TO DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES), EVEN IF SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 8. Accepting Warranty or Support. You may choose to offer, and to charge a fee for, warranty, support, indemnity or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or support. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2025 Noveum Team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords ai anthropic langchain llm monitoring multi-agent observability openai tracing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Noveum Trace SDK

[![CI](https://github.com/Noveum/noveum-trace/actions/workflows/ci.yml/badge.svg)](https://github.com/Noveum/noveum-trace/actions/workflows/ci.yml)
[![Release](https://github.com/Noveum/noveum-trace/actions/workflows/release.yml/badge.svg)](https://github.com/Noveum/noveum-trace/actions/workflows/release.yml)
[![codecov](https://codecov.io/gh/Noveum/noveum-trace/branch/main/graph/badge.svg)](https://codecov.io/gh/Noveum/noveum-trace)
[![PyPI version](https://badge.fury.io/py/noveum-trace.svg)](https://badge.fury.io/py/noveum-trace)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

**Simple, decorator-based tracing SDK for LLM applications and multi-agent systems.**

Noveum Trace provides an easy way to add observability to your LLM applications. With simple decorators, you can trace function calls, LLM interactions, agent workflows, and multi-agent coordination patterns.

## โœจ Key Features

- **๐ŸŽฏ Decorator-First API** - Add tracing with a single `@trace` decorator
- **๐Ÿค– Multi-Agent Support** - Built for multi-agent systems and workflows
- **โ˜๏ธ Cloud Integration** - Send traces to Noveum platform or custom endpoints
- **๐Ÿ”Œ Framework Agnostic** - Works with any Python LLM framework
- **๐Ÿš€ Zero Configuration** - Works out of the box with sensible defaults
- **๐Ÿ“Š Comprehensive Tracing** - Capture function calls, LLM interactions, and agent workflows
- **๐Ÿ”„ Flexible Approaches** - Decorators, and context managers

## ๐Ÿš€ Quick Start

### Installation

```bash
pip install noveum-trace
```

### Basic Usage

```python
import noveum_trace

# Initialize the SDK
noveum_trace.init(
    api_key="your-api-key",
    project="my-llm-app"
)

# Trace any function
@noveum_trace.trace
def process_document(document_id: str) -> dict:
    # Your function logic here
    return {"status": "processed", "id": document_id}

# Trace LLM calls with automatic metadata capture
@noveum_trace.trace_llm
def call_openai(prompt: str) -> str:
    import openai
    client = openai.OpenAI()
    response = client.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": prompt}]
    )
    return response.choices[0].message.content

# Trace agent workflows
@noveum_trace.trace_agent(agent_id="researcher")
def research_task(query: str) -> dict:
    # Agent logic here
    return {"findings": "...", "confidence": 0.95}
```

### Multi-Agent Example

```python
import noveum_trace

noveum_trace.init(
    api_key="your-api-key",
    project="multi-agent-system"
)

@noveum_trace.trace_agent(agent_id="orchestrator")
def orchestrate_workflow(task: str) -> dict:
    # Coordinate multiple agents
    research_result = research_agent(task)
    analysis_result = analysis_agent(research_result)
    return synthesis_agent(research_result, analysis_result)

@noveum_trace.trace_agent(agent_id="researcher")
def research_agent(task: str) -> dict:
    # Research implementation
    return {"data": "...", "sources": [...]}

@noveum_trace.trace_agent(agent_id="analyst")
def analysis_agent(data: dict) -> dict:
    # Analysis implementation
    return {"insights": "...", "metrics": {...}}
```

## ๐Ÿ—๏ธ Architecture

```
noveum_trace/
โ”œโ”€โ”€ core/           # Core tracing primitives (Trace, Span, Context)
โ”œโ”€โ”€ decorators/     # Decorator-based API (@trace, @trace_llm, etc.)
โ”œโ”€โ”€ context_managers/ # Context managers for inline tracing
โ”œโ”€โ”€ transport/      # HTTP transport and batch processing
โ”œโ”€โ”€ agents/         # Multi-agent system support
โ”œโ”€โ”€ streaming/      # Streaming LLM support
โ”œโ”€โ”€ threads/        # Conversation thread management
โ””โ”€โ”€ utils/          # Utilities (exceptions, serialization, etc.)
```

## ๐Ÿ”ง Configuration

### Environment Variables

```bash
export NOVEUM_API_KEY="your-api-key"
export NOVEUM_PROJECT="your-project-name"
export NOVEUM_ENVIRONMENT="production"
```

### Programmatic Configuration

```python
import noveum_trace

# Basic configuration
noveum_trace.init(
    api_key="your-api-key",
    project="my-project",
    environment="production"
)

# Advanced configuration with transport settings
noveum_trace.init(
    api_key="your-api-key",
    project="my-project",
    environment="production",
    transport_config={
        "batch_size": 50,
        "batch_timeout": 2.0,
        "retry_attempts": 3,
        "timeout": 30
    },
    tracing_config={
        "sample_rate": 1.0,
        "capture_errors": True,
        "capture_stack_traces": False
    }
)
```

## ๐ŸŽฏ Available Decorators

### @trace - General Purpose Tracing

```python
@noveum_trace.trace
def my_function(arg1: str, arg2: int) -> dict:
    return {"result": f"{arg1}_{arg2}"}

# With options
@noveum_trace.trace(capture_performance=True, capture_args=True)
def expensive_function(data: list) -> dict:
    # Function implementation
    return {"processed": len(data)}
```

### @trace_llm - LLM Call Tracing

```python
@noveum_trace.trace_llm
def call_llm(prompt: str) -> str:
    # LLM call implementation
    return response

# With provider specification
@noveum_trace.trace_llm(provider="openai", capture_tokens=True)
def call_openai(prompt: str) -> str:
    # OpenAI specific implementation
    return response
```

### @trace_agent - Agent Workflow Tracing

```python
# Required: agent_id parameter
@noveum_trace.trace_agent(agent_id="my_agent")
def agent_function(task: str) -> dict:
    # Agent implementation
    return result

# With full configuration
@noveum_trace.trace_agent(
    agent_id="researcher",
    role="information_gatherer",
    capabilities=["web_search", "document_analysis"]
)
def research_agent(query: str) -> dict:
    # Research implementation
    return {"findings": "...", "sources": [...]}
```

### @trace_tool - Tool Usage Tracing

```python
@noveum_trace.trace_tool
def search_web(query: str) -> list:
    # Tool implementation
    return results

# With tool specification
@noveum_trace.trace_tool(tool_name="web_search", tool_type="api")
def search_api(query: str) -> list:
    # API search implementation
    return search_results
```

### @trace_retrieval - Retrieval Operation Tracing

```python
@noveum_trace.trace_retrieval
def retrieve_documents(query: str) -> list:
    # Retrieval implementation
    return documents

# With retrieval configuration
@noveum_trace.trace_retrieval(
    retrieval_type="vector_search",
    index_name="documents",
    capture_scores=True
)
def vector_search(query: str, top_k: int = 5) -> list:
    # Vector search implementation
    return results
```

## ๐Ÿ”„ Context Managers - Inline Tracing

For scenarios where you need granular control or can't modify function signatures:

```python
import noveum_trace

def process_user_query(user_input: str) -> str:
    # Pre-processing (not traced)
    cleaned_input = user_input.strip().lower()

    # Trace just the LLM call
    with noveum_trace.trace_llm_call(model="gpt-4", provider="openai") as span:
        response = openai_client.chat.completions.create(
            model="gpt-4",
            messages=[{"role": "user", "content": cleaned_input}]
        )

        # Add custom attributes
        span.set_attributes({
            "llm.input_tokens": response.usage.prompt_tokens,
            "llm.output_tokens": response.usage.completion_tokens
        })

    # Post-processing (not traced)
    return format_response(response.choices[0].message.content)

def multi_step_workflow(task: str) -> dict:
    results = {}

    # Trace agent operation
    with noveum_trace.trace_agent_operation(
        agent_type="planner",
        operation="task_planning"
    ) as span:
        plan = create_task_plan(task)
        span.set_attribute("plan.steps", len(plan.steps))
        results["plan"] = plan

    # Trace tool usage
    with noveum_trace.trace_operation("database_query") as span:
        data = query_database(plan.query)
        span.set_attributes({
            "query.results_count": len(data),
            "query.table": "tasks"
        })
        results["data"] = data

    return results
```

## ๐Ÿงต Thread Management

Track conversation threads and multi-turn interactions:

```python
from noveum_trace import ThreadContext

# Create and manage conversation threads
with ThreadContext(name="customer_support") as thread:
    thread.add_message("user", "Hello, I need help with my order")

    # LLM response within thread context
    with noveum_trace.trace_llm_call(model="gpt-4") as span:
        response = llm_client.chat.completions.create(...)
        thread.add_message("assistant", response.choices[0].message.content)
```

## ๐ŸŒŠ Streaming Support

Trace streaming LLM responses with real-time metrics:

```python
from noveum_trace import trace_streaming

def stream_openai_response(prompt: str):
    with trace_streaming(model="gpt-4", provider="openai") as manager:
        stream = openai_client.chat.completions.create(
            model="gpt-4",
            messages=[{"role": "user", "content": prompt}],
            stream=True
        )

        for chunk in stream:
            if chunk.choices[0].delta.content:
                content = chunk.choices[0].delta.content
                manager.add_token(content)
                yield content

        # Streaming metrics are automatically captured
```

## ๐Ÿงช Testing

Run the test suite:

```bash
# Install development dependencies
pip install -e ".[dev]"

# Run all tests
pytest

# Run with coverage
pytest --cov=noveum_trace --cov-report=html

# Run specific test categories
pytest -m llm
pytest -m agent
```

## ๐Ÿค Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Setup

```bash
# Clone the repository
git clone https://github.com/Noveum/noveum-trace.git
cd noveum-trace

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Run examples
python docs/examples/basic_usage.py
```

## ๐Ÿ“– Examples

Check out the [examples](docs/examples/) directory for complete working examples:

- [Basic Usage](docs/examples/basic_usage.py) - Simple function tracing
- [Agent Workflow](docs/examples/agent_workflow_example.py) - Multi-agent coordination
- [Flexible Tracing](docs/examples/flexible_tracing_example.py) - Context managers and inline tracing
- [Streaming Example](docs/examples/streaming_example.py) - Real-time streaming support
- [Multimodal Examples](docs/examples/multimodal_examples.py) - Image, audio, and video tracing

## ๐Ÿš€ Advanced Usage

### Manual Trace Creation

```python
# Create traces manually for full control
client = noveum_trace.get_client()

with client.create_contextual_trace("custom_workflow") as trace:
    with client.create_contextual_span("step_1") as span1:
        # Step 1 implementation
        span1.set_attributes({"step": 1, "status": "completed"})

    with client.create_contextual_span("step_2") as span2:
        # Step 2 implementation
        span2.set_attributes({"step": 2, "status": "completed"})
```

## ๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ™‹โ€โ™€๏ธ Support

- [GitHub Issues](https://github.com/Noveum/noveum-trace/issues)
- [Documentation](https://github.com/Noveum/noveum-trace/tree/main/docs)
- [Examples](https://github.com/Noveum/noveum-trace/tree/main/examples)

---

**Built by the Noveum Team**

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "noveum-trace",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Noveum Team <engineering@noveum.ai>",
    "keywords": "ai, anthropic, langchain, llm, monitoring, multi-agent, observability, openai, tracing",
    "author": null,
    "author_email": "Noveum Team <engineering@noveum.ai>",
    "download_url": "https://files.pythonhosted.org/packages/93/86/ef625bdc837070a77e62b34c4c005d209b503814195fecc865b0e79e2a88/noveum_trace-0.3.7.tar.gz",
    "platform": null,
    "description": "# Noveum Trace SDK\n\n[![CI](https://github.com/Noveum/noveum-trace/actions/workflows/ci.yml/badge.svg)](https://github.com/Noveum/noveum-trace/actions/workflows/ci.yml)\n[![Release](https://github.com/Noveum/noveum-trace/actions/workflows/release.yml/badge.svg)](https://github.com/Noveum/noveum-trace/actions/workflows/release.yml)\n[![codecov](https://codecov.io/gh/Noveum/noveum-trace/branch/main/graph/badge.svg)](https://codecov.io/gh/Noveum/noveum-trace)\n[![PyPI version](https://badge.fury.io/py/noveum-trace.svg)](https://badge.fury.io/py/noveum-trace)\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n**Simple, decorator-based tracing SDK for LLM applications and multi-agent systems.**\n\nNoveum Trace provides an easy way to add observability to your LLM applications. With simple decorators, you can trace function calls, LLM interactions, agent workflows, and multi-agent coordination patterns.\n\n## \u2728 Key Features\n\n- **\ud83c\udfaf Decorator-First API** - Add tracing with a single `@trace` decorator\n- **\ud83e\udd16 Multi-Agent Support** - Built for multi-agent systems and workflows\n- **\u2601\ufe0f Cloud Integration** - Send traces to Noveum platform or custom endpoints\n- **\ud83d\udd0c Framework Agnostic** - Works with any Python LLM framework\n- **\ud83d\ude80 Zero Configuration** - Works out of the box with sensible defaults\n- **\ud83d\udcca Comprehensive Tracing** - Capture function calls, LLM interactions, and agent workflows\n- **\ud83d\udd04 Flexible Approaches** - Decorators, and context managers\n\n## \ud83d\ude80 Quick Start\n\n### Installation\n\n```bash\npip install noveum-trace\n```\n\n### Basic Usage\n\n```python\nimport noveum_trace\n\n# Initialize the SDK\nnoveum_trace.init(\n    api_key=\"your-api-key\",\n    project=\"my-llm-app\"\n)\n\n# Trace any function\n@noveum_trace.trace\ndef process_document(document_id: str) -> dict:\n    # Your function logic here\n    return {\"status\": \"processed\", \"id\": document_id}\n\n# Trace LLM calls with automatic metadata capture\n@noveum_trace.trace_llm\ndef call_openai(prompt: str) -> str:\n    import openai\n    client = openai.OpenAI()\n    response = client.chat.completions.create(\n        model=\"gpt-4\",\n        messages=[{\"role\": \"user\", \"content\": prompt}]\n    )\n    return response.choices[0].message.content\n\n# Trace agent workflows\n@noveum_trace.trace_agent(agent_id=\"researcher\")\ndef research_task(query: str) -> dict:\n    # Agent logic here\n    return {\"findings\": \"...\", \"confidence\": 0.95}\n```\n\n### Multi-Agent Example\n\n```python\nimport noveum_trace\n\nnoveum_trace.init(\n    api_key=\"your-api-key\",\n    project=\"multi-agent-system\"\n)\n\n@noveum_trace.trace_agent(agent_id=\"orchestrator\")\ndef orchestrate_workflow(task: str) -> dict:\n    # Coordinate multiple agents\n    research_result = research_agent(task)\n    analysis_result = analysis_agent(research_result)\n    return synthesis_agent(research_result, analysis_result)\n\n@noveum_trace.trace_agent(agent_id=\"researcher\")\ndef research_agent(task: str) -> dict:\n    # Research implementation\n    return {\"data\": \"...\", \"sources\": [...]}\n\n@noveum_trace.trace_agent(agent_id=\"analyst\")\ndef analysis_agent(data: dict) -> dict:\n    # Analysis implementation\n    return {\"insights\": \"...\", \"metrics\": {...}}\n```\n\n## \ud83c\udfd7\ufe0f Architecture\n\n```\nnoveum_trace/\n\u251c\u2500\u2500 core/           # Core tracing primitives (Trace, Span, Context)\n\u251c\u2500\u2500 decorators/     # Decorator-based API (@trace, @trace_llm, etc.)\n\u251c\u2500\u2500 context_managers/ # Context managers for inline tracing\n\u251c\u2500\u2500 transport/      # HTTP transport and batch processing\n\u251c\u2500\u2500 agents/         # Multi-agent system support\n\u251c\u2500\u2500 streaming/      # Streaming LLM support\n\u251c\u2500\u2500 threads/        # Conversation thread management\n\u2514\u2500\u2500 utils/          # Utilities (exceptions, serialization, etc.)\n```\n\n## \ud83d\udd27 Configuration\n\n### Environment Variables\n\n```bash\nexport NOVEUM_API_KEY=\"your-api-key\"\nexport NOVEUM_PROJECT=\"your-project-name\"\nexport NOVEUM_ENVIRONMENT=\"production\"\n```\n\n### Programmatic Configuration\n\n```python\nimport noveum_trace\n\n# Basic configuration\nnoveum_trace.init(\n    api_key=\"your-api-key\",\n    project=\"my-project\",\n    environment=\"production\"\n)\n\n# Advanced configuration with transport settings\nnoveum_trace.init(\n    api_key=\"your-api-key\",\n    project=\"my-project\",\n    environment=\"production\",\n    transport_config={\n        \"batch_size\": 50,\n        \"batch_timeout\": 2.0,\n        \"retry_attempts\": 3,\n        \"timeout\": 30\n    },\n    tracing_config={\n        \"sample_rate\": 1.0,\n        \"capture_errors\": True,\n        \"capture_stack_traces\": False\n    }\n)\n```\n\n## \ud83c\udfaf Available Decorators\n\n### @trace - General Purpose Tracing\n\n```python\n@noveum_trace.trace\ndef my_function(arg1: str, arg2: int) -> dict:\n    return {\"result\": f\"{arg1}_{arg2}\"}\n\n# With options\n@noveum_trace.trace(capture_performance=True, capture_args=True)\ndef expensive_function(data: list) -> dict:\n    # Function implementation\n    return {\"processed\": len(data)}\n```\n\n### @trace_llm - LLM Call Tracing\n\n```python\n@noveum_trace.trace_llm\ndef call_llm(prompt: str) -> str:\n    # LLM call implementation\n    return response\n\n# With provider specification\n@noveum_trace.trace_llm(provider=\"openai\", capture_tokens=True)\ndef call_openai(prompt: str) -> str:\n    # OpenAI specific implementation\n    return response\n```\n\n### @trace_agent - Agent Workflow Tracing\n\n```python\n# Required: agent_id parameter\n@noveum_trace.trace_agent(agent_id=\"my_agent\")\ndef agent_function(task: str) -> dict:\n    # Agent implementation\n    return result\n\n# With full configuration\n@noveum_trace.trace_agent(\n    agent_id=\"researcher\",\n    role=\"information_gatherer\",\n    capabilities=[\"web_search\", \"document_analysis\"]\n)\ndef research_agent(query: str) -> dict:\n    # Research implementation\n    return {\"findings\": \"...\", \"sources\": [...]}\n```\n\n### @trace_tool - Tool Usage Tracing\n\n```python\n@noveum_trace.trace_tool\ndef search_web(query: str) -> list:\n    # Tool implementation\n    return results\n\n# With tool specification\n@noveum_trace.trace_tool(tool_name=\"web_search\", tool_type=\"api\")\ndef search_api(query: str) -> list:\n    # API search implementation\n    return search_results\n```\n\n### @trace_retrieval - Retrieval Operation Tracing\n\n```python\n@noveum_trace.trace_retrieval\ndef retrieve_documents(query: str) -> list:\n    # Retrieval implementation\n    return documents\n\n# With retrieval configuration\n@noveum_trace.trace_retrieval(\n    retrieval_type=\"vector_search\",\n    index_name=\"documents\",\n    capture_scores=True\n)\ndef vector_search(query: str, top_k: int = 5) -> list:\n    # Vector search implementation\n    return results\n```\n\n## \ud83d\udd04 Context Managers - Inline Tracing\n\nFor scenarios where you need granular control or can't modify function signatures:\n\n```python\nimport noveum_trace\n\ndef process_user_query(user_input: str) -> str:\n    # Pre-processing (not traced)\n    cleaned_input = user_input.strip().lower()\n\n    # Trace just the LLM call\n    with noveum_trace.trace_llm_call(model=\"gpt-4\", provider=\"openai\") as span:\n        response = openai_client.chat.completions.create(\n            model=\"gpt-4\",\n            messages=[{\"role\": \"user\", \"content\": cleaned_input}]\n        )\n\n        # Add custom attributes\n        span.set_attributes({\n            \"llm.input_tokens\": response.usage.prompt_tokens,\n            \"llm.output_tokens\": response.usage.completion_tokens\n        })\n\n    # Post-processing (not traced)\n    return format_response(response.choices[0].message.content)\n\ndef multi_step_workflow(task: str) -> dict:\n    results = {}\n\n    # Trace agent operation\n    with noveum_trace.trace_agent_operation(\n        agent_type=\"planner\",\n        operation=\"task_planning\"\n    ) as span:\n        plan = create_task_plan(task)\n        span.set_attribute(\"plan.steps\", len(plan.steps))\n        results[\"plan\"] = plan\n\n    # Trace tool usage\n    with noveum_trace.trace_operation(\"database_query\") as span:\n        data = query_database(plan.query)\n        span.set_attributes({\n            \"query.results_count\": len(data),\n            \"query.table\": \"tasks\"\n        })\n        results[\"data\"] = data\n\n    return results\n```\n\n## \ud83e\uddf5 Thread Management\n\nTrack conversation threads and multi-turn interactions:\n\n```python\nfrom noveum_trace import ThreadContext\n\n# Create and manage conversation threads\nwith ThreadContext(name=\"customer_support\") as thread:\n    thread.add_message(\"user\", \"Hello, I need help with my order\")\n\n    # LLM response within thread context\n    with noveum_trace.trace_llm_call(model=\"gpt-4\") as span:\n        response = llm_client.chat.completions.create(...)\n        thread.add_message(\"assistant\", response.choices[0].message.content)\n```\n\n## \ud83c\udf0a Streaming Support\n\nTrace streaming LLM responses with real-time metrics:\n\n```python\nfrom noveum_trace import trace_streaming\n\ndef stream_openai_response(prompt: str):\n    with trace_streaming(model=\"gpt-4\", provider=\"openai\") as manager:\n        stream = openai_client.chat.completions.create(\n            model=\"gpt-4\",\n            messages=[{\"role\": \"user\", \"content\": prompt}],\n            stream=True\n        )\n\n        for chunk in stream:\n            if chunk.choices[0].delta.content:\n                content = chunk.choices[0].delta.content\n                manager.add_token(content)\n                yield content\n\n        # Streaming metrics are automatically captured\n```\n\n## \ud83e\uddea Testing\n\nRun the test suite:\n\n```bash\n# Install development dependencies\npip install -e \".[dev]\"\n\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=noveum_trace --cov-report=html\n\n# Run specific test categories\npytest -m llm\npytest -m agent\n```\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/Noveum/noveum-trace.git\ncd noveum-trace\n\n# Install in development mode\npip install -e \".[dev]\"\n\n# Run tests\npytest\n\n# Run examples\npython docs/examples/basic_usage.py\n```\n\n## \ud83d\udcd6 Examples\n\nCheck out the [examples](docs/examples/) directory for complete working examples:\n\n- [Basic Usage](docs/examples/basic_usage.py) - Simple function tracing\n- [Agent Workflow](docs/examples/agent_workflow_example.py) - Multi-agent coordination\n- [Flexible Tracing](docs/examples/flexible_tracing_example.py) - Context managers and inline tracing\n- [Streaming Example](docs/examples/streaming_example.py) - Real-time streaming support\n- [Multimodal Examples](docs/examples/multimodal_examples.py) - Image, audio, and video tracing\n\n## \ud83d\ude80 Advanced Usage\n\n### Manual Trace Creation\n\n```python\n# Create traces manually for full control\nclient = noveum_trace.get_client()\n\nwith client.create_contextual_trace(\"custom_workflow\") as trace:\n    with client.create_contextual_span(\"step_1\") as span1:\n        # Step 1 implementation\n        span1.set_attributes({\"step\": 1, \"status\": \"completed\"})\n\n    with client.create_contextual_span(\"step_2\") as span2:\n        # Step 2 implementation\n        span2.set_attributes({\"step\": 2, \"status\": \"completed\"})\n```\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\ude4b\u200d\u2640\ufe0f Support\n\n- [GitHub Issues](https://github.com/Noveum/noveum-trace/issues)\n- [Documentation](https://github.com/Noveum/noveum-trace/tree/main/docs)\n- [Examples](https://github.com/Noveum/noveum-trace/tree/main/examples)\n\n---\n\n**Built by the Noveum Team**\n",
    "bugtrack_url": null,
    "license": "Apache License\n                                   Version 2.0, January 2004\n                                http://www.apache.org/licenses/\n        \n           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n        \n           1. Definitions.\n        \n              \"License\" shall mean the terms and conditions for use, reproduction,\n              and distribution as defined by Sections 1 through 9 of this document.\n        \n              \"Licensor\" shall mean the copyright owner or entity granting the License.\n        \n              \"Legal Entity\" shall mean the union of the acting entity and all\n              other entities that control, are controlled by, or are under common\n              control with that entity. For the purposes of this definition,\n              \"control\" means (i) the power, direct or indirect, to cause the\n              direction or management of such entity, whether by contract or\n              otherwise, or (ii) ownership of fifty percent (50%) or more of the\n              outstanding shares, or (iii) beneficial ownership of such entity.\n        \n              \"You\" (or \"Your\") shall mean an individual or Legal Entity\n              exercising permissions granted by this License.\n        \n              \"Source\" form shall mean the preferred form for making modifications,\n              including but not limited to software source code, documentation\n              source, and configuration files.\n        \n              \"Object\" form shall mean any form resulting from mechanical\n              transformation or translation of a Source form, including but\n              not limited to compiled object code, generated documentation,\n              and conversions to other media types.\n        \n              \"Work\" shall mean the work of authorship, whether in Source or\n              Object form, made available under the License, as indicated by a\n              copyright notice that is included in or attached to the work\n              (which shall not include the header fields of an \"Apache-style\"\n              license).\n        \n              \"Derivative Works\" shall mean any work, whether in Source or Object\n              form, that is based upon (or derived from) the Work and for which the\n              editorial revisions, annotations, elaborations, or other modifications\n              represent, as a whole, an original work of authorship. For the purposes\n              of this License, Derivative Works shall not include works that remain\n              separable from, or merely link (or bind by name) to the interfaces of,\n              the Work and derivative works thereof.\n        \n              \"Contribution\" shall mean any work of authorship, including\n              the original version of the Work and any modifications or additions\n              to that Work or Derivative Works thereof, that is intentionally\n              submitted to Licensor for inclusion in the Work by the copyright owner\n              or by an individual or Legal Entity authorized to submit on behalf of\n              the copyright owner. For the purposes of this definition, \"submitted\"\n              means any form of electronic, verbal, or written communication sent\n              to the Licensor or its representatives, including but not limited to\n              communication on electronic mailing lists, source code control\n              systems, and issue tracking systems that are managed by, or on behalf\n              of, the Licensor for the purpose of discussing and improving the Work,\n              but excluding communication that is conspicuously marked or otherwise\n              designated in writing by the copyright owner as \"Not a Contribution.\"\n        \n              \"Contributor\" shall mean Licensor and any individual or Legal Entity\n              on behalf of whom a Contribution has been received by Licensor and\n              subsequently incorporated within the Work.\n        \n           2. Grant of Copyright License. Subject to the terms and conditions of\n              this License, each Contributor hereby grants to You a perpetual,\n              worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n              copyright license to use, reproduce, modify, display, perform,\n              sublicense, and distribute the Work and its Derivative Works in\n              Source or Object form.\n        \n           3. Grant of Patent License. Subject to the terms and conditions of\n              this License, each Contributor hereby grants to You a perpetual,\n              worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n              (except as stated in this section) patent license to make, have made,\n              use, offer to sell, sell, import, and otherwise transfer the Work,\n              where such license applies only to those patent claims licensable\n              by such Contributor that are necessarily infringed by their\n              Contribution(s) alone or by combination of their Contribution(s)\n              with the Work to which such Contribution(s) was submitted. If You\n              institute patent litigation against any entity (including a\n              cross-claim or counterclaim in a lawsuit) alleging that the Work\n              or a Contribution incorporated within the Work constitutes direct\n              or contributory patent infringement, then any patent licenses\n              granted to You under this License for that Work shall terminate\n              as of the date such litigation is filed.\n        \n           4. Redistribution. You may reproduce and distribute copies of the\n              Work or Derivative Works thereof in any medium, with or without\n              modifications, and in Source or Object form, provided that You\n              meet the following conditions:\n        \n              (a) You must give any other recipients of the Work or\n                  Derivative Works a copy of this License; and\n        \n              (b) You must cause any modified files to carry prominent notices\n                  stating that You changed the files; and\n        \n              (c) You must retain, in the Source form of any Derivative Works\n                  that You distribute, all copyright, trademark, patent,\n                  attribution and other notices from the Source form of the Work,\n                  excluding those notices that do not pertain to any part of\n                  the Derivative Works; and\n        \n              (d) If the Work includes a \"NOTICE\" file as part of its\n                  distribution, then any Derivative Works that You distribute must\n                  include a readable copy of the attribution notices contained\n                  within such NOTICE file, excluding those notices that do not\n                  pertain to any part of the Derivative Works, in at least one\n                  of the following places: within a NOTICE file distributed\n                  as part of the Derivative Works; within the Source form or\n                  documentation, if provided along with the Derivative Works; or,\n                  within a display generated by the Derivative Works, if and\n                  wherever such third-party notices normally appear. The contents\n                  of the NOTICE file are for informational purposes only and\n                  do not modify the License. You may add Your own attribution\n                  notices within Derivative Works that You distribute, alongside\n                  or as an addendum to the NOTICE text from the Work, provided\n                  that such additional attribution notices cannot be construed\n                  as modifying the License.\n        \n              You may add Your own copyright notice to Your modifications and\n              may provide additional or different license terms and conditions\n              for use, reproduction, or distribution of Your modifications, or\n              for any such Derivative Works as a whole, provided Your use,\n              reproduction, and distribution of the Work otherwise complies with\n              the conditions stated in this License.\n        \n           5. Submission of Contributions. Unless You explicitly state otherwise,\n              any Contribution intentionally submitted for inclusion in the Work\n              by You to the Licensor shall be under the terms and conditions of\n              this License, without any additional terms or conditions.\n              Notwithstanding the above, nothing herein shall supersede or modify\n              the terms of any separate license agreement you may have executed\n              with Licensor regarding such Contributions.\n        \n           6. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW OR\n              AGREED TO IN WRITING, LICENSOR PROVIDES THE WORK (AND EACH\n              CONTRIBUTOR PROVIDES ITS CONTRIBUTIONS) ON AN \"AS IS\" BASIS,\n              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR\n              IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS\n              OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A\n              PARTICULAR PURPOSE. You are solely responsible for determining the\n              appropriateness of using or redistributing the Work and assume any\n              risks associated with Your exercise of permissions under this License.\n        \n           7. Limitation of Liability. IN NO EVENT AND UNDER NO LEGAL THEORY,\n              WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE,\n              UNLESS REQUIRED BY APPLICABLE LAW (SUCH AS DELIBERATE AND GROSSLY\n              NEGLIGENT ACTS) OR AGREED TO IN WRITING, SHALL ANY CONTRIBUTOR BE\n              LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL,\n              INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING AS A\n              RESULT OF THIS LICENSE OR OUT OF THE USE OR INABILITY TO USE THE\n              WORK (INCLUDING BUT NOT LIMITED TO DAMAGES FOR LOSS OF GOODWILL,\n              WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL\n              OTHER COMMERCIAL DAMAGES OR LOSSES), EVEN IF SUCH CONTRIBUTOR\n              HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n        \n           8. Accepting Warranty or Support. You may choose to offer, and to\n              charge a fee for, warranty, support, indemnity or other liability\n              obligations and/or rights consistent with this License. However, in\n              accepting such obligations, You may act only on Your own behalf and\n              on Your sole responsibility, not on behalf of any other Contributor,\n              and only if You agree to indemnify, defend, and hold each Contributor\n              harmless for any liability incurred by, or claims asserted against,\n              such Contributor by reason of your accepting any such warranty or\n              support.\n        \n           END OF TERMS AND CONDITIONS\n        \n           APPENDIX: How to apply the Apache License to your work.\n        \n              To apply the Apache License to your work, attach the following\n              boilerplate notice, with the fields enclosed by brackets \"[]\"\n              replaced with your own identifying information. (Don't include\n              the brackets!)  The text should be enclosed in the appropriate\n              comment syntax for the file format. We also recommend that a\n              file or class name and description of purpose be included on the\n              same \"printed page\" as the copyright notice for easier\n              identification within third-party archives.\n        \n           Copyright 2025 Noveum Team\n        \n           Licensed under the Apache License, Version 2.0 (the \"License\");\n           you may not use this file except in compliance with the License.\n           You may obtain a copy of the License at\n        \n               http://www.apache.org/licenses/LICENSE-2.0\n        \n           Unless required by applicable law or agreed to in writing, software\n           distributed under the License is distributed on an \"AS IS\" BASIS,\n           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n           See the License for the specific language governing permissions and\n           limitations under the License.",
    "summary": "Cloud-first, decorator-based tracing SDK for LLM applications and multi-agent systems",
    "version": "0.3.7",
    "project_urls": {
        "Bug Tracker": "https://github.com/Noveum/noveum-trace/issues",
        "Changelog": "https://github.com/Noveum/noveum-trace/blob/main/CHANGELOG.md",
        "Documentation": "https://noveum-trace.readthedocs.io",
        "Homepage": "https://github.com/Noveum/noveum-trace",
        "Repository": "https://github.com/Noveum/noveum-trace"
    },
    "split_keywords": [
        "ai",
        " anthropic",
        " langchain",
        " llm",
        " monitoring",
        " multi-agent",
        " observability",
        " openai",
        " tracing"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4c085329207be8eedcbd9812c38c90fccdabf0ee2a0a6fe29633d92cd6730b71",
                "md5": "1ce4f56179246e160dd7e8726d7fada4",
                "sha256": "6149b3580a262b3c62d187a6d365d6922ee7b3fdc6f73facf1c1905bcbe01cbe"
            },
            "downloads": -1,
            "filename": "noveum_trace-0.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1ce4f56179246e160dd7e8726d7fada4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 85043,
            "upload_time": "2025-08-28T17:21:18",
            "upload_time_iso_8601": "2025-08-28T17:21:18.929847Z",
            "url": "https://files.pythonhosted.org/packages/4c/08/5329207be8eedcbd9812c38c90fccdabf0ee2a0a6fe29633d92cd6730b71/noveum_trace-0.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9386ef625bdc837070a77e62b34c4c005d209b503814195fecc865b0e79e2a88",
                "md5": "5856ac804c03005591534761e7fe81cd",
                "sha256": "69721903d427e240fcbd028f34c83aaf2769650cc1f108e8bed650a465222f61"
            },
            "downloads": -1,
            "filename": "noveum_trace-0.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "5856ac804c03005591534761e7fe81cd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 168757,
            "upload_time": "2025-08-28T17:21:20",
            "upload_time_iso_8601": "2025-08-28T17:21:20.548098Z",
            "url": "https://files.pythonhosted.org/packages/93/86/ef625bdc837070a77e62b34c4c005d209b503814195fecc865b0e79e2a88/noveum_trace-0.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-28 17:21:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Noveum",
    "github_project": "noveum-trace",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "noveum-trace"
}
        
Elapsed time: 0.88535s