vellum-ai 0.11.5__py3-none-any.whl → 0.11.6__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,7 @@ class BaseClientWrapper:
17
17
  headers: typing.Dict[str, str] = {
18
18
  "X-Fern-Language": "Python",
19
19
  "X-Fern-SDK-Name": "vellum-ai",
20
- "X-Fern-SDK-Version": "0.11.5",
20
+ "X-Fern-SDK-Version": "0.11.6",
21
21
  }
22
22
  headers["X_API_KEY"] = self.api_key
23
23
  return headers
@@ -1,3 +1,4 @@
1
+ import inspect
1
2
  from typing import Any, ClassVar, Dict, Generic, List, Optional, Sequence, Tuple, Type, TypeVar, cast, get_args
2
3
 
3
4
  from vellum import (
@@ -189,7 +190,8 @@ class CodeExecutionNode(BaseNode[StateType], Generic[StateType, _OutputType], me
189
190
  return compiled_inputs
190
191
 
191
192
  def _resolve_code(self) -> str:
192
- code = read_file_from_path(self.filepath)
193
+ root = inspect.getfile(self.__class__)
194
+ code = read_file_from_path(node_filepath=root, script_filepath=self.filepath)
193
195
  if not code:
194
196
  raise NodeException(
195
197
  message=f"Filepath '{self.filepath}' does not exist",
@@ -2,21 +2,11 @@ import os
2
2
  from typing import Union
3
3
 
4
4
 
5
- def get_project_root() -> str:
6
- current_dir = os.getcwd()
7
- while current_dir != "/":
8
- if ".git" in os.listdir(current_dir):
9
- return current_dir
10
- current_dir = os.path.dirname(current_dir)
11
- raise FileNotFoundError("Project root not found.")
12
-
13
-
14
- def read_file_from_path(filepath: str) -> Union[str, None]:
15
- project_root = get_project_root()
16
- relative_filepath = os.path.join(project_root, filepath)
17
-
18
- if not os.path.exists(relative_filepath):
19
- return None
20
-
21
- with open(relative_filepath) as file:
22
- return file.read()
5
+ def read_file_from_path(node_filepath: str, script_filepath: str) -> Union[str, None]:
6
+ node_filepath_dir = os.path.dirname(node_filepath)
7
+ full_filepath = os.path.join(node_filepath_dir, script_filepath)
8
+
9
+ if os.path.isfile(full_filepath):
10
+ with open(full_filepath) as file:
11
+ return file.read()
12
+ return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vellum-ai
3
- Version: 0.11.5
3
+ Version: 0.11.6
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.9,<4.0
@@ -28,7 +28,7 @@ vellum_ee/workflows/display/nodes/types.py,sha256=St1BB6no528OyELGiyRabWao0GGw6m
28
28
  vellum_ee/workflows/display/nodes/utils.py,sha256=sloya5TpXsnot1HURc9L51INwflRqUzHxRVnCS9Cd-4,973
29
29
  vellum_ee/workflows/display/nodes/vellum/__init__.py,sha256=nmPLj8vkbVCS46XQqmHq8Xj8Mr36wCK_vWf26A9KIkw,1505
30
30
  vellum_ee/workflows/display/nodes/vellum/api_node.py,sha256=4SSQGecKWHuoGy5YIGJeOZVHGKwTs_8Y-gf3GvsHb0M,8506
31
- vellum_ee/workflows/display/nodes/vellum/code_execution_node.py,sha256=MASV7u0X4eiS3SzRWeBcbWZ_YgNlwwg5cM2vaFWjpqk,3915
31
+ vellum_ee/workflows/display/nodes/vellum/code_execution_node.py,sha256=HzB4zQ6MYlRII9GsZcBPzOswFUuwBjn-b3FuDLNyujg,4025
32
32
  vellum_ee/workflows/display/nodes/vellum/conditional_node.py,sha256=gUbSP8_oSAMNIb0CGiefd2FMYgoO6wMoG6iA1FakMjk,13293
33
33
  vellum_ee/workflows/display/nodes/vellum/error_node.py,sha256=ygTjSjYDI4DtkxADWub5rhBnRWItMKWF6fezBrgpOKA,1979
34
34
  vellum_ee/workflows/display/nodes/vellum/final_output_node.py,sha256=UezalObmZ3mcg7Nou2RgiI_0cmc7_tSdZLNB591iCcI,2772
@@ -78,7 +78,7 @@ vellum/client/README.md,sha256=JkCJjmMZl4jrPj46pkmL9dpK4gSzQQmP5I7z4aME4LY,4749
78
78
  vellum/client/__init__.py,sha256=o4m7iRZWEV8rP3GkdaztHAjNmjxjWERlarviFoHzuKI,110927
79
79
  vellum/client/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
80
80
  vellum/client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
81
- vellum/client/core/client_wrapper.py,sha256=Lchp9CqqaSiM_CP0YETtEwr4rvjUV6p2Y7s0tL_-n6Q,1890
81
+ vellum/client/core/client_wrapper.py,sha256=xZCaeJ0zVTtxXqFRe54cEDIyxXqbJlQAZ5gQGXg4sSc,1890
82
82
  vellum/client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
83
83
  vellum/client/core/file.py,sha256=X9IbmkZmB2bB_DpmZAO3crWdXagOakAyn6UCOCImCPg,2322
84
84
  vellum/client/core/http_client.py,sha256=R0pQpCppnEtxccGvXl4uJ76s7ro_65Fo_erlNNLp_AI,19228
@@ -1301,12 +1301,12 @@ vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py,sha256=1_OXD
1301
1301
  vellum/workflows/nodes/displayable/bases/prompt_deployment_node.py,sha256=MdrAKN8QGPk_JnNjbEBaVVKwVLPE2judbBcWuYJgbkY,4964
1302
1302
  vellum/workflows/nodes/displayable/bases/search_node.py,sha256=S7J8tTW681O4wcWYerGOfH6h-_BlE8-JMJHpW8eCVG0,3564
1303
1303
  vellum/workflows/nodes/displayable/code_execution_node/__init__.py,sha256=0FLWMMktpzSnmBMizQglBpcPrP80fzVsoJwJgf822Cg,76
1304
- vellum/workflows/nodes/displayable/code_execution_node/node.py,sha256=zK-gxWmox8QZ84J11faUmasRozNKDIBv_86Gjq8uj7M,7975
1304
+ vellum/workflows/nodes/displayable/code_execution_node/node.py,sha256=uwT_sn-XT0uYe7E-0DcJfcb3X33pwE0sw-2ri7FhoTo,8073
1305
1305
  vellum/workflows/nodes/displayable/code_execution_node/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1306
1306
  vellum/workflows/nodes/displayable/code_execution_node/tests/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1307
1307
  vellum/workflows/nodes/displayable/code_execution_node/tests/fixtures/main.py,sha256=5QsbmkzSlSbcbWTG_JmIqcP-JNJzOPTKxGzdHos19W4,79
1308
1308
  vellum/workflows/nodes/displayable/code_execution_node/tests/test_code_execution_node.py,sha256=2Kr7fKtjc1fW5z_6z6noKfWoETIVJbYi0AGhhSw-hsU,3376
1309
- vellum/workflows/nodes/displayable/code_execution_node/utils.py,sha256=LODnO8_KTxKWLTDbjR0CbrtoUHwdcwv-lBJM-CPcuyc,609
1309
+ vellum/workflows/nodes/displayable/code_execution_node/utils.py,sha256=LfI3kj2zQz6UGMld_uA9z2LjZobqRcgxQO4jdUWkg7o,376
1310
1310
  vellum/workflows/nodes/displayable/conditional_node/__init__.py,sha256=AS_EIqFdU1F9t8aLmbZU-rLh9ry6LCJ0uj0D8F0L5Uw,72
1311
1311
  vellum/workflows/nodes/displayable/conditional_node/node.py,sha256=REFZdEVetXGyOK1RbIN1T6yRblrP0hfyZUls2KfjTKg,1016
1312
1312
  vellum/workflows/nodes/displayable/final_output_node/__init__.py,sha256=G7VXM4OWpubvSJtVkGmMNeqgb9GkM7qZT838eL18XU4,72
@@ -1377,8 +1377,8 @@ vellum/workflows/vellum_client.py,sha256=ODrq_TSl-drX2aezXegf7pizpWDVJuTXH-j6528
1377
1377
  vellum/workflows/workflows/__init__.py,sha256=KY45TqvavCCvXIkyCFMEc0dc6jTMOUci93U2DUrlZYc,66
1378
1378
  vellum/workflows/workflows/base.py,sha256=mnI-kZ78yt7u6NFSTUo-tYjDnarP-RJ7uZjwjCn6PCQ,16795
1379
1379
  vellum/workflows/workflows/event_filters.py,sha256=-uQcMB7IpPd-idMku8f2QNVhPXPFWo6FZLlGjRf8rCo,1996
1380
- vellum_ai-0.11.5.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
1381
- vellum_ai-0.11.5.dist-info/METADATA,sha256=8CXclMT8Nu3M7czzPkH0K0toXno3RpXdZIBlhrasKME,5128
1382
- vellum_ai-0.11.5.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
1383
- vellum_ai-0.11.5.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
1384
- vellum_ai-0.11.5.dist-info/RECORD,,
1380
+ vellum_ai-0.11.6.dist-info/LICENSE,sha256=hOypcdt481qGNISA784bnAGWAE6tyIf9gc2E78mYC3E,1574
1381
+ vellum_ai-0.11.6.dist-info/METADATA,sha256=PlJ1b2Y0mTg3Ob_st_UHH7dOU5JqNqQI2-1akD7YOZs,5128
1382
+ vellum_ai-0.11.6.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
1383
+ vellum_ai-0.11.6.dist-info/entry_points.txt,sha256=HCH4yc_V3J_nDv3qJzZ_nYS8llCHZViCDP1ejgCc5Ak,42
1384
+ vellum_ai-0.11.6.dist-info/RECORD,,
@@ -1,3 +1,4 @@
1
+ import inspect
1
2
  from uuid import UUID
2
3
  from typing import ClassVar, Dict, Generic, Optional, TypeVar
3
4
 
@@ -28,7 +29,8 @@ class BaseCodeExecutionNodeDisplay(BaseNodeVellumDisplay[_CodeExecutionNodeType]
28
29
  node = self._node
29
30
  node_id = self.node_id
30
31
 
31
- code = read_file_from_path(raise_if_descriptor(node.filepath))
32
+ node_file_path = inspect.getfile(node)
33
+ code = read_file_from_path(node_filepath=node_file_path, script_filepath=(raise_if_descriptor(node.filepath)))
32
34
  code_inputs = raise_if_descriptor(node.code_inputs)
33
35
 
34
36
  inputs = [