Skip to main content

Python library for the Noodler API

Project description

Noodler Python SDK

Example

from noodler import setup, instrument_openai
from openai import OpenAI

# Configure OpenTelemetry tracing
setup(
    base_url="http://localhost:8000",
    api_key="noodler-api-key",
)

# Create and instrument OpenAI client
client = OpenAI()
wrapped_client = instrument_openai(client)

# Use the instrumented client - all API calls will be automatically traced
# Non-streaming
response = wrapped_client.chat.completions.create(
    model="gpt-4.1",
    messages=[
        {"role": "user", "content": "hi there!"}
    ],
)

# Streaming (also supported)
stream = wrapped_client.chat.completions.create(
    model="gpt-4.1",
    messages=[
        {"role": "user", "content": "hi there!"}
    ],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content, end="")

Features

  • ✅ Automatic tracing of chat.completions.create() calls
  • ✅ Support for both streaming and non-streaming responses
  • ✅ Full OpenTelemetry GenAI semantic convention compliance
  • ✅ Token usage tracking
  • ✅ Error tracking and span status reporting

Limitations

Currently, only the chat.completions.create() endpoint is instrumented. Other OpenAI endpoints (embeddings, audio, fine-tuning, etc.) are not automatically traced. Calls to these endpoints will work normally but will not generate traces.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

noodler_sdk-0.1.0.tar.gz (55.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

noodler_sdk-0.1.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file noodler_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: noodler_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 55.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for noodler_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 16b3b892b4e1d65b855fecd334cb78dd685e5214a6d8cfcbcaec14b46cbcd763
MD5 ae542b0e55e5dc5f374f92ed3f664fc6
BLAKE2b-256 fbb509a7c621d414c7128bedd1d32034884cd4d265d263568612a0ef4a4665dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for noodler_sdk-0.1.0.tar.gz:

Publisher: publish.yml on noodler-dev/noodler-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file noodler_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: noodler_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for noodler_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cfd77e25e0fcc2924cd6d6ae425359f2742658803ac5510b99bc9ef930e955dc
MD5 9db373133f67af0a2649745ae486d024
BLAKE2b-256 d7ea426f13fc6d9395974175b6fca7a8e62855076a421df3928dc9881ce2f8c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for noodler_sdk-0.1.0-py3-none-any.whl:

Publisher: publish.yml on noodler-dev/noodler-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page