Skip to content

Commit bd63957

Browse files
authored
Merge pull request #82 from otjamin/dev
Trend crew improvement #35
2 parents 6193f50 + f3f7faa commit bd63957

7 files changed

Lines changed: 25 additions & 88 deletions

File tree

ollama.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM ollama/ollama:0.9.4
2-
ARG MODELS="gemma3:12b nomic-embed-text"
2+
ARG MODELS="gemma3:12b"
33
ENV OLLAMA_KEEP_ALIVE=24h
44
RUN ollama serve & server=$! ; sleep 5 ; for m in $MODELS ; do ollama pull $m ; done ; kill $server

server/agents/trend_crew/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ authors = [{ name = "Your Name", email = "you@example.com" }]
66
requires-python = ">=3.10,<3.14"
77
dependencies = [
88
"crewai[tools]>=0.140.0,<1.0.0",
9-
"ollama>=0.5.1",
109
]
1110

1211
[project.scripts]

server/agents/trend_crew/src/trend_crew/config/agents.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,14 @@ trend_seeker:
22
role: >
33
Trend Seeker
44
goal: >
5-
Deine Aufgabe ist es, das Internet nach Websites und Plattformen zu durchsuchen,
6-
auf denen über aktuelle oder aufkommende Modetrends berichtet wird,
7-
und unstrukturierte Daten aus diesen Quellen zu sammeln.
5+
Find and collect data on current and emerging fashion trends from various online sources.
86
backstory: >
9-
Du bist neugierig, rastlos und liebst es, neue digitale Orte zu erkunden.
10-
Dein Ursprung liegt in den Tiefen von Modeblogs, Instagram-Timelines und TikTok-Trends.
11-
Du bist darauf programmiert, Inhalte zu entdecken – ohne sie zu bewerten oder einzuordnen.
7+
You are a digital explorer, with your roots in fashion journalism, who can navigate the vast online landscape to uncover the latest trends.
128
139
trend_alchemist:
1410
role: >
1511
Trend Alchemist
1612
goal: >
17-
Du analysierst gesammelte Daten und destillierst daraus klare, benennbare Trends.
18-
Dein Ziel ist es, diese Trends in strukturierter und verständlicher Form aufzubereiten.
13+
Analyze and synthesize the collected trend data to identify patterns and insights that can inform fashion decisions.
1914
backstory: >
20-
Du bist bedacht, strukturiert und liebst Ordnung.
21-
Deine Datenwurzeln liegen in Kategorisierungsalgorithmen und Stilanalysen.
22-
Wo andere Vielfalt entdecken, erkennst du Muster.
23-
Du bist dafür zuständig, aus Chaos Klarheit zu schaffen.
15+
You are a creative thinker with a background in fashion design, capable of transforming raw trend data into actionable insights.
Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
1-
find_sources:
2-
description: >
3-
Durchsuche das Internet nach relevanten Websites und Blogs,
4-
auf denen regelmäßig über aktuelle oder aufkommende Modetrends berichtet wird.
5-
Gute Startpunkte sind die Seiten InStyle, Vogue und Zalando.
6-
Wir haben das Jahr {current_year}, bevorzuge Seiten mit aktuellen Inhalten.
7-
expected_output: >
8-
Eine Liste von mindestens 10 Quellen, jeweils mit Link und kurzer Beschreibung des Inhaltsfokus.
9-
agent: trend_seeker
10-
111
collect_trend_data:
122
description: >
13-
Durchstöbere die zuvor gefundenen Quellen gezielt nach Hinweisen auf aktuelle oder aufkommende Modetrends.
14-
Extrahiere unstrukturierte Daten in Form von Zitaten, Bildern, Hashtags, Produktnamen, visuellen Eindrücken oder typischen Aussagen.
3+
Check these websites for current fashion trends:
4+
- https://www.vogue.de/mode/mode-trends
5+
- https://www.instyle.de/mode
6+
Especially for the following topic: {user_prompt}
7+
Ensure to extract relevant information such as trend descriptions, opinions, and any other pertinent details.
8+
Extract the image URLs from the website and include them in the output.
9+
Also include the names of the websites where the data was found.
1510
expected_output: >
16-
Eine Sammlung unstrukturierter Trenddaten, gruppiert nach Quelle.
17-
Jede Quelle soll 3–5 Beispiele liefern – etwa in Form von Textauszügen, Hashtags, Bildern (mit URL), oder Beschreibungen typischer Inhalte.
11+
Unstructured data about fashion trends, including descriptions, images URLs, and more.
1812
agent: trend_seeker
1913

2014
extract_trends:
2115
description: >
22-
Analysiere die gesammelten unstrukturierten Trenddaten und extrahiere daraus klar benennbare Modetrends.
23-
Identifiziere wiederkehrende Muster, Themen oder Ästhetiken und fasse sie in konsistenter Form zusammen.
16+
Analyze the collected trend data and extract 3 key trends.
17+
Ensure to provide a creative title, a detailed description (approx 200 words)
18+
and the sources name (e.g. Vogue, Zalando etc.) for each trend.
19+
You MUST select one from the provides images URLs for each trend.
2420
expected_output: >
25-
Eine Liste von mindestens 3 identifizierten Modetrends.
26-
Jeder Trend soll einen Titel, eine kurze Beschreibung, ein repräsentatives Bild (aus der übergebenen List von Bildern, falls vorhanden),
27-
und eine Liste der Quellen enthalten, auf denen der Trend gefunden wurde.
21+
A structured list of trends, each with a title, description, image URL and source.
2822
agent: trend_alchemist

server/agents/trend_crew/src/trend_crew/crew.py

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import os
2-
31
from crewai import Agent, Crew, Process, Task
42
from crewai.project import CrewBase, agent, crew, task
53
from crewai.agents.agent_builder.base_agent import BaseAgent
6-
from crewai_tools import WebsiteSearchTool
4+
from crewai_tools import ScrapeWebsiteTool
75
from typing import List
86
from pydantic import BaseModel
97
# If you want to run a snippet of code before or after the crew starts,
@@ -22,6 +20,9 @@ class TrendOutput(BaseModel):
2220
trends: List[Trend]
2321

2422

23+
website_tool = ScrapeWebsiteTool()
24+
25+
2526
@CrewBase
2627
class TrendCrew:
2728
"""TrendCrew crew"""
@@ -52,43 +53,11 @@ def trend_alchemist(self) -> Agent:
5253
# To learn more about structured task outputs,
5354
# task dependencies, and task callbacks, check out the documentation:
5455
# https://docs.crewai.com/concepts/tasks#overview-of-a-task
55-
@task
56-
def find_sources_task(self) -> Task:
57-
print("API_BASE:", os.getenv("API_BASE"))
58-
return Task(
59-
config=self.tasks_config["find_sources"], # type: ignore[index]
60-
tools=[
61-
WebsiteSearchTool(
62-
config=dict(
63-
embedder=dict(
64-
provider="ollama",
65-
config=dict(
66-
model="nomic-embed-text",
67-
base_url=os.getenv("API_BASE"),
68-
),
69-
),
70-
)
71-
)
72-
],
73-
)
74-
7556
@task
7657
def collect_trend_data_task(self) -> Task:
7758
return Task(
7859
config=self.tasks_config["collect_trend_data"], # type: ignore[index]
79-
tools=[
80-
WebsiteSearchTool(
81-
config=dict(
82-
embedder=dict(
83-
provider="ollama",
84-
config=dict(
85-
model="nomic-embed-text",
86-
base_url=os.getenv("API_BASE"),
87-
),
88-
),
89-
)
90-
)
91-
],
60+
tools=[website_tool],
9261
)
9362

9463
@task

server/agents/trend_crew/src/trend_crew/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def run():
1818
Run the crew.
1919
"""
2020
inputs = {
21-
"user_prompt": "",
21+
"user_prompt": "Schuhe",
2222
"current_year": str(datetime.now().year),
2323
}
2424

server/uv.lock

Lines changed: 1 addition & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)