类class
agentscope.toolDirEntry
@dataclass
class DirEntry
源码Source
agentscope/tool/_builtin/_backend.py:87–108目录条目,让智能体以受控方式调用外部能力。位于 agentscope.tool 包。
Mirrors :class:os.DirEntry: the metadata comes from the same
directory read as the name, so a listing costs one round trip
instead of one per entry plus one per attribute.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
name | str | 名称字段。 The entry's base name, without any leading directory. | — |
is_dir | bool | 是目录字段。 Whether the entry is a directory, following symlinks. | — |
size_bytes | int | None | 大小字节字段。 Size in bytes of a file. Always ``None`` for a
directory — its on-disk size says nothing a caller wants —
and ``None`` when it could not be determined (a broken
symlink, a vanished entry). | None |
mtime | float | None | `mtime` 字段。 Modification time as a POSIX timestamp, or ``None``
for the same reasons. | None |
属性详情Attribute Detail
name
str名称字段。声明为 str。
The entry's base name, without any leading directory.
源码Source
agentscope/tool/_builtin/_backend.py:105is_dir
bool是目录字段。声明为 bool。
Whether the entry is a directory, following symlinks.
源码Source
agentscope/tool/_builtin/_backend.py:106size_bytes
int | None = None大小字节字段。声明为 int | None。
Size in bytes of a file. Always None for a
directory — its on-disk size says nothing a caller wants —
and None when it could not be determined (a broken
symlink, a vanished entry).
源码Source
agentscope/tool/_builtin/_backend.py:107mtime
float | None = Nonemtime 字段。声明为 float | None。
Modification time as a POSIX timestamp, or None
for the same reasons.
源码Source
agentscope/tool/_builtin/_backend.py:108