This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from agno.agent import Agent | |
from agno.models.openai.like import OpenAILike | |
from agno.tools.duckduckgo import DuckDuckGoTools | |
# Set your Clarifai PAT | |
os.environ["CLARIFAI_PAT"] = "your_clarifai_pat" | |
agent = Agent( | |
model=OpenAILike( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install -qU agno duckduckgo-search pypdf lancedb tantivy yfinance clarifai openai ddgs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from openai import OpenAI | |
client = OpenAI( | |
base_url="https://api.clarifai.com/v2/ext/openai/v1", | |
api_key="REPLACE_WITH_YOUR_CLARIFAI_PAT", | |
) | |
response = client.chat.completions.create( | |
model="https://clarifai.com/openai/chat-completion/models/gpt-oss-120b", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialize an Ollama model | |
clarifai model init --toolkit ollama --model-name gemma3:270m --port 8008 --context-length 16000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -it --rm --pull=always \ | |
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.51-nikolaik \ | |
-e LOG_ALL_EVENTS=true \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v ~/.openhands:/.openhands \ | |
-p 3000:3000 \ | |
--add-host host.docker.internal:host-gateway \ | |
--name openhands-app \ | |
docker.all-hands.dev/all-hands-ai/openhands:0.51 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.51-nikolaik |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from crewai.tools import tool | |
from crewai import LLM, Agent, Task, Crew, Process | |
# Step 1: Define the Research Tool | |
@tool("Research Tool") | |
def fetch_research_data(query: str) -> str: | |
"""Fetches research material and insights for a given blog topic.""" | |
# In a real-world scenario, this could call a search API or scrape web content | |
return f"Research data for '{query}': Key insights, statistics, and trends collected from credible sources." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from crewai import Agent, Task, Crew, Process | |
# 1. Define the Agent | |
blog_writer = Agent( | |
role="Blog Writing Specialist", | |
goal="Research topics and generate well-structured, engaging blog drafts.", | |
backstory=( | |
"You are an experienced content creator who specializes in writing insightful " | |
"and factually accurate blogs. You know how to analyze research material, " | |
"structure content logically, and produce clear, reader-friendly writing." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from crewai import LLM | |
clarifai_llm = LLM( | |
model="openai/deepseek-ai/deepseek-chat/models/DeepSeek-R1-Distill-Qwen-7B", | |
base_url="https://api.clarifai.com/v2/ext/openai/v1", | |
api_key=os.environ.get("CLARIFAI_PAT") | |
) | |
print("Clarifai LLM configured successfully.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from crewai.tools import tool | |
@tool("Research Tool") | |
def fetch_research_data(query: str) -> str: | |
"""Fetches research material and insights for a given blog topic.""" | |
# In a real-world scenario, this could call a search API or scrape web content | |
return f"Research data for '{query}': Key insights, statistics, and trends collected from credible sources." | |
print("Research tool defined successfully.") |