From ef165d65a744feeddf8a7b8b93259890da3e3979 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 13:10:33 -0700 Subject: [PATCH 01/20] Create OTel Exporter --- .../langsmith/_internal/_background_thread.py | 61 ++- .../langsmith/_internal/otel/_otel_client.py | 57 ++ .../_internal/otel/_otel_exporter.py | 508 ++++++++++++++++++ python/langsmith/client.py | 20 + python/langsmith/utils.py | 4 +- python/poetry.lock | 224 +++++++- python/pyproject.toml | 5 + 7 files changed, 862 insertions(+), 17 deletions(-) create mode 100644 python/langsmith/_internal/otel/_otel_client.py create mode 100644 python/langsmith/_internal/otel/_otel_exporter.py diff --git a/python/langsmith/_internal/_background_thread.py b/python/langsmith/_internal/_background_thread.py index c9c8c51fef..48ae7d1c1a 100644 --- a/python/langsmith/_internal/_background_thread.py +++ b/python/langsmith/_internal/_background_thread.py @@ -168,6 +168,30 @@ def _tracing_thread_handle_batch( tracing_queue.task_done() +def _otel_tracing_thread_handle_batch( + client: Client, + tracing_queue: Queue, + batch: List[TracingQueueItem], +) -> None: + """Handle a batch of tracing queue items by exporting them to OTEL.""" + try: + ops = combine_serialized_queue_operations([item.item for item in batch]) + + run_ops = [op for op in ops if isinstance(op, SerializedRunOperation)] + + if run_ops and client.otel_exporter is not None: + client.otel_exporter.export_batch(run_ops) + + except Exception: + logger.error("Error in OTEL tracing queue", exc_info=True) + # Exceptions are logged elsewhere, but we need to make sure the + # background thread continues to run + finally: + # Mark all items in the batch as done + for _ in batch: + tracing_queue.task_done() + + def get_size_limit_from_env() -> Optional[int]: size_limit_str = ls_utils.get_env_var( "BATCH_INGEST_SIZE_LIMIT", @@ -223,11 +247,10 @@ def tracing_control_thread_func(client_ref: weakref.ref[Client]) -> None: # 1 for this func, 1 for getrefcount, 1 for _get_data_type_cached num_known_refs = 3 - disable_compression = ls_utils.get_env_var("DISABLE_RUN_COMPRESSION") - if not ls_utils.is_truish(disable_compression) and use_multipart: - if not (client.info.instance_flags or {}).get( - "zstd_compression_enabled", False - ): + # Disable compression if explicitly set or if using OpenTelemetry + disable_compression = ls_utils.is_truish(ls_utils.get_env_var("DISABLE_RUN_COMPRESSION")) or client.otel_exporter is not None + if not disable_compression and use_multipart: + if not (client.info.instance_flags or {}).get("zstd_compression_enabled", False): logger.warning( "Run compression is not enabled. Please update to the latest " "version of LangSmith. Falling back to regular multipart ingestion." @@ -278,15 +301,19 @@ def keep_thread_active() -> bool: sub_threads.append(new_thread) new_thread.start() if next_batch := _tracing_thread_drain_queue(tracing_queue, limit=size_limit): - _tracing_thread_handle_batch( - client, tracing_queue, next_batch, use_multipart - ) + if client.otel_exporter is not None: + _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) + else: + _tracing_thread_handle_batch(client, tracing_queue, next_batch, use_multipart) # drain the queue on exit while next_batch := _tracing_thread_drain_queue( tracing_queue, limit=size_limit, block=False ): - _tracing_thread_handle_batch(client, tracing_queue, next_batch, use_multipart) + if client.otel_exporter is not None: + _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) + else: + _tracing_thread_handle_batch(client, tracing_queue, next_batch, use_multipart) def tracing_control_thread_func_compress_parallel( @@ -446,9 +473,14 @@ def _tracing_sub_thread_func( ): if next_batch := _tracing_thread_drain_queue(tracing_queue, limit=size_limit): seen_successive_empty_queues = 0 - _tracing_thread_handle_batch( - client, tracing_queue, next_batch, use_multipart - ) + if client.otel_exporter is not None: + _otel_tracing_thread_handle_batch( + client, tracing_queue, next_batch + ) + else: + _tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) else: seen_successive_empty_queues += 1 @@ -456,4 +488,7 @@ def _tracing_sub_thread_func( while next_batch := _tracing_thread_drain_queue( tracing_queue, limit=size_limit, block=False ): - _tracing_thread_handle_batch(client, tracing_queue, next_batch, use_multipart) + if client.otel_exporter is not None: + _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) + else: + _tracing_thread_handle_batch(client, tracing_queue, next_batch, use_multipart) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py new file mode 100644 index 0000000000..7172092bfc --- /dev/null +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -0,0 +1,57 @@ +"""Client configuration for OpenTelemetry integration with LangSmith.""" +import os +from langsmith import utils as ls_utils + +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.resources import Resource +from opentelemetry.sdk.trace.export import ConsoleSpanExporter, BatchSpanProcessor +from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter +from opentelemetry.sdk.resources import SERVICE_NAME + +def get_otlp_tracer_provider() -> TracerProvider: + """Get the OTLP tracer provider for LangSmith. + + This function creates a tracer provider that exports spans using the OTLP protocol + with LangSmith-specific defaults: + + - OTEL_EXPORTER_OTLP_ENDPOINT: https://api.smith.langchain.com/otel + - OTEL_EXPORTER_OTLP_HEADERS: Contains x-api-key from LangSmith API key and + Langsmith-Project header if project is configured + + These defaults can be overridden by setting the environment variables before + calling this function. + + Returns: + TracerProvider: The OTLP tracer provider. + """ + # Set LangSmith-specific defaults if not already set in environment + if "OTEL_EXPORTER_OTLP_ENDPOINT" not in os.environ: + ls_endpoint = ls_utils.get_api_url(None) + # os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = f"{ls_endpoint}/otel" + os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = "http://localhost:8080/otel" + print(f"OTEL_EXPORTER_OTLP_ENDPOINT set to {os.environ['OTEL_EXPORTER_OTLP_ENDPOINT']}") + + # Configure headers with API key and project if available + if "OTEL_EXPORTER_OTLP_HEADERS" not in os.environ: + api_key = ls_utils.get_api_key(None) + headers = f"x-api-key={api_key}" + + project = ls_utils.get_tracer_project() + if project: + headers += f",Langsmith-Project={project}" + + os.environ["OTEL_EXPORTER_OTLP_HEADERS"] = headers + + service_name = os.environ.get("OTEL_SERVICE_NAME", "langsmith") + resource = Resource(attributes={ + SERVICE_NAME: service_name + }) + + tracer_provider = TracerProvider(resource=resource) + + # The OTLPSpanExporter will use the environment variables we just set + otlp_exporter = OTLPSpanExporter() + span_processor = BatchSpanProcessor(otlp_exporter) + tracer_provider.add_span_processor(span_processor) + + return tracer_provider diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py new file mode 100644 index 0000000000..1b00d85d17 --- /dev/null +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -0,0 +1,508 @@ +"""OpenTelemetry exporter for LangSmith runs.""" +import datetime +import json +import logging +import uuid +from typing import Any, Dict, List, Optional, Tuple + +from opentelemetry import trace +from langsmith._internal import _orjson + +from opentelemetry.trace import set_span_in_context, Span + +from langsmith._internal._operations import ( + SerializedRunOperation, +) + +logger = logging.getLogger(__name__) + +# OpenTelemetry GenAI semconv attribute names +GEN_AI_OPERATION_NAME = "gen_ai.operation.name" +GEN_AI_SYSTEM = "gen_ai.system" +GEN_AI_REQUEST_MODEL = "gen_ai.request.model" +GEN_AI_RESPONSE_MODEL = "gen_ai.response.model" +GEN_AI_USAGE_INPUT_TOKENS = "gen_ai.usage.input_tokens" +GEN_AI_USAGE_OUTPUT_TOKENS = "gen_ai.usage.output_tokens" +GEN_AI_USAGE_TOTAL_TOKENS = "gen_ai.usage.total_tokens" +GEN_AI_REQUEST_MAX_TOKENS = "gen_ai.request.max_tokens" +GEN_AI_REQUEST_TEMPERATURE = "gen_ai.request.temperature" +GEN_AI_REQUEST_TOP_P = "gen_ai.request.top_p" +GEN_AI_REQUEST_FREQUENCY_PENALTY = "gen_ai.request.frequency_penalty" +GEN_AI_REQUEST_PRESENCE_PENALTY = "gen_ai.request.presence_penalty" +GEN_AI_RESPONSE_FINISH_REASONS = "gen_ai.response.finish_reasons" +GENAI_PROMPT = "gen_ai.prompt" +GENAI_COMPLETION = "gen_ai.completion" + +# LangSmith custom attributes +LANGSMITH_RUN_ID = "langsmith.span.id" +LANGSMITH_TRACE_ID = "langsmith.trace.id" +LANGSMITH_DOTTED_ORDER = "langsmith.span.dotted_order" +LANGSMITH_PARENT_RUN_ID = "langsmith.span.parent_id" +LANGSMITH_SESSION_ID = "langsmith.trace.session_id" +LANGSMITH_SESSION_NAME = "langsmith.trace.session_name" +LANGSMITH_RUN_TYPE = "langsmith.span.kind" +LANGSMITH_NAME = "langsmith.trace.name" +LANGSMITH_METADATA = "langsmith.metadata" +LANGSMITH_TAGS = "langsmith.span.tags" + +# GenAI event names +GEN_AI_SYSTEM_MESSAGE = "gen_ai.system.message" +GEN_AI_USER_MESSAGE = "gen_ai.user.message" +GEN_AI_ASSISTANT_MESSAGE = "gen_ai.assistant.message" +GEN_AI_CHOICE = "gen_ai.choice" + + + +class OTELExporter: + __slots__ = ["_tracer", "_spans"] + """OpenTelemetry exporter for LangSmith runs.""" + + def __init__(self, tracer_provider=None): + """Initialize the OTEL exporter. + + Args: + tracer_provider: Optional tracer provider to use. If not provided, + the global tracer provider will be used. + """ + self._tracer = trace.get_tracer( + "langsmith", + tracer_provider=tracer_provider + ) + self._spans = {} + + def export_batch(self, operations: List[SerializedRunOperation]) -> None: + """Export a batch of serialized run operations to OTEL. + + Args: + operations: List of serialized run operations to export. + """ + # Create a dictionary mapping run IDs to their operations + + for op in operations: + try: + run_info = self._deserialize_run_info(op) + if not run_info: + continue + if op.operation == "post": + span = self._create_span_for_run(op, run_info) + if span: + self._spans[op.id] = span + else: + self._update_span_for_run(op, run_info) + except Exception as e: + logger.exception(f"Error processing operation {op.id}: {e}") + + def _deserialize_run_info(self, op: SerializedRunOperation) -> Optional[dict]: + """Deserialize the run info from the operation. + + Args: + op: The serialized run operation. + + Returns: + The deserialized run info as a dictionary, or None if deserialization failed. + """ + try: + run_info = _orjson.loads(op._none) + + # convert run_info to a Run Schema + return run_info + except Exception as e: + logger.exception(f"Failed to deserialize run info for {op.id}: {e}") + return None + + def _create_span_for_run( + self, + op: SerializedRunOperation, + run_info: dict, + ) -> Optional[Span]: + """Create an OpenTelemetry span for a run operation. + + Args: + op: The serialized run operation. + run_info: The deserialized run info. + parent_span: Optional parent span. + + Returns: + The created span, or None if creation failed. + """ + try: + start_time = run_info.get("start_time") + start_time_utc_nano = self._as_utc_nano(start_time) + + end_time = run_info.get("end_time") + end_time_utc_nano = self._as_utc_nano(end_time) + + # Start the span + parent_run_id = run_info.get("parent_run_id") + if parent_run_id is not None and uuid.UUID(parent_run_id) in self._spans: + span = self._tracer.start_span( + run_info.get("name"), + context=set_span_in_context(self._spans[uuid.UUID(parent_run_id)]), + start_time=start_time_utc_nano, + ) + else: + span = self._tracer.start_span( + run_info.get("name"), + start_time=start_time_utc_nano, + ) + + # Set all attributes + self._set_span_attributes(span, run_info, op) + + # Set status based on error + if run_info.get("error"): + span.set_status(trace.StatusCode.ERROR) + span.record_exception(Exception(run_info.get("error"))) + else: + span.set_status(trace.StatusCode.OK) + + # End the span if end_time is present + end_time = run_info.get("end_time") + if end_time: + end_time_utc_nano = self._as_utc_nano(end_time) + if end_time_utc_nano: + span.end(end_time=end_time_utc_nano) + else: + span.end() + + return span + except Exception as e: + logger.exception(f"Failed to create span for run {op.id}: {e}") + return None + + + def _update_span_for_run(self, op: SerializedRunOperation, run_info: dict) -> None: + """Update an OpenTelemetry span for a run operation. + + Args: + op: The serialized run operation. + run_info: The deserialized run info. + """ + try: + # Get the span for this run + if op.id not in self._spans: + logger.debug(f"No span found for run {op.id} during update") + return + + span = self._spans[op.id] + + # Update attributes + self._set_span_attributes(span, run_info, op) + # Update status based on error + if run_info.get("error"): + span.set_status(trace.StatusCode.ERROR) + span.record_exception(Exception(run_info.get("error"))) + else: + span.set_status(trace.StatusCode.OK) + + # End the span if end_time is present + end_time = run_info.get("end_time") + if end_time: + end_time_utc_nano = self._as_utc_nano(end_time) + if end_time_utc_nano: + span.end(end_time=end_time_utc_nano) + else: + span.end() + # Remove the span from our dictionary + del self._spans[op.id] + + except Exception as e: + logger.exception(f"Failed to update span for run {op.id}: {e}") + + + def _extract_model_name(self, run_info: dict) -> Optional[str]: + """Extract model name from run info. + + Args: + run_info: The run info. + + Returns: + The model name, or None if not found. + """ + # Try to get model name from metadata + if run_info.get("extra") and run_info["extra"].get("metadata"): + metadata = run_info["extra"]["metadata"] + + # First check for ls_model_name in metadata + if metadata.get("ls_model_name"): + return metadata["ls_model_name"] + + # Then check invocation_params for model info + if "invocation_params" in metadata: + invocation_params = metadata["invocation_params"] + # Check model first, then model_name + if invocation_params.get("model"): + return invocation_params["model"] + elif invocation_params.get("model_name"): + return invocation_params["model_name"] + + return None + + def _set_span_attributes(self, span: Span, run_info: dict, op: SerializedRunOperation) -> None: + """Set attributes on the span. + + Args: + span: The span to set attributes on. + run_info: The deserialized run info. + op: The serialized run operation. + """ + # Set LangSmith-specific attributes + span.set_attribute(LANGSMITH_RUN_ID, str(op.id)) + span.set_attribute(LANGSMITH_TRACE_ID, str(op.trace_id)) + + if run_info.get("dotted_order"): + span.set_attribute(LANGSMITH_DOTTED_ORDER, str(run_info.get("dotted_order"))) + + if run_info.get("parent_run_id"): + span.set_attribute(LANGSMITH_PARENT_RUN_ID, str(run_info.get("parent_run_id"))) + if run_info.get("run_type"): + span.set_attribute(LANGSMITH_RUN_TYPE, str(run_info.get("run_type"))) + + if run_info.get("name"): + span.set_attribute(LANGSMITH_NAME, str(run_info.get("name"))) + + if run_info.get("session_id"): + span.set_attribute(LANGSMITH_SESSION_ID, str(run_info.get("session_id"))) + if run_info.get("session_name"): + span.set_attribute(LANGSMITH_SESSION_NAME, str(run_info.get("session_name"))) + + # Set GenAI attributes according to OTEL semantic conventions + # Set gen_ai.operation.name + operation_name = run_info.get("run_type", "chain") + span.set_attribute(GEN_AI_OPERATION_NAME, operation_name) + + # Set gen_ai.system + self._set_gen_ai_system(span, run_info) + + # Set model name if available + model_name = self._extract_model_name(run_info) + if model_name: + span.set_attribute(GEN_AI_REQUEST_MODEL, model_name) + + # Set token usage information + if run_info.get("prompt_tokens") is not None: + prompt_tokens = run_info["prompt_tokens"] + span.set_attribute(GEN_AI_USAGE_INPUT_TOKENS, int(prompt_tokens)) + + if run_info.get("completion_tokens") is not None: + completion_tokens = run_info["completion_tokens"] + span.set_attribute(GEN_AI_USAGE_OUTPUT_TOKENS, int(completion_tokens)) + + if run_info.get("total_tokens") is not None: + total_tokens = run_info["total_tokens"] + span.set_attribute(GEN_AI_USAGE_TOTAL_TOKENS, int(total_tokens)) + + # Set other parameters from invocation_params + self._set_invocation_parameters(span, run_info) + + # Set metadata and tags if available + extra = run_info.get("extra", {}) + metadata = extra.get("metadata", {}) + for key, value in metadata.items(): + span.set_attribute(f"{LANGSMITH_METADATA}.{key}", value) + + tags = run_info.get("tags") + if tags: + if isinstance(tags, list): + span.set_attribute(LANGSMITH_TAGS, ", ".join(tags)) + else: + span.set_attribute(LANGSMITH_TAGS, tags) + + + # Set inputs/outputs if available + self._set_io_attributes(span, op) + + def _set_gen_ai_system(self, span: Span, run_info: dict) -> None: + """Set the gen_ai.system attribute on the span based on the model provider. + + Args: + span: The span to set attributes on. + run_info: The deserialized run info. + """ + # Default to "langchain" if we can't determine the system + system = "langchain" + + # Extract model name to determine the system + model_name = self._extract_model_name(run_info) + if model_name: + model_lower = model_name.lower() + if "anthropic" in model_lower or model_lower.startswith("claude"): + system = "anthropic" + elif "bedrock" in model_lower: + system = "aws.bedrock" + elif "azure" in model_lower and "openai" in model_lower: + system = "az.ai.openai" + elif "azure" in model_lower and "inference" in model_lower: + system = "az.ai.inference" + elif "cohere" in model_lower: + system = "cohere" + elif "deepseek" in model_lower: + system = "deepseek" + elif "gemini" in model_lower: + system = "gemini" + elif "groq" in model_lower: + system = "groq" + elif "watson" in model_lower or "ibm" in model_lower: + system = "ibm.watsonx.ai" + elif "mistral" in model_lower: + system = "mistral_ai" + elif "gpt" in model_lower or "openai" in model_lower: + system = "openai" + elif "perplexity" in model_lower or "sonar" in model_lower: + system = "perplexity" + elif "vertex" in model_lower: + system = "vertex_ai" + elif "xai" in model_lower or "grok" in model_lower: + system = "xai" + + span.set_attribute(GEN_AI_SYSTEM, system) + setattr(span, "_gen_ai_system", system) + + def _set_invocation_parameters(self, span: Span, run_info: dict) -> None: + """Set invocation parameters on the span. + + Args: + span: The span to set attributes on. + run_info: The deserialized run info. + """ + if not (run_info.get("extra") and run_info["extra"].get("metadata")): + return + + metadata = run_info["extra"]["metadata"] + if "invocation_params" not in metadata: + return + + invocation_params = metadata["invocation_params"] + + # Set relevant invocation parameters + if "max_tokens" in invocation_params: + span.set_attribute(GEN_AI_REQUEST_MAX_TOKENS, invocation_params["max_tokens"]) + + if "temperature" in invocation_params: + span.set_attribute(GEN_AI_REQUEST_TEMPERATURE, invocation_params["temperature"]) + + if "top_p" in invocation_params: + span.set_attribute(GEN_AI_REQUEST_TOP_P, invocation_params["top_p"]) + + if "frequency_penalty" in invocation_params: + span.set_attribute(GEN_AI_REQUEST_FREQUENCY_PENALTY, invocation_params["frequency_penalty"]) + + if "presence_penalty" in invocation_params: + span.set_attribute(GEN_AI_REQUEST_PRESENCE_PENALTY, invocation_params["presence_penalty"]) + + + + def _set_io_attributes(self, span: Span, op: SerializedRunOperation) -> None: + """Set input/output attributes on the span. + + Args: + span: The span to set attributes on. + op: The serialized run operation. + """ + if op.inputs: + try: + inputs = _orjson.loads(op.inputs) + + if isinstance(inputs, dict) and 'model' in inputs and isinstance(inputs.get('messages'), list): + span.set_attribute(GEN_AI_REQUEST_MODEL, inputs['model']) + + span.set_attribute(GENAI_PROMPT, op.inputs) + + except Exception: + logger.debug("Failed to process inputs for run %s", op.id, exc_info=True) + + if op.outputs: + try: + outputs = _orjson.loads(op.outputs) + + # Extract token usage from outputs (for LLM runs) + token_usage = self.get_unified_run_tokens(outputs) + if token_usage: + span.set_attribute(GEN_AI_USAGE_INPUT_TOKENS, token_usage[0]) + span.set_attribute(GEN_AI_USAGE_OUTPUT_TOKENS, token_usage[1]) + span.set_attribute(GEN_AI_USAGE_TOTAL_TOKENS, token_usage[0] + token_usage[1]) + + if 'model' in outputs: + span.set_attribute(GEN_AI_RESPONSE_MODEL, str(outputs['model'])) + + span.set_attribute(GENAI_COMPLETION, op.outputs) + + except Exception: + logger.debug("Failed to process outputs for run %s", op.id, exc_info=True) + + def _as_utc_nano(self, timestamp: Optional[str]) -> Optional[int]: + if not timestamp: + return None + try: + dt = datetime.datetime.fromisoformat(timestamp) + return int(dt.astimezone(datetime.timezone.utc).timestamp() * 1_000_000_000) + except ValueError: + logger.exception(f"Failed to parse timestamp {timestamp}") + return None + + def get_unified_run_tokens(self, outputs: dict | None) -> Tuple[int, int] | None: + if not outputs: + return None + + # search in non-generations lists + if output := self._extract_unified_run_tokens(outputs.get("usage_metadata")): + return output + + # find if direct kwarg in outputs + keys = outputs.keys() + for key in keys: + haystack = outputs[key] + if not haystack or not isinstance(haystack, dict): + continue + + if output := self._extract_unified_run_tokens(haystack.get("usage_metadata")): + return output + + if ( + haystack.get("lc") == 1 + and "kwargs" in haystack + and isinstance(haystack["kwargs"], dict) + and ( + output := self._extract_unified_run_tokens( + haystack["kwargs"].get("usage_metadata") + ) + ) + ): + return output + + # find in generations + generations = outputs.get("generations") or [] + if not isinstance(generations, list): + return None + if generations and not isinstance(generations[0], list): + generations = [generations] + + for generation in [x for xs in generations for x in xs]: + if ( + isinstance(generation, dict) + and "message" in generation + and isinstance(generation["message"], dict) + and "kwargs" in generation["message"] + and isinstance(generation["message"]["kwargs"], dict) + and ( + output := self._extract_unified_run_tokens( + generation["message"]["kwargs"].get("usage_metadata") + ) + ) + ): + return output + return None + + def _extract_unified_run_tokens(self, outputs: Any | None) -> Tuple[int, int] | None: + if not outputs or not isinstance(outputs, dict): + return None + + if "input_tokens" not in outputs or "output_tokens" not in outputs: + return None + + if not isinstance(outputs["input_tokens"], int) or not isinstance( + outputs["output_tokens"], int + ): + return None + + return outputs["input_tokens"], outputs["output_tokens"] diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 2dd7fe35b6..1ce0a9cc69 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -100,9 +100,14 @@ serialized_feedback_operation_to_multipart_parts_and_context, serialized_run_operation_to_multipart_parts_and_context, ) +from langsmith._internal.otel._otel_exporter import OTELExporter +from langsmith._internal.otel._otel_client import get_otlp_tracer_provider from langsmith._internal._serde import dumps_json as _dumps_json from langsmith.schemas import AttachmentInfo +from opentelemetry import trace +from opentelemetry.sdk.trace import TracerProvider + try: from zoneinfo import ZoneInfo # type: ignore[import-not-found] except ImportError: @@ -398,6 +403,7 @@ class Client: "compressed_traces", "_data_available_event", "_futures", + "otel_exporter", ] def __init__( @@ -415,6 +421,7 @@ def __init__( hide_outputs: Optional[Union[Callable[[dict], dict], bool]] = None, info: Optional[Union[dict, ls_schemas.LangSmithInfo]] = None, api_urls: Optional[Dict[str, str]] = None, + otel_tracer_provider: Optional[TracerProvider] = None, ) -> None: """Initialize a Client instance. @@ -446,6 +453,8 @@ def __init__( URL in the dictionary. However, ONLY Runs are written (POST and PATCH) to all URLs in the dictionary. Feedback, sessions, datasets, examples, annotation queues and evaluation results are only written to the first. + otel_tracer_provider (Optional[TracerProvider]): Optional tracer provider for OpenTelemetry integration. + If not provided, a LangSmith-specific tracer provider will be used. Raises: LangSmithUserError: If the API key is not provided when using the hosted service. @@ -577,6 +586,16 @@ def __init__( self._manual_cleanup = False + if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): + if otel_tracer_provider is None: + otel_tracer_provider = get_otlp_tracer_provider() + # Set as global tracer provider if we're creating a new one + trace.set_tracer_provider(otel_tracer_provider) + + self.otel_exporter: Optional[OTELExporter] = OTELExporter(tracer_provider=otel_tracer_provider) + else: + self.otel_exporter = None + def _repr_html_(self) -> str: """Return an HTML representation of the instance with a link to the URL. @@ -5592,6 +5611,7 @@ def create_feedback( self.tracing_queue is not None or self.compressed_traces is not None ) and feedback.trace_id is not None + and self.otel_exporter is None ): serialized_op = serialize_feedback_dict(feedback) if self.compressed_traces is not None: diff --git a/python/langsmith/utils.py b/python/langsmith/utils.py index 7fdf7f5b06..04323dd1e7 100644 --- a/python/langsmith/utils.py +++ b/python/langsmith/utils.py @@ -811,4 +811,6 @@ def is_truish(val: Any) -> bool: Returns: bool: True if the value is truish, False otherwise. """ - return val is True or val == "true" or val == "True" or val == "TRUE" or val == "1" + if isinstance(val, str): + return val.lower() == "true" or val == "1" + return bool(val) diff --git a/python/poetry.lock b/python/poetry.lock index 030c60d4e2..a28d5a5a49 100644 --- a/python/poetry.lock +++ b/python/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. [[package]] name = "annotated-types" @@ -6,6 +6,7 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, @@ -17,6 +18,7 @@ version = "0.45.2" description = "The official Python library for the anthropic API" optional = false python-versions = ">=3.8" +groups = ["test"] files = [ {file = "anthropic-0.45.2-py3-none-any.whl", hash = "sha256:ecd746f7274451dfcb7e1180571ead624c7e1195d1d46cb7c70143d2aedb4d35"}, {file = "anthropic-0.45.2.tar.gz", hash = "sha256:32a18b9ecd12c91b2be4cae6ca2ab46a06937b5aa01b21308d97a6d29794fb5e"}, @@ -41,6 +43,7 @@ version = "4.8.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.9" +groups = ["main", "dev", "lint", "test"] files = [ {file = "anyio-4.8.0-py3-none-any.whl", hash = "sha256:b5011f270ab5eb0abf13385f851315585cc37ef330dd88e27ec3d34d651fd47a"}, {file = "anyio-4.8.0.tar.gz", hash = "sha256:1d9fe889df5212298c0c0723fa20479d1b94883a2df44bd3897aa91083316f7a"}, @@ -63,6 +66,7 @@ version = "25.1.0" description = "Classes Without Boilerplate" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "attrs-25.1.0-py3-none-any.whl", hash = "sha256:c75a69e28a550a7e93789579c22aa26b0f5b83b75dc4e08fe092980051e1090a"}, {file = "attrs-25.1.0.tar.gz", hash = "sha256:1c97078a80c814273a76b2a298a932eb681c87415c11dee0a6921de7f1b02c3e"}, @@ -82,6 +86,7 @@ version = "24.10.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "black-24.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e6668650ea4b685440857138e5fe40cde4d652633b1bdffc62933d0db4ed9812"}, {file = "black-24.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1c536fcf674217e87b8cc3657b81809d3c085d7bf3ef262ead700da345bfa6ea"}, @@ -128,6 +133,7 @@ version = "2025.1.31" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main", "dev", "lint", "test"] files = [ {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, @@ -139,6 +145,8 @@ version = "1.17.1" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation == \"PyPy\"" files = [ {file = "cffi-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14"}, {file = "cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67"}, @@ -218,6 +226,7 @@ version = "3.4.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, @@ -319,6 +328,7 @@ version = "8.1.8" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"}, {file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"}, @@ -333,10 +343,12 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["main", "dev", "lint", "test"] files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +markers = {main = "sys_platform == \"win32\"", dev = "sys_platform == \"win32\" or platform_system == \"Windows\"", lint = "platform_system == \"Windows\"", test = "sys_platform == \"win32\""} [[package]] name = "coverage" @@ -344,6 +356,7 @@ version = "7.6.12" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "coverage-7.6.12-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:704c8c8c6ce6569286ae9622e534b4f5b9759b6f2cd643f1c1a61f666d534fe8"}, {file = "coverage-7.6.12-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ad7525bf0241e5502168ae9c643a2f6c219fa0a283001cee4cf23a9b7da75879"}, @@ -422,6 +435,7 @@ version = "0.6.7" description = "Easily serialize dataclasses to and from JSON." optional = false python-versions = "<4.0,>=3.7" +groups = ["dev"] files = [ {file = "dataclasses_json-0.6.7-py3-none-any.whl", hash = "sha256:0dbf33f26c8d5305befd61b39d2b3414e8a407bedc2834dea9b8d642666fb40a"}, {file = "dataclasses_json-0.6.7.tar.gz", hash = "sha256:b6b3e528266ea45b9535223bc53ca645f5208833c29229e847b3f26a1cc55fc0"}, @@ -431,12 +445,32 @@ files = [ marshmallow = ">=3.18.0,<4.0.0" typing-inspect = ">=0.4.0,<1" +[[package]] +name = "deprecated" +version = "1.2.18" +description = "Python @deprecated decorator to deprecate old python classes, functions or methods." +optional = true +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +groups = ["main"] +markers = "extra == \"otel\"" +files = [ + {file = "Deprecated-1.2.18-py2.py3-none-any.whl", hash = "sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec"}, + {file = "deprecated-1.2.18.tar.gz", hash = "sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d"}, +] + +[package.dependencies] +wrapt = ">=1.10,<2" + +[package.extras] +dev = ["PyTest", "PyTest-Cov", "bump2version (<1)", "setuptools", "tox"] + [[package]] name = "distro" version = "1.9.0" description = "Distro - an OS platform information API" optional = false python-versions = ">=3.6" +groups = ["lint", "test"] files = [ {file = "distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2"}, {file = "distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"}, @@ -448,6 +482,8 @@ version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" +groups = ["main", "dev", "lint", "test"] +markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, @@ -462,6 +498,7 @@ version = "2.1.1" description = "execnet: rapid multi-Python deployment" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "execnet-2.1.1-py3-none-any.whl", hash = "sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc"}, {file = "execnet-2.1.1.tar.gz", hash = "sha256:5189b52c6121c24feae288166ab41b32549c7e2348652736540b9e6e7d4e72e3"}, @@ -476,6 +513,7 @@ version = "0.115.11" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "fastapi-0.115.11-py3-none-any.whl", hash = "sha256:32e1541b7b74602e4ef4a0260ecaf3aadf9d4f19590bba3e1bf2ac4666aa2c64"}, {file = "fastapi-0.115.11.tar.gz", hash = "sha256:cc81f03f688678b92600a65a5e618b93592c65005db37157147204d8924bf94f"}, @@ -496,6 +534,7 @@ version = "1.5.1" description = "Let your Python tests travel through time" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "freezegun-1.5.1-py3-none-any.whl", hash = "sha256:bf111d7138a8abe55ab48a71755673dbaa4ab87f4cff5634a4442dfec34c15f1"}, {file = "freezegun-1.5.1.tar.gz", hash = "sha256:b29dedfcda6d5e8e083ce71b2b542753ad48cfec44037b3fc79702e2980a89e9"}, @@ -510,6 +549,7 @@ version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false python-versions = ">=3.7" +groups = ["main", "dev", "lint", "test"] files = [ {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, @@ -521,6 +561,7 @@ version = "1.0.7" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd"}, {file = "httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"}, @@ -542,6 +583,7 @@ version = "0.27.2" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, @@ -567,6 +609,7 @@ version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" +groups = ["main", "dev", "lint", "test"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -575,12 +618,38 @@ files = [ [package.extras] all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] +[[package]] +name = "importlib-metadata" +version = "8.5.0" +description = "Read metadata from Python packages" +optional = true +python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" +files = [ + {file = "importlib_metadata-8.5.0-py3-none-any.whl", hash = "sha256:45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b"}, + {file = "importlib_metadata-8.5.0.tar.gz", hash = "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7"}, +] + +[package.dependencies] +zipp = ">=3.20" + +[package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +enabler = ["pytest-enabler (>=2.2)"] +perf = ["ipython"] +test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] +type = ["pytest-mypy"] + [[package]] name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" optional = false python-versions = ">=3.7" +groups = ["main", "dev", "test"] files = [ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, @@ -592,6 +661,7 @@ version = "0.8.2" description = "Fast iterable JSON parser." optional = false python-versions = ">=3.8" +groups = ["lint", "test"] files = [ {file = "jiter-0.8.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:ca8577f6a413abe29b079bc30f907894d7eb07a865c4df69475e868d73e71c7b"}, {file = "jiter-0.8.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b25bd626bde7fb51534190c7e3cb97cee89ee76b76d7585580e22f34f5e3f393"}, @@ -677,6 +747,8 @@ version = "0.1.0rc5" description = "" optional = true python-versions = ">=3.9" +groups = ["main"] +markers = "extra == \"langsmith-pyo3\"" files = [ {file = "langsmith_pyo3-0.1.0rc5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:670e5707f09e756e3b71f12a46f546826893158c2dde3250e212234e15ac8c70"}, {file = "langsmith_pyo3-0.1.0rc5-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:e0d2261c3f9ba07594c7450187604c4c4b1e10e3b3f4a4eb39587a495d6945e3"}, @@ -716,6 +788,8 @@ version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"pytest\"" files = [ {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"}, {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"}, @@ -740,6 +814,7 @@ version = "3.26.1" description = "A lightweight library for converting complex datatypes to and from native Python datatypes." optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "marshmallow-3.26.1-py3-none-any.whl", hash = "sha256:3350409f20a70a7e4e11a27661187b77cdcaeb20abca41c1454fe33636bea09c"}, {file = "marshmallow-3.26.1.tar.gz", hash = "sha256:e6d8affb6cb61d39d26402096dc0aee12d5a26d490a121f118d2e81dc0719dc6"}, @@ -759,6 +834,8 @@ version = "0.1.2" description = "Markdown URL utilities" optional = true python-versions = ">=3.7" +groups = ["main"] +markers = "extra == \"pytest\"" files = [ {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, @@ -770,6 +847,7 @@ version = "6.1.0" description = "multidict implementation" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "multidict-6.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3380252550e372e8511d49481bd836264c009adb826b23fefcc5dd3c69692f60"}, {file = "multidict-6.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:99f826cbf970077383d7de805c0681799491cb939c25450b9b5b3ced03ca99f1"}, @@ -874,6 +952,7 @@ version = "1.2.1" description = "Parser for multipart/form-data" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "multipart-1.2.1-py3-none-any.whl", hash = "sha256:c03dc203bc2e67f6b46a599467ae0d87cf71d7530504b2c1ff4a9ea21d8b8c8c"}, {file = "multipart-1.2.1.tar.gz", hash = "sha256:829b909b67bc1ad1c6d4488fcdc6391c2847842b08323addf5200db88dbe9480"}, @@ -889,6 +968,7 @@ version = "1.15.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"}, {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"}, @@ -942,6 +1022,7 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -953,6 +1034,7 @@ version = "2.0.2" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "numpy-2.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:51129a29dbe56f9ca83438b706e2e69a39892b5eda6cedcb6b0c9fdc9b0d3ece"}, {file = "numpy-2.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f15975dfec0cf2239224d80e32c3170b1d168335eaedee69da84fbe9f1f9cd04"}, @@ -1007,6 +1089,7 @@ version = "1.65.4" description = "The official Python library for the openai API" optional = false python-versions = ">=3.8" +groups = ["lint"] files = [ {file = "openai-1.65.4-py3-none-any.whl", hash = "sha256:15566d46574b94eae3d18efc2f9a4ebd1366d1d44bfc1bdafeea7a5cf8271bcb"}, {file = "openai-1.65.4.tar.gz", hash = "sha256:0b08c58625d556f5c6654701af1023689c173eb0989ce8f73c7fd0eb22203c76"}, @@ -1026,12 +1109,66 @@ typing-extensions = ">=4.11,<5" datalib = ["numpy (>=1)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)"] realtime = ["websockets (>=13,<15)"] +[[package]] +name = "opentelemetry-api" +version = "1.30.0" +description = "OpenTelemetry Python API" +optional = true +python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" +files = [ + {file = "opentelemetry_api-1.30.0-py3-none-any.whl", hash = "sha256:d5f5284890d73fdf47f843dda3210edf37a38d66f44f2b5aedc1e89ed455dc09"}, + {file = "opentelemetry_api-1.30.0.tar.gz", hash = "sha256:375893400c1435bf623f7dfb3bcd44825fe6b56c34d0667c542ea8257b1a1240"}, +] + +[package.dependencies] +deprecated = ">=1.2.6" +importlib-metadata = ">=6.0,<=8.5.0" + +[[package]] +name = "opentelemetry-sdk" +version = "1.30.0" +description = "OpenTelemetry Python SDK" +optional = true +python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" +files = [ + {file = "opentelemetry_sdk-1.30.0-py3-none-any.whl", hash = "sha256:14fe7afc090caad881addb6926cec967129bd9260c4d33ae6a217359f6b61091"}, + {file = "opentelemetry_sdk-1.30.0.tar.gz", hash = "sha256:c9287a9e4a7614b9946e933a67168450b9ab35f08797eb9bc77d998fa480fa18"}, +] + +[package.dependencies] +opentelemetry-api = "1.30.0" +opentelemetry-semantic-conventions = "0.51b0" +typing-extensions = ">=3.7.4" + +[[package]] +name = "opentelemetry-semantic-conventions" +version = "0.51b0" +description = "OpenTelemetry Semantic Conventions" +optional = true +python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" +files = [ + {file = "opentelemetry_semantic_conventions-0.51b0-py3-none-any.whl", hash = "sha256:fdc777359418e8d06c86012c3dc92c88a6453ba662e941593adb062e48c2eeae"}, + {file = "opentelemetry_semantic_conventions-0.51b0.tar.gz", hash = "sha256:3fabf47f35d1fd9aebcdca7e6802d86bd5ebc3bc3408b7e3248dde6e87a18c47"}, +] + +[package.dependencies] +deprecated = ">=1.2.6" +opentelemetry-api = "1.30.0" + [[package]] name = "orjson" version = "3.10.15" description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" optional = false python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation != \"PyPy\"" files = [ {file = "orjson-3.10.15-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:552c883d03ad185f720d0c09583ebde257e41b9521b74ff40e08b7dec4559c04"}, {file = "orjson-3.10.15-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:616e3e8d438d02e4854f70bfdc03a6bcdb697358dbaa6bcd19cbe24d24ece1f8"}, @@ -1120,6 +1257,7 @@ version = "24.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "test"] files = [ {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, @@ -1131,6 +1269,7 @@ version = "2.2.2.240807" description = "Type annotations for pandas" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "pandas_stubs-2.2.2.240807-py3-none-any.whl", hash = "sha256:893919ad82be4275f0d07bb47a95d08bae580d3fdea308a7acfcb3f02e76186e"}, {file = "pandas_stubs-2.2.2.240807.tar.gz", hash = "sha256:64a559725a57a449f46225fbafc422520b7410bff9252b661a225b5559192a93"}, @@ -1146,6 +1285,7 @@ version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, @@ -1157,6 +1297,7 @@ version = "4.3.6" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, @@ -1173,6 +1314,7 @@ version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "test"] files = [ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, @@ -1188,6 +1330,7 @@ version = "0.3.0" description = "Accelerated property cache" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "propcache-0.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:efa44f64c37cc30c9f05932c740a8b40ce359f51882c70883cc95feac842da4d"}, {file = "propcache-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2383a17385d9800b6eb5855c2f05ee550f803878f344f58b6e194de08b96352c"}, @@ -1295,6 +1438,7 @@ version = "5.9.8" description = "Cross-platform lib for process and system monitoring in Python." optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +groups = ["dev"] files = [ {file = "psutil-5.9.8-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:26bd09967ae00920df88e0352a91cff1a78f8d69b3ecabbfe733610c0af486c8"}, {file = "psutil-5.9.8-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:05806de88103b25903dff19bb6692bd2e714ccf9e668d050d144012055cbca73"}, @@ -1323,6 +1467,7 @@ version = "0.3.14" description = "Sampling profiler for Python programs" optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "py_spy-0.3.14-py2.py3-none-macosx_10_7_x86_64.whl", hash = "sha256:5b342cc5feb8d160d57a7ff308de153f6be68dcf506ad02b4d67065f2bae7f45"}, {file = "py_spy-0.3.14-py2.py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:fe7efe6c91f723442259d428bf1f9ddb9c1679828866b353d539345ca40d9dd2"}, @@ -1339,6 +1484,8 @@ version = "2.22" description = "C parser in Python" optional = false python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation == \"PyPy\"" files = [ {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, @@ -1350,6 +1497,7 @@ version = "2.10.6" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, @@ -1370,6 +1518,7 @@ version = "2.27.2" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, @@ -1482,6 +1631,8 @@ version = "2.19.1" description = "Pygments is a syntax highlighting package written in Python." optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"pytest\"" files = [ {file = "pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c"}, {file = "pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f"}, @@ -1496,6 +1647,7 @@ version = "2.9.0" description = "Python module to run and analyze benchmarks" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "pyperf-2.9.0-py3-none-any.whl", hash = "sha256:215673fb60f3fbbc6c7a90b609b0806d8466fded8dd502bf5731e2b92506076e"}, {file = "pyperf-2.9.0.tar.gz", hash = "sha256:dbe0feef8ec1a465df191bba2576149762d15a8c9985c9fea93ab625d875c362"}, @@ -1513,6 +1665,7 @@ version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" +groups = ["main", "dev", "test"] files = [ {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, @@ -1535,6 +1688,7 @@ version = "0.21.2" description = "Pytest support for asyncio" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pytest_asyncio-0.21.2-py3-none-any.whl", hash = "sha256:ab664c88bb7998f711d8039cacd4884da6430886ae8bbd4eded552ed2004f16b"}, {file = "pytest_asyncio-0.21.2.tar.gz", hash = "sha256:d67738fc232b94b326b9d060750beb16e0074210b98dd8b58a5239fa2a154f45"}, @@ -1553,6 +1707,7 @@ version = "4.1.0" description = "Pytest plugin for measuring coverage." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pytest-cov-4.1.0.tar.gz", hash = "sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6"}, {file = "pytest_cov-4.1.0-py3-none-any.whl", hash = "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a"}, @@ -1571,6 +1726,7 @@ version = "14.0" description = "pytest plugin to re-run tests to eliminate flaky failures" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest-rerunfailures-14.0.tar.gz", hash = "sha256:4a400bcbcd3c7a4ad151ab8afac123d90eca3abe27f98725dc4d9702887d2e92"}, {file = "pytest_rerunfailures-14.0-py3-none-any.whl", hash = "sha256:4197bdd2eaeffdbf50b5ea6e7236f47ff0e44d1def8dae08e409f536d84e7b32"}, @@ -1586,6 +1742,7 @@ version = "0.7.0" description = "Pytest Plugin to disable socket calls during tests" optional = false python-versions = ">=3.8,<4.0" +groups = ["dev", "test"] files = [ {file = "pytest_socket-0.7.0-py3-none-any.whl", hash = "sha256:7e0f4642177d55d317bbd58fc68c6bd9048d6eadb2d46a89307fa9221336ce45"}, {file = "pytest_socket-0.7.0.tar.gz", hash = "sha256:71ab048cbbcb085c15a4423b73b619a8b35d6a307f46f78ea46be51b1b7e11b3"}, @@ -1600,6 +1757,7 @@ version = "0.11.0" description = "unittest subTest() support and subtests fixture" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pytest-subtests-0.11.0.tar.gz", hash = "sha256:51865c88457545f51fb72011942f0a3c6901ee9e24cbfb6d1b9dc1348bafbe37"}, {file = "pytest_subtests-0.11.0-py3-none-any.whl", hash = "sha256:453389984952eec85ab0ce0c4f026337153df79587048271c7fd0f49119c07e4"}, @@ -1615,6 +1773,7 @@ version = "0.3.5" description = "Automatically rerun your tests on file modifications" optional = false python-versions = ">=3.7.0,<4.0.0" +groups = ["dev"] files = [ {file = "pytest_watcher-0.3.5-py3-none-any.whl", hash = "sha256:af00ca52c7be22dc34c0fd3d7ffef99057207a73b05dc5161fe3b2fe91f58130"}, {file = "pytest_watcher-0.3.5.tar.gz", hash = "sha256:8896152460ba2b1a8200c12117c6611008ec96c8b2d811f0a05ab8a82b043ff8"}, @@ -1630,6 +1789,7 @@ version = "3.6.1" description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"}, {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"}, @@ -1650,6 +1810,7 @@ version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["dev"] files = [ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, @@ -1664,6 +1825,7 @@ version = "6.0.2" description = "YAML parser and emitter for Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, @@ -1726,6 +1888,7 @@ version = "2.32.3" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, @@ -1747,6 +1910,7 @@ version = "1.0.0" description = "A utility belt for advanced users of python-requests" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +groups = ["main"] files = [ {file = "requests-toolbelt-1.0.0.tar.gz", hash = "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6"}, {file = "requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06"}, @@ -1761,6 +1925,8 @@ version = "13.9.4" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = true python-versions = ">=3.8.0" +groups = ["main"] +markers = "extra == \"pytest\"" files = [ {file = "rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90"}, {file = "rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098"}, @@ -1780,6 +1946,7 @@ version = "0.6.9" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "ruff-0.6.9-py3-none-linux_armv6l.whl", hash = "sha256:064df58d84ccc0ac0fcd63bc3090b251d90e2a372558c0f057c3f75ed73e1ccd"}, {file = "ruff-0.6.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:140d4b5c9f5fc7a7b074908a78ab8d384dd7f6510402267bc76c37195c02a7ec"}, @@ -1807,6 +1974,7 @@ version = "1.17.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["dev"] files = [ {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, @@ -1818,6 +1986,7 @@ version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" +groups = ["main", "dev", "lint", "test"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -1829,6 +1998,7 @@ version = "0.46.0" description = "The little ASGI library that shines." optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "starlette-0.46.0-py3-none-any.whl", hash = "sha256:913f0798bd90ba90a9156383bcf1350a17d6259451d0d8ee27fc0cf2db609038"}, {file = "starlette-0.46.0.tar.gz", hash = "sha256:b359e4567456b28d473d0193f34c0de0ed49710d75ef183a74a5ce0499324f50"}, @@ -1847,6 +2017,7 @@ version = "2.2.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "test"] files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, @@ -1881,6 +2052,7 @@ files = [ {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] +markers = {main = "python_version < \"3.11\"", dev = "python_full_version <= \"3.11.0a6\"", test = "python_version < \"3.11\""} [[package]] name = "tqdm" @@ -1888,6 +2060,7 @@ version = "4.67.1" description = "Fast, Extensible Progress Meter" optional = false python-versions = ">=3.7" +groups = ["lint"] files = [ {file = "tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2"}, {file = "tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2"}, @@ -1909,6 +2082,7 @@ version = "5.9.5.20240516" description = "Typing stubs for psutil" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types-psutil-5.9.5.20240516.tar.gz", hash = "sha256:bb296f59fc56458891d0feb1994717e548a1bcf89936a2877df8792b822b4696"}, {file = "types_psutil-5.9.5.20240516-py3-none-any.whl", hash = "sha256:83146ded949a10167d9895e567b3b71e53ebc5e23fd8363eab62b3c76cce7b89"}, @@ -1920,6 +2094,7 @@ version = "2025.1.0.20250204" description = "Typing stubs for pytz" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "types_pytz-2025.1.0.20250204-py3-none-any.whl", hash = "sha256:32ca4a35430e8b94f6603b35beb7f56c32260ddddd4f4bb305fdf8f92358b87e"}, {file = "types_pytz-2025.1.0.20250204.tar.gz", hash = "sha256:00f750132769f1c65a4f7240bc84f13985b4da774bd17dfbe5d9cd442746bd49"}, @@ -1931,6 +2106,7 @@ version = "6.0.12.20241230" description = "Typing stubs for PyYAML" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types_PyYAML-6.0.12.20241230-py3-none-any.whl", hash = "sha256:fa4d32565219b68e6dee5f67534c722e53c00d1cfc09c435ef04d7353e1e96e6"}, {file = "types_pyyaml-6.0.12.20241230.tar.gz", hash = "sha256:7f07622dbd34bb9c8b264fe860a17e0efcad00d50b5f27e93984909d9363498c"}, @@ -1942,6 +2118,8 @@ version = "2.31.0.6" description = "Typing stubs for requests" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "platform_python_implementation == \"PyPy\" or python_version < \"3.10\"" files = [ {file = "types-requests-2.31.0.6.tar.gz", hash = "sha256:cd74ce3b53c461f1228a9b783929ac73a666658f223e28ed29753771477b3bd0"}, {file = "types_requests-2.31.0.6-py3-none-any.whl", hash = "sha256:a2db9cb228a81da8348b49ad6db3f5519452dd20a9c1e1a868c83c5fe88fd1a9"}, @@ -1956,6 +2134,8 @@ version = "2.32.0.20250306" description = "Typing stubs for requests" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "platform_python_implementation != \"PyPy\" and python_version >= \"3.10\"" files = [ {file = "types_requests-2.32.0.20250306-py3-none-any.whl", hash = "sha256:25f2cbb5c8710b2022f8bbee7b2b66f319ef14aeea2f35d80f18c9dbf3b60a0b"}, {file = "types_requests-2.32.0.20250306.tar.gz", hash = "sha256:0962352694ec5b2f95fda877ee60a159abdf84a0fc6fdace599f20acb41a03d1"}, @@ -1970,6 +2150,7 @@ version = "4.67.0.20250301" description = "Typing stubs for tqdm" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "types_tqdm-4.67.0.20250301-py3-none-any.whl", hash = "sha256:8af97deb8e6874af833555dc1fe0fcd456b1a789470bf6cd8813d4e7ee4f6c5b"}, {file = "types_tqdm-4.67.0.20250301.tar.gz", hash = "sha256:5e89a38ad89b867823368eb97d9f90d2fc69806bb055dde62716a05da62b5e0d"}, @@ -1984,6 +2165,8 @@ version = "1.26.25.14" description = "Typing stubs for urllib3" optional = false python-versions = "*" +groups = ["dev"] +markers = "platform_python_implementation == \"PyPy\" or python_version < \"3.10\"" files = [ {file = "types-urllib3-1.26.25.14.tar.gz", hash = "sha256:229b7f577c951b8c1b92c1bc2b2fdb0b49847bd2af6d1cc2a2e3dd340f3bda8f"}, {file = "types_urllib3-1.26.25.14-py3-none-any.whl", hash = "sha256:9683bbb7fb72e32bfe9d2be6e04875fbe1b3eeec3cbb4ea231435aa7fd6b4f0e"}, @@ -1995,6 +2178,7 @@ version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, @@ -2006,6 +2190,7 @@ version = "0.9.0" description = "Runtime inspection utilities for typing module." optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, @@ -2021,6 +2206,8 @@ version = "1.26.20" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +groups = ["main", "dev"] +markers = "platform_python_implementation == \"PyPy\" or python_version < \"3.10\"" files = [ {file = "urllib3-1.26.20-py2.py3-none-any.whl", hash = "sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e"}, {file = "urllib3-1.26.20.tar.gz", hash = "sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32"}, @@ -2037,6 +2224,8 @@ version = "2.3.0" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.9" +groups = ["main", "dev"] +markers = "platform_python_implementation != \"PyPy\" and python_version >= \"3.10\"" files = [ {file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"}, {file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"}, @@ -2054,6 +2243,7 @@ version = "0.29.0" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "uvicorn-0.29.0-py3-none-any.whl", hash = "sha256:2c2aac7ff4f4365c206fd773a39bf4ebd1047c238f8b8268ad996829323473de"}, {file = "uvicorn-0.29.0.tar.gz", hash = "sha256:6a69214c0b6a087462412670b3ef21224fa48cae0e452b5883e8e8bdfdd11dd0"}, @@ -2073,6 +2263,7 @@ version = "6.0.2" description = "Automatically mock your HTTP interactions to simplify and speed up testing" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "vcrpy-6.0.2-py2.py3-none-any.whl", hash = "sha256:40370223861181bc76a5e5d4b743a95058bb1ad516c3c08570316ab592f56cad"}, {file = "vcrpy-6.0.2.tar.gz", hash = "sha256:88e13d9111846745898411dbc74a75ce85870af96dd320d75f1ee33158addc09"}, @@ -2096,6 +2287,7 @@ version = "6.0.0" description = "Filesystem events monitoring" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "watchdog-6.0.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d1cdb490583ebd691c012b3d6dae011000fe42edb7a82ece80965b42abd61f26"}, {file = "watchdog-6.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bc64ab3bdb6a04d69d4023b29422170b74681784ffb9463ed4870cf2f3e66112"}, @@ -2138,6 +2330,7 @@ version = "1.17.2" description = "Module for decorators, wrappers and monkey patching." optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "wrapt-1.17.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3d57c572081fed831ad2d26fd430d565b76aa277ed1d30ff4d40670b1c0dd984"}, {file = "wrapt-1.17.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b5e251054542ae57ac7f3fba5d10bfff615b6c2fb09abeb37d2f1463f841ae22"}, @@ -2219,6 +2412,7 @@ files = [ {file = "wrapt-1.17.2-py3-none-any.whl", hash = "sha256:b18f2d1533a71f069c7f82d524a52599053d4c7166e9dd374ae2136b7f40f7c8"}, {file = "wrapt-1.17.2.tar.gz", hash = "sha256:41388e9d4d1522446fe79d3213196bd9e3b301a336965b9e27ca2788ebd122f3"}, ] +markers = {main = "extra == \"otel\""} [[package]] name = "yarl" @@ -2226,6 +2420,7 @@ version = "1.18.3" description = "Yet another URL library" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "yarl-1.18.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7df647e8edd71f000a5208fe6ff8c382a1de8edfbccdbbfe649d263de07d8c34"}, {file = "yarl-1.18.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c69697d3adff5aa4f874b19c0e4ed65180ceed6318ec856ebc423aa5850d84f7"}, @@ -2316,12 +2511,34 @@ idna = ">=2.0" multidict = ">=4.0" propcache = ">=0.2.0" +[[package]] +name = "zipp" +version = "3.21.0" +description = "Backport of pathlib-compatible object wrapper for zip files" +optional = true +python-versions = ">=3.9" +groups = ["main"] +markers = "extra == \"otel\"" +files = [ + {file = "zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931"}, + {file = "zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4"}, +] + +[package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +cover = ["pytest-cov"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-ignore-flaky"] +type = ["pytest-mypy"] + [[package]] name = "zstandard" version = "0.23.0" description = "Zstandard bindings for Python" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "zstandard-0.23.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bf0a05b6059c0528477fba9054d09179beb63744355cab9f38059548fedd46a9"}, {file = "zstandard-0.23.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fc9ca1c9718cb3b06634c7c8dec57d24e9438b2aa9a0f02b8bb36bf478538880"}, @@ -2430,10 +2647,11 @@ cffi = ["cffi (>=1.11)"] [extras] langsmith-pyo3 = ["langsmith-pyo3"] +otel = ["opentelemetry-api", "opentelemetry-sdk"] pytest = ["pytest", "rich"] vcr = [] [metadata] -lock-version = "2.0" +lock-version = "2.1" python-versions = ">=3.9,<4.0" -content-hash = "58926db79a7544278e7b234fb89860273a78a55d040f7651f313bf8f8b63d0cc" +content-hash = "c9905c20a3793b07e6809cbcc736a09e075716daf69db4ad4acc2749b2d513cf" diff --git a/python/pyproject.toml b/python/pyproject.toml index 3906666e37..294ead63d9 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -39,6 +39,10 @@ rich = {version = "^13.9.4", optional = true} pytest = {version = ">=7.0.0", optional = true} packaging = ">=23.2" +# Enabled via `otel` extra: `pip install langsmith[otel]` +opentelemetry-api = { version = "^1.30.0", optional = true } +opentelemetry-sdk = { version = "^1.30.0", optional = true } + [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" black = ">=23.3,<25.0" @@ -80,6 +84,7 @@ anthropic = "^0.45.0" [tool.poetry.extras] vcr = ["vcrpy"] langsmith_pyo3 = ["langsmith-pyo3"] +otel = ["opentelemetry-api", "opentelemetry-sdk"] pytest = ["pytest", "rich", "vcrpy"] [build-system] From 875a2cca6494f9df06986e8becc29d4b22c819b4 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 13:21:07 -0700 Subject: [PATCH 02/20] fix imports --- python/langsmith/_internal/otel/_otel_client.py | 5 +---- python/langsmith/client.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index 7172092bfc..e8189aebc4 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -27,9 +27,7 @@ def get_otlp_tracer_provider() -> TracerProvider: # Set LangSmith-specific defaults if not already set in environment if "OTEL_EXPORTER_OTLP_ENDPOINT" not in os.environ: ls_endpoint = ls_utils.get_api_url(None) - # os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = f"{ls_endpoint}/otel" - os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = "http://localhost:8080/otel" - print(f"OTEL_EXPORTER_OTLP_ENDPOINT set to {os.environ['OTEL_EXPORTER_OTLP_ENDPOINT']}") + os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = f"{ls_endpoint}/otel" # Configure headers with API key and project if available if "OTEL_EXPORTER_OTLP_HEADERS" not in os.environ: @@ -49,7 +47,6 @@ def get_otlp_tracer_provider() -> TracerProvider: tracer_provider = TracerProvider(resource=resource) - # The OTLPSpanExporter will use the environment variables we just set otlp_exporter = OTLPSpanExporter() span_processor = BatchSpanProcessor(otlp_exporter) tracer_provider.add_span_processor(span_processor) diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 1ce0a9cc69..54b413dba3 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -105,8 +105,14 @@ from langsmith._internal._serde import dumps_json as _dumps_json from langsmith.schemas import AttachmentInfo -from opentelemetry import trace -from opentelemetry.sdk.trace import TracerProvider +try: + from opentelemetry import trace as otel_trace + from opentelemetry.sdk.trace import TracerProvider +except ImportError: + # These imports are only available if the 'otel' extra is installed + # via pip install langsmith[otel] + otel_trace = None # type: ignore + TracerProvider = None # type: ignore try: from zoneinfo import ZoneInfo # type: ignore[import-not-found] @@ -590,7 +596,7 @@ def __init__( if otel_tracer_provider is None: otel_tracer_provider = get_otlp_tracer_provider() # Set as global tracer provider if we're creating a new one - trace.set_tracer_provider(otel_tracer_provider) + otel_trace.set_tracer_provider(otel_tracer_provider) self.otel_exporter: Optional[OTELExporter] = OTELExporter(tracer_provider=otel_tracer_provider) else: From f80fe61193e55894ff615b004efbd2f2c962a18c Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 13:23:02 -0700 Subject: [PATCH 03/20] remove unused import --- python/langsmith/_internal/otel/_otel_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index e8189aebc4..841e7f814f 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -4,7 +4,7 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.resources import Resource -from opentelemetry.sdk.trace.export import ConsoleSpanExporter, BatchSpanProcessor +from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.resources import SERVICE_NAME From 8bf0800face607648158e6199b89926839a149bf Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 13:32:33 -0700 Subject: [PATCH 04/20] lint long lines --- .../langsmith/_internal/_background_thread.py | 31 ++- .../langsmith/_internal/otel/_otel_client.py | 47 ++-- .../_internal/otel/_otel_exporter.py | 224 ++++++++++-------- python/langsmith/client.py | 10 +- 4 files changed, 180 insertions(+), 132 deletions(-) diff --git a/python/langsmith/_internal/_background_thread.py b/python/langsmith/_internal/_background_thread.py index 48ae7d1c1a..e940d6aebb 100644 --- a/python/langsmith/_internal/_background_thread.py +++ b/python/langsmith/_internal/_background_thread.py @@ -176,12 +176,12 @@ def _otel_tracing_thread_handle_batch( """Handle a batch of tracing queue items by exporting them to OTEL.""" try: ops = combine_serialized_queue_operations([item.item for item in batch]) - + run_ops = [op for op in ops if isinstance(op, SerializedRunOperation)] - + if run_ops and client.otel_exporter is not None: client.otel_exporter.export_batch(run_ops) - + except Exception: logger.error("Error in OTEL tracing queue", exc_info=True) # Exceptions are logged elsewhere, but we need to make sure the @@ -248,9 +248,14 @@ def tracing_control_thread_func(client_ref: weakref.ref[Client]) -> None: num_known_refs = 3 # Disable compression if explicitly set or if using OpenTelemetry - disable_compression = ls_utils.is_truish(ls_utils.get_env_var("DISABLE_RUN_COMPRESSION")) or client.otel_exporter is not None + disable_compression = ( + ls_utils.is_truish(ls_utils.get_env_var("DISABLE_RUN_COMPRESSION")) + or client.otel_exporter is not None + ) if not disable_compression and use_multipart: - if not (client.info.instance_flags or {}).get("zstd_compression_enabled", False): + if not (client.info.instance_flags or {}).get( + "zstd_compression_enabled", False + ): logger.warning( "Run compression is not enabled. Please update to the latest " "version of LangSmith. Falling back to regular multipart ingestion." @@ -304,7 +309,9 @@ def keep_thread_active() -> bool: if client.otel_exporter is not None: _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) else: - _tracing_thread_handle_batch(client, tracing_queue, next_batch, use_multipart) + _tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) # drain the queue on exit while next_batch := _tracing_thread_drain_queue( @@ -313,7 +320,9 @@ def keep_thread_active() -> bool: if client.otel_exporter is not None: _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) else: - _tracing_thread_handle_batch(client, tracing_queue, next_batch, use_multipart) + _tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) def tracing_control_thread_func_compress_parallel( @@ -474,9 +483,7 @@ def _tracing_sub_thread_func( if next_batch := _tracing_thread_drain_queue(tracing_queue, limit=size_limit): seen_successive_empty_queues = 0 if client.otel_exporter is not None: - _otel_tracing_thread_handle_batch( - client, tracing_queue, next_batch - ) + _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) else: _tracing_thread_handle_batch( client, tracing_queue, next_batch, use_multipart @@ -491,4 +498,6 @@ def _tracing_sub_thread_func( if client.otel_exporter is not None: _otel_tracing_thread_handle_batch(client, tracing_queue, next_batch) else: - _tracing_thread_handle_batch(client, tracing_queue, next_batch, use_multipart) + _tracing_thread_handle_batch( + client, tracing_queue, next_batch, use_multipart + ) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index 841e7f814f..7f4cc18b49 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -1,26 +1,37 @@ """Client configuration for OpenTelemetry integration with LangSmith.""" + import os + from langsmith import utils as ls_utils -from opentelemetry.sdk.trace import TracerProvider -from opentelemetry.sdk.resources import Resource -from opentelemetry.sdk.trace.export import BatchSpanProcessor -from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter -from opentelemetry.sdk.resources import SERVICE_NAME +try: + from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter + from opentelemetry.sdk.resources import SERVICE_NAME, Resource + from opentelemetry.sdk.trace import TracerProvider + from opentelemetry.sdk.trace.export import BatchSpanProcessor +except ImportError: + # These imports are only available if the 'otel' extra is installed + # via pip install langsmith[otel] + TracerProvider = None # type: ignore + Resource = None # type: ignore + BatchSpanProcessor = None # type: ignore + OTLPSpanExporter = None # type: ignore + SERVICE_NAME = None # type: ignore -def get_otlp_tracer_provider() -> TracerProvider: + +def get_otlp_tracer_provider() -> TracerProvider: # type: ignore """Get the OTLP tracer provider for LangSmith. - + This function creates a tracer provider that exports spans using the OTLP protocol with LangSmith-specific defaults: - + - OTEL_EXPORTER_OTLP_ENDPOINT: https://api.smith.langchain.com/otel - OTEL_EXPORTER_OTLP_HEADERS: Contains x-api-key from LangSmith API key and Langsmith-Project header if project is configured - + These defaults can be overridden by setting the environment variables before calling this function. - + Returns: TracerProvider: The OTLP tracer provider. """ @@ -28,25 +39,23 @@ def get_otlp_tracer_provider() -> TracerProvider: if "OTEL_EXPORTER_OTLP_ENDPOINT" not in os.environ: ls_endpoint = ls_utils.get_api_url(None) os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = f"{ls_endpoint}/otel" - + # Configure headers with API key and project if available if "OTEL_EXPORTER_OTLP_HEADERS" not in os.environ: api_key = ls_utils.get_api_key(None) headers = f"x-api-key={api_key}" - + project = ls_utils.get_tracer_project() if project: headers += f",Langsmith-Project={project}" - + os.environ["OTEL_EXPORTER_OTLP_HEADERS"] = headers - + service_name = os.environ.get("OTEL_SERVICE_NAME", "langsmith") - resource = Resource(attributes={ - SERVICE_NAME: service_name - }) - + resource = Resource(attributes={SERVICE_NAME: service_name}) + tracer_provider = TracerProvider(resource=resource) - + otlp_exporter = OTLPSpanExporter() span_processor = BatchSpanProcessor(otlp_exporter) tracer_provider.add_span_processor(span_processor) diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index 1b00d85d17..01064f7f13 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -1,19 +1,25 @@ """OpenTelemetry exporter for LangSmith runs.""" + import datetime -import json import logging import uuid -from typing import Any, Dict, List, Optional, Tuple +from typing import Any, List, Optional, Tuple -from opentelemetry import trace from langsmith._internal import _orjson - -from opentelemetry.trace import set_span_in_context, Span - from langsmith._internal._operations import ( SerializedRunOperation, ) +try: + from opentelemetry import trace + from opentelemetry.trace import Span, set_span_in_context +except ImportError: + # These imports are only available if the 'otel' extra is installed + # via pip install langsmith[otel] + trace = None # type: ignore + set_span_in_context = None # type: ignore + Span = None # type: ignore + logger = logging.getLogger(__name__) # OpenTelemetry GenAI semconv attribute names @@ -52,32 +58,28 @@ GEN_AI_CHOICE = "gen_ai.choice" - class OTELExporter: __slots__ = ["_tracer", "_spans"] """OpenTelemetry exporter for LangSmith runs.""" - + def __init__(self, tracer_provider=None): """Initialize the OTEL exporter. - + Args: tracer_provider: Optional tracer provider to use. If not provided, the global tracer provider will be used. """ - self._tracer = trace.get_tracer( - "langsmith", - tracer_provider=tracer_provider - ) + self._tracer = trace.get_tracer("langsmith", tracer_provider=tracer_provider) self._spans = {} def export_batch(self, operations: List[SerializedRunOperation]) -> None: """Export a batch of serialized run operations to OTEL. - + Args: operations: List of serialized run operations to export. """ # Create a dictionary mapping run IDs to their operations - + for op in operations: try: run_info = self._deserialize_run_info(op) @@ -91,15 +93,16 @@ def export_batch(self, operations: List[SerializedRunOperation]) -> None: self._update_span_for_run(op, run_info) except Exception as e: logger.exception(f"Error processing operation {op.id}: {e}") - + def _deserialize_run_info(self, op: SerializedRunOperation) -> Optional[dict]: """Deserialize the run info from the operation. - + Args: op: The serialized run operation. - + Returns: - The deserialized run info as a dictionary, or None if deserialization failed. + The deserialized run info as a dictionary, or None if deserialization + failed. """ try: run_info = _orjson.loads(op._none) @@ -109,19 +112,19 @@ def _deserialize_run_info(self, op: SerializedRunOperation) -> Optional[dict]: except Exception as e: logger.exception(f"Failed to deserialize run info for {op.id}: {e}") return None - + def _create_span_for_run( - self, - op: SerializedRunOperation, - run_info: dict, + self, + op: SerializedRunOperation, + run_info: dict, ) -> Optional[Span]: """Create an OpenTelemetry span for a run operation. - + Args: op: The serialized run operation. run_info: The deserialized run info. parent_span: Optional parent span. - + Returns: The created span, or None if creation failed. """ @@ -131,7 +134,7 @@ def _create_span_for_run( end_time = run_info.get("end_time") end_time_utc_nano = self._as_utc_nano(end_time) - + # Start the span parent_run_id = run_info.get("parent_run_id") if parent_run_id is not None and uuid.UUID(parent_run_id) in self._spans: @@ -145,10 +148,10 @@ def _create_span_for_run( run_info.get("name"), start_time=start_time_utc_nano, ) - + # Set all attributes self._set_span_attributes(span, run_info, op) - + # Set status based on error if run_info.get("error"): span.set_status(trace.StatusCode.ERROR) @@ -169,11 +172,10 @@ def _create_span_for_run( except Exception as e: logger.exception(f"Failed to create span for run {op.id}: {e}") return None - - + def _update_span_for_run(self, op: SerializedRunOperation, run_info: dict) -> None: """Update an OpenTelemetry span for a run operation. - + Args: op: The serialized run operation. run_info: The deserialized run info. @@ -183,9 +185,9 @@ def _update_span_for_run(self, op: SerializedRunOperation, run_info: dict) -> No if op.id not in self._spans: logger.debug(f"No span found for run {op.id} during update") return - + span = self._spans[op.id] - + # Update attributes self._set_span_attributes(span, run_info, op) # Update status based on error @@ -194,7 +196,7 @@ def _update_span_for_run(self, op: SerializedRunOperation, run_info: dict) -> No span.record_exception(Exception(run_info.get("error"))) else: span.set_status(trace.StatusCode.OK) - + # End the span if end_time is present end_time = run_info.get("end_time") if end_time: @@ -205,28 +207,27 @@ def _update_span_for_run(self, op: SerializedRunOperation, run_info: dict) -> No span.end() # Remove the span from our dictionary del self._spans[op.id] - + except Exception as e: logger.exception(f"Failed to update span for run {op.id}: {e}") - def _extract_model_name(self, run_info: dict) -> Optional[str]: """Extract model name from run info. - + Args: run_info: The run info. - + Returns: The model name, or None if not found. """ # Try to get model name from metadata if run_info.get("extra") and run_info["extra"].get("metadata"): metadata = run_info["extra"]["metadata"] - + # First check for ls_model_name in metadata if metadata.get("ls_model_name"): return metadata["ls_model_name"] - + # Then check invocation_params for model info if "invocation_params" in metadata: invocation_params = metadata["invocation_params"] @@ -235,12 +236,14 @@ def _extract_model_name(self, run_info: dict) -> Optional[str]: return invocation_params["model"] elif invocation_params.get("model_name"): return invocation_params["model_name"] - + return None - - def _set_span_attributes(self, span: Span, run_info: dict, op: SerializedRunOperation) -> None: + + def _set_span_attributes( + self, span: Span, run_info: dict, op: SerializedRunOperation + ) -> None: """Set attributes on the span. - + Args: span: The span to set attributes on. run_info: The deserialized run info. @@ -249,49 +252,55 @@ def _set_span_attributes(self, span: Span, run_info: dict, op: SerializedRunOper # Set LangSmith-specific attributes span.set_attribute(LANGSMITH_RUN_ID, str(op.id)) span.set_attribute(LANGSMITH_TRACE_ID, str(op.trace_id)) - + if run_info.get("dotted_order"): - span.set_attribute(LANGSMITH_DOTTED_ORDER, str(run_info.get("dotted_order"))) - + span.set_attribute( + LANGSMITH_DOTTED_ORDER, str(run_info.get("dotted_order")) + ) + if run_info.get("parent_run_id"): - span.set_attribute(LANGSMITH_PARENT_RUN_ID, str(run_info.get("parent_run_id"))) + span.set_attribute( + LANGSMITH_PARENT_RUN_ID, str(run_info.get("parent_run_id")) + ) if run_info.get("run_type"): span.set_attribute(LANGSMITH_RUN_TYPE, str(run_info.get("run_type"))) - + if run_info.get("name"): span.set_attribute(LANGSMITH_NAME, str(run_info.get("name"))) if run_info.get("session_id"): span.set_attribute(LANGSMITH_SESSION_ID, str(run_info.get("session_id"))) if run_info.get("session_name"): - span.set_attribute(LANGSMITH_SESSION_NAME, str(run_info.get("session_name"))) - + span.set_attribute( + LANGSMITH_SESSION_NAME, str(run_info.get("session_name")) + ) + # Set GenAI attributes according to OTEL semantic conventions # Set gen_ai.operation.name operation_name = run_info.get("run_type", "chain") span.set_attribute(GEN_AI_OPERATION_NAME, operation_name) - + # Set gen_ai.system self._set_gen_ai_system(span, run_info) - + # Set model name if available model_name = self._extract_model_name(run_info) if model_name: span.set_attribute(GEN_AI_REQUEST_MODEL, model_name) - + # Set token usage information if run_info.get("prompt_tokens") is not None: prompt_tokens = run_info["prompt_tokens"] span.set_attribute(GEN_AI_USAGE_INPUT_TOKENS, int(prompt_tokens)) - + if run_info.get("completion_tokens") is not None: completion_tokens = run_info["completion_tokens"] span.set_attribute(GEN_AI_USAGE_OUTPUT_TOKENS, int(completion_tokens)) - + if run_info.get("total_tokens") is not None: total_tokens = run_info["total_tokens"] span.set_attribute(GEN_AI_USAGE_TOTAL_TOKENS, int(total_tokens)) - + # Set other parameters from invocation_params self._set_invocation_parameters(span, run_info) @@ -300,28 +309,27 @@ def _set_span_attributes(self, span: Span, run_info: dict, op: SerializedRunOper metadata = extra.get("metadata", {}) for key, value in metadata.items(): span.set_attribute(f"{LANGSMITH_METADATA}.{key}", value) - + tags = run_info.get("tags") if tags: if isinstance(tags, list): span.set_attribute(LANGSMITH_TAGS, ", ".join(tags)) else: span.set_attribute(LANGSMITH_TAGS, tags) - - + # Set inputs/outputs if available self._set_io_attributes(span, op) def _set_gen_ai_system(self, span: Span, run_info: dict) -> None: """Set the gen_ai.system attribute on the span based on the model provider. - + Args: span: The span to set attributes on. run_info: The deserialized run info. """ # Default to "langchain" if we can't determine the system system = "langchain" - + # Extract model name to determine the system model_name = self._extract_model_name(run_info) if model_name: @@ -354,47 +362,53 @@ def _set_gen_ai_system(self, span: Span, run_info: dict) -> None: system = "vertex_ai" elif "xai" in model_lower or "grok" in model_lower: system = "xai" - + span.set_attribute(GEN_AI_SYSTEM, system) setattr(span, "_gen_ai_system", system) - + def _set_invocation_parameters(self, span: Span, run_info: dict) -> None: """Set invocation parameters on the span. - + Args: span: The span to set attributes on. run_info: The deserialized run info. """ if not (run_info.get("extra") and run_info["extra"].get("metadata")): return - + metadata = run_info["extra"]["metadata"] if "invocation_params" not in metadata: return - + invocation_params = metadata["invocation_params"] - + # Set relevant invocation parameters if "max_tokens" in invocation_params: - span.set_attribute(GEN_AI_REQUEST_MAX_TOKENS, invocation_params["max_tokens"]) - + span.set_attribute( + GEN_AI_REQUEST_MAX_TOKENS, invocation_params["max_tokens"] + ) + if "temperature" in invocation_params: - span.set_attribute(GEN_AI_REQUEST_TEMPERATURE, invocation_params["temperature"]) - + span.set_attribute( + GEN_AI_REQUEST_TEMPERATURE, invocation_params["temperature"] + ) + if "top_p" in invocation_params: span.set_attribute(GEN_AI_REQUEST_TOP_P, invocation_params["top_p"]) - + if "frequency_penalty" in invocation_params: - span.set_attribute(GEN_AI_REQUEST_FREQUENCY_PENALTY, invocation_params["frequency_penalty"]) - - if "presence_penalty" in invocation_params: - span.set_attribute(GEN_AI_REQUEST_PRESENCE_PENALTY, invocation_params["presence_penalty"]) + span.set_attribute( + GEN_AI_REQUEST_FREQUENCY_PENALTY, invocation_params["frequency_penalty"] + ) + if "presence_penalty" in invocation_params: + span.set_attribute( + GEN_AI_REQUEST_PRESENCE_PENALTY, invocation_params["presence_penalty"] + ) - def _set_io_attributes(self, span: Span, op: SerializedRunOperation) -> None: """Set input/output attributes on the span. - + Args: span: The span to set attributes on. op: The serialized run operation. @@ -402,33 +416,43 @@ def _set_io_attributes(self, span: Span, op: SerializedRunOperation) -> None: if op.inputs: try: inputs = _orjson.loads(op.inputs) - - if isinstance(inputs, dict) and 'model' in inputs and isinstance(inputs.get('messages'), list): - span.set_attribute(GEN_AI_REQUEST_MODEL, inputs['model']) - + + if ( + isinstance(inputs, dict) + and "model" in inputs + and isinstance(inputs.get("messages"), list) + ): + span.set_attribute(GEN_AI_REQUEST_MODEL, inputs["model"]) + span.set_attribute(GENAI_PROMPT, op.inputs) - + except Exception: - logger.debug("Failed to process inputs for run %s", op.id, exc_info=True) - + logger.debug( + "Failed to process inputs for run %s", op.id, exc_info=True + ) + if op.outputs: try: outputs = _orjson.loads(op.outputs) - + # Extract token usage from outputs (for LLM runs) token_usage = self.get_unified_run_tokens(outputs) if token_usage: span.set_attribute(GEN_AI_USAGE_INPUT_TOKENS, token_usage[0]) span.set_attribute(GEN_AI_USAGE_OUTPUT_TOKENS, token_usage[1]) - span.set_attribute(GEN_AI_USAGE_TOTAL_TOKENS, token_usage[0] + token_usage[1]) - - if 'model' in outputs: - span.set_attribute(GEN_AI_RESPONSE_MODEL, str(outputs['model'])) - + span.set_attribute( + GEN_AI_USAGE_TOTAL_TOKENS, token_usage[0] + token_usage[1] + ) + + if "model" in outputs: + span.set_attribute(GEN_AI_RESPONSE_MODEL, str(outputs["model"])) + span.set_attribute(GENAI_COMPLETION, op.outputs) - + except Exception: - logger.debug("Failed to process outputs for run %s", op.id, exc_info=True) + logger.debug( + "Failed to process outputs for run %s", op.id, exc_info=True + ) def _as_utc_nano(self, timestamp: Optional[str]) -> Optional[int]: if not timestamp: @@ -438,7 +462,7 @@ def _as_utc_nano(self, timestamp: Optional[str]) -> Optional[int]: return int(dt.astimezone(datetime.timezone.utc).timestamp() * 1_000_000_000) except ValueError: logger.exception(f"Failed to parse timestamp {timestamp}") - return None + return None def get_unified_run_tokens(self, outputs: dict | None) -> Tuple[int, int] | None: if not outputs: @@ -455,7 +479,9 @@ def get_unified_run_tokens(self, outputs: dict | None) -> Tuple[int, int] | None if not haystack or not isinstance(haystack, dict): continue - if output := self._extract_unified_run_tokens(haystack.get("usage_metadata")): + if output := self._extract_unified_run_tokens( + haystack.get("usage_metadata") + ): return output if ( @@ -492,8 +518,10 @@ def get_unified_run_tokens(self, outputs: dict | None) -> Tuple[int, int] | None ): return output return None - - def _extract_unified_run_tokens(self, outputs: Any | None) -> Tuple[int, int] | None: + + def _extract_unified_run_tokens( + self, outputs: Any | None + ) -> Tuple[int, int] | None: if not outputs or not isinstance(outputs, dict): return None diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 54b413dba3..fad7fa5bc5 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -100,9 +100,9 @@ serialized_feedback_operation_to_multipart_parts_and_context, serialized_run_operation_to_multipart_parts_and_context, ) -from langsmith._internal.otel._otel_exporter import OTELExporter -from langsmith._internal.otel._otel_client import get_otlp_tracer_provider from langsmith._internal._serde import dumps_json as _dumps_json +from langsmith._internal.otel._otel_client import get_otlp_tracer_provider +from langsmith._internal.otel._otel_exporter import OTELExporter from langsmith.schemas import AttachmentInfo try: @@ -597,8 +597,10 @@ def __init__( otel_tracer_provider = get_otlp_tracer_provider() # Set as global tracer provider if we're creating a new one otel_trace.set_tracer_provider(otel_tracer_provider) - - self.otel_exporter: Optional[OTELExporter] = OTELExporter(tracer_provider=otel_tracer_provider) + + self.otel_exporter: Optional[OTELExporter] = OTELExporter( + tracer_provider=otel_tracer_provider + ) else: self.otel_exporter = None From acad6e541f4b36a8d7ea00f1d0bc72f1d345bbf6 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 13:52:55 -0700 Subject: [PATCH 05/20] fix mypy imports --- python/langsmith/_internal/otel/_otel_client.py | 8 ++++---- python/langsmith/_internal/otel/_otel_exporter.py | 10 +++++----- python/langsmith/client.py | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index 7f4cc18b49..922f00cc1b 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -5,10 +5,10 @@ from langsmith import utils as ls_utils try: - from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter - from opentelemetry.sdk.resources import SERVICE_NAME, Resource - from opentelemetry.sdk.trace import TracerProvider - from opentelemetry.sdk.trace.export import BatchSpanProcessor + from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter # type: ignore + from opentelemetry.sdk.resources import SERVICE_NAME, Resource # type: ignore + from opentelemetry.sdk.trace import TracerProvider # type: ignore + from opentelemetry.sdk.trace.export import BatchSpanProcessor # type: ignore except ImportError: # These imports are only available if the 'otel' extra is installed # via pip install langsmith[otel] diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index 01064f7f13..97423efff1 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -11,8 +11,8 @@ ) try: - from opentelemetry import trace - from opentelemetry.trace import Span, set_span_in_context + from opentelemetry import trace # type: ignore + from opentelemetry.trace import Span, set_span_in_context # type: ignore except ImportError: # These imports are only available if the 'otel' extra is installed # via pip install langsmith[otel] @@ -464,7 +464,7 @@ def _as_utc_nano(self, timestamp: Optional[str]) -> Optional[int]: logger.exception(f"Failed to parse timestamp {timestamp}") return None - def get_unified_run_tokens(self, outputs: dict | None) -> Tuple[int, int] | None: + def get_unified_run_tokens(self, outputs: Optional[dict]) -> Optional[Tuple[int, int]]: if not outputs: return None @@ -520,8 +520,8 @@ def get_unified_run_tokens(self, outputs: dict | None) -> Tuple[int, int] | None return None def _extract_unified_run_tokens( - self, outputs: Any | None - ) -> Tuple[int, int] | None: + self, outputs: Optional[Any] + ) -> Optional[Tuple[int, int]]: if not outputs or not isinstance(outputs, dict): return None diff --git a/python/langsmith/client.py b/python/langsmith/client.py index fad7fa5bc5..e593fe56a0 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -106,8 +106,8 @@ from langsmith.schemas import AttachmentInfo try: - from opentelemetry import trace as otel_trace - from opentelemetry.sdk.trace import TracerProvider + from opentelemetry import trace as otel_trace # type: ignore + from opentelemetry.sdk.trace import TracerProvider # type: ignore except ImportError: # These imports are only available if the 'otel' extra is installed # via pip install langsmith[otel] From 32326188caf6d990c3b523e29e5e930b16a2e677 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 13:58:01 -0700 Subject: [PATCH 06/20] lint --- python/langsmith/_internal/otel/_otel_client.py | 4 +++- python/langsmith/_internal/otel/_otel_exporter.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index 922f00cc1b..818a56dfba 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -5,7 +5,9 @@ from langsmith import utils as ls_utils try: - from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter # type: ignore + from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( + OTLPSpanExporter, # type: ignore + ) from opentelemetry.sdk.resources import SERVICE_NAME, Resource # type: ignore from opentelemetry.sdk.trace import TracerProvider # type: ignore from opentelemetry.sdk.trace.export import BatchSpanProcessor # type: ignore diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index 97423efff1..cd3d10c6d7 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -464,7 +464,9 @@ def _as_utc_nano(self, timestamp: Optional[str]) -> Optional[int]: logger.exception(f"Failed to parse timestamp {timestamp}") return None - def get_unified_run_tokens(self, outputs: Optional[dict]) -> Optional[Tuple[int, int]]: + def get_unified_run_tokens( + self, outputs: Optional[dict] + ) -> Optional[Tuple[int, int]]: if not outputs: return None From 71a7ef7d8f79122e905813318c4a9b42e136b3a8 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 14:06:33 -0700 Subject: [PATCH 07/20] Add integration test --- .../python-integration-tests/action.yml | 2 +- python/tests/integration_tests/test_client.py | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/.github/actions/python-integration-tests/action.yml b/.github/actions/python-integration-tests/action.yml index c1884c7e57..31f704a0f6 100644 --- a/.github/actions/python-integration-tests/action.yml +++ b/.github/actions/python-integration-tests/action.yml @@ -40,7 +40,7 @@ runs: - name: Install dependencies run: | poetry install --with dev - poetry run pip install -U langchain langchain-openai langchain-anthropic tiktoken rapidfuzz vcrpy numpy + poetry run pip install -U langchain langchain-openai langchain-anthropic tiktoken rapidfuzz vcrpy numpy opentelemetry-api opentelemetry-sdk shell: bash working-directory: python diff --git a/python/tests/integration_tests/test_client.py b/python/tests/integration_tests/test_client.py index 10ffd08fd5..24f3315a35 100644 --- a/python/tests/integration_tests/test_client.py +++ b/python/tests/integration_tests/test_client.py @@ -3012,3 +3012,47 @@ def _get_run(run_id: ID_TYPE) -> bool: # Clean up langchain_client.delete_annotation_queue(queue.id) + + +def test_otel_trace_export(monkeypatch: pytest.MonkeyPatch): + monkeypatch.setenv("LANGCHAIN_OTEL_ENABLED", "true") + + client = Client(api_key="test-key") + + assert client.otel_exporter is not None, "OTEL exporter should be enabled." + + run_id = uuid4() + start_time = datetime.datetime.now(datetime.timezone.utc) + end_time = start_time + datetime.timedelta(seconds=2) + + client.create_run( + id=run_id, + name="OTEL Export Test", + run_type="llm", + inputs={"prompt": "Hello, OTEL!"}, + start_time=start_time, + end_time=end_time, + ) + + client.update_run( + run_id=run_id, + outputs={"answer": "Hello, User!"}, + extra={"metadata": {"foo": "bar"}}, + tags=["otel", "test"], + end_time=end_time, + ) + + # Wait until the run is ingested by LangSmith. + wait_for(lambda: client.read_run(run_id).end_time is not None) + + # Retrieve the run from LangSmith. + retrieved_run = client.read_run(run_id) + assert retrieved_run.id == run_id + assert retrieved_run.start_time == start_time + assert retrieved_run.end_time == end_time + assert retrieved_run.name == "OTEL Export Test" + assert retrieved_run.run_type == "llm" + assert retrieved_run.inputs == {"prompt": "Hello, OTEL!"} + assert retrieved_run.outputs == {"answer": "Hello, User!"} + assert retrieved_run.extra == {"metadata": {"foo": "bar"}} + assert retrieved_run.tags == ["otel", "test"] From 8a3021bc65ddb5bb67c61c41ec4eeab73c909087 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 14:38:46 -0700 Subject: [PATCH 08/20] imports --- .../langsmith/_internal/otel/_otel_client.py | 25 ++++++------------- .../_internal/otel/_otel_exporter.py | 13 +++------- python/langsmith/client.py | 25 +++++++++++-------- 3 files changed, 24 insertions(+), 39 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index 818a56dfba..1748d5f574 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -1,27 +1,16 @@ """Client configuration for OpenTelemetry integration with LangSmith.""" import os - from langsmith import utils as ls_utils -try: - from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( - OTLPSpanExporter, # type: ignore - ) - from opentelemetry.sdk.resources import SERVICE_NAME, Resource # type: ignore - from opentelemetry.sdk.trace import TracerProvider # type: ignore - from opentelemetry.sdk.trace.export import BatchSpanProcessor # type: ignore -except ImportError: - # These imports are only available if the 'otel' extra is installed - # via pip install langsmith[otel] - TracerProvider = None # type: ignore - Resource = None # type: ignore - BatchSpanProcessor = None # type: ignore - OTLPSpanExporter = None # type: ignore - SERVICE_NAME = None # type: ignore - +from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( + OTLPSpanExporter, +) # type: ignore[import-untyped] +from opentelemetry.sdk.resources import SERVICE_NAME, Resource # type: ignore[import-untyped] +from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-untyped] +from opentelemetry.sdk.trace.export import BatchSpanProcessor # type: ignore[import-untyped] -def get_otlp_tracer_provider() -> TracerProvider: # type: ignore +def get_otlp_tracer_provider() -> TracerProvider: """Get the OTLP tracer provider for LangSmith. This function creates a tracer provider that exports spans using the OTLP protocol diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index cd3d10c6d7..6f1a50584d 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -3,22 +3,15 @@ import datetime import logging import uuid -from typing import Any, List, Optional, Tuple +from typing import Any, List, Optional, Tuple, TYPE_CHECKING from langsmith._internal import _orjson from langsmith._internal._operations import ( SerializedRunOperation, ) -try: - from opentelemetry import trace # type: ignore - from opentelemetry.trace import Span, set_span_in_context # type: ignore -except ImportError: - # These imports are only available if the 'otel' extra is installed - # via pip install langsmith[otel] - trace = None # type: ignore - set_span_in_context = None # type: ignore - Span = None # type: ignore +from opentelemetry import trace # type: ignore[import-untyped] +from opentelemetry.trace import Span, set_span_in_context # type: ignore[import-untyped] logger = logging.getLogger(__name__) diff --git a/python/langsmith/client.py b/python/langsmith/client.py index e593fe56a0..ed00bfc850 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -101,19 +101,8 @@ serialized_run_operation_to_multipart_parts_and_context, ) from langsmith._internal._serde import dumps_json as _dumps_json -from langsmith._internal.otel._otel_client import get_otlp_tracer_provider -from langsmith._internal.otel._otel_exporter import OTELExporter from langsmith.schemas import AttachmentInfo -try: - from opentelemetry import trace as otel_trace # type: ignore - from opentelemetry.sdk.trace import TracerProvider # type: ignore -except ImportError: - # These imports are only available if the 'otel' extra is installed - # via pip install langsmith[otel] - otel_trace = None # type: ignore - TracerProvider = None # type: ignore - try: from zoneinfo import ZoneInfo # type: ignore[import-not-found] except ImportError: @@ -121,6 +110,11 @@ class ZoneInfo: # type: ignore[no-redef] """Introduced in python 3.9.""" +try: + from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-untyped] +except ImportError: + class TracerProvider: # type: ignore[no-redef] + """Used for optional OTEL tracing.""" if TYPE_CHECKING: import pandas as pd # type: ignore @@ -593,6 +587,15 @@ def __init__( self._manual_cleanup = False if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): + try: + from opentelemetry import trace as otel_trace + from langsmith._internal.otel._otel_client import get_otlp_tracer_provider + from langsmith._internal.otel._otel_exporter import OTELExporter + except ImportError as e: + raise ImportError( + "OpenTelemetry packages are required for OTEL tracing. " + "Install them with: pip install langsmith[otel]" + ) from e if otel_tracer_provider is None: otel_tracer_provider = get_otlp_tracer_provider() # Set as global tracer provider if we're creating a new one From db26d3872183437472d13fde4fe435ad69da8145 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 14:39:06 -0700 Subject: [PATCH 09/20] fmt --- python/langsmith/_internal/otel/_otel_client.py | 13 ++++++++++--- python/langsmith/_internal/otel/_otel_exporter.py | 11 +++++++---- python/langsmith/client.py | 10 ++++++++-- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index 1748d5f574..cb212653aa 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -1,14 +1,21 @@ """Client configuration for OpenTelemetry integration with LangSmith.""" import os -from langsmith import utils as ls_utils from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( OTLPSpanExporter, ) # type: ignore[import-untyped] -from opentelemetry.sdk.resources import SERVICE_NAME, Resource # type: ignore[import-untyped] +from opentelemetry.sdk.resources import ( # type: ignore[import-untyped] + SERVICE_NAME, + Resource, +) from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-untyped] -from opentelemetry.sdk.trace.export import BatchSpanProcessor # type: ignore[import-untyped] +from opentelemetry.sdk.trace.export import ( + BatchSpanProcessor, # type: ignore[import-untyped] +) + +from langsmith import utils as ls_utils + def get_otlp_tracer_provider() -> TracerProvider: """Get the OTLP tracer provider for LangSmith. diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index 6f1a50584d..6503017b86 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -3,16 +3,19 @@ import datetime import logging import uuid -from typing import Any, List, Optional, Tuple, TYPE_CHECKING +from typing import Any, List, Optional, Tuple + +from opentelemetry import trace # type: ignore[import-untyped] +from opentelemetry.trace import ( # type: ignore[import-untyped] + Span, + set_span_in_context, +) from langsmith._internal import _orjson from langsmith._internal._operations import ( SerializedRunOperation, ) -from opentelemetry import trace # type: ignore[import-untyped] -from opentelemetry.trace import Span, set_span_in_context # type: ignore[import-untyped] - logger = logging.getLogger(__name__) # OpenTelemetry GenAI semconv attribute names diff --git a/python/langsmith/client.py b/python/langsmith/client.py index ed00bfc850..de257185c9 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -110,12 +110,15 @@ class ZoneInfo: # type: ignore[no-redef] """Introduced in python 3.9.""" + try: - from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-untyped] + from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-untyped] except ImportError: + class TracerProvider: # type: ignore[no-redef] """Used for optional OTEL tracing.""" + if TYPE_CHECKING: import pandas as pd # type: ignore from langchain_core.runnables import Runnable @@ -589,7 +592,10 @@ def __init__( if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): try: from opentelemetry import trace as otel_trace - from langsmith._internal.otel._otel_client import get_otlp_tracer_provider + + from langsmith._internal.otel._otel_client import ( + get_otlp_tracer_provider, + ) from langsmith._internal.otel._otel_exporter import OTELExporter except ImportError as e: raise ImportError( From 5270ff3e159d368987ae5c2278b66a7569b00f6a Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 14:44:21 -0700 Subject: [PATCH 10/20] maybe fix imports --- python/langsmith/_internal/otel/_otel_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index cb212653aa..f7c335d86c 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -10,8 +10,8 @@ Resource, ) from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-untyped] -from opentelemetry.sdk.trace.export import ( - BatchSpanProcessor, # type: ignore[import-untyped] +from opentelemetry.sdk.trace.export import ( # type: ignore[import-untyped] + BatchSpanProcessor, ) from langsmith import utils as ls_utils From 2827b9abc953ab4c712adff4bf33d18884fe83d4 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 14:45:52 -0700 Subject: [PATCH 11/20] import not found --- python/langsmith/_internal/otel/_otel_client.py | 8 ++++---- python/langsmith/_internal/otel/_otel_exporter.py | 4 ++-- python/langsmith/client.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index f7c335d86c..52e8854f16 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -4,13 +4,13 @@ from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( OTLPSpanExporter, -) # type: ignore[import-untyped] -from opentelemetry.sdk.resources import ( # type: ignore[import-untyped] +) # type: ignore[import-not-found] +from opentelemetry.sdk.resources import ( # type: ignore[import-not-found] SERVICE_NAME, Resource, ) -from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-untyped] -from opentelemetry.sdk.trace.export import ( # type: ignore[import-untyped] +from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-not-found] +from opentelemetry.sdk.trace.export import ( # type: ignore[import-not-found] BatchSpanProcessor, ) diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index 6503017b86..0f85ce6793 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -5,8 +5,8 @@ import uuid from typing import Any, List, Optional, Tuple -from opentelemetry import trace # type: ignore[import-untyped] -from opentelemetry.trace import ( # type: ignore[import-untyped] +from opentelemetry import trace # type: ignore[import-not-found] +from opentelemetry.trace import ( # type: ignore[import-not-found] Span, set_span_in_context, ) diff --git a/python/langsmith/client.py b/python/langsmith/client.py index de257185c9..14a6f8acbb 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -112,7 +112,7 @@ class ZoneInfo: # type: ignore[no-redef] try: - from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-untyped] + from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-not-found] except ImportError: class TracerProvider: # type: ignore[no-redef] From 71a38bffe9f50dacf153eddce0b4e37d0c5ef531 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 15:00:04 -0700 Subject: [PATCH 12/20] Add http exporter module --- python/poetry.lock | 371 ++++++++++++++++++++---------------------- python/pyproject.toml | 5 +- 2 files changed, 175 insertions(+), 201 deletions(-) diff --git a/python/poetry.lock b/python/poetry.lock index a28d5a5a49..e6adae65de 100644 --- a/python/poetry.lock +++ b/python/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "annotated-types" @@ -6,7 +6,6 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" -groups = ["main", "dev", "lint", "test"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, @@ -18,7 +17,6 @@ version = "0.45.2" description = "The official Python library for the anthropic API" optional = false python-versions = ">=3.8" -groups = ["test"] files = [ {file = "anthropic-0.45.2-py3-none-any.whl", hash = "sha256:ecd746f7274451dfcb7e1180571ead624c7e1195d1d46cb7c70143d2aedb4d35"}, {file = "anthropic-0.45.2.tar.gz", hash = "sha256:32a18b9ecd12c91b2be4cae6ca2ab46a06937b5aa01b21308d97a6d29794fb5e"}, @@ -43,7 +41,6 @@ version = "4.8.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.9" -groups = ["main", "dev", "lint", "test"] files = [ {file = "anyio-4.8.0-py3-none-any.whl", hash = "sha256:b5011f270ab5eb0abf13385f851315585cc37ef330dd88e27ec3d34d651fd47a"}, {file = "anyio-4.8.0.tar.gz", hash = "sha256:1d9fe889df5212298c0c0723fa20479d1b94883a2df44bd3897aa91083316f7a"}, @@ -66,7 +63,6 @@ version = "25.1.0" description = "Classes Without Boilerplate" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "attrs-25.1.0-py3-none-any.whl", hash = "sha256:c75a69e28a550a7e93789579c22aa26b0f5b83b75dc4e08fe092980051e1090a"}, {file = "attrs-25.1.0.tar.gz", hash = "sha256:1c97078a80c814273a76b2a298a932eb681c87415c11dee0a6921de7f1b02c3e"}, @@ -86,7 +82,6 @@ version = "24.10.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "black-24.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e6668650ea4b685440857138e5fe40cde4d652633b1bdffc62933d0db4ed9812"}, {file = "black-24.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1c536fcf674217e87b8cc3657b81809d3c085d7bf3ef262ead700da345bfa6ea"}, @@ -133,7 +128,6 @@ version = "2025.1.31" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" -groups = ["main", "dev", "lint", "test"] files = [ {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, @@ -145,8 +139,6 @@ version = "1.17.1" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" -groups = ["main"] -markers = "platform_python_implementation == \"PyPy\"" files = [ {file = "cffi-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14"}, {file = "cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67"}, @@ -226,7 +218,6 @@ version = "3.4.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7" -groups = ["main"] files = [ {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, @@ -328,7 +319,6 @@ version = "8.1.8" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" -groups = ["dev"] files = [ {file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"}, {file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"}, @@ -343,12 +333,10 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -groups = ["main", "dev", "lint", "test"] files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] -markers = {main = "sys_platform == \"win32\"", dev = "sys_platform == \"win32\" or platform_system == \"Windows\"", lint = "platform_system == \"Windows\"", test = "sys_platform == \"win32\""} [[package]] name = "coverage" @@ -356,7 +344,6 @@ version = "7.6.12" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "coverage-7.6.12-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:704c8c8c6ce6569286ae9622e534b4f5b9759b6f2cd643f1c1a61f666d534fe8"}, {file = "coverage-7.6.12-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ad7525bf0241e5502168ae9c643a2f6c219fa0a283001cee4cf23a9b7da75879"}, @@ -435,7 +422,6 @@ version = "0.6.7" description = "Easily serialize dataclasses to and from JSON." optional = false python-versions = "<4.0,>=3.7" -groups = ["dev"] files = [ {file = "dataclasses_json-0.6.7-py3-none-any.whl", hash = "sha256:0dbf33f26c8d5305befd61b39d2b3414e8a407bedc2834dea9b8d642666fb40a"}, {file = "dataclasses_json-0.6.7.tar.gz", hash = "sha256:b6b3e528266ea45b9535223bc53ca645f5208833c29229e847b3f26a1cc55fc0"}, @@ -451,8 +437,6 @@ version = "1.2.18" description = "Python @deprecated decorator to deprecate old python classes, functions or methods." optional = true python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" -groups = ["main"] -markers = "extra == \"otel\"" files = [ {file = "Deprecated-1.2.18-py2.py3-none-any.whl", hash = "sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec"}, {file = "deprecated-1.2.18.tar.gz", hash = "sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d"}, @@ -470,7 +454,6 @@ version = "1.9.0" description = "Distro - an OS platform information API" optional = false python-versions = ">=3.6" -groups = ["lint", "test"] files = [ {file = "distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2"}, {file = "distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"}, @@ -482,8 +465,6 @@ version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" -groups = ["main", "dev", "lint", "test"] -markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, @@ -498,7 +479,6 @@ version = "2.1.1" description = "execnet: rapid multi-Python deployment" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "execnet-2.1.1-py3-none-any.whl", hash = "sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc"}, {file = "execnet-2.1.1.tar.gz", hash = "sha256:5189b52c6121c24feae288166ab41b32549c7e2348652736540b9e6e7d4e72e3"}, @@ -513,7 +493,6 @@ version = "0.115.11" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "fastapi-0.115.11-py3-none-any.whl", hash = "sha256:32e1541b7b74602e4ef4a0260ecaf3aadf9d4f19590bba3e1bf2ac4666aa2c64"}, {file = "fastapi-0.115.11.tar.gz", hash = "sha256:cc81f03f688678b92600a65a5e618b93592c65005db37157147204d8924bf94f"}, @@ -534,7 +513,6 @@ version = "1.5.1" description = "Let your Python tests travel through time" optional = false python-versions = ">=3.7" -groups = ["dev"] files = [ {file = "freezegun-1.5.1-py3-none-any.whl", hash = "sha256:bf111d7138a8abe55ab48a71755673dbaa4ab87f4cff5634a4442dfec34c15f1"}, {file = "freezegun-1.5.1.tar.gz", hash = "sha256:b29dedfcda6d5e8e083ce71b2b542753ad48cfec44037b3fc79702e2980a89e9"}, @@ -543,13 +521,29 @@ files = [ [package.dependencies] python-dateutil = ">=2.7" +[[package]] +name = "googleapis-common-protos" +version = "1.69.1" +description = "Common protobufs used in Google APIs" +optional = true +python-versions = ">=3.7" +files = [ + {file = "googleapis_common_protos-1.69.1-py2.py3-none-any.whl", hash = "sha256:4077f27a6900d5946ee5a369fab9c8ded4c0ef1c6e880458ea2f70c14f7b70d5"}, + {file = "googleapis_common_protos-1.69.1.tar.gz", hash = "sha256:e20d2d8dda87da6fe7340afbbdf4f0bcb4c8fae7e6cadf55926c31f946b0b9b1"}, +] + +[package.dependencies] +protobuf = ">=3.20.2,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<6.0.0.dev0" + +[package.extras] +grpc = ["grpcio (>=1.44.0,<2.0.0.dev0)"] + [[package]] name = "h11" version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false python-versions = ">=3.7" -groups = ["main", "dev", "lint", "test"] files = [ {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, @@ -561,7 +555,6 @@ version = "1.0.7" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" -groups = ["main", "dev", "lint", "test"] files = [ {file = "httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd"}, {file = "httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"}, @@ -583,7 +576,6 @@ version = "0.27.2" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" -groups = ["main", "dev", "lint", "test"] files = [ {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, @@ -609,7 +601,6 @@ version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" -groups = ["main", "dev", "lint", "test"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -624,8 +615,6 @@ version = "8.5.0" description = "Read metadata from Python packages" optional = true python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"otel\"" files = [ {file = "importlib_metadata-8.5.0-py3-none-any.whl", hash = "sha256:45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b"}, {file = "importlib_metadata-8.5.0.tar.gz", hash = "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7"}, @@ -649,7 +638,6 @@ version = "2.0.0" description = "brain-dead simple config-ini parsing" optional = false python-versions = ">=3.7" -groups = ["main", "dev", "test"] files = [ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, @@ -657,88 +645,87 @@ files = [ [[package]] name = "jiter" -version = "0.8.2" +version = "0.9.0" description = "Fast iterable JSON parser." optional = false python-versions = ">=3.8" -groups = ["lint", "test"] -files = [ - {file = "jiter-0.8.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:ca8577f6a413abe29b079bc30f907894d7eb07a865c4df69475e868d73e71c7b"}, - {file = "jiter-0.8.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b25bd626bde7fb51534190c7e3cb97cee89ee76b76d7585580e22f34f5e3f393"}, - {file = "jiter-0.8.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d5c826a221851a8dc028eb6d7d6429ba03184fa3c7e83ae01cd6d3bd1d4bd17d"}, - {file = "jiter-0.8.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d35c864c2dff13dfd79fb070fc4fc6235d7b9b359efe340e1261deb21b9fcb66"}, - {file = "jiter-0.8.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f557c55bc2b7676e74d39d19bcb8775ca295c7a028246175d6a8b431e70835e5"}, - {file = "jiter-0.8.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:580ccf358539153db147e40751a0b41688a5ceb275e6f3e93d91c9467f42b2e3"}, - {file = "jiter-0.8.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:af102d3372e917cffce49b521e4c32c497515119dc7bd8a75665e90a718bbf08"}, - {file = "jiter-0.8.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:cadcc978f82397d515bb2683fc0d50103acff2a180552654bb92d6045dec2c49"}, - {file = "jiter-0.8.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ba5bdf56969cad2019d4e8ffd3f879b5fdc792624129741d3d83fc832fef8c7d"}, - {file = "jiter-0.8.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:3b94a33a241bee9e34b8481cdcaa3d5c2116f575e0226e421bed3f7a6ea71cff"}, - {file = "jiter-0.8.2-cp310-cp310-win32.whl", hash = "sha256:6e5337bf454abddd91bd048ce0dca5134056fc99ca0205258766db35d0a2ea43"}, - {file = "jiter-0.8.2-cp310-cp310-win_amd64.whl", hash = "sha256:4a9220497ca0cb1fe94e3f334f65b9b5102a0b8147646118f020d8ce1de70105"}, - {file = "jiter-0.8.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:2dd61c5afc88a4fda7d8b2cf03ae5947c6ac7516d32b7a15bf4b49569a5c076b"}, - {file = "jiter-0.8.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a6c710d657c8d1d2adbbb5c0b0c6bfcec28fd35bd6b5f016395f9ac43e878a15"}, - {file = "jiter-0.8.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9584de0cd306072635fe4b89742bf26feae858a0683b399ad0c2509011b9dc0"}, - {file = "jiter-0.8.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5a90a923338531b7970abb063cfc087eebae6ef8ec8139762007188f6bc69a9f"}, - {file = "jiter-0.8.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d21974d246ed0181558087cd9f76e84e8321091ebfb3a93d4c341479a736f099"}, - {file = "jiter-0.8.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:32475a42b2ea7b344069dc1e81445cfc00b9d0e3ca837f0523072432332e9f74"}, - {file = "jiter-0.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8b9931fd36ee513c26b5bf08c940b0ac875de175341cbdd4fa3be109f0492586"}, - {file = "jiter-0.8.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ce0820f4a3a59ddced7fce696d86a096d5cc48d32a4183483a17671a61edfddc"}, - {file = "jiter-0.8.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8ffc86ae5e3e6a93765d49d1ab47b6075a9c978a2b3b80f0f32628f39caa0c88"}, - {file = "jiter-0.8.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5127dc1abd809431172bc3fbe8168d6b90556a30bb10acd5ded41c3cfd6f43b6"}, - {file = "jiter-0.8.2-cp311-cp311-win32.whl", hash = "sha256:66227a2c7b575720c1871c8800d3a0122bb8ee94edb43a5685aa9aceb2782d44"}, - {file = "jiter-0.8.2-cp311-cp311-win_amd64.whl", hash = "sha256:cde031d8413842a1e7501e9129b8e676e62a657f8ec8166e18a70d94d4682855"}, - {file = "jiter-0.8.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:e6ec2be506e7d6f9527dae9ff4b7f54e68ea44a0ef6b098256ddf895218a2f8f"}, - {file = "jiter-0.8.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:76e324da7b5da060287c54f2fabd3db5f76468006c811831f051942bf68c9d44"}, - {file = "jiter-0.8.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:180a8aea058f7535d1c84183c0362c710f4750bef66630c05f40c93c2b152a0f"}, - {file = "jiter-0.8.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:025337859077b41548bdcbabe38698bcd93cfe10b06ff66617a48ff92c9aec60"}, - {file = "jiter-0.8.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ecff0dc14f409599bbcafa7e470c00b80f17abc14d1405d38ab02e4b42e55b57"}, - {file = "jiter-0.8.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ffd9fee7d0775ebaba131f7ca2e2d83839a62ad65e8e02fe2bd8fc975cedeb9e"}, - {file = "jiter-0.8.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14601dcac4889e0a1c75ccf6a0e4baf70dbc75041e51bcf8d0e9274519df6887"}, - {file = "jiter-0.8.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:92249669925bc1c54fcd2ec73f70f2c1d6a817928480ee1c65af5f6b81cdf12d"}, - {file = "jiter-0.8.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:e725edd0929fa79f8349ab4ec7f81c714df51dc4e991539a578e5018fa4a7152"}, - {file = "jiter-0.8.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bf55846c7b7a680eebaf9c3c48d630e1bf51bdf76c68a5f654b8524335b0ad29"}, - {file = "jiter-0.8.2-cp312-cp312-win32.whl", hash = "sha256:7efe4853ecd3d6110301665a5178b9856be7e2a9485f49d91aa4d737ad2ae49e"}, - {file = "jiter-0.8.2-cp312-cp312-win_amd64.whl", hash = "sha256:83c0efd80b29695058d0fd2fa8a556490dbce9804eac3e281f373bbc99045f6c"}, - {file = "jiter-0.8.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:ca1f08b8e43dc3bd0594c992fb1fd2f7ce87f7bf0d44358198d6da8034afdf84"}, - {file = "jiter-0.8.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5672a86d55416ccd214c778efccf3266b84f87b89063b582167d803246354be4"}, - {file = "jiter-0.8.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:58dc9bc9767a1101f4e5e22db1b652161a225874d66f0e5cb8e2c7d1c438b587"}, - {file = "jiter-0.8.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:37b2998606d6dadbb5ccda959a33d6a5e853252d921fec1792fc902351bb4e2c"}, - {file = "jiter-0.8.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4ab9a87f3784eb0e098f84a32670cfe4a79cb6512fd8f42ae3d0709f06405d18"}, - {file = "jiter-0.8.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:79aec8172b9e3c6d05fd4b219d5de1ac616bd8da934107325a6c0d0e866a21b6"}, - {file = "jiter-0.8.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:711e408732d4e9a0208008e5892c2966b485c783cd2d9a681f3eb147cf36c7ef"}, - {file = "jiter-0.8.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:653cf462db4e8c41995e33d865965e79641ef45369d8a11f54cd30888b7e6ff1"}, - {file = "jiter-0.8.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:9c63eaef32b7bebac8ebebf4dabebdbc6769a09c127294db6babee38e9f405b9"}, - {file = "jiter-0.8.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:eb21aaa9a200d0a80dacc7a81038d2e476ffe473ffdd9c91eb745d623561de05"}, - {file = "jiter-0.8.2-cp313-cp313-win32.whl", hash = "sha256:789361ed945d8d42850f919342a8665d2dc79e7e44ca1c97cc786966a21f627a"}, - {file = "jiter-0.8.2-cp313-cp313-win_amd64.whl", hash = "sha256:ab7f43235d71e03b941c1630f4b6e3055d46b6cb8728a17663eaac9d8e83a865"}, - {file = "jiter-0.8.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:b426f72cd77da3fec300ed3bc990895e2dd6b49e3bfe6c438592a3ba660e41ca"}, - {file = "jiter-0.8.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2dd880785088ff2ad21ffee205e58a8c1ddabc63612444ae41e5e4b321b39c0"}, - {file = "jiter-0.8.2-cp313-cp313t-win_amd64.whl", hash = "sha256:3ac9f578c46f22405ff7f8b1f5848fb753cc4b8377fbec8470a7dc3997ca7566"}, - {file = "jiter-0.8.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:9e1fa156ee9454642adb7e7234a383884452532bc9d53d5af2d18d98ada1d79c"}, - {file = "jiter-0.8.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:0cf5dfa9956d96ff2efb0f8e9c7d055904012c952539a774305aaaf3abdf3d6c"}, - {file = "jiter-0.8.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e52bf98c7e727dd44f7c4acb980cb988448faeafed8433c867888268899b298b"}, - {file = "jiter-0.8.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a2ecaa3c23e7a7cf86d00eda3390c232f4d533cd9ddea4b04f5d0644faf642c5"}, - {file = "jiter-0.8.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:08d4c92bf480e19fc3f2717c9ce2aa31dceaa9163839a311424b6862252c943e"}, - {file = "jiter-0.8.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:99d9a1eded738299ba8e106c6779ce5c3893cffa0e32e4485d680588adae6db8"}, - {file = "jiter-0.8.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d20be8b7f606df096e08b0b1b4a3c6f0515e8dac296881fe7461dfa0fb5ec817"}, - {file = "jiter-0.8.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d33f94615fcaf872f7fd8cd98ac3b429e435c77619777e8a449d9d27e01134d1"}, - {file = "jiter-0.8.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:317b25e98a35ffec5c67efe56a4e9970852632c810d35b34ecdd70cc0e47b3b6"}, - {file = "jiter-0.8.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fc9043259ee430ecd71d178fccabd8c332a3bf1e81e50cae43cc2b28d19e4cb7"}, - {file = "jiter-0.8.2-cp38-cp38-win32.whl", hash = "sha256:fc5adda618205bd4678b146612ce44c3cbfdee9697951f2c0ffdef1f26d72b63"}, - {file = "jiter-0.8.2-cp38-cp38-win_amd64.whl", hash = "sha256:cd646c827b4f85ef4a78e4e58f4f5854fae0caf3db91b59f0d73731448a970c6"}, - {file = "jiter-0.8.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:e41e75344acef3fc59ba4765df29f107f309ca9e8eace5baacabd9217e52a5ee"}, - {file = "jiter-0.8.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f22b16b35d5c1df9dfd58843ab2cd25e6bf15191f5a236bed177afade507bfc"}, - {file = "jiter-0.8.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f7200b8f7619d36aa51c803fd52020a2dfbea36ffec1b5e22cab11fd34d95a6d"}, - {file = "jiter-0.8.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:70bf4c43652cc294040dbb62256c83c8718370c8b93dd93d934b9a7bf6c4f53c"}, - {file = "jiter-0.8.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f9d471356dc16f84ed48768b8ee79f29514295c7295cb41e1133ec0b2b8d637d"}, - {file = "jiter-0.8.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:859e8eb3507894093d01929e12e267f83b1d5f6221099d3ec976f0c995cb6bd9"}, - {file = "jiter-0.8.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eaa58399c01db555346647a907b4ef6d4f584b123943be6ed5588c3f2359c9f4"}, - {file = "jiter-0.8.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8f2d5ed877f089862f4c7aacf3a542627c1496f972a34d0474ce85ee7d939c27"}, - {file = "jiter-0.8.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:03c9df035d4f8d647f8c210ddc2ae0728387275340668fb30d2421e17d9a0841"}, - {file = "jiter-0.8.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8bd2a824d08d8977bb2794ea2682f898ad3d8837932e3a74937e93d62ecbb637"}, - {file = "jiter-0.8.2-cp39-cp39-win32.whl", hash = "sha256:ca29b6371ebc40e496995c94b988a101b9fbbed48a51190a4461fcb0a68b4a36"}, - {file = "jiter-0.8.2-cp39-cp39-win_amd64.whl", hash = "sha256:1c0dfbd1be3cbefc7510102370d86e35d1d53e5a93d48519688b1bf0f761160a"}, - {file = "jiter-0.8.2.tar.gz", hash = "sha256:cd73d3e740666d0e639f678adb176fad25c1bcbdae88d8d7b857e1783bb4212d"}, +files = [ + {file = "jiter-0.9.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:816ec9b60fdfd1fec87da1d7ed46c66c44ffec37ab2ef7de5b147b2fce3fd5ad"}, + {file = "jiter-0.9.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9b1d3086f8a3ee0194ecf2008cf81286a5c3e540d977fa038ff23576c023c0ea"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1339f839b91ae30b37c409bf16ccd3dc453e8b8c3ed4bd1d6a567193651a4a51"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ffba79584b3b670fefae66ceb3a28822365d25b7bf811e030609a3d5b876f538"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cfc7d0a8e899089d11f065e289cb5b2daf3d82fbe028f49b20d7b809193958d"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e00a1a2bbfaaf237e13c3d1592356eab3e9015d7efd59359ac8b51eb56390a12"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1d9870561eb26b11448854dce0ff27a9a27cb616b632468cafc938de25e9e51"}, + {file = "jiter-0.9.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9872aeff3f21e437651df378cb75aeb7043e5297261222b6441a620218b58708"}, + {file = "jiter-0.9.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:1fd19112d1049bdd47f17bfbb44a2c0001061312dcf0e72765bfa8abd4aa30e5"}, + {file = "jiter-0.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6ef5da104664e526836070e4a23b5f68dec1cc673b60bf1edb1bfbe8a55d0678"}, + {file = "jiter-0.9.0-cp310-cp310-win32.whl", hash = "sha256:cb12e6d65ebbefe5518de819f3eda53b73187b7089040b2d17f5b39001ff31c4"}, + {file = "jiter-0.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:c43ca669493626d8672be3b645dbb406ef25af3f4b6384cfd306da7eb2e70322"}, + {file = "jiter-0.9.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6c4d99c71508912a7e556d631768dcdef43648a93660670986916b297f1c54af"}, + {file = "jiter-0.9.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8f60fb8ce7df529812bf6c625635a19d27f30806885139e367af93f6e734ef58"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:51c4e1a4f8ea84d98b7b98912aa4290ac3d1eabfde8e3c34541fae30e9d1f08b"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f4c677c424dc76684fea3e7285a7a2a7493424bea89ac441045e6a1fb1d7b3b"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2221176dfec87f3470b21e6abca056e6b04ce9bff72315cb0b243ca9e835a4b5"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3c7adb66f899ffa25e3c92bfcb593391ee1947dbdd6a9a970e0d7e713237d572"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c98d27330fdfb77913c1097a7aab07f38ff2259048949f499c9901700789ac15"}, + {file = "jiter-0.9.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:eda3f8cc74df66892b1d06b5d41a71670c22d95a1ca2cbab73654745ce9d0419"}, + {file = "jiter-0.9.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:dd5ab5ddc11418dce28343123644a100f487eaccf1de27a459ab36d6cca31043"}, + {file = "jiter-0.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:42f8a68a69f047b310319ef8e2f52fdb2e7976fb3313ef27df495cf77bcad965"}, + {file = "jiter-0.9.0-cp311-cp311-win32.whl", hash = "sha256:a25519efb78a42254d59326ee417d6f5161b06f5da827d94cf521fed961b1ff2"}, + {file = "jiter-0.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:923b54afdd697dfd00d368b7ccad008cccfeb1efb4e621f32860c75e9f25edbd"}, + {file = "jiter-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:7b46249cfd6c48da28f89eb0be3f52d6fdb40ab88e2c66804f546674e539ec11"}, + {file = "jiter-0.9.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:609cf3c78852f1189894383cf0b0b977665f54cb38788e3e6b941fa6d982c00e"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d726a3890a54561e55a9c5faea1f7655eda7f105bd165067575ace6e65f80bb2"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2e89dc075c1fef8fa9be219e249f14040270dbc507df4215c324a1839522ea75"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04e8ffa3c353b1bc4134f96f167a2082494351e42888dfcf06e944f2729cbe1d"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:203f28a72a05ae0e129b3ed1f75f56bc419d5f91dfacd057519a8bd137b00c42"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fca1a02ad60ec30bb230f65bc01f611c8608b02d269f998bc29cca8619a919dc"}, + {file = "jiter-0.9.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:237e5cee4d5d2659aaf91bbf8ec45052cc217d9446070699441a91b386ae27dc"}, + {file = "jiter-0.9.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:528b6b71745e7326eed73c53d4aa57e2a522242320b6f7d65b9c5af83cf49b6e"}, + {file = "jiter-0.9.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9f48e86b57bc711eb5acdfd12b6cb580a59cc9a993f6e7dcb6d8b50522dcd50d"}, + {file = "jiter-0.9.0-cp312-cp312-win32.whl", hash = "sha256:699edfde481e191d81f9cf6d2211debbfe4bd92f06410e7637dffb8dd5dfde06"}, + {file = "jiter-0.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:099500d07b43f61d8bd780466d429c45a7b25411b334c60ca875fa775f68ccb0"}, + {file = "jiter-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:2764891d3f3e8b18dce2cff24949153ee30c9239da7c00f032511091ba688ff7"}, + {file = "jiter-0.9.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:387b22fbfd7a62418d5212b4638026d01723761c75c1c8232a8b8c37c2f1003b"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d8da8629ccae3606c61d9184970423655fb4e33d03330bcdfe52d234d32f69"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a1be73d8982bdc278b7b9377426a4b44ceb5c7952073dd7488e4ae96b88e1103"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2228eaaaa111ec54b9e89f7481bffb3972e9059301a878d085b2b449fbbde635"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:11509bfecbc319459647d4ac3fd391d26fdf530dad00c13c4dadabf5b81f01a4"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f22238da568be8bbd8e0650e12feeb2cfea15eda4f9fc271d3b362a4fa0604d"}, + {file = "jiter-0.9.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:17f5d55eb856597607562257c8e36c42bc87f16bef52ef7129b7da11afc779f3"}, + {file = "jiter-0.9.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:6a99bed9fbb02f5bed416d137944419a69aa4c423e44189bc49718859ea83bc5"}, + {file = "jiter-0.9.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:e057adb0cd1bd39606100be0eafe742de2de88c79df632955b9ab53a086b3c8d"}, + {file = "jiter-0.9.0-cp313-cp313-win32.whl", hash = "sha256:f7e6850991f3940f62d387ccfa54d1a92bd4bb9f89690b53aea36b4364bcab53"}, + {file = "jiter-0.9.0-cp313-cp313-win_amd64.whl", hash = "sha256:c8ae3bf27cd1ac5e6e8b7a27487bf3ab5f82318211ec2e1346a5b058756361f7"}, + {file = "jiter-0.9.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f0b2827fb88dda2cbecbbc3e596ef08d69bda06c6f57930aec8e79505dc17001"}, + {file = "jiter-0.9.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:062b756ceb1d40b0b28f326cba26cfd575a4918415b036464a52f08632731e5a"}, + {file = "jiter-0.9.0-cp313-cp313t-win_amd64.whl", hash = "sha256:6f7838bc467ab7e8ef9f387bd6de195c43bad82a569c1699cb822f6609dd4cdf"}, + {file = "jiter-0.9.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:4a2d16360d0642cd68236f931b85fe50288834c383492e4279d9f1792e309571"}, + {file = "jiter-0.9.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e84ed1c9c9ec10bbb8c37f450077cbe3c0d4e8c2b19f0a49a60ac7ace73c7452"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9f3c848209ccd1bfa344a1240763975ca917de753c7875c77ec3034f4151d06c"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7825f46e50646bee937e0f849d14ef3a417910966136f59cd1eb848b8b5bb3e4"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d82a811928b26d1a6311a886b2566f68ccf2b23cf3bfed042e18686f1f22c2d7"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0c058ecb51763a67f019ae423b1cbe3fa90f7ee6280c31a1baa6ccc0c0e2d06e"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9897115ad716c48f0120c1f0c4efae348ec47037319a6c63b2d7838bb53aaef4"}, + {file = "jiter-0.9.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:351f4c90a24c4fb8c87c6a73af2944c440494ed2bea2094feecacb75c50398ae"}, + {file = "jiter-0.9.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d45807b0f236c485e1e525e2ce3a854807dfe28ccf0d013dd4a563395e28008a"}, + {file = "jiter-0.9.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:1537a890724ba00fdba21787010ac6f24dad47f763410e9e1093277913592784"}, + {file = "jiter-0.9.0-cp38-cp38-win32.whl", hash = "sha256:e3630ec20cbeaddd4b65513fa3857e1b7c4190d4481ef07fb63d0fad59033321"}, + {file = "jiter-0.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:2685f44bf80e95f8910553bf2d33b9c87bf25fceae6e9f0c1355f75d2922b0ee"}, + {file = "jiter-0.9.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:9ef340fae98065071ccd5805fe81c99c8f80484e820e40043689cf97fb66b3e2"}, + {file = "jiter-0.9.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:efb767d92c63b2cd9ec9f24feeb48f49574a713870ec87e9ba0c2c6e9329c3e2"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:113f30f87fb1f412510c6d7ed13e91422cfd329436364a690c34c8b8bd880c42"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8793b6df019b988526f5a633fdc7456ea75e4a79bd8396a3373c371fc59f5c9b"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7a9aaa5102dba4e079bb728076fadd5a2dca94c05c04ce68004cfd96f128ea34"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d838650f6ebaf4ccadfb04522463e74a4c378d7e667e0eb1865cfe3990bfac49"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0194f813efdf4b8865ad5f5c5f50f8566df7d770a82c51ef593d09e0b347020"}, + {file = "jiter-0.9.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a7954a401d0a8a0b8bc669199db78af435aae1e3569187c2939c477c53cb6a0a"}, + {file = "jiter-0.9.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4feafe787eb8a8d98168ab15637ca2577f6ddf77ac6c8c66242c2d028aa5420e"}, + {file = "jiter-0.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:27cd1f2e8bb377f31d3190b34e4328d280325ad7ef55c6ac9abde72f79e84d2e"}, + {file = "jiter-0.9.0-cp39-cp39-win32.whl", hash = "sha256:161d461dcbe658cf0bd0aa375b30a968b087cdddc624fc585f3867c63c6eca95"}, + {file = "jiter-0.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:e8b36d8a16a61993be33e75126ad3d8aa29cf450b09576f3c427d27647fcb4aa"}, + {file = "jiter-0.9.0.tar.gz", hash = "sha256:aadba0964deb424daa24492abc3d229c60c4a31bfee205aedbf1acc7639d7893"}, ] [[package]] @@ -747,8 +734,6 @@ version = "0.1.0rc5" description = "" optional = true python-versions = ">=3.9" -groups = ["main"] -markers = "extra == \"langsmith-pyo3\"" files = [ {file = "langsmith_pyo3-0.1.0rc5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:670e5707f09e756e3b71f12a46f546826893158c2dde3250e212234e15ac8c70"}, {file = "langsmith_pyo3-0.1.0rc5-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:e0d2261c3f9ba07594c7450187604c4c4b1e10e3b3f4a4eb39587a495d6945e3"}, @@ -788,8 +773,6 @@ version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" optional = true python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"pytest\"" files = [ {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"}, {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"}, @@ -814,7 +797,6 @@ version = "3.26.1" description = "A lightweight library for converting complex datatypes to and from native Python datatypes." optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "marshmallow-3.26.1-py3-none-any.whl", hash = "sha256:3350409f20a70a7e4e11a27661187b77cdcaeb20abca41c1454fe33636bea09c"}, {file = "marshmallow-3.26.1.tar.gz", hash = "sha256:e6d8affb6cb61d39d26402096dc0aee12d5a26d490a121f118d2e81dc0719dc6"}, @@ -834,8 +816,6 @@ version = "0.1.2" description = "Markdown URL utilities" optional = true python-versions = ">=3.7" -groups = ["main"] -markers = "extra == \"pytest\"" files = [ {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, @@ -847,7 +827,6 @@ version = "6.1.0" description = "multidict implementation" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "multidict-6.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3380252550e372e8511d49481bd836264c009adb826b23fefcc5dd3c69692f60"}, {file = "multidict-6.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:99f826cbf970077383d7de805c0681799491cb939c25450b9b5b3ced03ca99f1"}, @@ -952,7 +931,6 @@ version = "1.2.1" description = "Parser for multipart/form-data" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "multipart-1.2.1-py3-none-any.whl", hash = "sha256:c03dc203bc2e67f6b46a599467ae0d87cf71d7530504b2c1ff4a9ea21d8b8c8c"}, {file = "multipart-1.2.1.tar.gz", hash = "sha256:829b909b67bc1ad1c6d4488fcdc6391c2847842b08323addf5200db88dbe9480"}, @@ -968,7 +946,6 @@ version = "1.15.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"}, {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"}, @@ -1022,7 +999,6 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" -groups = ["dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -1034,7 +1010,6 @@ version = "2.0.2" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "numpy-2.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:51129a29dbe56f9ca83438b706e2e69a39892b5eda6cedcb6b0c9fdc9b0d3ece"}, {file = "numpy-2.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f15975dfec0cf2239224d80e32c3170b1d168335eaedee69da84fbe9f1f9cd04"}, @@ -1085,14 +1060,13 @@ files = [ [[package]] name = "openai" -version = "1.65.4" +version = "1.66.2" description = "The official Python library for the openai API" optional = false python-versions = ">=3.8" -groups = ["lint"] files = [ - {file = "openai-1.65.4-py3-none-any.whl", hash = "sha256:15566d46574b94eae3d18efc2f9a4ebd1366d1d44bfc1bdafeea7a5cf8271bcb"}, - {file = "openai-1.65.4.tar.gz", hash = "sha256:0b08c58625d556f5c6654701af1023689c173eb0989ce8f73c7fd0eb22203c76"}, + {file = "openai-1.66.2-py3-none-any.whl", hash = "sha256:75194057ee6bb8b732526387b6041327a05656d976fc21c064e21c8ac6b07999"}, + {file = "openai-1.66.2.tar.gz", hash = "sha256:9b3a843c25f81ee09b6469d483d9fba779d5c6ea41861180772f043481b0598d"}, ] [package.dependencies] @@ -1115,8 +1089,6 @@ version = "1.30.0" description = "OpenTelemetry Python API" optional = true python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"otel\"" files = [ {file = "opentelemetry_api-1.30.0-py3-none-any.whl", hash = "sha256:d5f5284890d73fdf47f843dda3210edf37a38d66f44f2b5aedc1e89ed455dc09"}, {file = "opentelemetry_api-1.30.0.tar.gz", hash = "sha256:375893400c1435bf623f7dfb3bcd44825fe6b56c34d0667c542ea8257b1a1240"}, @@ -1126,14 +1098,60 @@ files = [ deprecated = ">=1.2.6" importlib-metadata = ">=6.0,<=8.5.0" +[[package]] +name = "opentelemetry-exporter-otlp-proto-common" +version = "1.30.0" +description = "OpenTelemetry Protobuf encoding" +optional = true +python-versions = ">=3.8" +files = [ + {file = "opentelemetry_exporter_otlp_proto_common-1.30.0-py3-none-any.whl", hash = "sha256:5468007c81aa9c44dc961ab2cf368a29d3475977df83b4e30aeed42aa7bc3b38"}, + {file = "opentelemetry_exporter_otlp_proto_common-1.30.0.tar.gz", hash = "sha256:ddbfbf797e518411857d0ca062c957080279320d6235a279f7b64ced73c13897"}, +] + +[package.dependencies] +opentelemetry-proto = "1.30.0" + +[[package]] +name = "opentelemetry-exporter-otlp-proto-http" +version = "1.30.0" +description = "OpenTelemetry Collector Protobuf over HTTP Exporter" +optional = true +python-versions = ">=3.8" +files = [ + {file = "opentelemetry_exporter_otlp_proto_http-1.30.0-py3-none-any.whl", hash = "sha256:9578e790e579931c5ffd50f1e6975cbdefb6a0a0a5dea127a6ae87df10e0a589"}, + {file = "opentelemetry_exporter_otlp_proto_http-1.30.0.tar.gz", hash = "sha256:c3ae75d4181b1e34a60662a6814d0b94dd33b628bee5588a878bed92cee6abdc"}, +] + +[package.dependencies] +deprecated = ">=1.2.6" +googleapis-common-protos = ">=1.52,<2.0" +opentelemetry-api = ">=1.15,<2.0" +opentelemetry-exporter-otlp-proto-common = "1.30.0" +opentelemetry-proto = "1.30.0" +opentelemetry-sdk = ">=1.30.0,<1.31.0" +requests = ">=2.7,<3.0" + +[[package]] +name = "opentelemetry-proto" +version = "1.30.0" +description = "OpenTelemetry Python Proto" +optional = true +python-versions = ">=3.8" +files = [ + {file = "opentelemetry_proto-1.30.0-py3-none-any.whl", hash = "sha256:c6290958ff3ddacc826ca5abbeb377a31c2334387352a259ba0df37c243adc11"}, + {file = "opentelemetry_proto-1.30.0.tar.gz", hash = "sha256:afe5c9c15e8b68d7c469596e5b32e8fc085eb9febdd6fb4e20924a93a0389179"}, +] + +[package.dependencies] +protobuf = ">=5.0,<6.0" + [[package]] name = "opentelemetry-sdk" version = "1.30.0" description = "OpenTelemetry Python SDK" optional = true python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"otel\"" files = [ {file = "opentelemetry_sdk-1.30.0-py3-none-any.whl", hash = "sha256:14fe7afc090caad881addb6926cec967129bd9260c4d33ae6a217359f6b61091"}, {file = "opentelemetry_sdk-1.30.0.tar.gz", hash = "sha256:c9287a9e4a7614b9946e933a67168450b9ab35f08797eb9bc77d998fa480fa18"}, @@ -1150,8 +1168,6 @@ version = "0.51b0" description = "OpenTelemetry Semantic Conventions" optional = true python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"otel\"" files = [ {file = "opentelemetry_semantic_conventions-0.51b0-py3-none-any.whl", hash = "sha256:fdc777359418e8d06c86012c3dc92c88a6453ba662e941593adb062e48c2eeae"}, {file = "opentelemetry_semantic_conventions-0.51b0.tar.gz", hash = "sha256:3fabf47f35d1fd9aebcdca7e6802d86bd5ebc3bc3408b7e3248dde6e87a18c47"}, @@ -1167,8 +1183,6 @@ version = "3.10.15" description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" optional = false python-versions = ">=3.8" -groups = ["main"] -markers = "platform_python_implementation != \"PyPy\"" files = [ {file = "orjson-3.10.15-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:552c883d03ad185f720d0c09583ebde257e41b9521b74ff40e08b7dec4559c04"}, {file = "orjson-3.10.15-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:616e3e8d438d02e4854f70bfdc03a6bcdb697358dbaa6bcd19cbe24d24ece1f8"}, @@ -1257,7 +1271,6 @@ version = "24.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" -groups = ["main", "dev", "test"] files = [ {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, @@ -1269,7 +1282,6 @@ version = "2.2.2.240807" description = "Type annotations for pandas" optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "pandas_stubs-2.2.2.240807-py3-none-any.whl", hash = "sha256:893919ad82be4275f0d07bb47a95d08bae580d3fdea308a7acfcb3f02e76186e"}, {file = "pandas_stubs-2.2.2.240807.tar.gz", hash = "sha256:64a559725a57a449f46225fbafc422520b7410bff9252b661a225b5559192a93"}, @@ -1285,7 +1297,6 @@ version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, @@ -1297,7 +1308,6 @@ version = "4.3.6" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, @@ -1314,7 +1324,6 @@ version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" -groups = ["main", "dev", "test"] files = [ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, @@ -1330,7 +1339,6 @@ version = "0.3.0" description = "Accelerated property cache" optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "propcache-0.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:efa44f64c37cc30c9f05932c740a8b40ce359f51882c70883cc95feac842da4d"}, {file = "propcache-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2383a17385d9800b6eb5855c2f05ee550f803878f344f58b6e194de08b96352c"}, @@ -1432,13 +1440,32 @@ files = [ {file = "propcache-0.3.0.tar.gz", hash = "sha256:a8fd93de4e1d278046345f49e2238cdb298589325849b2645d4a94c53faeffc5"}, ] +[[package]] +name = "protobuf" +version = "5.29.3" +description = "" +optional = true +python-versions = ">=3.8" +files = [ + {file = "protobuf-5.29.3-cp310-abi3-win32.whl", hash = "sha256:3ea51771449e1035f26069c4c7fd51fba990d07bc55ba80701c78f886bf9c888"}, + {file = "protobuf-5.29.3-cp310-abi3-win_amd64.whl", hash = "sha256:a4fa6f80816a9a0678429e84973f2f98cbc218cca434abe8db2ad0bffc98503a"}, + {file = "protobuf-5.29.3-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:a8434404bbf139aa9e1300dbf989667a83d42ddda9153d8ab76e0d5dcaca484e"}, + {file = "protobuf-5.29.3-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:daaf63f70f25e8689c072cfad4334ca0ac1d1e05a92fc15c54eb9cf23c3efd84"}, + {file = "protobuf-5.29.3-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:c027e08a08be10b67c06bf2370b99c811c466398c357e615ca88c91c07f0910f"}, + {file = "protobuf-5.29.3-cp38-cp38-win32.whl", hash = "sha256:84a57163a0ccef3f96e4b6a20516cedcf5bb3a95a657131c5c3ac62200d23252"}, + {file = "protobuf-5.29.3-cp38-cp38-win_amd64.whl", hash = "sha256:b89c115d877892a512f79a8114564fb435943b59067615894c3b13cd3e1fa107"}, + {file = "protobuf-5.29.3-cp39-cp39-win32.whl", hash = "sha256:0eb32bfa5219fc8d4111803e9a690658aa2e6366384fd0851064b963b6d1f2a7"}, + {file = "protobuf-5.29.3-cp39-cp39-win_amd64.whl", hash = "sha256:6ce8cc3389a20693bfde6c6562e03474c40851b44975c9b2bf6df7d8c4f864da"}, + {file = "protobuf-5.29.3-py3-none-any.whl", hash = "sha256:0a18ed4a24198528f2333802eb075e59dea9d679ab7a6c5efb017a59004d849f"}, + {file = "protobuf-5.29.3.tar.gz", hash = "sha256:5da0f41edaf117bde316404bad1a486cb4ededf8e4a54891296f648e8e076620"}, +] + [[package]] name = "psutil" version = "5.9.8" description = "Cross-platform lib for process and system monitoring in Python." optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" -groups = ["dev"] files = [ {file = "psutil-5.9.8-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:26bd09967ae00920df88e0352a91cff1a78f8d69b3ecabbfe733610c0af486c8"}, {file = "psutil-5.9.8-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:05806de88103b25903dff19bb6692bd2e714ccf9e668d050d144012055cbca73"}, @@ -1467,7 +1494,6 @@ version = "0.3.14" description = "Sampling profiler for Python programs" optional = false python-versions = "*" -groups = ["dev"] files = [ {file = "py_spy-0.3.14-py2.py3-none-macosx_10_7_x86_64.whl", hash = "sha256:5b342cc5feb8d160d57a7ff308de153f6be68dcf506ad02b4d67065f2bae7f45"}, {file = "py_spy-0.3.14-py2.py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:fe7efe6c91f723442259d428bf1f9ddb9c1679828866b353d539345ca40d9dd2"}, @@ -1484,8 +1510,6 @@ version = "2.22" description = "C parser in Python" optional = false python-versions = ">=3.8" -groups = ["main"] -markers = "platform_python_implementation == \"PyPy\"" files = [ {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, @@ -1497,7 +1521,6 @@ version = "2.10.6" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" -groups = ["main", "dev", "lint", "test"] files = [ {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, @@ -1518,7 +1541,6 @@ version = "2.27.2" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" -groups = ["main", "dev", "lint", "test"] files = [ {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, @@ -1631,8 +1653,6 @@ version = "2.19.1" description = "Pygments is a syntax highlighting package written in Python." optional = true python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"pytest\"" files = [ {file = "pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c"}, {file = "pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f"}, @@ -1647,7 +1667,6 @@ version = "2.9.0" description = "Python module to run and analyze benchmarks" optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "pyperf-2.9.0-py3-none-any.whl", hash = "sha256:215673fb60f3fbbc6c7a90b609b0806d8466fded8dd502bf5731e2b92506076e"}, {file = "pyperf-2.9.0.tar.gz", hash = "sha256:dbe0feef8ec1a465df191bba2576149762d15a8c9985c9fea93ab625d875c362"}, @@ -1665,7 +1684,6 @@ version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" -groups = ["main", "dev", "test"] files = [ {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, @@ -1688,7 +1706,6 @@ version = "0.21.2" description = "Pytest support for asyncio" optional = false python-versions = ">=3.7" -groups = ["dev"] files = [ {file = "pytest_asyncio-0.21.2-py3-none-any.whl", hash = "sha256:ab664c88bb7998f711d8039cacd4884da6430886ae8bbd4eded552ed2004f16b"}, {file = "pytest_asyncio-0.21.2.tar.gz", hash = "sha256:d67738fc232b94b326b9d060750beb16e0074210b98dd8b58a5239fa2a154f45"}, @@ -1707,7 +1724,6 @@ version = "4.1.0" description = "Pytest plugin for measuring coverage." optional = false python-versions = ">=3.7" -groups = ["dev"] files = [ {file = "pytest-cov-4.1.0.tar.gz", hash = "sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6"}, {file = "pytest_cov-4.1.0-py3-none-any.whl", hash = "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a"}, @@ -1726,7 +1742,6 @@ version = "14.0" description = "pytest plugin to re-run tests to eliminate flaky failures" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "pytest-rerunfailures-14.0.tar.gz", hash = "sha256:4a400bcbcd3c7a4ad151ab8afac123d90eca3abe27f98725dc4d9702887d2e92"}, {file = "pytest_rerunfailures-14.0-py3-none-any.whl", hash = "sha256:4197bdd2eaeffdbf50b5ea6e7236f47ff0e44d1def8dae08e409f536d84e7b32"}, @@ -1742,7 +1757,6 @@ version = "0.7.0" description = "Pytest Plugin to disable socket calls during tests" optional = false python-versions = ">=3.8,<4.0" -groups = ["dev", "test"] files = [ {file = "pytest_socket-0.7.0-py3-none-any.whl", hash = "sha256:7e0f4642177d55d317bbd58fc68c6bd9048d6eadb2d46a89307fa9221336ce45"}, {file = "pytest_socket-0.7.0.tar.gz", hash = "sha256:71ab048cbbcb085c15a4423b73b619a8b35d6a307f46f78ea46be51b1b7e11b3"}, @@ -1757,7 +1771,6 @@ version = "0.11.0" description = "unittest subTest() support and subtests fixture" optional = false python-versions = ">=3.7" -groups = ["dev"] files = [ {file = "pytest-subtests-0.11.0.tar.gz", hash = "sha256:51865c88457545f51fb72011942f0a3c6901ee9e24cbfb6d1b9dc1348bafbe37"}, {file = "pytest_subtests-0.11.0-py3-none-any.whl", hash = "sha256:453389984952eec85ab0ce0c4f026337153df79587048271c7fd0f49119c07e4"}, @@ -1773,7 +1786,6 @@ version = "0.3.5" description = "Automatically rerun your tests on file modifications" optional = false python-versions = ">=3.7.0,<4.0.0" -groups = ["dev"] files = [ {file = "pytest_watcher-0.3.5-py3-none-any.whl", hash = "sha256:af00ca52c7be22dc34c0fd3d7ffef99057207a73b05dc5161fe3b2fe91f58130"}, {file = "pytest_watcher-0.3.5.tar.gz", hash = "sha256:8896152460ba2b1a8200c12117c6611008ec96c8b2d811f0a05ab8a82b043ff8"}, @@ -1789,7 +1801,6 @@ version = "3.6.1" description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"}, {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"}, @@ -1810,7 +1821,6 @@ version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -groups = ["dev"] files = [ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, @@ -1825,7 +1835,6 @@ version = "6.0.2" description = "YAML parser and emitter for Python" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, @@ -1888,7 +1897,6 @@ version = "2.32.3" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" -groups = ["main"] files = [ {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, @@ -1910,7 +1918,6 @@ version = "1.0.0" description = "A utility belt for advanced users of python-requests" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -groups = ["main"] files = [ {file = "requests-toolbelt-1.0.0.tar.gz", hash = "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6"}, {file = "requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06"}, @@ -1925,8 +1932,6 @@ version = "13.9.4" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = true python-versions = ">=3.8.0" -groups = ["main"] -markers = "extra == \"pytest\"" files = [ {file = "rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90"}, {file = "rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098"}, @@ -1946,7 +1951,6 @@ version = "0.6.9" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" -groups = ["dev"] files = [ {file = "ruff-0.6.9-py3-none-linux_armv6l.whl", hash = "sha256:064df58d84ccc0ac0fcd63bc3090b251d90e2a372558c0f057c3f75ed73e1ccd"}, {file = "ruff-0.6.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:140d4b5c9f5fc7a7b074908a78ab8d384dd7f6510402267bc76c37195c02a7ec"}, @@ -1974,7 +1978,6 @@ version = "1.17.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -groups = ["dev"] files = [ {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, @@ -1986,7 +1989,6 @@ version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" -groups = ["main", "dev", "lint", "test"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -1994,14 +1996,13 @@ files = [ [[package]] name = "starlette" -version = "0.46.0" +version = "0.46.1" description = "The little ASGI library that shines." optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ - {file = "starlette-0.46.0-py3-none-any.whl", hash = "sha256:913f0798bd90ba90a9156383bcf1350a17d6259451d0d8ee27fc0cf2db609038"}, - {file = "starlette-0.46.0.tar.gz", hash = "sha256:b359e4567456b28d473d0193f34c0de0ed49710d75ef183a74a5ce0499324f50"}, + {file = "starlette-0.46.1-py3-none-any.whl", hash = "sha256:77c74ed9d2720138b25875133f3a2dae6d854af2ec37dceb56aef370c1d8a227"}, + {file = "starlette-0.46.1.tar.gz", hash = "sha256:3c88d58ee4bd1bb807c0d1acb381838afc7752f9ddaec81bbe4383611d833230"}, ] [package.dependencies] @@ -2017,7 +2018,6 @@ version = "2.2.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" -groups = ["main", "dev", "test"] files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, @@ -2052,7 +2052,6 @@ files = [ {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] -markers = {main = "python_version < \"3.11\"", dev = "python_full_version <= \"3.11.0a6\"", test = "python_version < \"3.11\""} [[package]] name = "tqdm" @@ -2060,7 +2059,6 @@ version = "4.67.1" description = "Fast, Extensible Progress Meter" optional = false python-versions = ">=3.7" -groups = ["lint"] files = [ {file = "tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2"}, {file = "tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2"}, @@ -2082,7 +2080,6 @@ version = "5.9.5.20240516" description = "Typing stubs for psutil" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "types-psutil-5.9.5.20240516.tar.gz", hash = "sha256:bb296f59fc56458891d0feb1994717e548a1bcf89936a2877df8792b822b4696"}, {file = "types_psutil-5.9.5.20240516-py3-none-any.whl", hash = "sha256:83146ded949a10167d9895e567b3b71e53ebc5e23fd8363eab62b3c76cce7b89"}, @@ -2094,7 +2091,6 @@ version = "2025.1.0.20250204" description = "Typing stubs for pytz" optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "types_pytz-2025.1.0.20250204-py3-none-any.whl", hash = "sha256:32ca4a35430e8b94f6603b35beb7f56c32260ddddd4f4bb305fdf8f92358b87e"}, {file = "types_pytz-2025.1.0.20250204.tar.gz", hash = "sha256:00f750132769f1c65a4f7240bc84f13985b4da774bd17dfbe5d9cd442746bd49"}, @@ -2106,7 +2102,6 @@ version = "6.0.12.20241230" description = "Typing stubs for PyYAML" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "types_PyYAML-6.0.12.20241230-py3-none-any.whl", hash = "sha256:fa4d32565219b68e6dee5f67534c722e53c00d1cfc09c435ef04d7353e1e96e6"}, {file = "types_pyyaml-6.0.12.20241230.tar.gz", hash = "sha256:7f07622dbd34bb9c8b264fe860a17e0efcad00d50b5f27e93984909d9363498c"}, @@ -2118,8 +2113,6 @@ version = "2.31.0.6" description = "Typing stubs for requests" optional = false python-versions = ">=3.7" -groups = ["dev"] -markers = "platform_python_implementation == \"PyPy\" or python_version < \"3.10\"" files = [ {file = "types-requests-2.31.0.6.tar.gz", hash = "sha256:cd74ce3b53c461f1228a9b783929ac73a666658f223e28ed29753771477b3bd0"}, {file = "types_requests-2.31.0.6-py3-none-any.whl", hash = "sha256:a2db9cb228a81da8348b49ad6db3f5519452dd20a9c1e1a868c83c5fe88fd1a9"}, @@ -2134,8 +2127,6 @@ version = "2.32.0.20250306" description = "Typing stubs for requests" optional = false python-versions = ">=3.9" -groups = ["dev"] -markers = "platform_python_implementation != \"PyPy\" and python_version >= \"3.10\"" files = [ {file = "types_requests-2.32.0.20250306-py3-none-any.whl", hash = "sha256:25f2cbb5c8710b2022f8bbee7b2b66f319ef14aeea2f35d80f18c9dbf3b60a0b"}, {file = "types_requests-2.32.0.20250306.tar.gz", hash = "sha256:0962352694ec5b2f95fda877ee60a159abdf84a0fc6fdace599f20acb41a03d1"}, @@ -2150,7 +2141,6 @@ version = "4.67.0.20250301" description = "Typing stubs for tqdm" optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "types_tqdm-4.67.0.20250301-py3-none-any.whl", hash = "sha256:8af97deb8e6874af833555dc1fe0fcd456b1a789470bf6cd8813d4e7ee4f6c5b"}, {file = "types_tqdm-4.67.0.20250301.tar.gz", hash = "sha256:5e89a38ad89b867823368eb97d9f90d2fc69806bb055dde62716a05da62b5e0d"}, @@ -2165,8 +2155,6 @@ version = "1.26.25.14" description = "Typing stubs for urllib3" optional = false python-versions = "*" -groups = ["dev"] -markers = "platform_python_implementation == \"PyPy\" or python_version < \"3.10\"" files = [ {file = "types-urllib3-1.26.25.14.tar.gz", hash = "sha256:229b7f577c951b8c1b92c1bc2b2fdb0b49847bd2af6d1cc2a2e3dd340f3bda8f"}, {file = "types_urllib3-1.26.25.14-py3-none-any.whl", hash = "sha256:9683bbb7fb72e32bfe9d2be6e04875fbe1b3eeec3cbb4ea231435aa7fd6b4f0e"}, @@ -2178,7 +2166,6 @@ version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" -groups = ["main", "dev", "lint", "test"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, @@ -2190,7 +2177,6 @@ version = "0.9.0" description = "Runtime inspection utilities for typing module." optional = false python-versions = "*" -groups = ["dev"] files = [ {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, @@ -2206,8 +2192,6 @@ version = "1.26.20" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" -groups = ["main", "dev"] -markers = "platform_python_implementation == \"PyPy\" or python_version < \"3.10\"" files = [ {file = "urllib3-1.26.20-py2.py3-none-any.whl", hash = "sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e"}, {file = "urllib3-1.26.20.tar.gz", hash = "sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32"}, @@ -2224,8 +2208,6 @@ version = "2.3.0" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.9" -groups = ["main", "dev"] -markers = "platform_python_implementation != \"PyPy\" and python_version >= \"3.10\"" files = [ {file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"}, {file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"}, @@ -2243,7 +2225,6 @@ version = "0.29.0" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "uvicorn-0.29.0-py3-none-any.whl", hash = "sha256:2c2aac7ff4f4365c206fd773a39bf4ebd1047c238f8b8268ad996829323473de"}, {file = "uvicorn-0.29.0.tar.gz", hash = "sha256:6a69214c0b6a087462412670b3ef21224fa48cae0e452b5883e8e8bdfdd11dd0"}, @@ -2263,7 +2244,6 @@ version = "6.0.2" description = "Automatically mock your HTTP interactions to simplify and speed up testing" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "vcrpy-6.0.2-py2.py3-none-any.whl", hash = "sha256:40370223861181bc76a5e5d4b743a95058bb1ad516c3c08570316ab592f56cad"}, {file = "vcrpy-6.0.2.tar.gz", hash = "sha256:88e13d9111846745898411dbc74a75ce85870af96dd320d75f1ee33158addc09"}, @@ -2287,7 +2267,6 @@ version = "6.0.0" description = "Filesystem events monitoring" optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "watchdog-6.0.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d1cdb490583ebd691c012b3d6dae011000fe42edb7a82ece80965b42abd61f26"}, {file = "watchdog-6.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bc64ab3bdb6a04d69d4023b29422170b74681784ffb9463ed4870cf2f3e66112"}, @@ -2330,7 +2309,6 @@ version = "1.17.2" description = "Module for decorators, wrappers and monkey patching." optional = false python-versions = ">=3.8" -groups = ["main", "dev"] files = [ {file = "wrapt-1.17.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3d57c572081fed831ad2d26fd430d565b76aa277ed1d30ff4d40670b1c0dd984"}, {file = "wrapt-1.17.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b5e251054542ae57ac7f3fba5d10bfff615b6c2fb09abeb37d2f1463f841ae22"}, @@ -2412,7 +2390,6 @@ files = [ {file = "wrapt-1.17.2-py3-none-any.whl", hash = "sha256:b18f2d1533a71f069c7f82d524a52599053d4c7166e9dd374ae2136b7f40f7c8"}, {file = "wrapt-1.17.2.tar.gz", hash = "sha256:41388e9d4d1522446fe79d3213196bd9e3b301a336965b9e27ca2788ebd122f3"}, ] -markers = {main = "extra == \"otel\""} [[package]] name = "yarl" @@ -2420,7 +2397,6 @@ version = "1.18.3" description = "Yet another URL library" optional = false python-versions = ">=3.9" -groups = ["dev"] files = [ {file = "yarl-1.18.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7df647e8edd71f000a5208fe6ff8c382a1de8edfbccdbbfe649d263de07d8c34"}, {file = "yarl-1.18.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c69697d3adff5aa4f874b19c0e4ed65180ceed6318ec856ebc423aa5850d84f7"}, @@ -2517,8 +2493,6 @@ version = "3.21.0" description = "Backport of pathlib-compatible object wrapper for zip files" optional = true python-versions = ">=3.9" -groups = ["main"] -markers = "extra == \"otel\"" files = [ {file = "zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931"}, {file = "zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4"}, @@ -2538,7 +2512,6 @@ version = "0.23.0" description = "Zstandard bindings for Python" optional = false python-versions = ">=3.8" -groups = ["main"] files = [ {file = "zstandard-0.23.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bf0a05b6059c0528477fba9054d09179beb63744355cab9f38059548fedd46a9"}, {file = "zstandard-0.23.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fc9ca1c9718cb3b06634c7c8dec57d24e9438b2aa9a0f02b8bb36bf478538880"}, @@ -2652,6 +2625,6 @@ pytest = ["pytest", "rich"] vcr = [] [metadata] -lock-version = "2.1" +lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "c9905c20a3793b07e6809cbcc736a09e075716daf69db4ad4acc2749b2d513cf" +content-hash = "cdac908e6369456d95a75455cc41425ebb023b2e4a4f226c647f0aa68cdb663f" diff --git a/python/pyproject.toml b/python/pyproject.toml index 294ead63d9..c8c8c099df 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -40,8 +40,9 @@ pytest = {version = ">=7.0.0", optional = true} packaging = ">=23.2" # Enabled via `otel` extra: `pip install langsmith[otel]` -opentelemetry-api = { version = "^1.30.0", optional = true } -opentelemetry-sdk = { version = "^1.30.0", optional = true } +opentelemetry-sdk = {version = "^1.30.0", optional = true} +opentelemetry-api = {version = "^1.30.0", optional = true} +opentelemetry-exporter-otlp-proto-http = {version = "^1.30.0", optional = true} [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" From e3437d25caf100db5deaa32f25abe44c2c0d64cf Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 15:48:34 -0700 Subject: [PATCH 13/20] actually fix imports --- .../langsmith/_internal/otel/_otel_client.py | 41 ++++++++++++------- .../_internal/otel/_otel_exporter.py | 26 +++++++++--- python/langsmith/client.py | 36 +++++++++------- 3 files changed, 69 insertions(+), 34 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index 52e8854f16..0b6f233658 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -2,22 +2,29 @@ import os -from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( - OTLPSpanExporter, -) # type: ignore[import-not-found] -from opentelemetry.sdk.resources import ( # type: ignore[import-not-found] - SERVICE_NAME, - Resource, -) -from opentelemetry.sdk.trace import TracerProvider # type: ignore[import-not-found] -from opentelemetry.sdk.trace.export import ( # type: ignore[import-not-found] - BatchSpanProcessor, -) - from langsmith import utils as ls_utils - -def get_otlp_tracer_provider() -> TracerProvider: +HAS_OTEL = False +try: + if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): + from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( + OTLPSpanExporter, + ) + from opentelemetry.sdk.resources import ( + SERVICE_NAME, + Resource, + ) + from opentelemetry.sdk.trace import TracerProvider + from opentelemetry.sdk.trace.export import ( + BatchSpanProcessor, + ) + HAS_OTEL = True +except ImportError: + pass + + + +def get_otlp_tracer_provider() -> "TracerProvider": """Get the OTLP tracer provider for LangSmith. This function creates a tracer provider that exports spans using the OTLP protocol @@ -34,6 +41,12 @@ def get_otlp_tracer_provider() -> TracerProvider: TracerProvider: The OTLP tracer provider. """ # Set LangSmith-specific defaults if not already set in environment + if not HAS_OTEL: + raise ImportError( + "OpenTelemetry packages are required to use this function. " + "Please install with `pip install langsmith[otel]`" + ) + if "OTEL_EXPORTER_OTLP_ENDPOINT" not in os.environ: ls_endpoint = ls_utils.get_api_url(None) os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = f"{ls_endpoint}/otel" diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index 0f85ce6793..6390eb889e 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -3,13 +3,22 @@ import datetime import logging import uuid +import warnings from typing import Any, List, Optional, Tuple -from opentelemetry import trace # type: ignore[import-not-found] -from opentelemetry.trace import ( # type: ignore[import-not-found] - Span, - set_span_in_context, -) +from langsmith import utils as ls_utils + +HAS_OTEL = False +try: + if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): + from opentelemetry import trace + from opentelemetry.trace import ( + Span, + set_span_in_context, + ) + HAS_OTEL = True +except ImportError: + pass from langsmith._internal import _orjson from langsmith._internal._operations import ( @@ -65,6 +74,13 @@ def __init__(self, tracer_provider=None): tracer_provider: Optional tracer provider to use. If not provided, the global tracer provider will be used. """ + if not HAS_OTEL: + warnings.warn( + "OTEL_ENABLED is set but OpenTelemetry packages are not installed. " + "Install with `pip install langsmith[otel]`" + ) + return + self._tracer = trace.get_tracer("langsmith", tracer_provider=tracer_provider) self._spans = {} diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 14a6f8acbb..d3b95fa39f 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -103,6 +103,19 @@ from langsmith._internal._serde import dumps_json as _dumps_json from langsmith.schemas import AttachmentInfo +HAS_OTEL = False +try: + if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): + from opentelemetry import trace as otel_trace + + from langsmith._internal.otel._otel_client import ( + get_otlp_tracer_provider, + ) + from langsmith._internal.otel._otel_exporter import OTELExporter + HAS_OTEL = True +except ImportError: + pass + try: from zoneinfo import ZoneInfo # type: ignore[import-not-found] except ImportError: @@ -424,7 +437,7 @@ def __init__( hide_outputs: Optional[Union[Callable[[dict], dict], bool]] = None, info: Optional[Union[dict, ls_schemas.LangSmithInfo]] = None, api_urls: Optional[Dict[str, str]] = None, - otel_tracer_provider: Optional[TracerProvider] = None, + otel_tracer_provider: Optional["TracerProvider"] = None, ) -> None: """Initialize a Client instance. @@ -510,6 +523,8 @@ def __init__( self.compressed_traces: Optional[CompressedTraces] = None self._data_available_event: Optional[threading.Event] = None self._futures: Optional[set[cf.Future]] = None + self.otel_exporter: Optional[OTELExporter] = None + # Initialize auto batching if auto_batch_tracing: self.tracing_queue: Optional[PriorityQueue] = PriorityQueue() @@ -590,28 +605,19 @@ def __init__( self._manual_cleanup = False if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): - try: - from opentelemetry import trace as otel_trace - - from langsmith._internal.otel._otel_client import ( - get_otlp_tracer_provider, + if not HAS_OTEL: + warnings.warn( + "OTEL_ENABLED is set but OpenTelemetry packages are not installed. " + "Install with `pip install langsmith[otel]`" ) - from langsmith._internal.otel._otel_exporter import OTELExporter - except ImportError as e: - raise ImportError( - "OpenTelemetry packages are required for OTEL tracing. " - "Install them with: pip install langsmith[otel]" - ) from e if otel_tracer_provider is None: otel_tracer_provider = get_otlp_tracer_provider() # Set as global tracer provider if we're creating a new one otel_trace.set_tracer_provider(otel_tracer_provider) - self.otel_exporter: Optional[OTELExporter] = OTELExporter( + self.otel_exporter = OTELExporter( tracer_provider=otel_tracer_provider ) - else: - self.otel_exporter = None def _repr_html_(self) -> str: """Return an HTML representation of the instance with a link to the URL. From 6fda5a5a7364ebcce73fa88898602cba13d1b20d Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 11 Mar 2025 15:58:17 -0700 Subject: [PATCH 14/20] fmt --- python/langsmith/_internal/otel/_otel_client.py | 2 +- python/langsmith/_internal/otel/_otel_exporter.py | 11 ++++++----- python/langsmith/client.py | 7 +++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index 0b6f233658..0318e5532d 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -18,12 +18,12 @@ from opentelemetry.sdk.trace.export import ( BatchSpanProcessor, ) + HAS_OTEL = True except ImportError: pass - def get_otlp_tracer_provider() -> "TracerProvider": """Get the OTLP tracer provider for LangSmith. diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index 6390eb889e..ee80dc3990 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -7,6 +7,10 @@ from typing import Any, List, Optional, Tuple from langsmith import utils as ls_utils +from langsmith._internal import _orjson +from langsmith._internal._operations import ( + SerializedRunOperation, +) HAS_OTEL = False try: @@ -16,15 +20,11 @@ Span, set_span_in_context, ) + HAS_OTEL = True except ImportError: pass -from langsmith._internal import _orjson -from langsmith._internal._operations import ( - SerializedRunOperation, -) - logger = logging.getLogger(__name__) # OpenTelemetry GenAI semconv attribute names @@ -55,6 +55,7 @@ LANGSMITH_NAME = "langsmith.trace.name" LANGSMITH_METADATA = "langsmith.metadata" LANGSMITH_TAGS = "langsmith.span.tags" +LANGSMITH_RUNTIME = "langsmith.span.runtime" # GenAI event names GEN_AI_SYSTEM_MESSAGE = "gen_ai.system.message" diff --git a/python/langsmith/client.py b/python/langsmith/client.py index d3b95fa39f..24fcd8857b 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -112,6 +112,7 @@ get_otlp_tracer_provider, ) from langsmith._internal.otel._otel_exporter import OTELExporter + HAS_OTEL = True except ImportError: pass @@ -437,7 +438,7 @@ def __init__( hide_outputs: Optional[Union[Callable[[dict], dict], bool]] = None, info: Optional[Union[dict, ls_schemas.LangSmithInfo]] = None, api_urls: Optional[Dict[str, str]] = None, - otel_tracer_provider: Optional["TracerProvider"] = None, + otel_tracer_provider: Optional[TracerProvider] = None, ) -> None: """Initialize a Client instance. @@ -615,9 +616,7 @@ def __init__( # Set as global tracer provider if we're creating a new one otel_trace.set_tracer_provider(otel_tracer_provider) - self.otel_exporter = OTELExporter( - tracer_provider=otel_tracer_provider - ) + self.otel_exporter = OTELExporter(tracer_provider=otel_tracer_provider) def _repr_html_(self) -> str: """Return an HTML representation of the instance with a link to the URL. From 20dd20be40e826f5981902deffdfc43f361e9e98 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Wed, 12 Mar 2025 09:30:46 -0700 Subject: [PATCH 15/20] Add additional otel attributes and cut rc version --- .../_internal/otel/_otel_exporter.py | 112 +++++++++++++++++- python/langsmith/client.py | 2 +- python/pyproject.toml | 2 +- 3 files changed, 108 insertions(+), 8 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index ee80dc3990..dce23d44c0 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -44,6 +44,20 @@ GENAI_PROMPT = "gen_ai.prompt" GENAI_COMPLETION = "gen_ai.completion" +# Additional GenAI attributes +GEN_AI_REQUEST_STREAMING = "gen_ai.request.streaming" +GEN_AI_REQUEST_HEADERS = "gen_ai.request.headers" +GEN_AI_REQUEST_EXTRA_QUERY = "gen_ai.request.extra_query" +GEN_AI_REQUEST_EXTRA_BODY = "gen_ai.request.extra_body" +GEN_AI_SERIALIZED_NAME = "gen_ai.serialized.name" +GEN_AI_SERIALIZED_SIGNATURE = "gen_ai.serialized.signature" +GEN_AI_SERIALIZED_DOC = "gen_ai.serialized.doc" +GEN_AI_RESPONSE_ID = "gen_ai.response.id" +GEN_AI_RESPONSE_SERVICE_TIER = "gen_ai.response.service_tier" +GEN_AI_RESPONSE_SYSTEM_FINGERPRINT = "gen_ai.response.system_fingerprint" +GEN_AI_USAGE_INPUT_TOKEN_DETAILS = "gen_ai.usage.input_token_details" +GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS = "gen_ai.usage.output_token_details" + # LangSmith custom attributes LANGSMITH_RUN_ID = "langsmith.span.id" LANGSMITH_TRACE_ID = "langsmith.trace.id" @@ -330,6 +344,16 @@ def _set_span_attributes( else: span.set_attribute(LANGSMITH_TAGS, tags) + # Support additional serialized attributes, if present + if run_info.get("serialized") and isinstance(run_info["serialized"], dict): + serialized = run_info["serialized"] + if "name" in serialized and serialized["name"] is not None: + span.set_attribute(GEN_AI_SERIALIZED_NAME, serialized["name"]) + if "signature" in serialized and serialized["signature"] is not None: + span.set_attribute(GEN_AI_SERIALIZED_SIGNATURE, serialized["signature"]) + if "doc" in serialized and serialized["doc"] is not None: + span.set_attribute(GEN_AI_SERIALIZED_DOC, serialized["doc"]) + # Set inputs/outputs if available self._set_io_attributes(span, op) @@ -430,12 +454,32 @@ def _set_io_attributes(self, span: Span, op: SerializedRunOperation) -> None: try: inputs = _orjson.loads(op.inputs) - if ( - isinstance(inputs, dict) - and "model" in inputs - and isinstance(inputs.get("messages"), list) - ): - span.set_attribute(GEN_AI_REQUEST_MODEL, inputs["model"]) + if isinstance(inputs, dict): + if ( + "model" in inputs + and isinstance(inputs.get("messages"), list) + and inputs["model"] is not None + ): + span.set_attribute(GEN_AI_REQUEST_MODEL, inputs["model"]) + + # Set additional request attributes if available. + if "stream" in inputs and inputs["stream"] is not None: + span.set_attribute(GEN_AI_REQUEST_STREAMING, inputs["stream"]) + if ( + "extra_headers" in inputs + and inputs["extra_headers"] is not None + ): + span.set_attribute( + GEN_AI_REQUEST_HEADERS, inputs["extra_headers"] + ) + if "extra_query" in inputs and inputs["extra_query"] is not None: + span.set_attribute( + GEN_AI_REQUEST_EXTRA_QUERY, inputs["extra_query"] + ) + if "extra_body" in inputs and inputs["extra_body"] is not None: + span.set_attribute( + GEN_AI_REQUEST_EXTRA_BODY, inputs["extra_body"] + ) span.set_attribute(GENAI_PROMPT, op.inputs) @@ -459,6 +503,62 @@ def _set_io_attributes(self, span: Span, op: SerializedRunOperation) -> None: if "model" in outputs: span.set_attribute(GEN_AI_RESPONSE_MODEL, str(outputs["model"])) + # Extract additional response attributes. + if isinstance(outputs, dict): + if "id" in outputs and outputs["id"] is not None: + span.set_attribute(GEN_AI_RESPONSE_ID, outputs["id"]) + if "choices" in outputs and isinstance(outputs["choices"], list): + finish_reasons = [] + for choice in outputs["choices"]: + if ( + "finish_reason" in choice + and choice["finish_reason"] is not None + ): + finish_reasons.append(str(choice["finish_reason"])) + if finish_reasons: + span.set_attribute( + GEN_AI_RESPONSE_FINISH_REASONS, + ", ".join(finish_reasons), + ) + if ( + "service_tier" in outputs + and outputs["service_tier"] is not None + ): + span.set_attribute( + GEN_AI_RESPONSE_SERVICE_TIER, outputs["service_tier"] + ) + if ( + "system_fingerprint" in outputs + and outputs["system_fingerprint"] is not None + ): + span.set_attribute( + GEN_AI_RESPONSE_SYSTEM_FINGERPRINT, + outputs["system_fingerprint"], + ) + if "usage_metadata" in outputs and isinstance( + outputs["usage_metadata"], dict + ): + usage_metadata = outputs["usage_metadata"] + if ( + "input_token_details" in usage_metadata + and usage_metadata["input_token_details"] is not None + ): + input_token_details = str( + usage_metadata["input_token_details"] + ) + span.set_attribute( + GEN_AI_USAGE_INPUT_TOKEN_DETAILS, input_token_details + ) + if ( + "output_token_details" in usage_metadata + and usage_metadata["output_token_details"] is not None + ): + output_token_details = str( + usage_metadata["output_token_details"] + ) + span.set_attribute( + GEN_AI_USAGE_OUTPUT_TOKEN_DETAILS, output_token_details + ) span.set_attribute(GENAI_COMPLETION, op.outputs) diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 24fcd8857b..e097d2f85e 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -608,7 +608,7 @@ def __init__( if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): if not HAS_OTEL: warnings.warn( - "OTEL_ENABLED is set but OpenTelemetry packages are not installed. " + "LANGSMITH_OTEL_ENABLED is set but OpenTelemetry packages are not installed. " "Install with `pip install langsmith[otel]`" ) if otel_tracer_provider is None: diff --git a/python/pyproject.toml b/python/pyproject.toml index c8c8c099df..719e8614c8 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langsmith" -version = "0.3.12" +version = "0.3.13rc0" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." authors = ["LangChain "] license = "MIT" From e57793d76253a5f82047689cdd33c4374ab50508 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Wed, 12 Mar 2025 09:33:32 -0700 Subject: [PATCH 16/20] span import --- python/langsmith/_internal/otel/_otel_exporter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index dce23d44c0..76337abc6b 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -144,7 +144,7 @@ def _create_span_for_run( self, op: SerializedRunOperation, run_info: dict, - ) -> Optional[Span]: + ) -> Optional["Span"]: """Create an OpenTelemetry span for a run operation. Args: @@ -267,7 +267,7 @@ def _extract_model_name(self, run_info: dict) -> Optional[str]: return None def _set_span_attributes( - self, span: Span, run_info: dict, op: SerializedRunOperation + self, span: "Span", run_info: dict, op: SerializedRunOperation ) -> None: """Set attributes on the span. @@ -357,7 +357,7 @@ def _set_span_attributes( # Set inputs/outputs if available self._set_io_attributes(span, op) - def _set_gen_ai_system(self, span: Span, run_info: dict) -> None: + def _set_gen_ai_system(self, span: "Span", run_info: dict) -> None: """Set the gen_ai.system attribute on the span based on the model provider. Args: @@ -403,7 +403,7 @@ def _set_gen_ai_system(self, span: Span, run_info: dict) -> None: span.set_attribute(GEN_AI_SYSTEM, system) setattr(span, "_gen_ai_system", system) - def _set_invocation_parameters(self, span: Span, run_info: dict) -> None: + def _set_invocation_parameters(self, span: "Span", run_info: dict) -> None: """Set invocation parameters on the span. Args: @@ -443,7 +443,7 @@ def _set_invocation_parameters(self, span: Span, run_info: dict) -> None: GEN_AI_REQUEST_PRESENCE_PENALTY, invocation_params["presence_penalty"] ) - def _set_io_attributes(self, span: Span, op: SerializedRunOperation) -> None: + def _set_io_attributes(self, span: "Span", op: SerializedRunOperation) -> None: """Set input/output attributes on the span. Args: From bdc97133daa2c5964daa54e6b2811dcb1d9b9f1a Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Wed, 12 Mar 2025 10:01:08 -0700 Subject: [PATCH 17/20] Add additional otel deps --- python/poetry.lock | 130 ++++++++++++++++++++++++++++++++++++++++-- python/pyproject.toml | 4 +- 2 files changed, 128 insertions(+), 6 deletions(-) diff --git a/python/poetry.lock b/python/poetry.lock index e6adae65de..9f978836ac 100644 --- a/python/poetry.lock +++ b/python/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. [[package]] name = "annotated-types" @@ -6,6 +6,7 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, @@ -17,6 +18,7 @@ version = "0.45.2" description = "The official Python library for the anthropic API" optional = false python-versions = ">=3.8" +groups = ["test"] files = [ {file = "anthropic-0.45.2-py3-none-any.whl", hash = "sha256:ecd746f7274451dfcb7e1180571ead624c7e1195d1d46cb7c70143d2aedb4d35"}, {file = "anthropic-0.45.2.tar.gz", hash = "sha256:32a18b9ecd12c91b2be4cae6ca2ab46a06937b5aa01b21308d97a6d29794fb5e"}, @@ -41,6 +43,7 @@ version = "4.8.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.9" +groups = ["main", "dev", "lint", "test"] files = [ {file = "anyio-4.8.0-py3-none-any.whl", hash = "sha256:b5011f270ab5eb0abf13385f851315585cc37ef330dd88e27ec3d34d651fd47a"}, {file = "anyio-4.8.0.tar.gz", hash = "sha256:1d9fe889df5212298c0c0723fa20479d1b94883a2df44bd3897aa91083316f7a"}, @@ -63,6 +66,7 @@ version = "25.1.0" description = "Classes Without Boilerplate" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "attrs-25.1.0-py3-none-any.whl", hash = "sha256:c75a69e28a550a7e93789579c22aa26b0f5b83b75dc4e08fe092980051e1090a"}, {file = "attrs-25.1.0.tar.gz", hash = "sha256:1c97078a80c814273a76b2a298a932eb681c87415c11dee0a6921de7f1b02c3e"}, @@ -82,6 +86,7 @@ version = "24.10.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "black-24.10.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e6668650ea4b685440857138e5fe40cde4d652633b1bdffc62933d0db4ed9812"}, {file = "black-24.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1c536fcf674217e87b8cc3657b81809d3c085d7bf3ef262ead700da345bfa6ea"}, @@ -128,6 +133,7 @@ version = "2025.1.31" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main", "dev", "lint", "test"] files = [ {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, @@ -139,6 +145,8 @@ version = "1.17.1" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation == \"PyPy\"" files = [ {file = "cffi-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14"}, {file = "cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67"}, @@ -218,6 +226,7 @@ version = "3.4.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, @@ -319,6 +328,7 @@ version = "8.1.8" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"}, {file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"}, @@ -333,10 +343,12 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["main", "dev", "lint", "test"] files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +markers = {main = "sys_platform == \"win32\"", dev = "sys_platform == \"win32\" or platform_system == \"Windows\"", lint = "platform_system == \"Windows\"", test = "sys_platform == \"win32\""} [[package]] name = "coverage" @@ -344,6 +356,7 @@ version = "7.6.12" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "coverage-7.6.12-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:704c8c8c6ce6569286ae9622e534b4f5b9759b6f2cd643f1c1a61f666d534fe8"}, {file = "coverage-7.6.12-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ad7525bf0241e5502168ae9c643a2f6c219fa0a283001cee4cf23a9b7da75879"}, @@ -422,6 +435,7 @@ version = "0.6.7" description = "Easily serialize dataclasses to and from JSON." optional = false python-versions = "<4.0,>=3.7" +groups = ["dev"] files = [ {file = "dataclasses_json-0.6.7-py3-none-any.whl", hash = "sha256:0dbf33f26c8d5305befd61b39d2b3414e8a407bedc2834dea9b8d642666fb40a"}, {file = "dataclasses_json-0.6.7.tar.gz", hash = "sha256:b6b3e528266ea45b9535223bc53ca645f5208833c29229e847b3f26a1cc55fc0"}, @@ -437,6 +451,8 @@ version = "1.2.18" description = "Python @deprecated decorator to deprecate old python classes, functions or methods." optional = true python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "Deprecated-1.2.18-py2.py3-none-any.whl", hash = "sha256:bd5011788200372a32418f888e326a09ff80d0214bd961147cfed01b5c018eec"}, {file = "deprecated-1.2.18.tar.gz", hash = "sha256:422b6f6d859da6f2ef57857761bfb392480502a64c3028ca9bbe86085d72115d"}, @@ -454,6 +470,7 @@ version = "1.9.0" description = "Distro - an OS platform information API" optional = false python-versions = ">=3.6" +groups = ["lint", "test"] files = [ {file = "distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2"}, {file = "distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed"}, @@ -465,6 +482,8 @@ version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" +groups = ["main", "dev", "lint", "test"] +markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, @@ -479,6 +498,7 @@ version = "2.1.1" description = "execnet: rapid multi-Python deployment" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "execnet-2.1.1-py3-none-any.whl", hash = "sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc"}, {file = "execnet-2.1.1.tar.gz", hash = "sha256:5189b52c6121c24feae288166ab41b32549c7e2348652736540b9e6e7d4e72e3"}, @@ -493,6 +513,7 @@ version = "0.115.11" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "fastapi-0.115.11-py3-none-any.whl", hash = "sha256:32e1541b7b74602e4ef4a0260ecaf3aadf9d4f19590bba3e1bf2ac4666aa2c64"}, {file = "fastapi-0.115.11.tar.gz", hash = "sha256:cc81f03f688678b92600a65a5e618b93592c65005db37157147204d8924bf94f"}, @@ -513,6 +534,7 @@ version = "1.5.1" description = "Let your Python tests travel through time" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "freezegun-1.5.1-py3-none-any.whl", hash = "sha256:bf111d7138a8abe55ab48a71755673dbaa4ab87f4cff5634a4442dfec34c15f1"}, {file = "freezegun-1.5.1.tar.gz", hash = "sha256:b29dedfcda6d5e8e083ce71b2b542753ad48cfec44037b3fc79702e2980a89e9"}, @@ -527,6 +549,8 @@ version = "1.69.1" description = "Common protobufs used in Google APIs" optional = true python-versions = ">=3.7" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "googleapis_common_protos-1.69.1-py2.py3-none-any.whl", hash = "sha256:4077f27a6900d5946ee5a369fab9c8ded4c0ef1c6e880458ea2f70c14f7b70d5"}, {file = "googleapis_common_protos-1.69.1.tar.gz", hash = "sha256:e20d2d8dda87da6fe7340afbbdf4f0bcb4c8fae7e6cadf55926c31f946b0b9b1"}, @@ -544,6 +568,7 @@ version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false python-versions = ">=3.7" +groups = ["main", "dev", "lint", "test"] files = [ {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, @@ -555,6 +580,7 @@ version = "1.0.7" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd"}, {file = "httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"}, @@ -576,6 +602,7 @@ version = "0.27.2" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, @@ -601,6 +628,7 @@ version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" +groups = ["main", "dev", "lint", "test"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -615,6 +643,8 @@ version = "8.5.0" description = "Read metadata from Python packages" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "importlib_metadata-8.5.0-py3-none-any.whl", hash = "sha256:45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b"}, {file = "importlib_metadata-8.5.0.tar.gz", hash = "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7"}, @@ -638,6 +668,7 @@ version = "2.0.0" description = "brain-dead simple config-ini parsing" optional = false python-versions = ">=3.7" +groups = ["main", "dev", "test"] files = [ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, @@ -649,6 +680,7 @@ version = "0.9.0" description = "Fast iterable JSON parser." optional = false python-versions = ">=3.8" +groups = ["lint", "test"] files = [ {file = "jiter-0.9.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:816ec9b60fdfd1fec87da1d7ed46c66c44ffec37ab2ef7de5b147b2fce3fd5ad"}, {file = "jiter-0.9.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9b1d3086f8a3ee0194ecf2008cf81286a5c3e540d977fa038ff23576c023c0ea"}, @@ -734,6 +766,8 @@ version = "0.1.0rc5" description = "" optional = true python-versions = ">=3.9" +groups = ["main"] +markers = "extra == \"langsmith-pyo3\"" files = [ {file = "langsmith_pyo3-0.1.0rc5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:670e5707f09e756e3b71f12a46f546826893158c2dde3250e212234e15ac8c70"}, {file = "langsmith_pyo3-0.1.0rc5-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:e0d2261c3f9ba07594c7450187604c4c4b1e10e3b3f4a4eb39587a495d6945e3"}, @@ -773,6 +807,8 @@ version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"pytest\"" files = [ {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"}, {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"}, @@ -797,6 +833,7 @@ version = "3.26.1" description = "A lightweight library for converting complex datatypes to and from native Python datatypes." optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "marshmallow-3.26.1-py3-none-any.whl", hash = "sha256:3350409f20a70a7e4e11a27661187b77cdcaeb20abca41c1454fe33636bea09c"}, {file = "marshmallow-3.26.1.tar.gz", hash = "sha256:e6d8affb6cb61d39d26402096dc0aee12d5a26d490a121f118d2e81dc0719dc6"}, @@ -816,6 +853,8 @@ version = "0.1.2" description = "Markdown URL utilities" optional = true python-versions = ">=3.7" +groups = ["main"] +markers = "extra == \"pytest\"" files = [ {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, @@ -827,6 +866,7 @@ version = "6.1.0" description = "multidict implementation" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "multidict-6.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3380252550e372e8511d49481bd836264c009adb826b23fefcc5dd3c69692f60"}, {file = "multidict-6.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:99f826cbf970077383d7de805c0681799491cb939c25450b9b5b3ced03ca99f1"}, @@ -931,6 +971,7 @@ version = "1.2.1" description = "Parser for multipart/form-data" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "multipart-1.2.1-py3-none-any.whl", hash = "sha256:c03dc203bc2e67f6b46a599467ae0d87cf71d7530504b2c1ff4a9ea21d8b8c8c"}, {file = "multipart-1.2.1.tar.gz", hash = "sha256:829b909b67bc1ad1c6d4488fcdc6391c2847842b08323addf5200db88dbe9480"}, @@ -946,6 +987,7 @@ version = "1.15.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"}, {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"}, @@ -999,6 +1041,7 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -1010,6 +1053,7 @@ version = "2.0.2" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "numpy-2.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:51129a29dbe56f9ca83438b706e2e69a39892b5eda6cedcb6b0c9fdc9b0d3ece"}, {file = "numpy-2.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f15975dfec0cf2239224d80e32c3170b1d168335eaedee69da84fbe9f1f9cd04"}, @@ -1064,6 +1108,7 @@ version = "1.66.2" description = "The official Python library for the openai API" optional = false python-versions = ">=3.8" +groups = ["lint"] files = [ {file = "openai-1.66.2-py3-none-any.whl", hash = "sha256:75194057ee6bb8b732526387b6041327a05656d976fc21c064e21c8ac6b07999"}, {file = "openai-1.66.2.tar.gz", hash = "sha256:9b3a843c25f81ee09b6469d483d9fba779d5c6ea41861180772f043481b0598d"}, @@ -1089,6 +1134,8 @@ version = "1.30.0" description = "OpenTelemetry Python API" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "opentelemetry_api-1.30.0-py3-none-any.whl", hash = "sha256:d5f5284890d73fdf47f843dda3210edf37a38d66f44f2b5aedc1e89ed455dc09"}, {file = "opentelemetry_api-1.30.0.tar.gz", hash = "sha256:375893400c1435bf623f7dfb3bcd44825fe6b56c34d0667c542ea8257b1a1240"}, @@ -1104,6 +1151,8 @@ version = "1.30.0" description = "OpenTelemetry Protobuf encoding" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "opentelemetry_exporter_otlp_proto_common-1.30.0-py3-none-any.whl", hash = "sha256:5468007c81aa9c44dc961ab2cf368a29d3475977df83b4e30aeed42aa7bc3b38"}, {file = "opentelemetry_exporter_otlp_proto_common-1.30.0.tar.gz", hash = "sha256:ddbfbf797e518411857d0ca062c957080279320d6235a279f7b64ced73c13897"}, @@ -1118,6 +1167,8 @@ version = "1.30.0" description = "OpenTelemetry Collector Protobuf over HTTP Exporter" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "opentelemetry_exporter_otlp_proto_http-1.30.0-py3-none-any.whl", hash = "sha256:9578e790e579931c5ffd50f1e6975cbdefb6a0a0a5dea127a6ae87df10e0a589"}, {file = "opentelemetry_exporter_otlp_proto_http-1.30.0.tar.gz", hash = "sha256:c3ae75d4181b1e34a60662a6814d0b94dd33b628bee5588a878bed92cee6abdc"}, @@ -1138,6 +1189,8 @@ version = "1.30.0" description = "OpenTelemetry Python Proto" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "opentelemetry_proto-1.30.0-py3-none-any.whl", hash = "sha256:c6290958ff3ddacc826ca5abbeb377a31c2334387352a259ba0df37c243adc11"}, {file = "opentelemetry_proto-1.30.0.tar.gz", hash = "sha256:afe5c9c15e8b68d7c469596e5b32e8fc085eb9febdd6fb4e20924a93a0389179"}, @@ -1152,6 +1205,8 @@ version = "1.30.0" description = "OpenTelemetry Python SDK" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "opentelemetry_sdk-1.30.0-py3-none-any.whl", hash = "sha256:14fe7afc090caad881addb6926cec967129bd9260c4d33ae6a217359f6b61091"}, {file = "opentelemetry_sdk-1.30.0.tar.gz", hash = "sha256:c9287a9e4a7614b9946e933a67168450b9ab35f08797eb9bc77d998fa480fa18"}, @@ -1168,6 +1223,8 @@ version = "0.51b0" description = "OpenTelemetry Semantic Conventions" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "opentelemetry_semantic_conventions-0.51b0-py3-none-any.whl", hash = "sha256:fdc777359418e8d06c86012c3dc92c88a6453ba662e941593adb062e48c2eeae"}, {file = "opentelemetry_semantic_conventions-0.51b0.tar.gz", hash = "sha256:3fabf47f35d1fd9aebcdca7e6802d86bd5ebc3bc3408b7e3248dde6e87a18c47"}, @@ -1183,6 +1240,8 @@ version = "3.10.15" description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" optional = false python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation != \"PyPy\"" files = [ {file = "orjson-3.10.15-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:552c883d03ad185f720d0c09583ebde257e41b9521b74ff40e08b7dec4559c04"}, {file = "orjson-3.10.15-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:616e3e8d438d02e4854f70bfdc03a6bcdb697358dbaa6bcd19cbe24d24ece1f8"}, @@ -1271,6 +1330,7 @@ version = "24.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "test"] files = [ {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, @@ -1282,6 +1342,7 @@ version = "2.2.2.240807" description = "Type annotations for pandas" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "pandas_stubs-2.2.2.240807-py3-none-any.whl", hash = "sha256:893919ad82be4275f0d07bb47a95d08bae580d3fdea308a7acfcb3f02e76186e"}, {file = "pandas_stubs-2.2.2.240807.tar.gz", hash = "sha256:64a559725a57a449f46225fbafc422520b7410bff9252b661a225b5559192a93"}, @@ -1297,6 +1358,7 @@ version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, @@ -1308,6 +1370,7 @@ version = "4.3.6" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, @@ -1324,6 +1387,7 @@ version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "test"] files = [ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, @@ -1339,6 +1403,7 @@ version = "0.3.0" description = "Accelerated property cache" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "propcache-0.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:efa44f64c37cc30c9f05932c740a8b40ce359f51882c70883cc95feac842da4d"}, {file = "propcache-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2383a17385d9800b6eb5855c2f05ee550f803878f344f58b6e194de08b96352c"}, @@ -1446,6 +1511,8 @@ version = "5.29.3" description = "" optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "protobuf-5.29.3-cp310-abi3-win32.whl", hash = "sha256:3ea51771449e1035f26069c4c7fd51fba990d07bc55ba80701c78f886bf9c888"}, {file = "protobuf-5.29.3-cp310-abi3-win_amd64.whl", hash = "sha256:a4fa6f80816a9a0678429e84973f2f98cbc218cca434abe8db2ad0bffc98503a"}, @@ -1466,6 +1533,7 @@ version = "5.9.8" description = "Cross-platform lib for process and system monitoring in Python." optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +groups = ["dev"] files = [ {file = "psutil-5.9.8-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:26bd09967ae00920df88e0352a91cff1a78f8d69b3ecabbfe733610c0af486c8"}, {file = "psutil-5.9.8-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:05806de88103b25903dff19bb6692bd2e714ccf9e668d050d144012055cbca73"}, @@ -1494,6 +1562,7 @@ version = "0.3.14" description = "Sampling profiler for Python programs" optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "py_spy-0.3.14-py2.py3-none-macosx_10_7_x86_64.whl", hash = "sha256:5b342cc5feb8d160d57a7ff308de153f6be68dcf506ad02b4d67065f2bae7f45"}, {file = "py_spy-0.3.14-py2.py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:fe7efe6c91f723442259d428bf1f9ddb9c1679828866b353d539345ca40d9dd2"}, @@ -1510,6 +1579,8 @@ version = "2.22" description = "C parser in Python" optional = false python-versions = ">=3.8" +groups = ["main"] +markers = "platform_python_implementation == \"PyPy\"" files = [ {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, @@ -1521,6 +1592,7 @@ version = "2.10.6" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, @@ -1541,6 +1613,7 @@ version = "2.27.2" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, @@ -1653,6 +1726,8 @@ version = "2.19.1" description = "Pygments is a syntax highlighting package written in Python." optional = true python-versions = ">=3.8" +groups = ["main"] +markers = "extra == \"pytest\"" files = [ {file = "pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c"}, {file = "pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f"}, @@ -1667,6 +1742,7 @@ version = "2.9.0" description = "Python module to run and analyze benchmarks" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "pyperf-2.9.0-py3-none-any.whl", hash = "sha256:215673fb60f3fbbc6c7a90b609b0806d8466fded8dd502bf5731e2b92506076e"}, {file = "pyperf-2.9.0.tar.gz", hash = "sha256:dbe0feef8ec1a465df191bba2576149762d15a8c9985c9fea93ab625d875c362"}, @@ -1684,6 +1760,7 @@ version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" +groups = ["main", "dev", "test"] files = [ {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, @@ -1706,6 +1783,7 @@ version = "0.21.2" description = "Pytest support for asyncio" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pytest_asyncio-0.21.2-py3-none-any.whl", hash = "sha256:ab664c88bb7998f711d8039cacd4884da6430886ae8bbd4eded552ed2004f16b"}, {file = "pytest_asyncio-0.21.2.tar.gz", hash = "sha256:d67738fc232b94b326b9d060750beb16e0074210b98dd8b58a5239fa2a154f45"}, @@ -1724,6 +1802,7 @@ version = "4.1.0" description = "Pytest plugin for measuring coverage." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pytest-cov-4.1.0.tar.gz", hash = "sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6"}, {file = "pytest_cov-4.1.0-py3-none-any.whl", hash = "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a"}, @@ -1742,6 +1821,7 @@ version = "14.0" description = "pytest plugin to re-run tests to eliminate flaky failures" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest-rerunfailures-14.0.tar.gz", hash = "sha256:4a400bcbcd3c7a4ad151ab8afac123d90eca3abe27f98725dc4d9702887d2e92"}, {file = "pytest_rerunfailures-14.0-py3-none-any.whl", hash = "sha256:4197bdd2eaeffdbf50b5ea6e7236f47ff0e44d1def8dae08e409f536d84e7b32"}, @@ -1757,6 +1837,7 @@ version = "0.7.0" description = "Pytest Plugin to disable socket calls during tests" optional = false python-versions = ">=3.8,<4.0" +groups = ["dev", "test"] files = [ {file = "pytest_socket-0.7.0-py3-none-any.whl", hash = "sha256:7e0f4642177d55d317bbd58fc68c6bd9048d6eadb2d46a89307fa9221336ce45"}, {file = "pytest_socket-0.7.0.tar.gz", hash = "sha256:71ab048cbbcb085c15a4423b73b619a8b35d6a307f46f78ea46be51b1b7e11b3"}, @@ -1771,6 +1852,7 @@ version = "0.11.0" description = "unittest subTest() support and subtests fixture" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "pytest-subtests-0.11.0.tar.gz", hash = "sha256:51865c88457545f51fb72011942f0a3c6901ee9e24cbfb6d1b9dc1348bafbe37"}, {file = "pytest_subtests-0.11.0-py3-none-any.whl", hash = "sha256:453389984952eec85ab0ce0c4f026337153df79587048271c7fd0f49119c07e4"}, @@ -1786,6 +1868,7 @@ version = "0.3.5" description = "Automatically rerun your tests on file modifications" optional = false python-versions = ">=3.7.0,<4.0.0" +groups = ["dev"] files = [ {file = "pytest_watcher-0.3.5-py3-none-any.whl", hash = "sha256:af00ca52c7be22dc34c0fd3d7ffef99057207a73b05dc5161fe3b2fe91f58130"}, {file = "pytest_watcher-0.3.5.tar.gz", hash = "sha256:8896152460ba2b1a8200c12117c6611008ec96c8b2d811f0a05ab8a82b043ff8"}, @@ -1801,6 +1884,7 @@ version = "3.6.1" description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"}, {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"}, @@ -1821,6 +1905,7 @@ version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["dev"] files = [ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, @@ -1835,6 +1920,7 @@ version = "6.0.2" description = "YAML parser and emitter for Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, @@ -1897,6 +1983,7 @@ version = "2.32.3" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, @@ -1918,6 +2005,7 @@ version = "1.0.0" description = "A utility belt for advanced users of python-requests" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +groups = ["main"] files = [ {file = "requests-toolbelt-1.0.0.tar.gz", hash = "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6"}, {file = "requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06"}, @@ -1932,6 +2020,8 @@ version = "13.9.4" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = true python-versions = ">=3.8.0" +groups = ["main"] +markers = "extra == \"pytest\"" files = [ {file = "rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90"}, {file = "rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098"}, @@ -1951,6 +2041,7 @@ version = "0.6.9" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "ruff-0.6.9-py3-none-linux_armv6l.whl", hash = "sha256:064df58d84ccc0ac0fcd63bc3090b251d90e2a372558c0f057c3f75ed73e1ccd"}, {file = "ruff-0.6.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:140d4b5c9f5fc7a7b074908a78ab8d384dd7f6510402267bc76c37195c02a7ec"}, @@ -1978,6 +2069,7 @@ version = "1.17.0" description = "Python 2 and 3 compatibility utilities" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["dev"] files = [ {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, @@ -1989,6 +2081,7 @@ version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" +groups = ["main", "dev", "lint", "test"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -2000,6 +2093,7 @@ version = "0.46.1" description = "The little ASGI library that shines." optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "starlette-0.46.1-py3-none-any.whl", hash = "sha256:77c74ed9d2720138b25875133f3a2dae6d854af2ec37dceb56aef370c1d8a227"}, {file = "starlette-0.46.1.tar.gz", hash = "sha256:3c88d58ee4bd1bb807c0d1acb381838afc7752f9ddaec81bbe4383611d833230"}, @@ -2018,6 +2112,7 @@ version = "2.2.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "test"] files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, @@ -2052,6 +2147,7 @@ files = [ {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] +markers = {main = "python_version < \"3.11\"", dev = "python_full_version <= \"3.11.0a6\"", test = "python_version < \"3.11\""} [[package]] name = "tqdm" @@ -2059,6 +2155,7 @@ version = "4.67.1" description = "Fast, Extensible Progress Meter" optional = false python-versions = ">=3.7" +groups = ["lint"] files = [ {file = "tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2"}, {file = "tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2"}, @@ -2080,6 +2177,7 @@ version = "5.9.5.20240516" description = "Typing stubs for psutil" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types-psutil-5.9.5.20240516.tar.gz", hash = "sha256:bb296f59fc56458891d0feb1994717e548a1bcf89936a2877df8792b822b4696"}, {file = "types_psutil-5.9.5.20240516-py3-none-any.whl", hash = "sha256:83146ded949a10167d9895e567b3b71e53ebc5e23fd8363eab62b3c76cce7b89"}, @@ -2091,6 +2189,7 @@ version = "2025.1.0.20250204" description = "Typing stubs for pytz" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "types_pytz-2025.1.0.20250204-py3-none-any.whl", hash = "sha256:32ca4a35430e8b94f6603b35beb7f56c32260ddddd4f4bb305fdf8f92358b87e"}, {file = "types_pytz-2025.1.0.20250204.tar.gz", hash = "sha256:00f750132769f1c65a4f7240bc84f13985b4da774bd17dfbe5d9cd442746bd49"}, @@ -2102,6 +2201,7 @@ version = "6.0.12.20241230" description = "Typing stubs for PyYAML" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "types_PyYAML-6.0.12.20241230-py3-none-any.whl", hash = "sha256:fa4d32565219b68e6dee5f67534c722e53c00d1cfc09c435ef04d7353e1e96e6"}, {file = "types_pyyaml-6.0.12.20241230.tar.gz", hash = "sha256:7f07622dbd34bb9c8b264fe860a17e0efcad00d50b5f27e93984909d9363498c"}, @@ -2113,6 +2213,8 @@ version = "2.31.0.6" description = "Typing stubs for requests" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "platform_python_implementation == \"PyPy\" or python_version < \"3.10\"" files = [ {file = "types-requests-2.31.0.6.tar.gz", hash = "sha256:cd74ce3b53c461f1228a9b783929ac73a666658f223e28ed29753771477b3bd0"}, {file = "types_requests-2.31.0.6-py3-none-any.whl", hash = "sha256:a2db9cb228a81da8348b49ad6db3f5519452dd20a9c1e1a868c83c5fe88fd1a9"}, @@ -2127,6 +2229,8 @@ version = "2.32.0.20250306" description = "Typing stubs for requests" optional = false python-versions = ">=3.9" +groups = ["dev"] +markers = "platform_python_implementation != \"PyPy\" and python_version >= \"3.10\"" files = [ {file = "types_requests-2.32.0.20250306-py3-none-any.whl", hash = "sha256:25f2cbb5c8710b2022f8bbee7b2b66f319ef14aeea2f35d80f18c9dbf3b60a0b"}, {file = "types_requests-2.32.0.20250306.tar.gz", hash = "sha256:0962352694ec5b2f95fda877ee60a159abdf84a0fc6fdace599f20acb41a03d1"}, @@ -2141,6 +2245,7 @@ version = "4.67.0.20250301" description = "Typing stubs for tqdm" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "types_tqdm-4.67.0.20250301-py3-none-any.whl", hash = "sha256:8af97deb8e6874af833555dc1fe0fcd456b1a789470bf6cd8813d4e7ee4f6c5b"}, {file = "types_tqdm-4.67.0.20250301.tar.gz", hash = "sha256:5e89a38ad89b867823368eb97d9f90d2fc69806bb055dde62716a05da62b5e0d"}, @@ -2155,6 +2260,8 @@ version = "1.26.25.14" description = "Typing stubs for urllib3" optional = false python-versions = "*" +groups = ["dev"] +markers = "platform_python_implementation == \"PyPy\" or python_version < \"3.10\"" files = [ {file = "types-urllib3-1.26.25.14.tar.gz", hash = "sha256:229b7f577c951b8c1b92c1bc2b2fdb0b49847bd2af6d1cc2a2e3dd340f3bda8f"}, {file = "types_urllib3-1.26.25.14-py3-none-any.whl", hash = "sha256:9683bbb7fb72e32bfe9d2be6e04875fbe1b3eeec3cbb4ea231435aa7fd6b4f0e"}, @@ -2166,6 +2273,7 @@ version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev", "lint", "test"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, @@ -2177,6 +2285,7 @@ version = "0.9.0" description = "Runtime inspection utilities for typing module." optional = false python-versions = "*" +groups = ["dev"] files = [ {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, @@ -2192,6 +2301,8 @@ version = "1.26.20" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +groups = ["main", "dev"] +markers = "platform_python_implementation == \"PyPy\" or python_version < \"3.10\"" files = [ {file = "urllib3-1.26.20-py2.py3-none-any.whl", hash = "sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e"}, {file = "urllib3-1.26.20.tar.gz", hash = "sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32"}, @@ -2208,6 +2319,8 @@ version = "2.3.0" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.9" +groups = ["main", "dev"] +markers = "platform_python_implementation != \"PyPy\" and python_version >= \"3.10\"" files = [ {file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"}, {file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"}, @@ -2225,6 +2338,7 @@ version = "0.29.0" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "uvicorn-0.29.0-py3-none-any.whl", hash = "sha256:2c2aac7ff4f4365c206fd773a39bf4ebd1047c238f8b8268ad996829323473de"}, {file = "uvicorn-0.29.0.tar.gz", hash = "sha256:6a69214c0b6a087462412670b3ef21224fa48cae0e452b5883e8e8bdfdd11dd0"}, @@ -2244,6 +2358,7 @@ version = "6.0.2" description = "Automatically mock your HTTP interactions to simplify and speed up testing" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "vcrpy-6.0.2-py2.py3-none-any.whl", hash = "sha256:40370223861181bc76a5e5d4b743a95058bb1ad516c3c08570316ab592f56cad"}, {file = "vcrpy-6.0.2.tar.gz", hash = "sha256:88e13d9111846745898411dbc74a75ce85870af96dd320d75f1ee33158addc09"}, @@ -2267,6 +2382,7 @@ version = "6.0.0" description = "Filesystem events monitoring" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "watchdog-6.0.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d1cdb490583ebd691c012b3d6dae011000fe42edb7a82ece80965b42abd61f26"}, {file = "watchdog-6.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bc64ab3bdb6a04d69d4023b29422170b74681784ffb9463ed4870cf2f3e66112"}, @@ -2309,6 +2425,7 @@ version = "1.17.2" description = "Module for decorators, wrappers and monkey patching." optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "wrapt-1.17.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3d57c572081fed831ad2d26fd430d565b76aa277ed1d30ff4d40670b1c0dd984"}, {file = "wrapt-1.17.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b5e251054542ae57ac7f3fba5d10bfff615b6c2fb09abeb37d2f1463f841ae22"}, @@ -2390,6 +2507,7 @@ files = [ {file = "wrapt-1.17.2-py3-none-any.whl", hash = "sha256:b18f2d1533a71f069c7f82d524a52599053d4c7166e9dd374ae2136b7f40f7c8"}, {file = "wrapt-1.17.2.tar.gz", hash = "sha256:41388e9d4d1522446fe79d3213196bd9e3b301a336965b9e27ca2788ebd122f3"}, ] +markers = {main = "extra == \"otel\""} [[package]] name = "yarl" @@ -2397,6 +2515,7 @@ version = "1.18.3" description = "Yet another URL library" optional = false python-versions = ">=3.9" +groups = ["dev"] files = [ {file = "yarl-1.18.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7df647e8edd71f000a5208fe6ff8c382a1de8edfbccdbbfe649d263de07d8c34"}, {file = "yarl-1.18.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c69697d3adff5aa4f874b19c0e4ed65180ceed6318ec856ebc423aa5850d84f7"}, @@ -2493,6 +2612,8 @@ version = "3.21.0" description = "Backport of pathlib-compatible object wrapper for zip files" optional = true python-versions = ">=3.9" +groups = ["main"] +markers = "extra == \"otel\"" files = [ {file = "zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931"}, {file = "zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4"}, @@ -2512,6 +2633,7 @@ version = "0.23.0" description = "Zstandard bindings for Python" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "zstandard-0.23.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bf0a05b6059c0528477fba9054d09179beb63744355cab9f38059548fedd46a9"}, {file = "zstandard-0.23.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fc9ca1c9718cb3b06634c7c8dec57d24e9438b2aa9a0f02b8bb36bf478538880"}, @@ -2620,11 +2742,11 @@ cffi = ["cffi (>=1.11)"] [extras] langsmith-pyo3 = ["langsmith-pyo3"] -otel = ["opentelemetry-api", "opentelemetry-sdk"] +otel = ["opentelemetry-api", "opentelemetry-exporter-otlp-proto-http", "opentelemetry-sdk"] pytest = ["pytest", "rich"] vcr = [] [metadata] -lock-version = "2.0" +lock-version = "2.1" python-versions = ">=3.9,<4.0" -content-hash = "cdac908e6369456d95a75455cc41425ebb023b2e4a4f226c647f0aa68cdb663f" +content-hash = "d2977557129e71ab0ddc4c5051fe655062eb93b850c35b7e4662d5cdd2439dfb" diff --git a/python/pyproject.toml b/python/pyproject.toml index 86e8dd0918..ed83bdf98b 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langsmith" -version = "0.3.14rc0" +version = "0.3.14rc1" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." authors = ["LangChain "] license = "MIT" @@ -85,7 +85,7 @@ anthropic = "^0.45.0" [tool.poetry.extras] vcr = ["vcrpy"] langsmith_pyo3 = ["langsmith-pyo3"] -otel = ["opentelemetry-api", "opentelemetry-sdk"] +otel = ["opentelemetry-api", "opentelemetry-sdk", "opentelemetry-exporter-otlp-proto-http"] pytest = ["pytest", "rich", "vcrpy"] [build-system] From 0f97524516d72ef6e0562f08ffaee5fb99a7e862 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 18 Mar 2025 15:27:46 -0700 Subject: [PATCH 18/20] comments --- .../python-integration-tests/action.yml | 2 +- .../langsmith/_internal/_background_thread.py | 10 +++++--- .../_internal/otel/_otel_exporter.py | 25 ++++++++++++++----- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/actions/python-integration-tests/action.yml b/.github/actions/python-integration-tests/action.yml index 31f704a0f6..8ff0b484e6 100644 --- a/.github/actions/python-integration-tests/action.yml +++ b/.github/actions/python-integration-tests/action.yml @@ -40,7 +40,7 @@ runs: - name: Install dependencies run: | poetry install --with dev - poetry run pip install -U langchain langchain-openai langchain-anthropic tiktoken rapidfuzz vcrpy numpy opentelemetry-api opentelemetry-sdk + poetry run pip install -U langchain langchain-openai langchain-anthropic tiktoken rapidfuzz vcrpy numpy opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http shell: bash working-directory: python diff --git a/python/langsmith/_internal/_background_thread.py b/python/langsmith/_internal/_background_thread.py index e940d6aebb..1454aa9e7a 100644 --- a/python/langsmith/_internal/_background_thread.py +++ b/python/langsmith/_internal/_background_thread.py @@ -178,9 +178,13 @@ def _otel_tracing_thread_handle_batch( ops = combine_serialized_queue_operations([item.item for item in batch]) run_ops = [op for op in ops if isinstance(op, SerializedRunOperation)] - - if run_ops and client.otel_exporter is not None: - client.otel_exporter.export_batch(run_ops) + if run_ops: + if client.otel_exporter is not None: + client.otel_exporter.export_batch(run_ops) + else: + logger.error( + "Error in OTEL tracing queue: client.otel_exporter is None" + ) except Exception: logger.error("Error in OTEL tracing queue", exc_info=True) diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index 76337abc6b..8c9a3eacba 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -44,9 +44,6 @@ GENAI_PROMPT = "gen_ai.prompt" GENAI_COMPLETION = "gen_ai.completion" -# Additional GenAI attributes -GEN_AI_REQUEST_STREAMING = "gen_ai.request.streaming" -GEN_AI_REQUEST_HEADERS = "gen_ai.request.headers" GEN_AI_REQUEST_EXTRA_QUERY = "gen_ai.request.extra_query" GEN_AI_REQUEST_EXTRA_BODY = "gen_ai.request.extra_body" GEN_AI_SERIALIZED_NAME = "gen_ai.serialized.name" @@ -70,6 +67,8 @@ LANGSMITH_METADATA = "langsmith.metadata" LANGSMITH_TAGS = "langsmith.span.tags" LANGSMITH_RUNTIME = "langsmith.span.runtime" +LANGSMITH_REQUEST_STREAMING = "langsmith.request.streaming" +LANGSMITH_REQUEST_HEADERS = "langsmith.request.headers" # GenAI event names GEN_AI_SYSTEM_MESSAGE = "gen_ai.system.message" @@ -77,6 +76,18 @@ GEN_AI_ASSISTANT_MESSAGE = "gen_ai.assistant.message" GEN_AI_CHOICE = "gen_ai.choice" +WELL_KNOWN_OPERATION_NAMES = { + "llm": "chat", + "tool": "execute_tool", + "retriever": "embeddings", + "embedding": "embeddings", + "prompt": "chat", +} + + +def _get_operation_name(run_type: str) -> str: + return WELL_KNOWN_OPERATION_NAMES.get(run_type, run_type) + class OTELExporter: __slots__ = ["_tracer", "_spans"] @@ -304,7 +315,7 @@ def _set_span_attributes( # Set GenAI attributes according to OTEL semantic conventions # Set gen_ai.operation.name - operation_name = run_info.get("run_type", "chain") + operation_name = _get_operation_name(run_info.get("run_type", "chain")) span.set_attribute(GEN_AI_OPERATION_NAME, operation_name) # Set gen_ai.system @@ -464,13 +475,15 @@ def _set_io_attributes(self, span: "Span", op: SerializedRunOperation) -> None: # Set additional request attributes if available. if "stream" in inputs and inputs["stream"] is not None: - span.set_attribute(GEN_AI_REQUEST_STREAMING, inputs["stream"]) + span.set_attribute( + LANGSMITH_REQUEST_STREAMING, inputs["stream"] + ) if ( "extra_headers" in inputs and inputs["extra_headers"] is not None ): span.set_attribute( - GEN_AI_REQUEST_HEADERS, inputs["extra_headers"] + LANGSMITH_REQUEST_HEADERS, inputs["extra_headers"] ) if "extra_query" in inputs and inputs["extra_query"] is not None: span.set_attribute( From ebbe27f89d5335480fa15b690d207c5fe17ef939 Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 18 Mar 2025 16:29:00 -0700 Subject: [PATCH 19/20] fix imports --- .../langsmith/_internal/otel/_otel_client.py | 8 ++-- .../_internal/otel/_otel_exporter.py | 4 +- python/tests/integration_tests/test_client.py | 44 ------------------- 3 files changed, 6 insertions(+), 50 deletions(-) diff --git a/python/langsmith/_internal/otel/_otel_client.py b/python/langsmith/_internal/otel/_otel_client.py index 0318e5532d..23e30d7434 100644 --- a/python/langsmith/_internal/otel/_otel_client.py +++ b/python/langsmith/_internal/otel/_otel_client.py @@ -7,15 +7,15 @@ HAS_OTEL = False try: if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): - from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( + from opentelemetry.exporter.otlp.proto.http.trace_exporter import ( # type: ignore[import] OTLPSpanExporter, ) - from opentelemetry.sdk.resources import ( + from opentelemetry.sdk.resources import ( # type: ignore[import] SERVICE_NAME, Resource, ) - from opentelemetry.sdk.trace import TracerProvider - from opentelemetry.sdk.trace.export import ( + from opentelemetry.sdk.trace import TracerProvider # type: ignore[import] + from opentelemetry.sdk.trace.export import ( # type: ignore[import] BatchSpanProcessor, ) diff --git a/python/langsmith/_internal/otel/_otel_exporter.py b/python/langsmith/_internal/otel/_otel_exporter.py index 8c9a3eacba..7c7cbcde13 100644 --- a/python/langsmith/_internal/otel/_otel_exporter.py +++ b/python/langsmith/_internal/otel/_otel_exporter.py @@ -15,8 +15,8 @@ HAS_OTEL = False try: if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): - from opentelemetry import trace - from opentelemetry.trace import ( + from opentelemetry import trace # type: ignore[import] + from opentelemetry.trace import ( # type: ignore[import] Span, set_span_in_context, ) diff --git a/python/tests/integration_tests/test_client.py b/python/tests/integration_tests/test_client.py index 24f3315a35..10ffd08fd5 100644 --- a/python/tests/integration_tests/test_client.py +++ b/python/tests/integration_tests/test_client.py @@ -3012,47 +3012,3 @@ def _get_run(run_id: ID_TYPE) -> bool: # Clean up langchain_client.delete_annotation_queue(queue.id) - - -def test_otel_trace_export(monkeypatch: pytest.MonkeyPatch): - monkeypatch.setenv("LANGCHAIN_OTEL_ENABLED", "true") - - client = Client(api_key="test-key") - - assert client.otel_exporter is not None, "OTEL exporter should be enabled." - - run_id = uuid4() - start_time = datetime.datetime.now(datetime.timezone.utc) - end_time = start_time + datetime.timedelta(seconds=2) - - client.create_run( - id=run_id, - name="OTEL Export Test", - run_type="llm", - inputs={"prompt": "Hello, OTEL!"}, - start_time=start_time, - end_time=end_time, - ) - - client.update_run( - run_id=run_id, - outputs={"answer": "Hello, User!"}, - extra={"metadata": {"foo": "bar"}}, - tags=["otel", "test"], - end_time=end_time, - ) - - # Wait until the run is ingested by LangSmith. - wait_for(lambda: client.read_run(run_id).end_time is not None) - - # Retrieve the run from LangSmith. - retrieved_run = client.read_run(run_id) - assert retrieved_run.id == run_id - assert retrieved_run.start_time == start_time - assert retrieved_run.end_time == end_time - assert retrieved_run.name == "OTEL Export Test" - assert retrieved_run.run_type == "llm" - assert retrieved_run.inputs == {"prompt": "Hello, OTEL!"} - assert retrieved_run.outputs == {"answer": "Hello, User!"} - assert retrieved_run.extra == {"metadata": {"foo": "bar"}} - assert retrieved_run.tags == ["otel", "test"] From c6617ac4d3c68839ac57c0bed758db8658090c0d Mon Sep 17 00:00:00 2001 From: Angus Jelinek Date: Tue, 18 Mar 2025 21:26:34 -0700 Subject: [PATCH 20/20] fix otel import --- .github/actions/python-integration-tests/action.yml | 2 +- python/langsmith/client.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/actions/python-integration-tests/action.yml b/.github/actions/python-integration-tests/action.yml index 8ff0b484e6..c1884c7e57 100644 --- a/.github/actions/python-integration-tests/action.yml +++ b/.github/actions/python-integration-tests/action.yml @@ -40,7 +40,7 @@ runs: - name: Install dependencies run: | poetry install --with dev - poetry run pip install -U langchain langchain-openai langchain-anthropic tiktoken rapidfuzz vcrpy numpy opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http + poetry run pip install -U langchain langchain-openai langchain-anthropic tiktoken rapidfuzz vcrpy numpy shell: bash working-directory: python diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 913af620ca..45348612c7 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -106,7 +106,7 @@ HAS_OTEL = False try: if ls_utils.is_truish(ls_utils.get_env_var("OTEL_ENABLED")): - from opentelemetry import trace as otel_trace + from opentelemetry import trace as otel_trace # type: ignore[import] from langsmith._internal.otel._otel_client import ( get_otlp_tracer_provider, @@ -115,7 +115,9 @@ HAS_OTEL = True except ImportError: - pass + raise ImportError( + "To use OTEL tracing, you must install it with `pip install langsmith[otel]`" + ) try: from zoneinfo import ZoneInfo # type: ignore[import-not-found]