Skip to main content

Overview

Linkup can be used with Huggingface (smolagents) to create advanced AI agents and workflows based on internal and web data.

Getting Started with Linkup in Huggingface

2

Install dependencies

pip install linkup-sdk smolagents openai
3

Create your agent

from smolagents import CodeAgent, load_tool
from smolagents.models import OpenAIServerModel

linkup_tool = load_tool("Linkup-Platform/linkup-search-tool", trust_remote_code=True)
4

Initialize and run your agent

# Agent initialization
agent = CodeAgent(
    tools=[linkup_tool],
    model=OpenAIServerModel(
      model="gpt-4o-mini",
      api_key="your_openai_api_key"
    ),
)
# Agent invocation
response = agent.run("What was Microsoft's revenue last quarter and was it well perceived by the market?")
print(response)

Example Response

Microsoft's revenue last quarter (3Q2024) was approximately $65.59 billion. The market's perception is mixed; while many analysts are optimistic about growth fueled by AI and cloud services, 
there are concerns regarding a lack of guidance in their report, leading to a cautious reaction from some investors.
Facing issues? Reach out to our engineering team at support@linkup.so or via our Discord or book a 15 minutes call with a member of our technical team.
I