Guest User

Untitled

a guest
Jun 12th, 2024
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 118.94 KB | None | 0 0
  1. root@a55ffcb627e4:/# fastapi dev app
  2. INFO Using path app
  3. INFO Resolved absolute path /app
  4. INFO Searching for package file structure from directories with __init__.py files
  5. INFO Importing from /
  6.  
  7. ╭─ Python package file structure ─╮
  8. │ │
  9. │ 📁 app │
  10. │ └── 🐍 __init__.py │
  11. │ │
  12. ╰─────────────────────────────────╯
  13.  
  14. INFO Importing module app
  15. ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
  16. │ /app/.venv/lib/python3.12/site-packages/fastapi_cli/cli.py:174 in dev │
  17. │ │
  18. │ 171 │ │
  19. │ 172 │ Otherwise, it uses the first [bold]FastAPI[/bold] app found in the imported module o │
  20. │ 173 │ """ │
  21. │ ❱ 174 │ _run( │
  22. │ 175 │ │ path=path, │
  23. │ 176 │ │ host=host, │
  24. │ 177 │ │ port=port, │
  25. │ │
  26. │ ╭───────────── locals ─────────────╮ │
  27. │ │ app = None │ │
  28. │ │ host = '127.0.0.1' │ │
  29. │ │ path = PosixPath('app') │ │
  30. │ │ port = 8000 │ │
  31. │ │ proxy_headers = True │ │
  32. │ │ reload = True │ │
  33. │ │ root_path = '' │ │
  34. │ ╰──────────────────────────────────╯ │
  35. │ │
  36. │ /app/.venv/lib/python3.12/site-packages/fastapi_cli/cli.py:65 in _run │
  37. │ │
  38. │ 62 │ proxy_headers: bool = False, │
  39. │ 63 ) -> None: │
  40. │ 64 │ try: │
  41. │ ❱ 65 │ │ use_uvicorn_app = get_import_string(path=path, app_name=app) │
  42. │ 66 │ except FastAPICLIException as e: │
  43. │ 67 │ │ logger.error(str(e)) │
  44. │ 68 │ │ raise typer.Exit(code=1) from None │
  45. │ │
  46. │ ╭───────────── locals ─────────────╮ │
  47. │ │ app = None │ │
  48. │ │ command = 'dev' │ │
  49. │ │ host = '127.0.0.1' │ │
  50. │ │ path = PosixPath('app') │ │
  51. │ │ port = 8000 │ │
  52. │ │ proxy_headers = True │ │
  53. │ │ reload = True │ │
  54. │ │ root_path = '' │ │
  55. │ │ workers = None │ │
  56. │ ╰──────────────────────────────────╯ │
  57. │ │
  58. │ /app/.venv/lib/python3.12/site-packages/fastapi_cli/discover.py:154 in get_import_string │
  59. │ │
  60. │ 151 │ │ raise FastAPICLIException(f"Path does not exist {path}") │
  61. │ 152 │ mod_data = get_module_data_from_path(path) │
  62. │ 153 │ sys.path.insert(0, str(mod_data.extra_sys_path)) │
  63. │ ❱ 154 │ use_app_name = get_app_name(mod_data=mod_data, app_name=app_name) │
  64. │ 155 │ import_example = Syntax( │
  65. │ 156 │ │ f"from {mod_data.module_import_str} import {use_app_name}", "python" │
  66. │ 157 │ ) │
  67. │ │
  68. │ ╭─────────────────────────────────── locals ────────────────────────────────────╮ │
  69. │ │ app_name = None │ │
  70. │ │ mod_data = ModuleData(module_import_str='app', extra_sys_path=PosixPath('/')) │ │
  71. │ │ path = PosixPath('app') │ │
  72. │ ╰───────────────────────────────────────────────────────────────────────────────╯ │
  73. │ │
  74. │ /app/.venv/lib/python3.12/site-packages/fastapi_cli/discover.py:107 in get_app_name │
  75. │ │
  76. │ 104 │
  77. │ 105 def get_app_name(*, mod_data: ModuleData, app_name: Union[str, None] = None) -> str: │
  78. │ 106 │ try: │
  79. │ ❱ 107 │ │ mod = importlib.import_module(mod_data.module_import_str) │
  80. │ 108 │ except (ImportError, ValueError) as e: │
  81. │ 109 │ │ logger.error(f"Import error: {e}") │
  82. │ 110 │ │ logger.warning( │
  83. │ │
  84. │ ╭─────────────────────────────────── locals ────────────────────────────────────╮ │
  85. │ │ app_name = None │ │
  86. │ │ mod_data = ModuleData(module_import_str='app', extra_sys_path=PosixPath('/')) │ │
  87. │ ╰───────────────────────────────────────────────────────────────────────────────╯ │
  88. │ │
  89. │ /usr/local/lib/python3.12/importlib/__init__.py:90 in import_module │
  90. │ │
  91. │ 87 │ │ │ if character != '.': │
  92. │ 88 │ │ │ │ break │
  93. │ 89 │ │ │ level += 1 │
  94. │ ❱ 90 │ return _bootstrap._gcd_import(name[level:], package, level) │
  95. │ 91 │
  96. │ 92 │
  97. │ 93 _RELOADING = {} │
  98. │ │
  99. │ ╭──── locals ─────╮ │
  100. │ │ level = 0 │ │
  101. │ │ name = 'app' │ │
  102. │ │ package = None │ │
  103. │ ╰─────────────────╯ │
  104. │ in _gcd_import:1387 │
  105. │ ╭──── locals ─────╮ │
  106. │ │ level = 0 │ │
  107. │ │ name = 'app' │ │
  108. │ │ package = None │ │
  109. │ ╰─────────────────╯ │
  110. │ in _find_and_load:1360 │
  111. │ ╭────────────────────── locals ──────────────────────╮ │
  112. │ │ import_ = <function _gcd_import at 0x7384b458c0e0> │ │
  113. │ │ module = <object object at 0x7384b4564060> │ │
  114. │ │ name = 'app' │ │
  115. │ ╰────────────────────────────────────────────────────╯ │
  116. │ in _find_and_load_unlocked:1331 │
  117. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  118. │ │ import_ = <function _gcd_import at 0x7384b458c0e0> │ │
  119. │ │ name = 'app' │ │
  120. │ │ parent = '' │ │
  121. │ │ parent_spec = None │ │
  122. │ │ path = None │ │
  123. │ │ spec = ModuleSpec(name='app', loader=<_frozen_importlib_external.SourceFileLoader │ │
  124. │ │ object at 0x7384b1f6b8f0>, origin='/app/__init__.py', │ │
  125. │ │ submodule_search_locations=['/app']) │ │
  126. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  127. │ in _load_unlocked:935 │
  128. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  129. │ │ module = <module 'app' from '/app/__init__.py'> │ │
  130. │ │ spec = ModuleSpec(name='app', loader=<_frozen_importlib_external.SourceFileLoader object │ │
  131. │ │ at 0x7384b1f6b8f0>, origin='/app/__init__.py', submodule_search_locations=['/app']) │ │
  132. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  133. │ in exec_module:995 │
  134. │ ╭────────────────────────────────────── locals ──────────────────────────────────────╮ │
  135. │ │ code = <code object <module> at 0x7384b1f41d70, file "/app/__init__.py", line 1> │ │
  136. │ │ module = <module 'app' from '/app/__init__.py'> │ │
  137. │ │ self = <_frozen_importlib_external.SourceFileLoader object at 0x7384b1f6b8f0> │ │
  138. │ ╰────────────────────────────────────────────────────────────────────────────────────╯ │
  139. │ in _call_with_frames_removed:488 │
  140. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  141. │ │ args = ( │ │
  142. │ │ │ <code object <module> at 0x7384b1f41d70, file "/app/__init__.py", line 1>, │ │
  143. │ │ │ { │ │
  144. │ │ │ │ '__name__': 'app', │ │
  145. │ │ │ │ '__doc__': None, │ │
  146. │ │ │ │ '__package__': 'app', │ │
  147. │ │ │ │ '__loader__': <_frozen_importlib_external.SourceFileLoader object at │ │
  148. │ │ 0x7384b1f6b8f0>, │ │
  149. │ │ │ │ '__spec__': ModuleSpec(name='app', │ │
  150. │ │ loader=<_frozen_importlib_external.SourceFileLoader object at 0x7384b1f6b8f0>, │ │
  151. │ │ origin='/app/__init__.py', submodule_search_locations=['/app']), │ │
  152. │ │ │ │ '__path__': ['/app'], │ │
  153. │ │ │ │ '__file__': '/app/__init__.py', │ │
  154. │ │ │ │ '__cached__': '/app/__pycache__/__init__.cpython-312.pyc', │ │
  155. │ │ │ │ '__builtins__': { │ │
  156. │ │ │ │ │ '__name__': 'builtins', │ │
  157. │ │ │ │ │ '__doc__': 'Built-in functions, types, exceptions, and other │ │
  158. │ │ objects.\n\nThis module provides '+346, │ │
  159. │ │ │ │ │ '__package__': '', │ │
  160. │ │ │ │ │ '__loader__': <class '_frozen_importlib.BuiltinImporter'>, │ │
  161. │ │ │ │ │ '__spec__': ModuleSpec(name='builtins', loader=<class │ │
  162. │ │ '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │
  163. │ │ │ │ │ '__build_class__': <built-in function __build_class__>, │ │
  164. │ │ │ │ │ '__import__': <built-in function __import__>, │ │
  165. │ │ │ │ │ 'abs': <built-in function abs>, │ │
  166. │ │ │ │ │ 'all': <built-in function all>, │ │
  167. │ │ │ │ │ 'any': <built-in function any>, │ │
  168. │ │ │ │ │ ... +148 │ │
  169. │ │ │ │ }, │ │
  170. │ │ │ │ 'constants': <module 'app.constants' from '/app/constants.py'>, │ │
  171. │ │ │ │ ... +3 │ │
  172. │ │ │ } │ │
  173. │ │ ) │ │
  174. │ │ f = <built-in function exec> │ │
  175. │ │ kwds = {} │ │
  176. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  177. │ │
  178. │ /app/__init__.py:1 in <module> │
  179. │ │
  180. │ ❱ 1 from .nexus import app # noqa: F401 │
  181. │ 2 │
  182. │ │
  183. │ ╭────────────────────────────── locals ──────────────────────────────╮ │
  184. │ │ constants = <module 'app.constants' from '/app/constants.py'> │ │
  185. │ │ models = <module 'app.models' from '/app/models/__init__.py'> │ │
  186. │ │ routers = <module 'app.routers' from '/app/routers/__init__.py'> │ │
  187. │ │ utils = <module 'app.utils' from '/app/utils/__init__.py'> │ │
  188. │ ╰────────────────────────────────────────────────────────────────────╯ │
  189. │ │
  190. │ /app/nexus.py:6 in <module> │
  191. │ │
  192. │ 3 from starlette.middleware import Middleware │
  193. │ 4 │
  194. │ 5 from app.constants import AppConfig │
  195. │ ❱ 6 from app.routers import chat, embeddings, status, summary │
  196. │ 7 │
  197. │ 8 installed_middleware = [ │
  198. │ 9 │ Middleware( │
  199. │ │
  200. │ ╭────────────────────────────── locals ───────────────────────────────╮ │
  201. │ │ AppConfig = <class 'app.constants.AppConfig'> │ │
  202. │ │ CORSMiddleware = <class 'starlette.middleware.cors.CORSMiddleware'> │ │
  203. │ │ FastAPI = <class 'fastapi.applications.FastAPI'> │ │
  204. │ │ Middleware = <class 'starlette.middleware.Middleware'> │ │
  205. │ ╰─────────────────────────────────────────────────────────────────────╯ │
  206. │ │
  207. │ /app/routers/chat.py:7 in <module> │
  208. │ │
  209. │ 4 │
  210. │ 5 from app.constants import ErrorMessages │
  211. │ 6 from app.models.chat_request import ChatRequest │
  212. │ ❱ 7 from app.utils.retrieve_question_response import retrieve_question_response │
  213. │ 8 │
  214. │ 9 router = APIRouter() │
  215. │ 10 │
  216. │ │
  217. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  218. │ │ APIRouter = <class 'fastapi.routing.APIRouter'> │ │
  219. │ │ ChatRequest = <class 'app.models.chat_request.ChatRequest'> │ │
  220. │ │ ErrorMessages = <class 'app.constants.ErrorMessages'> │ │
  221. │ │ JSONResponse = <class 'starlette.responses.JSONResponse'> │ │
  222. │ │ requests = <module 'requests' from │ │
  223. │ │ '/app/.venv/lib/python3.12/site-packages/requests/__init__.py'> │ │
  224. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  225. │ │
  226. │ /app/utils/retrieve_question_response.py:8 in <module> │
  227. │ │
  228. │ 5 import chromadb │
  229. │ 6 from chromadb import ClientAPI │
  230. │ 7 from fastapi import HTTPException │
  231. │ ❱ 8 from langchain_chroma import Chroma │
  232. │ 9 from langchain_community.embeddings import HuggingFaceBgeEmbeddings │
  233. │ 10 from langchain_core.documents import Document │
  234. │ 11 from langchain_core.output_parsers import StrOutputParser │
  235. │ │
  236. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  237. │ │ Any = typing.Any │ │
  238. │ │ chromadb = <module 'chromadb' from │ │
  239. │ │ '/app/.venv/lib/python3.12/site-packages/chromadb/__init__.py'> │ │
  240. │ │ ClientAPI = <class 'chromadb.api.ClientAPI'> │ │
  241. │ │ HTTPException = <class 'fastapi.exceptions.HTTPException'> │ │
  242. │ │ suppress = <class 'contextlib.suppress'> │ │
  243. │ │ UUID = <class 'uuid.UUID'> │ │
  244. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  245. │ │
  246. │ /app/.venv/lib/python3.12/site-packages/langchain_chroma/__init__.py:1 in <module> │
  247. │ │
  248. │ ❱ 1 from langchain_chroma.vectorstores import Chroma │
  249. │ 2 │
  250. │ 3 __all__ = [ │
  251. │ 4 │ "Chroma", │
  252. │ │
  253. │ /app/.venv/lib/python3.12/site-packages/langchain_chroma/vectorstores.py:22 in <module> │
  254. │ │
  255. │ 19 import chromadb │
  256. │ 20 import chromadb.config │
  257. │ 21 import numpy as np │
  258. │ ❱ 22 from langchain_core.documents import Document │
  259. │ 23 from langchain_core.embeddings import Embeddings │
  260. │ 24 from langchain_core.utils import xor_args │
  261. │ 25 from langchain_core.vectorstores import VectorStore │
  262. │ │
  263. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  264. │ │ annotations = _Feature((3, 7, 0, 'beta', 1), None, 16777216) │ │
  265. │ │ Any = typing.Any │ │
  266. │ │ base64 = <module 'base64' from '/usr/local/lib/python3.12/base64.py'> │ │
  267. │ │ Callable = typing.Callable │ │
  268. │ │ chromadb = <module 'chromadb' from │ │
  269. │ │ '/app/.venv/lib/python3.12/site-packages/chromadb/__init__.py'> │ │
  270. │ │ Dict = typing.Dict │ │
  271. │ │ Iterable = typing.Iterable │ │
  272. │ │ List = typing.List │ │
  273. │ │ logging = <module 'logging' from '/usr/local/lib/python3.12/logging/__init__.py'> │ │
  274. │ │ np = <module 'numpy' from │ │
  275. │ │ '/app/.venv/lib/python3.12/site-packages/numpy/__init__.py'> │ │
  276. │ │ Optional = typing.Optional │ │
  277. │ │ Tuple = typing.Tuple │ │
  278. │ │ Type = typing.Type │ │
  279. │ │ TYPE_CHECKING = False │ │
  280. │ │ Union = typing.Union │ │
  281. │ │ uuid = <module 'uuid' from '/usr/local/lib/python3.12/uuid.py'> │ │
  282. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  283. │ │
  284. │ /app/.venv/lib/python3.12/site-packages/langchain_core/documents/__init__.py:6 in <module> │
  285. │ │
  286. │ 3 │
  287. │ 4 """ │
  288. │ 5 from langchain_core.documents.base import Document │
  289. │ ❱ 6 from langchain_core.documents.compressor import BaseDocumentCompressor │
  290. │ 7 from langchain_core.documents.transformers import BaseDocumentTransformer │
  291. │ 8 │
  292. │ 9 __all__ = ["Document", "BaseDocumentTransformer", "BaseDocumentCompressor"] │
  293. │ │
  294. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  295. │ │ base = <module 'langchain_core.documents.base' from │ │
  296. │ │ '/app/.venv/lib/python3.12/site-packages/langchain_core/documents/base.py'> │ │
  297. │ │ Document = <class 'langchain_core.documents.base.Document'> │ │
  298. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  299. │ │
  300. │ /app/.venv/lib/python3.12/site-packages/langchain_core/documents/compressor.py:6 in <module> │
  301. │ │
  302. │ 3 from abc import ABC, abstractmethod │
  303. │ 4 from typing import Optional, Sequence │
  304. │ 5 │
  305. │ ❱ 6 from langchain_core.callbacks import Callbacks │
  306. │ 7 from langchain_core.documents import Document │
  307. │ 8 from langchain_core.pydantic_v1 import BaseModel │
  308. │ 9 from langchain_core.runnables import run_in_executor │
  309. │ │
  310. │ ╭──────────────────────────── locals ─────────────────────────────╮ │
  311. │ │ ABC = <class 'abc.ABC'> │ │
  312. │ │ abstractmethod = <function abstractmethod at 0x7384b45d6480> │ │
  313. │ │ annotations = _Feature((3, 7, 0, 'beta', 1), None, 16777216) │ │
  314. │ │ Optional = typing.Optional │ │
  315. │ │ Sequence = typing.Sequence │ │
  316. │ ╰─────────────────────────────────────────────────────────────────╯ │
  317. │ │
  318. │ /app/.venv/lib/python3.12/site-packages/langchain_core/callbacks/__init__.py:22 in <module> │
  319. │ │
  320. │ 19 │ ToolManagerMixin, │
  321. │ 20 ) │
  322. │ 21 from langchain_core.callbacks.file import FileCallbackHandler │
  323. │ ❱ 22 from langchain_core.callbacks.manager import ( │
  324. │ 23 │ AsyncCallbackManager, │
  325. │ 24 │ AsyncCallbackManagerForChainGroup, │
  326. │ 25 │ AsyncCallbackManagerForChainRun, │
  327. │ │
  328. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  329. │ │ AsyncCallbackHandler = <class 'langchain_core.callbacks.base.AsyncCallbackHandler'> │ │
  330. │ │ base = <module 'langchain_core.callbacks.base' from │ │
  331. │ │ '/app/.venv/lib/python3.12/site-packages/langchain_core/callbacks/b… │ │
  332. │ │ BaseCallbackHandler = <class 'langchain_core.callbacks.base.BaseCallbackHandler'> │ │
  333. │ │ BaseCallbackManager = <class 'langchain_core.callbacks.base.BaseCallbackManager'> │ │
  334. │ │ CallbackManagerMixin = <class 'langchain_core.callbacks.base.CallbackManagerMixin'> │ │
  335. │ │ Callbacks = typing.Union[typing.List[langchain_core.callbacks.base.BaseCallback… │ │
  336. │ │ langchain_core.callbacks.base.BaseCallbackManager, NoneType] │ │
  337. │ │ ChainManagerMixin = <class 'langchain_core.callbacks.base.ChainManagerMixin'> │ │
  338. │ │ file = <module 'langchain_core.callbacks.file' from │ │
  339. │ │ '/app/.venv/lib/python3.12/site-packages/langchain_core/callbacks/f… │ │
  340. │ │ FileCallbackHandler = <class 'langchain_core.callbacks.file.FileCallbackHandler'> │ │
  341. │ │ LLMManagerMixin = <class 'langchain_core.callbacks.base.LLMManagerMixin'> │ │
  342. │ │ RetrieverManagerMixin = <class 'langchain_core.callbacks.base.RetrieverManagerMixin'> │ │
  343. │ │ RunManagerMixin = <class 'langchain_core.callbacks.base.RunManagerMixin'> │ │
  344. │ │ ToolManagerMixin = <class 'langchain_core.callbacks.base.ToolManagerMixin'> │ │
  345. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  346. │ │
  347. │ /app/.venv/lib/python3.12/site-packages/langchain_core/callbacks/manager.py:29 in <module> │
  348. │ │
  349. │ 26 ) │
  350. │ 27 from uuid import UUID │
  351. │ 28 │
  352. │ ❱ 29 from langsmith.run_helpers import get_run_tree_context │
  353. │ 30 from tenacity import RetryCallState │
  354. │ 31 │
  355. │ 32 from langchain_core.callbacks.base import ( │
  356. │ │
  357. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  358. │ │ ABC = <class 'abc.ABC'> │ │
  359. │ │ abstractmethod = <function abstractmethod at 0x7384b45d6480> │ │
  360. │ │ annotations = _Feature((3, 7, 0, 'beta', 1), None, 16777216) │ │
  361. │ │ Any = typing.Any │ │
  362. │ │ asynccontextmanager = <function asynccontextmanager at 0x7384b42a6160> │ │
  363. │ │ AsyncGenerator = typing.AsyncGenerator │ │
  364. │ │ asyncio = <module 'asyncio' from │ │
  365. │ │ '/usr/local/lib/python3.12/asyncio/__init__.py'> │ │
  366. │ │ Callable = typing.Callable │ │
  367. │ │ cast = <function cast at 0x7384b41c3100> │ │
  368. │ │ contextmanager = <function contextmanager at 0x7384b42a5260> │ │
  369. │ │ copy_context = <built-in function copy_context> │ │
  370. │ │ Coroutine = typing.Coroutine │ │
  371. │ │ Dict = typing.Dict │ │
  372. │ │ functools = <module 'functools' from '/usr/local/lib/python3.12/functools.py'> │ │
  373. │ │ Generator = typing.Generator │ │
  374. │ │ List = typing.List │ │
  375. │ │ logging = <module 'logging' from │ │
  376. │ │ '/usr/local/lib/python3.12/logging/__init__.py'> │ │
  377. │ │ Optional = typing.Optional │ │
  378. │ │ Sequence = typing.Sequence │ │
  379. │ │ ThreadPoolExecutor = <class 'concurrent.futures.thread.ThreadPoolExecutor'> │ │
  380. │ │ Type = typing.Type │ │
  381. │ │ TYPE_CHECKING = False │ │
  382. │ │ TypeVar = <class 'typing.TypeVar'> │ │
  383. │ │ Union = typing.Union │ │
  384. │ │ uuid = <module 'uuid' from '/usr/local/lib/python3.12/uuid.py'> │ │
  385. │ │ UUID = <class 'uuid.UUID'> │ │
  386. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  387. │ │
  388. │ /app/.venv/lib/python3.12/site-packages/langsmith/run_helpers.py:38 in <module> │
  389. │ │
  390. │ 35 │ runtime_checkable, │
  391. │ 36 ) │
  392. │ 37 │
  393. │ ❱ 38 from langsmith import client as ls_client │
  394. │ 39 from langsmith import run_trees, utils │
  395. │ 40 from langsmith._internal import _aiter as aitertools │
  396. │ 41 │
  397. │ │
  398. │ ╭────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  399. │ │ annotations = _Feature((3, 7, 0, 'beta', 1), None, 16777216) │ │
  400. │ │ Any = typing.Any │ │
  401. │ │ AsyncGenerator = typing.AsyncGenerator │ │
  402. │ │ asyncio = <module 'asyncio' from '/usr/local/lib/python3.12/asyncio/__init__.py'> │ │
  403. │ │ Awaitable = typing.Awaitable │ │
  404. │ │ Callable = typing.Callable │ │
  405. │ │ cast = <function cast at 0x7384b41c3100> │ │
  406. │ │ contextlib = <module 'contextlib' from '/usr/local/lib/python3.12/contextlib.py'> │ │
  407. │ │ contextvars = <module 'contextvars' from '/usr/local/lib/python3.12/contextvars.py'> │ │
  408. │ │ copy_context = <built-in function copy_context> │ │
  409. │ │ datetime = <module 'datetime' from '/usr/local/lib/python3.12/datetime.py'> │ │
  410. │ │ Dict = typing.Dict │ │
  411. │ │ functools = <module 'functools' from '/usr/local/lib/python3.12/functools.py'> │ │
  412. │ │ Generator = typing.Generator │ │
  413. │ │ Generic = <class 'typing.Generic'> │ │
  414. │ │ inspect = <module 'inspect' from '/usr/local/lib/python3.12/inspect.py'> │ │
  415. │ │ List = typing.List │ │
  416. │ │ logging = <module 'logging' from '/usr/local/lib/python3.12/logging/__init__.py'> │ │
  417. │ │ Mapping = typing.Mapping │ │
  418. │ │ Optional = typing.Optional │ │
  419. │ │ overload = <function overload at 0x7384b41c37e0> │ │
  420. │ │ Protocol = <class 'typing.Protocol'> │ │
  421. │ │ runtime_checkable = <function runtime_checkable at 0x7384b41c2700> │ │
  422. │ │ Tuple = typing.Tuple │ │
  423. │ │ Type = typing.Type │ │
  424. │ │ TYPE_CHECKING = False │ │
  425. │ │ TypedDict = <function TypedDict at 0x7384b41cc2c0> │ │
  426. │ │ TypeVar = <class 'typing.TypeVar'> │ │
  427. │ │ Union = typing.Union │ │
  428. │ │ uuid = <module 'uuid' from '/usr/local/lib/python3.12/uuid.py'> │ │
  429. │ │ warnings = <module 'warnings' from '/usr/local/lib/python3.12/warnings.py'> │ │
  430. │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯ │
  431. │ │
  432. │ /app/.venv/lib/python3.12/site-packages/langsmith/client.py:52 in <module> │
  433. │ │
  434. │ 49 from urllib3.util import Retry │
  435. │ 50 │
  436. │ 51 import langsmith │
  437. │ ❱ 52 from langsmith import env as ls_env │
  438. │ 53 from langsmith import schemas as ls_schemas │
  439. │ 54 from langsmith import utils as ls_utils │
  440. │ 55 │
  441. │ │
  442. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  443. │ │ annotations = _Feature((3, 7, 0, 'beta', 1), None, 16777216) │ │
  444. │ │ Any = typing.Any │ │
  445. │ │ atexit = <module 'atexit' (built-in)> │ │
  446. │ │ Callable = typing.Callable │ │
  447. │ │ cast = <function cast at 0x7384b41c3100> │ │
  448. │ │ collections = <module 'collections' from │ │
  449. │ │ '/usr/local/lib/python3.12/collections/__init__.py'> │ │
  450. │ │ dataclass = <function dataclass at 0x7384b3da62a0> │ │
  451. │ │ datetime = <module 'datetime' from '/usr/local/lib/python3.12/datetime.py'> │ │
  452. │ │ DefaultDict = typing.DefaultDict │ │
  453. │ │ Dict = typing.Dict │ │
  454. │ │ Empty = <class '_queue.Empty'> │ │
  455. │ │ field = <function field at 0x7384b3da4b80> │ │
  456. │ │ functools = <module 'functools' from '/usr/local/lib/python3.12/functools.py'> │ │
  457. │ │ importlib = <module 'importlib' from │ │
  458. │ │ '/usr/local/lib/python3.12/importlib/__init__.py'> │ │
  459. │ │ io = <module 'io' (frozen)> │ │
  460. │ │ Iterable = typing.Iterable │ │
  461. │ │ Iterator = typing.Iterator │ │
  462. │ │ json = <module 'json' from '/usr/local/lib/python3.12/json/__init__.py'> │ │
  463. │ │ langsmith = <module 'langsmith' from │ │
  464. │ │ '/app/.venv/lib/python3.12/site-packages/langsmith/__init__.py'> │ │
  465. │ │ List = typing.List │ │
  466. │ │ Literal = typing.Literal │ │
  467. │ │ logging = <module 'logging' from '/usr/local/lib/python3.12/logging/__init__.py'> │ │
  468. │ │ Mapping = typing.Mapping │ │
  469. │ │ Optional = typing.Optional │ │
  470. │ │ orjson = <module 'orjson' from │ │
  471. │ │ '/app/.venv/lib/python3.12/site-packages/orjson/__init__.py'> │ │
  472. │ │ os = <module 'os' (frozen)> │ │
  473. │ │ PriorityQueue = <class 'queue.PriorityQueue'> │ │
  474. │ │ Queue = <class 'queue.Queue'> │ │
  475. │ │ random = <module 'random' from '/usr/local/lib/python3.12/random.py'> │ │
  476. │ │ re = <module 're' from '/usr/local/lib/python3.12/re/__init__.py'> │ │
  477. │ │ requests = <module 'requests' from │ │
  478. │ │ '/app/.venv/lib/python3.12/site-packages/requests/__init__.py'> │ │
  479. │ │ requests_adapters = <module 'requests.adapters' from │ │
  480. │ │ '/app/.venv/lib/python3.12/site-packages/requests/adapters.py'> │ │
  481. │ │ Retry = <class 'urllib3.util.retry.Retry'> │ │
  482. │ │ Sequence = typing.Sequence │ │
  483. │ │ socket = <module 'socket' from '/usr/local/lib/python3.12/socket.py'> │ │
  484. │ │ sys = <module 'sys' (built-in)> │ │
  485. │ │ threading = <module 'threading' from '/usr/local/lib/python3.12/threading.py'> │ │
  486. │ │ time = <module 'time' (built-in)> │ │
  487. │ │ Tuple = typing.Tuple │ │
  488. │ │ Type = typing.Type │ │
  489. │ │ TYPE_CHECKING = False │ │
  490. │ │ Union = typing.Union │ │
  491. │ │ urllib_parse = <module 'urllib.parse' from '/usr/local/lib/python3.12/urllib/parse.py'> │ │
  492. │ │ uuid = <module 'uuid' from '/usr/local/lib/python3.12/uuid.py'> │ │
  493. │ │ warnings = <module 'warnings' from '/usr/local/lib/python3.12/warnings.py'> │ │
  494. │ │ weakref = <module 'weakref' from '/usr/local/lib/python3.12/weakref.py'> │ │
  495. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  496. │ │
  497. │ /app/.venv/lib/python3.12/site-packages/langsmith/env/__init__.py:3 in <module> │
  498. │ │
  499. │ 1 """Utilities to get information about the runtime environment.""" │
  500. │ 2 from langsmith.env._git import get_git_info │
  501. │ ❱ 3 from langsmith.env._runtime_env import ( │
  502. │ 4 │ get_docker_compose_command, │
  503. │ 5 │ get_docker_compose_version, │
  504. │ 6 │ get_docker_environment, │
  505. │ │
  506. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  507. │ │ _git = <module 'langsmith.env._git' from │ │
  508. │ │ '/app/.venv/lib/python3.12/site-packages/langsmith/env/_git.py'> │ │
  509. │ │ get_git_info = <functools._lru_cache_wrapper object at 0x7384a940b1c0> │ │
  510. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  511. │ │
  512. │ /app/.venv/lib/python3.12/site-packages/langsmith/env/_runtime_env.py:9 in <module> │
  513. │ │
  514. │ 6 import subprocess │
  515. │ 7 from typing import Dict, List, Optional, Union │
  516. │ 8 │
  517. │ ❱ 9 from langsmith.utils import get_docker_compose_command │
  518. │ 10 from langsmith.env._git import exec_git │
  519. │ 11 │
  520. │ 12 try: │
  521. │ │
  522. │ ╭─────────────────────────────────────── locals ───────────────────────────────────────╮ │
  523. │ │ Dict = typing.Dict │ │
  524. │ │ functools = <module 'functools' from '/usr/local/lib/python3.12/functools.py'> │ │
  525. │ │ List = typing.List │ │
  526. │ │ logging = <module 'logging' from '/usr/local/lib/python3.12/logging/__init__.py'> │ │
  527. │ │ Optional = typing.Optional │ │
  528. │ │ os = <module 'os' (frozen)> │ │
  529. │ │ platform = <module 'platform' from '/usr/local/lib/python3.12/platform.py'> │ │
  530. │ │ subprocess = <module 'subprocess' from '/usr/local/lib/python3.12/subprocess.py'> │ │
  531. │ │ Union = typing.Union │ │
  532. │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ │
  533. │ │
  534. │ /app/.venv/lib/python3.12/site-packages/langsmith/utils.py:29 in <module> │
  535. │ │
  536. │ 26 import requests │
  537. │ 27 from urllib3.util import Retry │
  538. │ 28 │
  539. │ ❱ 29 from langsmith import schemas as ls_schemas │
  540. │ 30 │
  541. │ 31 _LOGGER = logging.getLogger(__name__) │
  542. │ 32 │
  543. │ │
  544. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  545. │ │ Any = typing.Any │ │
  546. │ │ Callable = typing.Callable │ │
  547. │ │ contextlib = <module 'contextlib' from '/usr/local/lib/python3.12/contextlib.py'> │ │
  548. │ │ Dict = typing.Dict │ │
  549. │ │ enum = <module 'enum' from '/usr/local/lib/python3.12/enum.py'> │ │
  550. │ │ functools = <module 'functools' from '/usr/local/lib/python3.12/functools.py'> │ │
  551. │ │ Generator = typing.Generator │ │
  552. │ │ List = typing.List │ │
  553. │ │ logging = <module 'logging' from '/usr/local/lib/python3.12/logging/__init__.py'> │ │
  554. │ │ Mapping = typing.Mapping │ │
  555. │ │ Optional = typing.Optional │ │
  556. │ │ os = <module 'os' (frozen)> │ │
  557. │ │ pathlib = <module 'pathlib' from '/usr/local/lib/python3.12/pathlib.py'> │ │
  558. │ │ requests = <module 'requests' from │ │
  559. │ │ '/app/.venv/lib/python3.12/site-packages/requests/__init__.py'> │ │
  560. │ │ Retry = <class 'urllib3.util.retry.Retry'> │ │
  561. │ │ Sequence = typing.Sequence │ │
  562. │ │ subprocess = <module 'subprocess' from '/usr/local/lib/python3.12/subprocess.py'> │ │
  563. │ │ sys = <module 'sys' (built-in)> │ │
  564. │ │ threading = <module 'threading' from '/usr/local/lib/python3.12/threading.py'> │ │
  565. │ │ traceback = <module 'traceback' from '/usr/local/lib/python3.12/traceback.py'> │ │
  566. │ │ Tuple = typing.Tuple │ │
  567. │ │ Union = typing.Union │ │
  568. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  569. │ │
  570. │ /app/.venv/lib/python3.12/site-packages/langsmith/schemas.py:69 in <module> │
  571. │ │
  572. │ 66 │ split: Optional[Union[str, List[str]]] = None │
  573. │ 67 │
  574. │ 68 │
  575. │ ❱ 69 class Example(ExampleBase): │
  576. │ 70 │ """Example model.""" │
  577. │ 71 │ │
  578. │ 72 │ id: UUID │
  579. │ │
  580. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  581. │ │ annotations = _Feature((3, 7, 0, 'beta', 1), None, 16777216) │ │
  582. │ │ Any = typing.Any │ │
  583. │ │ BaseModel = <class 'pydantic.v1.main.BaseModel'> │ │
  584. │ │ datetime = <class 'datetime.datetime'> │ │
  585. │ │ Decimal = <class 'decimal.Decimal'> │ │
  586. │ │ Dict = typing.Dict │ │
  587. │ │ Enum = <enum 'Enum'> │ │
  588. │ │ ExampleBase = <class 'langsmith.schemas.ExampleBase'> │ │
  589. │ │ ExampleCreate = <class 'langsmith.schemas.ExampleCreate'> │ │
  590. │ │ Field = <function Field at 0x7384b1a25760> │ │
  591. │ │ List = typing.List │ │
  592. │ │ Literal = typing.Literal │ │
  593. │ │ Optional = typing.Optional │ │
  594. │ │ PrivateAttr = <function PrivateAttr at 0x7384b1a25da0> │ │
  595. │ │ Protocol = <class 'typing.Protocol'> │ │
  596. │ │ runtime_checkable = <function runtime_checkable at 0x7384b41c2700> │ │
  597. │ │ SCORE_TYPE = typing.Union[pydantic.v1.types.StrictBool, pydantic.v1.types.StrictInt, │ │
  598. │ │ pydantic.v1.types.StrictFloat, NoneType] │ │
  599. │ │ StrictBool = <class 'pydantic.v1.types.StrictBool'> │ │
  600. │ │ StrictFloat = <class 'pydantic.v1.types.StrictFloat'> │ │
  601. │ │ StrictInt = <class 'pydantic.v1.types.StrictInt'> │ │
  602. │ │ threading = <module 'threading' from '/usr/local/lib/python3.12/threading.py'> │ │
  603. │ │ timedelta = <class 'datetime.timedelta'> │ │
  604. │ │ timezone = <class 'datetime.timezone'> │ │
  605. │ │ TypedDict = <function TypedDict at 0x7384b3f35080> │ │
  606. │ │ Union = typing.Union │ │
  607. │ │ UUID = <class 'uuid.UUID'> │ │
  608. │ │ VALUE_TYPE = typing.Union[typing.Dict, pydantic.v1.types.StrictBool, │ │
  609. │ │ pydantic.v1.types.StrictInt, pydantic.v1.types.StrictFloat, str, │ │
  610. │ │ NoneType] │ │
  611. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  612. │ │
  613. │ /app/.venv/lib/python3.12/site-packages/pydantic/v1/main.py:286 in __new__ │
  614. │ │
  615. │ 283 │ │ # set __signature__ attr only for model class, but not for its instances │
  616. │ 284 │ │ cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls │
  617. │ 285 │ │ if resolve_forward_refs: │
  618. │ ❱ 286 │ │ │ cls.__try_update_forward_refs__() │
  619. │ 287 │ │ │
  620. │ 288 │ │ # preserve `__set_name__` protocol defined in https://peps.python.org/pep-0487 │
  621. │ 289 │ │ # for attributes not in `new_namespace` (e.g. private attributes) │
  622. │ │
  623. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  624. │ │ _custom_root_type = False │ │
  625. │ │ allowed_config_kwargs = { │ │
  626. │ │ │ 'allow_population_by_field_name', │ │
  627. │ │ │ 'json_encoders', │ │
  628. │ │ │ 'getter_dict', │ │
  629. │ │ │ 'prepare_field', │ │
  630. │ │ │ 'validate_assignment', │ │
  631. │ │ │ 'alias_generator', │ │
  632. │ │ │ 'max_anystr_length', │ │
  633. │ │ │ 'json_loads', │ │
  634. │ │ │ 'get_field_info', │ │
  635. │ │ │ 'allow_mutation', │ │
  636. │ │ │ ... +21 │ │
  637. │ │ } │ │
  638. │ │ allowed_types = (<class 'uuid.UUID'>, <class 'NoneType'>) │ │
  639. │ │ ann_name = '_tenant_id' │ │
  640. │ │ ann_type = typing.Optional[uuid.UUID] │ │
  641. │ │ annotations = { │ │
  642. │ │ │ 'id': <class 'uuid.UUID'>, │ │
  643. │ │ │ 'created_at': <class 'datetime.datetime'>, │ │
  644. │ │ │ 'modified_at': typing.Optional[datetime.datetime], │ │
  645. │ │ │ 'runs': ForwardRef('List[Run]'), │ │
  646. │ │ │ 'source_run_id': typing.Optional[uuid.UUID], │ │
  647. │ │ │ '_host_url': typing.Optional[str], │ │
  648. │ │ │ '_tenant_id': typing.Optional[uuid.UUID] │ │
  649. │ │ } │ │
  650. │ │ base = <class 'langsmith.schemas.ExampleBase'> │ │
  651. │ │ base_private_attributes = {} │ │
  652. │ │ bases = (<class 'langsmith.schemas.ExampleBase'>,) │ │
  653. │ │ can_be_changed = True │ │
  654. │ │ class_vars = set() │ │
  655. │ │ cls = <class 'langsmith.schemas.Example'> │ │
  656. │ │ config = <class 'pydantic.v1.config.Config'> │ │
  657. │ │ config_from_namespace = None │ │
  658. │ │ config_kwargs = {} │ │
  659. │ │ exclude_from_namespace = { │ │
  660. │ │ │ 'created_at', │ │
  661. │ │ │ 'metadata', │ │
  662. │ │ │ 'outputs', │ │
  663. │ │ │ '__slots__', │ │
  664. │ │ │ 'inputs', │ │
  665. │ │ │ 'id', │ │
  666. │ │ │ 'source_run_id', │ │
  667. │ │ │ '_tenant_id', │ │
  668. │ │ │ 'modified_at', │ │
  669. │ │ │ '_host_url', │ │
  670. │ │ │ ... +2 │ │
  671. │ │ } │ │
  672. │ │ extra_validators = None │ │
  673. │ │ f = ModelField( │ │
  674. │ │ │ name='metadata', │ │
  675. │ │ │ type=Optional[Mapping[str, Any]], │ │
  676. │ │ │ required=False, │ │
  677. │ │ │ default=None │ │
  678. │ │ ) │ │
  679. │ │ fields = { │ │
  680. │ │ │ 'dataset_id': ModelField( │ │
  681. │ │ │ │ name='dataset_id', │ │
  682. │ │ │ │ type=UUID, │ │
  683. │ │ │ │ required=True │ │
  684. │ │ │ ), │ │
  685. │ │ │ 'inputs': ModelField( │ │
  686. │ │ │ │ name='inputs', │ │
  687. │ │ │ │ type=Mapping[str, Any], │ │
  688. │ │ │ │ required=True │ │
  689. │ │ │ ), │ │
  690. │ │ │ 'outputs': ModelField( │ │
  691. │ │ │ │ name='outputs', │ │
  692. │ │ │ │ type=Optional[Mapping[str, Any]], │ │
  693. │ │ │ │ required=False, │ │
  694. │ │ │ │ default=None │ │
  695. │ │ │ ), │ │
  696. │ │ │ 'metadata': ModelField( │ │
  697. │ │ │ │ name='metadata', │ │
  698. │ │ │ │ type=Optional[Mapping[str, Any]], │ │
  699. │ │ │ │ required=False, │ │
  700. │ │ │ │ default=None │ │
  701. │ │ │ ), │ │
  702. │ │ │ 'id': ModelField(name='id', type=UUID, required=True), │ │
  703. │ │ │ 'created_at': ModelField( │ │
  704. │ │ │ │ name='created_at', │ │
  705. │ │ │ │ type=datetime, │ │
  706. │ │ │ │ required=True │ │
  707. │ │ │ ), │ │
  708. │ │ │ 'modified_at': ModelField( │ │
  709. │ │ │ │ name='modified_at', │ │
  710. │ │ │ │ type=Optional[datetime], │ │
  711. │ │ │ │ required=False, │ │
  712. │ │ │ │ default=None │ │
  713. │ │ │ ), │ │
  714. │ │ │ 'runs': ModelField( │ │
  715. │ │ │ │ name='runs', │ │
  716. │ │ │ │ type=ForwardRef('List[Run]'), │ │
  717. │ │ │ │ required=False, │ │
  718. │ │ │ │ default_factory='<function list>' │ │
  719. │ │ │ ), │ │
  720. │ │ │ 'source_run_id': ModelField( │ │
  721. │ │ │ │ name='source_run_id', │ │
  722. │ │ │ │ type=Optional[UUID], │ │
  723. │ │ │ │ required=False, │ │
  724. │ │ │ │ default=None │ │
  725. │ │ │ ) │ │
  726. │ │ } │ │
  727. │ │ hash_func = <function generate_hash_function.<locals>.hash_function at │ │
  728. │ │ 0x7384a918e480> │ │
  729. │ │ is_untouched = <function ModelMetaclass.__new__.<locals>.is_untouched at │ │
  730. │ │ 0x7384a918ed40> │ │
  731. │ │ json_encoder = <function pydantic_encoder at 0x7384b1a24d60> │ │
  732. │ │ kwargs = {} │ │
  733. │ │ mcs = <class 'pydantic.v1.main.ModelMetaclass'> │ │
  734. │ │ name = 'Example' │ │
  735. │ │ namespace = { │ │
  736. │ │ │ '__module__': 'langsmith.schemas', │ │
  737. │ │ │ '__qualname__': 'Example', │ │
  738. │ │ │ '__annotations__': { │ │
  739. │ │ │ │ 'id': 'UUID', │ │
  740. │ │ │ │ 'created_at': 'datetime', │ │
  741. │ │ │ │ 'modified_at': 'Optional[datetime]', │ │
  742. │ │ │ │ 'runs': 'List[Run]', │ │
  743. │ │ │ │ 'source_run_id': 'Optional[UUID]', │ │
  744. │ │ │ │ '_host_url': 'Optional[str]', │ │
  745. │ │ │ │ '_tenant_id': 'Optional[UUID]' │ │
  746. │ │ │ }, │ │
  747. │ │ │ '__doc__': 'Example model.', │ │
  748. │ │ │ 'modified_at': FieldInfo(extra={}), │ │
  749. │ │ │ 'runs': FieldInfo( │ │
  750. │ │ │ │ default=PydanticUndefined, │ │
  751. │ │ │ │ default_factory=<class 'list'>, │ │
  752. │ │ │ │ extra={} │ │
  753. │ │ │ ), │ │
  754. │ │ │ 'source_run_id': None, │ │
  755. │ │ │ '_host_url': ModelPrivateAttr(), │ │
  756. │ │ │ '_tenant_id': ModelPrivateAttr(), │ │
  757. │ │ │ '__init__': <function Example.__init__ at 0x7384a918e840>, │ │
  758. │ │ │ ... +2 │ │
  759. │ │ } │ │
  760. │ │ new_namespace = { │ │
  761. │ │ │ '__config__': <class 'pydantic.v1.config.Config'>, │ │
  762. │ │ │ '__fields__': { │ │
  763. │ │ │ │ 'dataset_id': ModelField( │ │
  764. │ │ │ │ │ name='dataset_id', │ │
  765. │ │ │ │ │ type=UUID, │ │
  766. │ │ │ │ │ required=True │ │
  767. │ │ │ │ ), │ │
  768. │ │ │ │ 'inputs': ModelField( │ │
  769. │ │ │ │ │ name='inputs', │ │
  770. │ │ │ │ │ type=Mapping[str, Any], │ │
  771. │ │ │ │ │ required=True │ │
  772. │ │ │ │ ), │ │
  773. │ │ │ │ 'outputs': ModelField( │ │
  774. │ │ │ │ │ name='outputs', │ │
  775. │ │ │ │ │ type=Optional[Mapping[str, Any]], │ │
  776. │ │ │ │ │ required=False, │ │
  777. │ │ │ │ │ default=None │ │
  778. │ │ │ │ ), │ │
  779. │ │ │ │ 'metadata': ModelField( │ │
  780. │ │ │ │ │ name='metadata', │ │
  781. │ │ │ │ │ type=Optional[Mapping[str, Any]], │ │
  782. │ │ │ │ │ required=False, │ │
  783. │ │ │ │ │ default=None │ │
  784. │ │ │ │ ), │ │
  785. │ │ │ │ 'id': ModelField(name='id', type=UUID, required=True), │ │
  786. │ │ │ │ 'created_at': ModelField( │ │
  787. │ │ │ │ │ name='created_at', │ │
  788. │ │ │ │ │ type=datetime, │ │
  789. │ │ │ │ │ required=True │ │
  790. │ │ │ │ ), │ │
  791. │ │ │ │ 'modified_at': ModelField( │ │
  792. │ │ │ │ │ name='modified_at', │ │
  793. │ │ │ │ │ type=Optional[datetime], │ │
  794. │ │ │ │ │ required=False, │ │
  795. │ │ │ │ │ default=None │ │
  796. │ │ │ │ ), │ │
  797. │ │ │ │ 'runs': ModelField( │ │
  798. │ │ │ │ │ name='runs', │ │
  799. │ │ │ │ │ type=ForwardRef('List[Run]'), │ │
  800. │ │ │ │ │ required=False, │ │
  801. │ │ │ │ │ default_factory='<function list>' │ │
  802. │ │ │ │ ), │ │
  803. │ │ │ │ 'source_run_id': ModelField( │ │
  804. │ │ │ │ │ name='source_run_id', │ │
  805. │ │ │ │ │ type=Optional[UUID], │ │
  806. │ │ │ │ │ required=False, │ │
  807. │ │ │ │ │ default=None │ │
  808. │ │ │ │ ) │ │
  809. │ │ │ }, │ │
  810. │ │ │ '__exclude_fields__': None, │ │
  811. │ │ │ '__include_fields__': None, │ │
  812. │ │ │ '__validators__': {}, │ │
  813. │ │ │ '__pre_root_validators__': [], │ │
  814. │ │ │ '__post_root_validators__': [], │ │
  815. │ │ │ '__schema_cache__': {}, │ │
  816. │ │ │ '__json_encoder__': <staticmethod(<function pydantic_encoder │ │
  817. │ │ at 0x7384b1a24d60>)>, │ │
  818. │ │ │ '__custom_root_type__': False, │ │
  819. │ │ │ ... +11 │ │
  820. │ │ } │ │
  821. │ │ post_root_validators = [] │ │
  822. │ │ post_rv_new = [] │ │
  823. │ │ pre_root_validators = [] │ │
  824. │ │ pre_rv_new = [] │ │
  825. │ │ private_attributes = { │ │
  826. │ │ │ '_host_url': ModelPrivateAttr(), │ │
  827. │ │ │ '_tenant_id': ModelPrivateAttr() │ │
  828. │ │ } │ │
  829. │ │ resolve_forward_refs = True │ │
  830. │ │ slots = set() │ │
  831. │ │ untouched_types = ( │ │
  832. │ │ │ <class 'function'>, │ │
  833. │ │ │ <class 'property'>, │ │
  834. │ │ │ <class 'type'>, │ │
  835. │ │ │ <class 'classmethod'>, │ │
  836. │ │ │ <class 'staticmethod'> │ │
  837. │ │ ) │ │
  838. │ │ validators = {} │ │
  839. │ │ value = <cell at 0x7384a93f3730: ModelMetaclass object at 0x61d16065b2c0> │ │
  840. │ │ var_name = '__classcell__' │ │
  841. │ │ vg = <pydantic.v1.class_validators.ValidatorGroup object at │ │
  842. │ │ 0x7384a8fd5040> │ │
  843. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  844. │ │
  845. │ /app/.venv/lib/python3.12/site-packages/pydantic/v1/main.py:807 in __try_update_forward_refs__ │
  846. │ │
  847. │ 804 │ │ Same as update_forward_refs but will not raise exception │
  848. │ 805 │ │ when forward references are not defined. │
  849. │ 806 │ │ """ │
  850. │ ❱ 807 │ │ update_model_forward_refs(cls, cls.__fields__.values(), cls.__config__.json_enco │
  851. │ 808 │ │
  852. │ 809 │ @classmethod │
  853. │ 810 │ def update_forward_refs(cls, **localns: Any) -> None: │
  854. │ │
  855. │ ╭─────────────────── locals ────────────────────╮ │
  856. │ │ cls = <class 'langsmith.schemas.Example'> │ │
  857. │ │ localns = {} │ │
  858. │ ╰───────────────────────────────────────────────╯ │
  859. │ │
  860. │ /app/.venv/lib/python3.12/site-packages/pydantic/v1/typing.py:554 in update_model_forward_refs │
  861. │ │
  862. │ 551 │ │
  863. │ 552 │ for f in fields: │
  864. │ 553 │ │ try: │
  865. │ ❱ 554 │ │ │ update_field_forward_refs(f, globalns=globalns, localns=localns) │
  866. │ 555 │ │ except exc_to_suppress: │
  867. │ 556 │ │ │ pass │
  868. │ 557 │
  869. │ │
  870. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  871. │ │ exc_to_suppress = (<class 'NameError'>,) │ │
  872. │ │ f = ModelField( │ │
  873. │ │ │ name='runs', │ │
  874. │ │ │ type=ForwardRef('List[Run]'), │ │
  875. │ │ │ required=False, │ │
  876. │ │ │ default_factory='<function list>' │ │
  877. │ │ ) │ │
  878. │ │ fields = dict_values([ModelField(name='dataset_id', type=UUID, required=True), │ │
  879. │ │ ModelField(name='inputs', type=Mapping[str, Any], required=True), │ │
  880. │ │ ModelField(name='outputs', type=Optional[Mapping[str, Any]], │ │
  881. │ │ required=False, default=None), ModelField(name='metadata', │ │
  882. │ │ type=Optional[Mapping[str, Any]], required=False, default=None), │ │
  883. │ │ ModelField(name='id', type=UUID, required=True), │ │
  884. │ │ ModelField(name='created_at', type=datetime, required=True), │ │
  885. │ │ ModelField(name='modified_at', type=Optional[datetime], required=False, │ │
  886. │ │ default=None), ModelField(name='runs', type=ForwardRef('List[Run]'), │ │
  887. │ │ required=False, default_factory='<function list>'), │ │
  888. │ │ ModelField(name='source_run_id', type=Optional[UUID], required=False, │ │
  889. │ │ default=None)]) │ │
  890. │ │ globalns = { │ │
  891. │ │ │ '__name__': 'langsmith.schemas', │ │
  892. │ │ │ '__doc__': 'Schemas for the LangSmith API.', │ │
  893. │ │ │ '__package__': 'langsmith', │ │
  894. │ │ │ '__loader__': <_frozen_importlib_external.SourceFileLoader object at │ │
  895. │ │ 0x7384a8fd4680>, │ │
  896. │ │ │ '__spec__': ModuleSpec(name='langsmith.schemas', │ │
  897. │ │ loader=<_frozen_importlib_external.SourceFileLoader object at │ │
  898. │ │ 0x7384a8fd4680>, │ │
  899. │ │ origin='/app/.venv/lib/python3.12/site-packages/langsmith/schemas.py'), │ │
  900. │ │ │ '__file__': │ │
  901. │ │ '/app/.venv/lib/python3.12/site-packages/langsmith/schemas.py', │ │
  902. │ │ │ '__cached__': │ │
  903. │ │ '/app/.venv/lib/python3.12/site-packages/langsmith/__pycache__/schemas.cp… │ │
  904. │ │ │ '__builtins__': { │ │
  905. │ │ │ │ '__name__': 'builtins', │ │
  906. │ │ │ │ '__doc__': 'Built-in functions, types, exceptions, and other │ │
  907. │ │ objects.\n\nThis module provides '+346, │ │
  908. │ │ │ │ '__package__': '', │ │
  909. │ │ │ │ '__loader__': <class '_frozen_importlib.BuiltinImporter'>, │ │
  910. │ │ │ │ '__spec__': ModuleSpec(name='builtins', loader=<class │ │
  911. │ │ '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │
  912. │ │ │ │ '__build_class__': <built-in function __build_class__>, │ │
  913. │ │ │ │ '__import__': <built-in function __import__>, │ │
  914. │ │ │ │ 'abs': <built-in function abs>, │ │
  915. │ │ │ │ 'all': <built-in function all>, │ │
  916. │ │ │ │ 'any': <built-in function any>, │ │
  917. │ │ │ │ ... +148 │ │
  918. │ │ │ }, │ │
  919. │ │ │ 'annotations': _Feature((3, 7, 0, 'beta', 1), None, 16777216), │ │
  920. │ │ │ 'threading': <module 'threading' from │ │
  921. │ │ '/usr/local/lib/python3.12/threading.py'>, │ │
  922. │ │ │ ... +26 │ │
  923. │ │ } │ │
  924. │ │ json_encoders = {} │ │
  925. │ │ localns = {} │ │
  926. │ │ model = <class 'langsmith.schemas.Example'> │ │
  927. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  928. │ │
  929. │ /app/.venv/lib/python3.12/site-packages/pydantic/v1/typing.py:520 in update_field_forward_refs │
  930. │ │
  931. │ 517 │ prepare = False │
  932. │ 518 │ if field.type_.__class__ == ForwardRef: │
  933. │ 519 │ │ prepare = True │
  934. │ ❱ 520 │ │ field.type_ = evaluate_forwardref(field.type_, globalns, localns or None) │
  935. │ 521 │ if field.outer_type_.__class__ == ForwardRef: │
  936. │ 522 │ │ prepare = True │
  937. │ 523 │ │ field.outer_type_ = evaluate_forwardref(field.outer_type_, globalns, localns or │
  938. │ │
  939. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  940. │ │ field = ModelField( │ │
  941. │ │ │ name='runs', │ │
  942. │ │ │ type=ForwardRef('List[Run]'), │ │
  943. │ │ │ required=False, │ │
  944. │ │ │ default_factory='<function list>' │ │
  945. │ │ ) │ │
  946. │ │ globalns = { │ │
  947. │ │ │ '__name__': 'langsmith.schemas', │ │
  948. │ │ │ '__doc__': 'Schemas for the LangSmith API.', │ │
  949. │ │ │ '__package__': 'langsmith', │ │
  950. │ │ │ '__loader__': <_frozen_importlib_external.SourceFileLoader object at │ │
  951. │ │ 0x7384a8fd4680>, │ │
  952. │ │ │ '__spec__': ModuleSpec(name='langsmith.schemas', │ │
  953. │ │ loader=<_frozen_importlib_external.SourceFileLoader object at 0x7384a8fd4680>, │ │
  954. │ │ origin='/app/.venv/lib/python3.12/site-packages/langsmith/schemas.py'), │ │
  955. │ │ │ '__file__': '/app/.venv/lib/python3.12/site-packages/langsmith/schemas.py', │ │
  956. │ │ │ '__cached__': │ │
  957. │ │ '/app/.venv/lib/python3.12/site-packages/langsmith/__pycache__/schemas.cpython-3… │ │
  958. │ │ │ '__builtins__': { │ │
  959. │ │ │ │ '__name__': 'builtins', │ │
  960. │ │ │ │ '__doc__': 'Built-in functions, types, exceptions, and other │ │
  961. │ │ objects.\n\nThis module provides '+346, │ │
  962. │ │ │ │ '__package__': '', │ │
  963. │ │ │ │ '__loader__': <class '_frozen_importlib.BuiltinImporter'>, │ │
  964. │ │ │ │ '__spec__': ModuleSpec(name='builtins', loader=<class │ │
  965. │ │ '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │
  966. │ │ │ │ '__build_class__': <built-in function __build_class__>, │ │
  967. │ │ │ │ '__import__': <built-in function __import__>, │ │
  968. │ │ │ │ 'abs': <built-in function abs>, │ │
  969. │ │ │ │ 'all': <built-in function all>, │ │
  970. │ │ │ │ 'any': <built-in function any>, │ │
  971. │ │ │ │ ... +148 │ │
  972. │ │ │ }, │ │
  973. │ │ │ 'annotations': _Feature((3, 7, 0, 'beta', 1), None, 16777216), │ │
  974. │ │ │ 'threading': <module 'threading' from │ │
  975. │ │ '/usr/local/lib/python3.12/threading.py'>, │ │
  976. │ │ │ ... +26 │ │
  977. │ │ } │ │
  978. │ │ localns = {} │ │
  979. │ │ prepare = True │ │
  980. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  981. │ │
  982. │ /app/.venv/lib/python3.12/site-packages/pydantic/v1/typing.py:66 in evaluate_forwardref │
  983. │ │
  984. │ 63 │ def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any: │
  985. │ 64 │ │ # Even though it is the right signature for python 3.9, mypy complains with │
  986. │ 65 │ │ # `error: Too many arguments for "_evaluate" of "ForwardRef"` hence the cast... │
  987. │ ❱ 66 │ │ return cast(Any, type_)._evaluate(globalns, localns, set()) │
  988. │ 67 │
  989. │ 68 │
  990. │ 69 if sys.version_info < (3, 9): │
  991. │ │
  992. │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
  993. │ │ globalns = { │ │
  994. │ │ │ '__name__': 'langsmith.schemas', │ │
  995. │ │ │ '__doc__': 'Schemas for the LangSmith API.', │ │
  996. │ │ │ '__package__': 'langsmith', │ │
  997. │ │ │ '__loader__': <_frozen_importlib_external.SourceFileLoader object at │ │
  998. │ │ 0x7384a8fd4680>, │ │
  999. │ │ │ '__spec__': ModuleSpec(name='langsmith.schemas', │ │
  1000. │ │ loader=<_frozen_importlib_external.SourceFileLoader object at 0x7384a8fd4680>, │ │
  1001. │ │ origin='/app/.venv/lib/python3.12/site-packages/langsmith/schemas.py'), │ │
  1002. │ │ │ '__file__': '/app/.venv/lib/python3.12/site-packages/langsmith/schemas.py', │ │
  1003. │ │ │ '__cached__': │ │
  1004. │ │ '/app/.venv/lib/python3.12/site-packages/langsmith/__pycache__/schemas.cpython-3… │ │
  1005. │ │ │ '__builtins__': { │ │
  1006. │ │ │ │ '__name__': 'builtins', │ │
  1007. │ │ │ │ '__doc__': 'Built-in functions, types, exceptions, and other │ │
  1008. │ │ objects.\n\nThis module provides '+346, │ │
  1009. │ │ │ │ '__package__': '', │ │
  1010. │ │ │ │ '__loader__': <class '_frozen_importlib.BuiltinImporter'>, │ │
  1011. │ │ │ │ '__spec__': ModuleSpec(name='builtins', loader=<class │ │
  1012. │ │ '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │
  1013. │ │ │ │ '__build_class__': <built-in function __build_class__>, │ │
  1014. │ │ │ │ '__import__': <built-in function __import__>, │ │
  1015. │ │ │ │ 'abs': <built-in function abs>, │ │
  1016. │ │ │ │ 'all': <built-in function all>, │ │
  1017. │ │ │ │ 'any': <built-in function any>, │ │
  1018. │ │ │ │ ... +148 │ │
  1019. │ │ │ }, │ │
  1020. │ │ │ 'annotations': _Feature((3, 7, 0, 'beta', 1), None, 16777216), │ │
  1021. │ │ │ 'threading': <module 'threading' from │ │
  1022. │ │ '/usr/local/lib/python3.12/threading.py'>, │ │
  1023. │ │ │ ... +26 │ │
  1024. │ │ } │ │
  1025. │ │ localns = None │ │
  1026. │ │ type_ = ForwardRef('List[Run]') │ │
  1027. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
  1028. ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
  1029. TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
Add Comment
Please, Sign In to add comment