Skip to content

Instantly share code, notes, and snippets.

View Sumanth077's full-sized avatar
🎯
Focusing

Sumanth Sumanth077

🎯
Focusing
View GitHub Profile
@Sumanth077
Sumanth077 / web_search_agent.py
Created September 26, 2025 20:54
Agno web search agent using GPT-OSS 120B and DuckDuckGo.
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(
@Sumanth077
Sumanth077 / install_packages.sh
Created September 26, 2025 20:50
Install required Python packages for Agno, web search, PDF handling, vector databases, finance data, AI models, and search tools.
pip install -qU agno duckduckgo-search pypdf lancedb tantivy yfinance clarifai openai ddgs
@Sumanth077
Sumanth077 / gpt-oss-120b-openai.py
Created September 14, 2025 07:48
Example Python script showing how to use Clarifai’s OpenAI-compatible API to run GPT-OSS-120B
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",
# Initialize an Ollama model
clarifai model init --toolkit ollama --model-name gemma3:270m --port 8008 --context-length 16000
@Sumanth077
Sumanth077 / docker-run-openshands.sh
Created August 11, 2025 08:58
Shell command to run the OpenHands runtime Docker image.
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
@Sumanth077
Sumanth077 / docker-pull-openshands.sh
Created August 11, 2025 08:55
Shell command to pull the OpenHands runtime Docker image.
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.51-nikolaik
@Sumanth077
Sumanth077 / blog_writer_agent.py
Created July 25, 2025 10:22
Blog-writing AI agent using CrewAI
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."
@Sumanth077
Sumanth077 / agent_task_crew_setup.py
Last active July 25, 2025 10:14
Defines an AI-powered blog-writing Agent using CrewAI
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."
@Sumanth077
Sumanth077 / clarifai_llm_setup.py
Created July 25, 2025 05:57
Example of configuring a CrewAI LLM to use a Clarifai-hosted DeepSeek model via API
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.")
@Sumanth077
Sumanth077 / research_tool.py
Last active July 25, 2025 10:14
A simple example of creating a custom tool in CrewAI that fetches research material for blog topics. It defines a fetch_research_data function (simulated) and wraps it as a reusable Tool.
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.")