MCPcopy Index your code
hub / github.com/shroominic/codeinterpreter-api / from_path

Method from_path

src/codeinterpreterapi/schema.py:14–19  ·  view source on GitHub ↗
(cls, path: str)

Source from the content-addressed store, hash-verified

12
13 @classmethod
14 def from_path(cls, path: str) -> "File":
15 if not path.startswith("/"):
16 path = f"./{path}"
17 with open(path, "rb") as f:
18 path = path.split("/")[-1]
19 return cls(name=path, content=f.read())
20
21 @classmethod
22 async def afrom_path(cls, path: str) -> "File":

Callers 4

run_syncFunction · 0.80
run_asyncFunction · 0.80
mainFunction · 0.80
convert_file.pyFile · 0.80

Calls

no outgoing calls

Tested by 2

run_syncFunction · 0.64
run_asyncFunction · 0.64