langtrace-python-sdk 2.1.9__tar.gz → 2.1.11__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.9 → langtrace_python_sdk-2.1.11}/PKG-INFO +1 -1
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/pinecone_example/basic.py +2 -2
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/__init__.py +2 -2
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/langtrace.py +21 -23
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/utils/with_root_span.py +72 -56
- langtrace_python_sdk-2.1.11/src/langtrace_python_sdk/version.py +1 -0
- langtrace_python_sdk-2.1.9/src/langtrace_python_sdk/version.py +0 -1
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/.gitignore +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/LICENSE +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/README.md +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/pyproject.toml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/anthropic_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/anthropic_example/completion.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/chroma_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/chroma_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/chat.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/chat_stream.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/embed.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/rerank.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/tools.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/fastapi_example/basic_route.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/hiveagent_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/langchain_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/langchain_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/langchain_example/groq_example.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/langchain_example/langgraph_example.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/langchain_example/tool.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/llamaindex_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/llamaindex_example/agent.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/llamaindex_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/llamaindex_example/data/abramov.txt +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/openai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/openai_example/chat_completion.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/openai_example/embeddings_create.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/openai_example/function_calling.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/openai_example/images_generate.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/openai_example/tool_calling.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/openai_example/tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/perplexity_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/pinecone_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/qdrant_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/qdrant_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/weaviate_example/query_text.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/types/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/utils/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/utils/llm.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/utils/misc.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/utils/prompt_registry.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/utils/sdk_version_checker.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/utils/types.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/run_example.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/__init__.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/anthropic/conftest.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/anthropic/test_anthropic.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/chroma/conftest.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/chroma/test_chroma.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/cohere/conftest.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/cohere/test_cohere_chat.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/cohere/test_cohere_embed.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/cohere/test_cohere_rerank.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/conftest.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/langchain/conftest.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/langchain/test_langchain.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/conftest.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/test_chat_completion.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/test_embeddings.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/test_image_generation.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/pinecone/conftest.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/pinecone/test_pinecone.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/qdrant/conftest.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/qdrant/test_qdrant.py +0 -0
- {langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/utils.py +0 -0
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/pinecone_example/basic.py
RENAMED
|
@@ -7,7 +7,7 @@ from openai import OpenAI
|
|
|
7
7
|
from pinecone import Pinecone, ServerlessSpec
|
|
8
8
|
|
|
9
9
|
from langtrace_python_sdk import langtrace, with_langtrace_root_span
|
|
10
|
-
from langtrace_python_sdk.utils.with_root_span import
|
|
10
|
+
from langtrace_python_sdk.utils.with_root_span import SendUserFeedback
|
|
11
11
|
|
|
12
12
|
_ = load_dotenv(find_dotenv())
|
|
13
13
|
|
|
@@ -48,7 +48,7 @@ def basic(span_id=None, trace_id=None):
|
|
|
48
48
|
resp = index.query(
|
|
49
49
|
vector=embedding, top_k=1, include_values=False, namespace="test-namespace"
|
|
50
50
|
)
|
|
51
|
-
|
|
51
|
+
SendUserFeedback().evaluate(
|
|
52
52
|
{"spanId": span_id, "traceId": trace_id, "userScore": 1, "userId": "123"}
|
|
53
53
|
)
|
|
54
54
|
return [res, resp]
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/__init__.py
RENAMED
|
@@ -17,11 +17,11 @@ limitations under the License.
|
|
|
17
17
|
from langtrace_python_sdk import langtrace
|
|
18
18
|
from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
|
|
19
19
|
from langtrace_python_sdk.utils.prompt_registry import get_prompt_from_registry
|
|
20
|
-
from langtrace_python_sdk.utils.with_root_span import
|
|
20
|
+
from langtrace_python_sdk.utils.with_root_span import SendUserFeedback
|
|
21
21
|
|
|
22
22
|
__all__ = [
|
|
23
23
|
"langtrace",
|
|
24
24
|
"with_langtrace_root_span",
|
|
25
25
|
"get_prompt_from_registry",
|
|
26
|
-
"
|
|
26
|
+
"SendUserFeedback",
|
|
27
27
|
]
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/langtrace.py
RENAMED
|
@@ -70,30 +70,8 @@ def init(
|
|
|
70
70
|
simple_processor_remote = SimpleSpanProcessor(remote_write_exporter)
|
|
71
71
|
simple_processor_console = SimpleSpanProcessor(console_exporter)
|
|
72
72
|
|
|
73
|
-
if write_spans_to_console:
|
|
74
|
-
print(Fore.BLUE + "Writing spans to console" + Fore.RESET)
|
|
75
|
-
provider.add_span_processor(simple_processor_console)
|
|
76
|
-
|
|
77
|
-
elif custom_remote_exporter is not None:
|
|
78
|
-
print(Fore.BLUE + "Exporting spans to custom remote exporter.." + Fore.RESET)
|
|
79
|
-
if batch:
|
|
80
|
-
provider.add_span_processor(batch_processor_remote)
|
|
81
|
-
else:
|
|
82
|
-
provider.add_span_processor(simple_processor_remote)
|
|
83
|
-
|
|
84
|
-
elif api_host is not None:
|
|
85
|
-
print(Fore.BLUE + f"Exporting spans to custom host: {api_host}.." + Fore.RESET)
|
|
86
|
-
if batch:
|
|
87
|
-
provider.add_span_processor(batch_processor_remote)
|
|
88
|
-
else:
|
|
89
|
-
provider.add_span_processor(simple_processor_remote)
|
|
90
|
-
else:
|
|
91
|
-
print(Fore.BLUE + "Exporting spans to Langtrace cloud.." + Fore.RESET)
|
|
92
|
-
provider.add_span_processor(batch_processor_remote)
|
|
93
|
-
|
|
94
73
|
# Initialize tracer
|
|
95
74
|
trace.set_tracer_provider(provider)
|
|
96
|
-
|
|
97
75
|
all_instrumentations = {
|
|
98
76
|
"openai": OpenAIInstrumentation(),
|
|
99
77
|
"groq": GroqInstrumentation(),
|
|
@@ -112,13 +90,33 @@ def init(
|
|
|
112
90
|
}
|
|
113
91
|
|
|
114
92
|
init_instrumentations(disable_instrumentations, all_instrumentations)
|
|
93
|
+
if write_spans_to_console:
|
|
94
|
+
print(Fore.BLUE + "Writing spans to console" + Fore.RESET)
|
|
95
|
+
provider.add_span_processor(simple_processor_console)
|
|
96
|
+
|
|
97
|
+
elif custom_remote_exporter is not None:
|
|
98
|
+
print(Fore.BLUE + "Exporting spans to custom remote exporter.." + Fore.RESET)
|
|
99
|
+
if batch:
|
|
100
|
+
provider.add_span_processor(batch_processor_remote)
|
|
101
|
+
else:
|
|
102
|
+
provider.add_span_processor(simple_processor_remote)
|
|
103
|
+
|
|
104
|
+
elif api_host is not None:
|
|
105
|
+
print(Fore.BLUE + f"Exporting spans to custom host: {api_host}.." + Fore.RESET)
|
|
106
|
+
if batch:
|
|
107
|
+
provider.add_span_processor(batch_processor_remote)
|
|
108
|
+
else:
|
|
109
|
+
provider.add_span_processor(simple_processor_remote)
|
|
110
|
+
else:
|
|
111
|
+
print(Fore.BLUE + "Exporting spans to Langtrace cloud.." + Fore.RESET)
|
|
112
|
+
provider.add_span_processor(batch_processor_remote)
|
|
115
113
|
|
|
116
114
|
|
|
117
115
|
def init_instrumentations(
|
|
118
116
|
disable_instrumentations: DisableInstrumentations, all_instrumentations: dict
|
|
119
117
|
):
|
|
120
118
|
if disable_instrumentations is None:
|
|
121
|
-
for
|
|
119
|
+
for idx, (name, v) in enumerate(all_instrumentations.items()):
|
|
122
120
|
v.instrument()
|
|
123
121
|
else:
|
|
124
122
|
|
|
@@ -34,6 +34,7 @@ from langtrace_python_sdk.utils.types import (
|
|
|
34
34
|
LangTraceApiError,
|
|
35
35
|
LangTraceEvaluation,
|
|
36
36
|
)
|
|
37
|
+
from colorama import Fore
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
def with_langtrace_root_span(
|
|
@@ -112,63 +113,78 @@ def with_additional_attributes(attributes={}):
|
|
|
112
113
|
return decorator
|
|
113
114
|
|
|
114
115
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
headers = {"x-api-key": os.environ["LANGTRACE_API_KEY"]}
|
|
119
|
-
if evaluation is not None:
|
|
120
|
-
# Make a PUT request to update the evaluation
|
|
121
|
-
response = requests.put(
|
|
122
|
-
f"{LANGTRACE_REMOTE_URL}/api/evaluation",
|
|
123
|
-
json=data,
|
|
124
|
-
params={"spanId": data["spanId"]},
|
|
125
|
-
headers=headers,
|
|
126
|
-
timeout=None,
|
|
127
|
-
)
|
|
128
|
-
response.raise_for_status()
|
|
116
|
+
class SendUserFeedback:
|
|
117
|
+
_langtrace_host: str
|
|
118
|
+
_langtrace_api_key: str
|
|
129
119
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
120
|
+
def __init__(self):
|
|
121
|
+
self._langtrace_host = os.environ.get(
|
|
122
|
+
"LANGTRACE_API_HOST", LANGTRACE_REMOTE_URL
|
|
123
|
+
)
|
|
124
|
+
self._langtrace_api_key = os.environ.get("LANGTRACE_API_KEY", None)
|
|
125
|
+
|
|
126
|
+
def evaluate(self, data: EvaluationAPIData) -> None:
|
|
127
|
+
try:
|
|
128
|
+
if self._langtrace_api_key is None:
|
|
129
|
+
print(Fore.RED)
|
|
130
|
+
print(
|
|
131
|
+
f"Missing Langtrace API key, proceed to {self._langtrace_host} to create one"
|
|
132
|
+
)
|
|
133
|
+
print("Set the API key as an environment variable LANGTRACE_API_KEY")
|
|
134
|
+
print(Fore.RESET)
|
|
135
|
+
return
|
|
136
|
+
evaluation = self.get_evaluation(data["spanId"])
|
|
137
|
+
headers = {"x-api-key": self._langtrace_api_key}
|
|
138
|
+
if evaluation is not None:
|
|
139
|
+
# Make a PUT request to update the evaluation
|
|
140
|
+
response = requests.put(
|
|
141
|
+
f"{self._langtrace_host}/api/evaluation",
|
|
142
|
+
json=data,
|
|
143
|
+
params={"spanId": data["spanId"]},
|
|
144
|
+
headers=headers,
|
|
145
|
+
timeout=None,
|
|
146
|
+
)
|
|
147
|
+
response.raise_for_status()
|
|
148
|
+
|
|
149
|
+
else:
|
|
150
|
+
# Make a POST request to create a new evaluation
|
|
151
|
+
response = requests.post(
|
|
152
|
+
f"{self._langtrace_host}/api/evaluation",
|
|
153
|
+
json=data,
|
|
154
|
+
params={"spanId": data["spanId"]},
|
|
155
|
+
headers=headers,
|
|
156
|
+
timeout=None,
|
|
157
|
+
)
|
|
158
|
+
response.raise_for_status()
|
|
159
|
+
|
|
160
|
+
except requests.RequestException as err:
|
|
161
|
+
if err.response is not None:
|
|
162
|
+
message = (
|
|
163
|
+
err.response.json().get("message", "")
|
|
164
|
+
if err.response.json().get("message", "")
|
|
165
|
+
else err.response.text if err.response.text else str(err)
|
|
166
|
+
)
|
|
167
|
+
raise LangTraceApiError(message, err.response.status_code)
|
|
168
|
+
raise LangTraceApiError(str(err), 500)
|
|
169
|
+
|
|
170
|
+
def get_evaluation(self, span_id: str) -> Optional[LangTraceEvaluation]:
|
|
171
|
+
try:
|
|
172
|
+
response = requests.get(
|
|
173
|
+
f"{self._langtrace_host}/api/evaluation",
|
|
174
|
+
params={"spanId": span_id},
|
|
175
|
+
headers={"x-api-key": self._langtrace_api_key},
|
|
137
176
|
timeout=None,
|
|
138
177
|
)
|
|
178
|
+
evaluations = response.json().get("evaluations", [])
|
|
139
179
|
response.raise_for_status()
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
raise Exception(f"API error: {error_msg}") from err
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
def _get_evaluation(span_id: str) -> Optional[LangTraceEvaluation]:
|
|
155
|
-
try:
|
|
156
|
-
response = requests.get(
|
|
157
|
-
f"{LANGTRACE_REMOTE_URL}/api/evaluation",
|
|
158
|
-
params={"spanId": span_id},
|
|
159
|
-
headers={"x-api-key": os.environ["LANGTRACE_API_KEY"]},
|
|
160
|
-
timeout=None,
|
|
161
|
-
)
|
|
162
|
-
evaluations = response.json().get("evaluations", [])
|
|
163
|
-
response.raise_for_status()
|
|
164
|
-
return None if not evaluations else evaluations[0]
|
|
165
|
-
|
|
166
|
-
except requests.RequestException as err:
|
|
167
|
-
if err.response is not None:
|
|
168
|
-
message = (
|
|
169
|
-
err.response.json().get("message", "")
|
|
170
|
-
if err.response.json().get("message", "")
|
|
171
|
-
else err.response.text if err.response.text else str(err)
|
|
172
|
-
)
|
|
173
|
-
raise LangTraceApiError(message, err.response.status_code)
|
|
174
|
-
raise LangTraceApiError(str(err), 500)
|
|
180
|
+
return None if not evaluations else evaluations[0]
|
|
181
|
+
|
|
182
|
+
except requests.RequestException as err:
|
|
183
|
+
if err.response is not None:
|
|
184
|
+
message = (
|
|
185
|
+
err.response.json().get("message", "")
|
|
186
|
+
if err.response.json().get("message", "")
|
|
187
|
+
else err.response.text if err.response.text else str(err)
|
|
188
|
+
)
|
|
189
|
+
raise LangTraceApiError(message, err.response.status_code)
|
|
190
|
+
raise LangTraceApiError(str(err), 500)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.11"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.1.9"
|
|
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.9 → langtrace_python_sdk-2.1.11}/src/examples/chroma_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/chroma_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/chat.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/embed.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/rerank.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/cohere_example/tools.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/hiveagent_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/langchain_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/langchain_example/tool.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/llamaindex_example/agent.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/llamaindex_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/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.9 → langtrace_python_sdk-2.1.11}/src/examples/perplexity_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/pinecone_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/qdrant_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/examples/qdrant_example/basic.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
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/utils/llm.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/langtrace_python_sdk/utils/misc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/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.9 → langtrace_python_sdk-2.1.11}/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.9 → langtrace_python_sdk-2.1.11}/src/tests/cohere/test_cohere_chat.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/cohere/test_cohere_embed.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/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.9 → langtrace_python_sdk-2.1.11}/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.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/test_chat_completion.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/test_embeddings.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/openai/test_image_generation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.9 → langtrace_python_sdk-2.1.11}/src/tests/pinecone/test_pinecone.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|