langtrace-python-sdk 1.2.21__tar.gz → 1.2.23__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/PKG-INFO +1 -1
- langtrace_python_sdk-1.2.23/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +1 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +6 -7
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/langtrace.py +3 -3
- langtrace_python_sdk-1.2.23/src/langtrace_python_sdk/version.py +1 -0
- langtrace_python_sdk-1.2.21/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -1
- langtrace_python_sdk-1.2.21/src/langtrace_python_sdk/version.py +0 -1
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/.gitignore +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/LICENSE +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/README.md +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/pyproject.toml +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/anthropic_example/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/anthropic_example/completion.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/chroma_example/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/chroma_example/basic.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/langchain_example/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/langchain_example/basic.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/langchain_example/tool.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/llamaindex_example/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/llamaindex_example/basic.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/llamaindex_example/data/abramov.txt +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/openai/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/openai/chat_completion.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/openai/embeddings_create.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/openai/function_calling.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/openai/images_generate.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/pinecone_example/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/pinecone_example/basic.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/constants/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/utils/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/utils/llm.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/utils/with_root_span.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/run_example.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/__init__.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/anthropic/test_anthropic.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/chroma/test_chroma.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/langchain/test_langchain.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/langchain/test_langchain_community.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/langchain/test_langchain_core.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/openai/test_chat_completion.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/openai/test_image_generation.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/pinecone/test_pinecone.py +0 -0
- {langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
LANGTRACE_REMOTE_URL = "https://langtrace.ai"
|
|
@@ -2,13 +2,12 @@ import json
|
|
|
2
2
|
import os
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
-
from langtrace_python_sdk.constants.exporter.langtrace_exporter import (
|
|
6
|
-
LANGTRACE_REMOTE_URL,
|
|
7
|
-
)
|
|
8
5
|
import requests
|
|
9
6
|
from opentelemetry.sdk.trace.export import ReadableSpan, SpanExporter, SpanExportResult
|
|
10
7
|
from opentelemetry.trace.span import format_trace_id
|
|
11
8
|
|
|
9
|
+
from langtrace_python_sdk.constants.exporter.langtrace_exporter import LANGTRACE_REMOTE_URL
|
|
10
|
+
|
|
12
11
|
|
|
13
12
|
class LangTraceExporter(SpanExporter):
|
|
14
13
|
"""
|
|
@@ -49,9 +48,10 @@ class LangTraceExporter(SpanExporter):
|
|
|
49
48
|
api_key: str
|
|
50
49
|
write_to_remote_url: bool
|
|
51
50
|
|
|
52
|
-
def __init__(self, api_key: str = None, write_to_remote_url: bool = False) -> None:
|
|
53
|
-
self.api_key = api_key
|
|
51
|
+
def __init__(self, api_key: str = None, write_to_remote_url: bool = False, api_host: typing.Optional[str] = None) -> None:
|
|
52
|
+
self.api_key = api_key or os.environ.get("LANGTRACE_API_KEY")
|
|
54
53
|
self.write_to_remote_url = write_to_remote_url
|
|
54
|
+
self.api_host: str = api_host or LANGTRACE_REMOTE_URL
|
|
55
55
|
|
|
56
56
|
if self.write_to_remote_url and not self.api_key:
|
|
57
57
|
raise ValueError("No API key provided")
|
|
@@ -66,7 +66,6 @@ class LangTraceExporter(SpanExporter):
|
|
|
66
66
|
Returns:
|
|
67
67
|
The result of the export SUCCESS or FAILURE
|
|
68
68
|
"""
|
|
69
|
-
|
|
70
69
|
data = [
|
|
71
70
|
{
|
|
72
71
|
"traceId": format_trace_id(span.get_span_context().trace_id),
|
|
@@ -86,7 +85,7 @@ class LangTraceExporter(SpanExporter):
|
|
|
86
85
|
# Send data to remote URL
|
|
87
86
|
try:
|
|
88
87
|
requests.post(
|
|
89
|
-
url=
|
|
88
|
+
url=f"{self.api_host}/api/trace",
|
|
90
89
|
data=json.dumps(data),
|
|
91
90
|
headers={"Content-Type": "application/json", "x-api-key": self.api_key},
|
|
92
91
|
)
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/langtrace.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
from typing import Optional
|
|
2
2
|
from opentelemetry import trace
|
|
3
3
|
from opentelemetry.sdk.trace import TracerProvider
|
|
4
4
|
from opentelemetry.sdk.trace.export import (
|
|
@@ -40,12 +40,12 @@ def init(
|
|
|
40
40
|
write_to_langtrace_cloud: bool = True,
|
|
41
41
|
debug_log_to_console: bool = False,
|
|
42
42
|
custom_remote_exporter=None,
|
|
43
|
+
api_host: Optional[str] = None,
|
|
43
44
|
):
|
|
44
|
-
|
|
45
45
|
provider = TracerProvider()
|
|
46
46
|
|
|
47
47
|
remote_write_exporter = (
|
|
48
|
-
LangTraceExporter(api_key, write_to_langtrace_cloud)
|
|
48
|
+
LangTraceExporter(api_key, write_to_langtrace_cloud, api_host=api_host)
|
|
49
49
|
if custom_remote_exporter is None
|
|
50
50
|
else custom_remote_exporter
|
|
51
51
|
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.23"
|
langtrace_python_sdk-1.2.21/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
LANGTRACE_REMOTE_URL = "https://langtrace.ai/api/trace"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.2.21"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/chroma_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/chroma_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/langchain_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/langchain_example/tool.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/llamaindex_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/openai/chat_completion.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/openai/embeddings_create.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/openai/function_calling.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/openai/images_generate.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/examples/pinecone_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/langtrace_python_sdk/utils/llm.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/anthropic/test_anthropic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/langchain/test_langchain.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/openai/test_chat_completion.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-1.2.21 → langtrace_python_sdk-1.2.23}/src/tests/pinecone/test_pinecone.py
RENAMED
|
File without changes
|
|
File without changes
|