是否曾尝试在销售电话前几分钟研究潜在客户,却发现昂贵的数据提供商提供的信息已过时?是的,我也是。这正是我上周末构建一些不同东西的原因。
以下场景可能听起来很熟悉:
您的销售代表即将接听一位热门潜在客户的电话。他们很快在你精美的数据丰富工具中查找该公司,并自信地提到,“我看到你最近筹集了 A 轮融资!”只听一阵尴尬的笑声,“其实那是两年前的事了。我们上个月刚刚结束了 C 轮。”
哎呀。
静态数据库,无论多么全面,都有一个基本缺陷:它们是静态的。当信息被收集、处理和提供时,它通常已经过时了。在快速发展的科技和商业世界中,这是一个真正的问题。
如果我们不依赖预先收集的数据,可以:
这正是我们今天要使用 Linkup 的 API 构建的。最好的部分?只需 50 行 Python 代码。
是时候编写一些代码了!但别担心 - 我们会将其分解成小块,即使您的非技术同事也能理解(嗯,几乎?)。
首先,让我们创建我们的项目并安装我们需要的工具:
mkdir company-intel cd company-intel pip install linkup-sdk pydantic
这里没什么特别的 - 只需创建一个新文件夹并安装我们的两个神奇成分:用于获取数据的 linkup-sdk 和用于确保我们的数据看起来漂亮的 pydantic。
在开始获取数据之前,让我们先定义一下我们真正想了解的公司哪些内容。将此视为您的愿望清单:
# schema.py - Our data wishlist! ? from pydantic import BaseModel from typing import List, Optional from enum import Enum class CompanyInfo(BaseModel): # The basics name: str = "" # Company name (duh!) website: str = "" # Where they live on the internet description: str = "" # What they do (hopefully not just buzzwords) # The interesting stuff latest_funding: str = "" # Show me the money! ? recent_news: List[str] = [] # What's the buzz? ? leadership_team: List[str] = [] # Who's running the show? ? tech_stack: List[str] = [] # The tools they love ⚡
这就像告诉餐厅你到底想在三明治中添加什么。我们正在使用 pydantic 来确保我们得到的正是我们订购的东西!
现在到了有趣的部分 - 让一切正常工作的引擎:
# company_intel.py - Where the magic happens! ? from linkup import LinkupClient from schema import CompanyInfo from typing import List class CompanyIntelligence: def __init__(self, api_key: str): # Initialize our crystal ball (aka Linkup client) self.client = LinkupClient(api_key=api_key) def research_company(self, company_name: str) -> CompanyInfo: # Craft our research question query = f""" Hey Linkup! Tell me everything fresh about {company_name}: ? The name of the company, its website, and a short description. ? Any recent funding rounds or big announcements? ? Who's on the leadership team right now? ?️ What tech are they using these days? ? What have they been up to lately? PS: Only stuff from the last 3 months, please! """ # Ask the question and get structured answers response = self.client.search( query=query, # What we want to know depth="deep", # Go deep, not shallow output_type="structured", # Give me clean data structured_output_schema=CompanyInfo # Format it like our wishlist ) return response
让我们来分解一下这里发生的事情:
现在让我们将其包装在一个很好的 API 中,供整个团队使用:
mkdir company-intel cd company-intel pip install linkup-sdk pydantic
这里有什么很酷的:
是时候看看我们的创作如何发挥作用了:
# schema.py - Our data wishlist! ? from pydantic import BaseModel from typing import List, Optional from enum import Enum class CompanyInfo(BaseModel): # The basics name: str = "" # Company name (duh!) website: str = "" # Where they live on the internet description: str = "" # What they do (hopefully not just buzzwords) # The interesting stuff latest_funding: str = "" # Show me the money! ? recent_news: List[str] = [] # What's the buzz? ? leadership_team: List[str] = [] # Who's running the show? ? tech_stack: List[str] = [] # The tools they love ⚡
瞧!新鲜、实时的公司数据触手可及!
想让它变得更酷吗?您可以添加以下一些有趣的内容:
# company_intel.py - Where the magic happens! ? from linkup import LinkupClient from schema import CompanyInfo from typing import List class CompanyIntelligence: def __init__(self, api_key: str): # Initialize our crystal ball (aka Linkup client) self.client = LinkupClient(api_key=api_key) def research_company(self, company_name: str) -> CompanyInfo: # Craft our research question query = f""" Hey Linkup! Tell me everything fresh about {company_name}: ? The name of the company, its website, and a short description. ? Any recent funding rounds or big announcements? ? Who's on the leadership team right now? ?️ What tech are they using these days? ? What have they been up to lately? PS: Only stuff from the last 3 months, please! """ # Ask the question and get structured answers response = self.client.search( query=query, # What we want to know depth="deep", # Go deep, not shallow output_type="structured", # Give me clean data structured_output_schema=CompanyInfo # Format it like our wishlist ) return response
我们一直在销售团队的生产中使用它,它改变了游戏规则:
可能性是无限的!以下是一些进一步推进的想法:
准备好构建自己的了吗?这是您需要的:
静态数据库的日子已经屈指可数了。在公司一夜之间转型、每周融资、每月更换技术堆栈的世界里,拥有实时情报不仅是件好事,而且是必不可少的。
我们在这里建造的只是一个开始。想象一下将其与:
结合起来你建造过类似的东西吗?您如何应对保持公司数据最新的挑战?请在评论中告诉我!
建立在 ☕ 和对新鲜数据的健康痴迷
以上是使用 Python 行链接构建实时公司智能引擎的详细内容。更多信息请关注PHP中文网其他相关文章!