Deep Agents
Agent generujący treści z Deep Agents
Zbuduj agenta AI generującego treści, który bada tematy, pisze posty blogowe i treści social media ze spójnym głosem marki — z Deep Agents.
contentblogsocial mediawriting
Działający kod
from deepagents import create_deep_agentfrom langchain_core.tools import tool
@tooldef web_search(query: str) -> str: """Research a topic before writing content.""" from tavily import TavilyClient client = TavilyClient() results = client.search(query, max_results=3) return "\n\n".join(r["content"] for r in results["results"])
@tooldef save_content(filename: str, content: str) -> str: """Save generated content to a file.""" Path(f"output/{filename}").write_text(content) return f"Saved to output/{filename}"
agent = create_deep_agent( model="anthropic:claude-sonnet-4-5-20250929", tools=[web_search, save_content], system_prompt="You are a content writer. Research the topic first, then write engaging content. Save the final output using save_content.",)
result = agent.invoke({ "messages": [("user", "Write a blog post about the benefits of AI agents in customer service")]})print(result["messages"][-1].content)Krok po kroku
1
Zainstaluj zależności
Zainstaluj Deep Agents i wymagane narzędzia do tego przypadku użycia.
2
Zdefiniuj narzędzia
Stwórz specyficzne dla domeny funkcje narzędzi, których agent będzie używał do interakcji z zewnętrznymi serwisami.
3
Stwórz agenta i uruchom
Zainicjalizuj agenta Deep Agents z narzędziami, ustaw prompt systemowy i wykonaj zapytanie.
Zbuduj z innymi frameworkami
Więcej poradników z Deep Agents
Gotowy do budowania z Deep Agents?
Wygeneruj gotowy do produkcji projekt z Deep Agents — FastAPI + Next.js, autoryzacja, streaming i więcej.
RozpocznijGotowy, żeby zbudować swojego pierwszego agenta AI?
Open-source'owe narzędzia, sprawdzone wzorce, zero boilerplate'u. Skonfiguruj swój stos i wyślij w minuty — nie miesiące.