ElasticDash Python SDK
Installation
pip install elasticdash
Then set your ElasticDash credentials as environment variables so the SDK knows who you are.
ELASTICDASH_SECRET_KEY = "sk-lf-..."
ELASTICDASH_PUBLIC_KEY = "pk-lf-..."
ELASTICDASH_BASE_URL = "https://devserver-logger.elasticdash.com"
At the moment, the Secret Key and Public Key will be provided by ElasticDash directly.
Usage
OpenAI SDK
Swap the regular OpenAI import to Langfuse’s OpenAI drop-in. It behaves like the regular OpenAI client while also recording each call for you.
from elasticdash.openai import openai
Use the OpenAI SDK as you normally would. The wrapper captures the prompt, model and output and forwards everything to ElasticDash.
completion = openai.chat.completions.create(
name="test-chat",
model="gpt-4o",
messages=[
{"role": "system", "content": "You are a very accurate calculator. You output only the result of the calculation."},
{"role": "user", "content": "1 + 1 = "}],
metadata={"someMetadataKey": "someValue"},
)
Manual Observation
This can help you cover the LLM models that we are not currently supporting.
from elasticdash import get_client
elasticdash = get_client()
# Create a span using a context manager
with elasticdash.start_as_current_observation(as_type="span", name="process-request") as span:
# Your processing logic here
span.update(input="Llm input here")
# Create a nested generation for an LLM call
with elasticdash.start_as_current_observation(as_type="generation", name="llm-response", model="gpt-3.5-turbo") as generation:
generation.update(input="Llm input here")
# Your LLM call logic here
span.update(output="Processing complete")
generation.update(output="Generated response")
# All spans are automatically closed when exiting their context blocks
# Flush events in short-lived applications
elasticdash.flush()
Metadata
Release files for elasticdash 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| elasticdash-0.0.4.tar.gz | 223.2 kB | Without provenance | Details for elasticdash-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| elasticdash-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for elasticdash-0.0.4-py3-none-any.whl |
Total release size: 644.1 kB
Release files / elasticdash-0.0.4.tar.gz
| Download URL | elasticdash-0.0.4.tar.gz |
|---|---|
| Size | 223.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cb02955766b0cc4120866b520827ddcf134087008b265fc619d18fe6d00ab07
|
|
BLAKE2b-256 checksum How to use checksums |
a3a09a325f8a8ab1cdf9aae1a0d825f91a5e6d100858aaca7e7cc23553d43381
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.16
|
Release files / elasticdash-0.0.4-py3-none-any.whl
| Download URL | elasticdash-0.0.4-py3-none-any.whl |
|---|---|
| Size | 420.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6fc8892820d303182c63392bd446f7198feaeb79011c1a07d4e267cafcc8ff57
|
|
BLAKE2b-256 checksum How to use checksums |
6c8caf0e9ee143cd8a38770026ef7dc516e08e8b045df8151d8bfdf8b81f3b2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.16
|
Security for elasticdash 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.