langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
95.52k stars 15.51k forks source link

langchain template list - 404 and never loads package #28031

Open markalosey opened 2 weeks ago

markalosey commented 2 weeks ago

Checked other resources

Example Code

# langchain templates list

Error Message and Stack Trace (if applicable)

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/mlosey/.local/pipx/venvs/langchain-cli/lib/python3.13/site-packages/langchain_cli/namespa │
│ ces/template.py:152 in list                                                                      │
│                                                                                                  │
│   149 │   """                                                                                    │
│   150 │   from langchain_cli.utils.github import list_packages                                   │
│   151 │                                                                                          │
│ ❱ 152 │   packages = list_packages(contains=contains)                                            │
│   153 │   for package in packages:                                                               │
│   154 │   │   typer.echo(package)                                                                │
│   155                                                                                            │
│                                                                                                  │
│ ╭──── locals ─────╮                                                                              │
│ │ contains = None │                                                                              │
│ ╰─────────────────╯                                                                              │
│                                                                                                  │
│ /Users/mlosey/.local/pipx/venvs/langchain-cli/lib/python3.13/site-packages/langchain_cli/utils/g │
│ ithub.py:24 in list_packages                                                                     │
│                                                                                                  │
│   21 │                                                                                           │
│   22 │   data = json.loads(res_str)                                                              │
│   23 │   package_names = [                                                                       │
│ ❱ 24 │   │   p["name"] for p in data if p["type"] == "dir" and p["name"] != "docs"               │
│   25 │   ]                                                                                       │
│   26 │   package_names_filtered = (                                                              │
│   27 │   │   [p for p in package_names if contains in p] if contains else package_names          │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │     conn = <http.client.HTTPSConnection object at 0x1067daf90>                               │ │
│ │ contains = None                                                                              │ │
│ │     data = {                                                                                 │ │
│ │            │   'message': 'Not Found',                                                       │ │
│ │            │   'documentation_url':                                                          │ │
│ │            'https://docs.github.com/rest/repos/contents#get-repository-content',             │ │
│ │            │   'status': '404'                                                               │ │
│ │            }                                                                                 │ │
│ │  headers = {                                                                                 │ │
│ │            │   'Accept': 'application/vnd.github+json',                                      │ │
│ │            │   'X-GitHub-Api-Version': '2022-11-28',                                         │ │
│ │            │   'User-Agent': 'langchain-cli'                                                 │ │
│ │            }                                                                                 │ │
│ │      res = <http.client.HTTPResponse object at 0x1067c8550>                                  │ │
│ │  res_str = b'{"message":"Not                                                                 │ │
│ │            Found","documentation_url":"https://docs.github.com/rest/repos/c'+47              │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: string indices must be integers, not 'str'

Description

System Info

System Information

OS: Darwin OS Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000 Python Version: 3.13.0 (main, Oct 7 2024, 05:02:14) [Clang 16.0.0 (clang-1600.0.26.4)]

Package Information

langchain_core: 0.2.43 langsmith: 0.1.142 langchain_cli: 0.0.31 langserve: 0.2.3

Optional packages not installed

langgraph

Other Dependencies

fastapi: 0.115.4 gitpython: 3.1.43 gritql: 0.1.5 httpx: 0.27.2 jsonpatch: 1.33 langserve[all]: Installed. No version info available. orjson: 3.10.11 packaging: 24.2 pydantic: 1.10.19 pyproject-toml: 0.0.10 PyYAML: 6.0.2 requests: 2.32.3 requests-toolbelt: 1.0.0 sse-starlette: 1.8.2 tenacity: 8.5.0 tomlkit: 0.12.5 typer[all]: Installed. No version info available. typing-extensions: 4.12.2 uvicorn: 0.23.2

zoneria commented 2 weeks ago

Did you find a solution?