{"id":23954,"library":"langsmith-fetch","title":"LangSmith Fetch","description":"Minimal CLI and library for fetching LangSmith threads and traces. Version 0.3.1, regular releases on PyPI.","status":"active","version":"0.3.1","language":"python","source_language":"en","source_url":"https://github.com/langchain-ai/langsmith-fetch","tags":["langsmith","llm","tracing","cli","debugging"],"install":[{"cmd":"pip install langsmith-fetch","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for LangSmith API interaction","package":"langsmith","optional":false},{"reason":"Used for CLI interface","package":"click","optional":false}],"imports":[{"note":"Incorrect submodule path","wrong":"from langsmith_fetch.fetch import LangSmithFetch","symbol":"LangSmithFetch","correct":"from langsmith_fetch import LangSmithFetch"},{"note":"Function is not in the main langsmith package","wrong":"from langsmith import fetch_thread","symbol":"fetch_thread","correct":"from langsmith_fetch import fetch_thread"},{"note":"","wrong":"","symbol":"fetch_trace","correct":"from langsmith_fetch import fetch_trace"},{"note":"main is in cli module, not top-level","wrong":"from langsmith_fetch import main","symbol":"main","correct":"from langsmith_fetch.cli import main"}],"quickstart":{"code":"import os\nfrom langsmith_fetch import fetch_thread\n\napi_key = os.environ.get('LANGSMITH_API_KEY', '')\nresult = fetch_thread('thread_id_here', api_key=api_key)\nprint(result)","lang":"python","description":"Fetch a LangSmith thread by ID using environment variable for API key."},"warnings":[{"fix":"Be consistent with casing and dashes depending on usage.","message":"The CLI and Python API have different parameter names. Use `--api-key` for CLI, `api_key` for Python.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use Python 3.10 or newer.","message":"Python 3.9 support dropped in 0.3.0, requires Python >=3.10.","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Always provide `api_key` parameter or use `--api-key` flag in CLI.","message":"API key must be passed explicitly; reading from environment is not automatic.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Access attributes directly instead of dict keys, e.g., `trace.id` instead of `trace['id']`.","message":"In version 0.3.0, the return format of `fetch_trace` changed from dict to custom Trace object.","severity":"breaking","affected_versions":"0.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install with `pip install langsmith-fetch` and import with `from langsmith_fetch import ...`.","cause":"Package not installed or installed under different name.","error":"ModuleNotFoundError: No module named 'langsmith_fetch'"},{"fix":"Set the LANGSMITH_API_KEY environment variable or pass `api_key` parameter.","cause":"Missing or incorrect LangSmith API key.","error":"langsmith_fetch.exceptions.AuthenticationError: Invalid API key"},{"fix":"Add `api_key=os.environ.get('LANGSMITH_API_KEY')` to the function call.","cause":"API key not provided.","error":"TypeError: fetch_thread() missing 1 required positional argument: 'api_key'"},{"fix":"Access attributes directly, e.g., `trace.id`, `trace.runs`.","cause":"Assuming returned object is a dict in version >=0.3.0.","error":"AttributeError: 'Trace' object has no attribute 'items'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}