async_read
Class info¶
🛈 DocStrings¶
_get_cached_fs
cached
¶
_get_cached_fs(protocol: str) -> AsyncFileSystem
Cached filesystem creation.
Source code in src/llmling_agent/utils/async_read.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
get_async_fs
async
¶
get_async_fs(path: StrPath) -> AsyncFileSystem
Get appropriate async filesystem for path.
Source code in src/llmling_agent/utils/async_read.py
35 36 37 38 39 40 |
|
read_path
async
¶
read_path(
path: StrPath, mode: Literal["rt", "rb"] = "rt", encoding: str = "utf-8"
) -> str | bytes
Read file content asynchronously when possible.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
StrPath
|
Path to read |
required |
mode
|
Literal['rt', 'rb']
|
Read mode ("rt" for text, "rb" for binary) |
'rt'
|
encoding
|
str
|
File encoding for text files |
'utf-8'
|
Returns:
Type | Description |
---|---|
str | bytes
|
File content as string or bytes depending on mode |
Source code in src/llmling_agent/utils/async_read.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|