Sentient 项目使用与配置指南

Sentient 项目使用与配置指南

sentient the framework/ sdk that lets you build browser controlling agents in 3 lines of code. join chat @ https://discord.gg/umgnyQU2K8 sentient 项目地址: https://gitcode.com/gh_mirrors/sent/sentient

1. 项目目录结构及介绍

Sentient 项目的目录结构如下所示:

sentient/
├── .gitignore
├── LICENSE
├── README.md
├── cookbook.py
├── poetry.lock
├── pyproject.toml
├── requirements.txt
  • .gitignore:Git 忽略文件,用于指定在版本控制中忽略的文件和目录。
  • LICENSE:项目许可证文件,本项目采用 MIT 许可。
  • README.md:项目自述文件,包含了项目的描述、使用说明和配置指南。
  • cookbook.py:示例脚本,展示了如何使用 Sentient 项目。
  • poetry.lock:Poetry 包管理工具的锁文件,确保项目依赖的一致性。
  • pyproject.toml:项目配置文件,用于定义项目的元数据和依赖。
  • requirements.txt:项目依赖文件,列出了项目运行所需的 Python 包。

2. 项目的启动文件介绍

项目的启动主要通过 cookbook.py 脚本进行。以下是一个简单的示例,展示如何使用 Sentient 来执行一个任务:

from sentient import sentient
import asyncio

# 运行任务
result = asyncio.run(sentient.invoke("play shape of you on youtube"))

在这个示例中,我们导入 sentient 模块,并使用 asyncio.run 来运行 sentient.invoke 函数。该函数接收一个目标字符串,例如 "play shape of you on youtube",并执行相应的浏览器控制任务。

3. 项目的配置文件介绍

项目的配置主要通过 pyproject.toml 文件进行。这个文件定义了项目的元数据、依赖和其他构建系统相关的配置。以下是一个配置文件的示例:

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "sentient"
version = "0.1.0"
description = "A framework/sdk to build browser controlling agents in 3 lines of code."
authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies]
python = "^3.8"

[tool.poetry.dev-dependencies]
pytest = "^6.2.4"

在这个配置文件中,我们定义了项目的名称、版本、描述、作者以及项目依赖的 Python 版本和开发依赖。

要使用 Sentient 项目,您需要确保安装了所有依赖项,这可以通过以下命令完成:

pip install -r requirements.txt

或者,如果您使用 Poetry,可以运行:

poetry install

确保正确配置和安装依赖后,您可以按照 cookbook.py 中的示例来使用 Sentient 项目。

sentient the framework/ sdk that lets you build browser controlling agents in 3 lines of code. join chat @ https://discord.gg/umgnyQU2K8 sentient 项目地址: https://gitcode.com/gh_mirrors/sent/sentient

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

孙茹纳

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值