langtrace-python-sdk 2.1.11__tar.gz → 2.1.12__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-2.1.11 → langtrace_python_sdk-2.1.12}/PKG-INFO +1 -1
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +8 -3
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/langtrace.py +13 -4
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/prompt_registry.py +1 -4
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/with_root_span.py +3 -3
- langtrace_python_sdk-2.1.12/src/langtrace_python_sdk/version.py +1 -0
- langtrace_python_sdk-2.1.11/src/langtrace_python_sdk/version.py +0 -1
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/.gitignore +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/LICENSE +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/README.md +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/pyproject.toml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/anthropic_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/anthropic_example/completion.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/chroma_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/chroma_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/chat.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/chat_stream.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/embed.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/rerank.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/tools.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/fastapi_example/basic_route.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/hiveagent_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/langchain_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/langchain_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/langchain_example/groq_example.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/langchain_example/langgraph_example.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/langchain_example/tool.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/llamaindex_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/llamaindex_example/agent.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/llamaindex_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/llamaindex_example/data/abramov.txt +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/chat_completion.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/embeddings_create.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/function_calling.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/images_generate.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/tool_calling.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/perplexity_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/pinecone_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/pinecone_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/qdrant_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/qdrant_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/weaviate_example/query_text.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/types/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/llm.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/misc.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/sdk_version_checker.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/types.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/run_example.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/__init__.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/anthropic/conftest.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/anthropic/test_anthropic.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/chroma/conftest.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/chroma/test_chroma.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/conftest.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/test_cohere_chat.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/test_cohere_embed.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/test_cohere_rerank.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/conftest.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/langchain/conftest.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/langchain/test_langchain.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/conftest.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/test_chat_completion.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/test_embeddings.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/test_image_generation.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/pinecone/conftest.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/pinecone/test_pinecone.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/qdrant/conftest.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/qdrant/test_qdrant.py +0 -0
- {langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/utils.py +0 -0
|
@@ -48,14 +48,19 @@ class LangTraceExporter(SpanExporter):
|
|
|
48
48
|
"""
|
|
49
49
|
|
|
50
50
|
api_key: str
|
|
51
|
+
api_host: str
|
|
51
52
|
|
|
52
53
|
def __init__(
|
|
53
54
|
self,
|
|
55
|
+
api_host,
|
|
54
56
|
api_key: str = None,
|
|
55
|
-
api_host: typing.Optional[str] = None,
|
|
56
57
|
) -> None:
|
|
57
58
|
self.api_key = api_key or os.environ.get("LANGTRACE_API_KEY")
|
|
58
|
-
self.api_host
|
|
59
|
+
self.api_host = (
|
|
60
|
+
f"{LANGTRACE_REMOTE_URL}/api/trace"
|
|
61
|
+
if api_host == LANGTRACE_REMOTE_URL
|
|
62
|
+
else api_host
|
|
63
|
+
)
|
|
59
64
|
|
|
60
65
|
def export(self, spans: typing.Sequence[ReadableSpan]) -> SpanExportResult:
|
|
61
66
|
"""
|
|
@@ -90,7 +95,7 @@ class LangTraceExporter(SpanExporter):
|
|
|
90
95
|
# Send data to remote URL
|
|
91
96
|
try:
|
|
92
97
|
response = requests.post(
|
|
93
|
-
url=f"{self.api_host}
|
|
98
|
+
url=f"{self.api_host}",
|
|
94
99
|
data=json.dumps(data),
|
|
95
100
|
headers={"Content-Type": "application/json", "x-api-key": self.api_key},
|
|
96
101
|
timeout=20,
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/langtrace.py
RENAMED
|
@@ -16,6 +16,9 @@ limitations under the License.
|
|
|
16
16
|
|
|
17
17
|
from typing import Optional
|
|
18
18
|
|
|
19
|
+
from langtrace_python_sdk.constants.exporter.langtrace_exporter import (
|
|
20
|
+
LANGTRACE_REMOTE_URL,
|
|
21
|
+
)
|
|
19
22
|
from langtrace_python_sdk.types import DisableInstrumentations, InstrumentationType
|
|
20
23
|
from opentelemetry import trace
|
|
21
24
|
from opentelemetry.sdk.trace import TracerProvider
|
|
@@ -46,6 +49,7 @@ from langtrace_python_sdk.instrumentation import (
|
|
|
46
49
|
from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor
|
|
47
50
|
from colorama import Fore
|
|
48
51
|
from langtrace_python_sdk.utils import check_if_sdk_is_outdated
|
|
52
|
+
import os
|
|
49
53
|
|
|
50
54
|
|
|
51
55
|
def init(
|
|
@@ -53,15 +57,19 @@ def init(
|
|
|
53
57
|
batch: bool = True,
|
|
54
58
|
write_spans_to_console: bool = False,
|
|
55
59
|
custom_remote_exporter=None,
|
|
56
|
-
api_host: Optional[str] =
|
|
60
|
+
api_host: Optional[str] = LANGTRACE_REMOTE_URL,
|
|
57
61
|
disable_instrumentations: Optional[DisableInstrumentations] = None,
|
|
58
62
|
):
|
|
63
|
+
|
|
64
|
+
host = (
|
|
65
|
+
os.environ.get("LANGTRACE_API_HOST", None) or api_host or LANGTRACE_REMOTE_URL
|
|
66
|
+
)
|
|
59
67
|
check_if_sdk_is_outdated()
|
|
60
68
|
print(Fore.GREEN + "Initializing Langtrace SDK.." + Fore.RESET)
|
|
61
69
|
provider = TracerProvider(resource=Resource.create({"service.name": sys.argv[0]}))
|
|
62
70
|
|
|
63
71
|
remote_write_exporter = (
|
|
64
|
-
LangTraceExporter(api_key=api_key, api_host=
|
|
72
|
+
LangTraceExporter(api_key=api_key, api_host=host)
|
|
65
73
|
if custom_remote_exporter is None
|
|
66
74
|
else custom_remote_exporter
|
|
67
75
|
)
|
|
@@ -70,6 +78,7 @@ def init(
|
|
|
70
78
|
simple_processor_remote = SimpleSpanProcessor(remote_write_exporter)
|
|
71
79
|
simple_processor_console = SimpleSpanProcessor(console_exporter)
|
|
72
80
|
|
|
81
|
+
os.environ["LANGTRACE_API_HOST"] = host.replace("/api/trace", "")
|
|
73
82
|
# Initialize tracer
|
|
74
83
|
trace.set_tracer_provider(provider)
|
|
75
84
|
all_instrumentations = {
|
|
@@ -101,8 +110,8 @@ def init(
|
|
|
101
110
|
else:
|
|
102
111
|
provider.add_span_processor(simple_processor_remote)
|
|
103
112
|
|
|
104
|
-
elif
|
|
105
|
-
print(Fore.BLUE + f"Exporting spans to custom host: {
|
|
113
|
+
elif host != LANGTRACE_REMOTE_URL:
|
|
114
|
+
print(Fore.BLUE + f"Exporting spans to custom host: {host}.." + Fore.RESET)
|
|
106
115
|
if batch:
|
|
107
116
|
provider.add_span_processor(batch_processor_remote)
|
|
108
117
|
else:
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import os
|
|
2
|
-
from langtrace_python_sdk.constants.exporter.langtrace_exporter import (
|
|
3
|
-
LANGTRACE_REMOTE_URL,
|
|
4
|
-
)
|
|
5
2
|
import requests
|
|
6
3
|
from urllib.parse import urlencode
|
|
7
4
|
from typing import Optional, TypedDict, Dict, List
|
|
@@ -59,7 +56,7 @@ def get_prompt_from_registry(
|
|
|
59
56
|
print(query_params)
|
|
60
57
|
# Make the GET request to the API
|
|
61
58
|
response = requests.get(
|
|
62
|
-
f"{
|
|
59
|
+
f"{os.environ['LANGTRACE_API_HOST']}/api/promptset?{query_string}",
|
|
63
60
|
headers=headers,
|
|
64
61
|
timeout=None,
|
|
65
62
|
)
|
|
@@ -118,9 +118,7 @@ class SendUserFeedback:
|
|
|
118
118
|
_langtrace_api_key: str
|
|
119
119
|
|
|
120
120
|
def __init__(self):
|
|
121
|
-
self._langtrace_host = os.environ
|
|
122
|
-
"LANGTRACE_API_HOST", LANGTRACE_REMOTE_URL
|
|
123
|
-
)
|
|
121
|
+
self._langtrace_host = os.environ["LANGTRACE_API_HOST"]
|
|
124
122
|
self._langtrace_api_key = os.environ.get("LANGTRACE_API_KEY", None)
|
|
125
123
|
|
|
126
124
|
def evaluate(self, data: EvaluationAPIData) -> None:
|
|
@@ -137,6 +135,7 @@ class SendUserFeedback:
|
|
|
137
135
|
headers = {"x-api-key": self._langtrace_api_key}
|
|
138
136
|
if evaluation is not None:
|
|
139
137
|
# Make a PUT request to update the evaluation
|
|
138
|
+
print(Fore.BLUE + "Updating Feedback.." + Fore.RESET)
|
|
140
139
|
response = requests.put(
|
|
141
140
|
f"{self._langtrace_host}/api/evaluation",
|
|
142
141
|
json=data,
|
|
@@ -147,6 +146,7 @@ class SendUserFeedback:
|
|
|
147
146
|
response.raise_for_status()
|
|
148
147
|
|
|
149
148
|
else:
|
|
149
|
+
print(Fore.BLUE + "Sending User Feedback.." + Fore.RESET)
|
|
150
150
|
# Make a POST request to create a new evaluation
|
|
151
151
|
response = requests.post(
|
|
152
152
|
f"{self._langtrace_host}/api/evaluation",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.12"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.1.11"
|
|
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-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/chroma_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/chroma_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/chat.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/embed.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/rerank.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/cohere_example/tools.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/hiveagent_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/langchain_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/langchain_example/tool.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/llamaindex_example/agent.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/llamaindex_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/openai_example/__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
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/perplexity_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/pinecone_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/qdrant_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/examples/qdrant_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/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
|
|
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-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/llm.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/misc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/langtrace_python_sdk/utils/types.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/anthropic/test_anthropic.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
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/test_cohere_chat.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/test_cohere_embed.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/cohere/test_cohere_rerank.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/langchain/test_langchain.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/test_chat_completion.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/openai/test_embeddings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.11 → langtrace_python_sdk-2.1.12}/src/tests/pinecone/test_pinecone.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|