附件#

class langsmith.schemas.Attachment(mime_type: str, data: bytes | Path)[源]#

如果使用,将作为附件存储的标注类型。

示例

from langsmith import traceable
from langsmith.schemas import Attachment


@traceable
def my_function(bar: int, my_val: Attachment):
    # my_val will be stored as an attachment
    # bar will be stored as inputs
    return bar

创建新实例:Attachment(mime_type, data)

属性

data

字段1的别名

mime_type

字段0的别名

方法

__init__()

count(value, /)

返回值的出现次数。

index(value[, start, stop])

返回值的第一个索引。

参数:
  • mime_type (str)

  • data (bytes | Path)

__init__()#
count(value, /)#

返回值的出现次数。

value
start=0,
stop=9223372036854775807,
如果值不存在,则引发 ValueError。,
/,
)#

返回值的第一个索引。

本页内容