一些增强人类想象力的应用想法与3个典型示例:
广告: TinyTroupe 可以在花费金钱之前,通过模拟受众离线评估数字广告(例如,Bing 广告)!
软件测试: TinyTroupe 可以为系统(例如,搜索引擎、聊天机器人或副驾驶)提供测试输入,然后评估结果。
培训和探索性数据: TinyTroupe 可以生成逼真的合成数据,这些数据后来可以用于训练模型或进行机会分析。
产品和项目管理: TinyTroupe 可以阅读项目或产品提案,并从特定角色(例如,医生、律师和一般知识工作者)的角度提供反馈。
头脑风暴: TinyTroupe 可以模拟焦点小组,以更低的成本提供出色的产品反馈!
🧪示例 1:客户访谈(来自 interview_with_customer.ipynb)
对话可以进行几个步骤,深入挖掘,直到顾问对收集到的信息(例如,一个具体的项目想法)感到满意:
TinyTroupe模拟人,不是助手
TinyTroupe项目结构
项目结构如下:
/tinytroupe
:包含 Python 库本身。特别是:/tinytroupe/prompts
包含用于调用 LLMs 的提示。/tests
:包含库的单元测试。您可以使用test.bat
脚本来运行这些测试。/examples
:包含展示如何使用库的示例,主要使用 Jupyter 笔记本(为了更好的可读性),但也作为纯 Python 脚本。/data
:示例或库使用的任何数据。/docs
:项目文档。
与任何Multi-Agent系统一样,TinyTroupe 提供两个关键抽象:
TinyPerson,具有个性、接收刺激并对其做出反应的Agent。 TinyWorld,Agent存在和互动的环境。
from tinytroupe.examples import create_lisa_the_data_scientist
lisa = create_lisa_the_data_scientist() # 从示例构建器实例化一个 Lisa
lisa.listen_and_act("告诉我关于你的生活。")
lisa = TinyPerson("Lisa")
lisa.define("age", 28)
lisa.define("nationality", "Canadian")
lisa.define("occupation", "Data Scientist")
lisa.define("routine", "每天早晨,你醒来,做一些瑜伽,然后查看你的电子邮件。", group="routines")
lisa.define("occupation_description",
"""
你是一名数据科学家。你在微软工作,(...)
""")
lisa.define_several("personality_traits",
[
{"trait": "你对新事物充满好奇,喜欢学习新事物。"},
{"trait": "你分析性强,喜欢解决问题。"},
{"trait": "你友好,喜欢与他人合作。"},
])
from tinytroupe.factory import TinyPersonFactory
factory = TinyPersonFactory("圣保罗的一家医院。")
person = factory.generate_person("创建一个喜欢宠物、大自然和重金属音乐的巴西医生。")
world = TinyWorld("聊天室", [lisa, oscar])
world.make_everyone_accessible()
lisa.listen("和 Oscar 谈谈以更多了解他")
world.run(4)
USER --> Lisa: [CONVERSATION]
> Talk to Oscar to know more about him
────────────────────────────────────────────── Chat Room step 1 of 4 ──────────────────────────────────────────────
Lisa --> Lisa: [THOUGHT]
> I will now act a bit, and then issue DONE.
Lisa acts: [TALK]
> Hi Oscar, I'd love to know more about you. Could you tell me a bit about yourself?
Lisa --> Lisa: [THOUGHT]
> I will now act a bit, and then issue DONE.
Lisa acts: [DONE]
Lisa --> Oscar: [CONVERSATION]
> Hi Oscar, I'd love to know more about you. Could you tell me a bit about yourself?
Oscar --> Oscar: [THOUGHT]
> I will now act a bit, and then issue DONE.
Oscar acts: [TALK]
> Hi Lisa! Sure, I'd be happy to share a bit about myself. I'm Oscar, a 30-year-old
> architect from Germany. I work at a company called Awesome Inc., where I focus on
> designing standard elements for new apartment buildings. I love modernist architecture,
> new technologies, and sustainable practices. In my free time, I enjoy traveling to
> exotic places, playing the guitar, and reading science fiction books. How about you?
Oscar --> Oscar: [THOUGHT]
> I will now act a bit, and then issue DONE.
Oscar acts: [DONE]
Oscar --> Lisa: [CONVERSATION]
> Hi Lisa! Sure, I'd be happy to share a bit about myself. I'm Oscar, a 30-year-old
> architect from Germany. I work at a company called Awesome Inc., where I focus on
> designing standard elements for new apartment buildings. I love modernist architecture,
> new technologies, and sustainable practices. In my free time, I enjoy traveling to
> exotic places, playing the guitar, and reading science fiction books. How about you?
https://github.com/microsoft/TinyTroupe
来源 | PaperAgent