File size: 1,952 Bytes
5967b99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from crewai import Agent, Task, Crew, Process
import os
from dotenv import load_dotenv

load_dotenv()

os.environ["GROQ_API_KEY"] = os.getenv("GROQ_API_KEY")

MODEL = "groq/llama-3.3-70b-versatile"


red_flag_analyst = Agent(
    role="Client Red Flag Analyst",
    goal="Detect risky freelance job postings and protect freelancers from bad clients",
    backstory="""You are an expert at evaluating freelance job posts for risk.

You can quickly identify scam patterns, vague requirements, exposure-only offers,

scope-budget mismatch, manipulative tone, and warning signs that waste freelancer time.""",
    verbose=False,
    allow_delegation=False,
    llm=MODEL
)


def detect_client_red_flags(job_posting):
    task = Task(
        description=f"""Analyze this freelance job posting and detect client red flags.



JOB POSTING:

{job_posting}



Evaluate specifically for:

1. Exposure-only or unpaid work language

2. Unrealistic budget vs scope mismatch

3. Vague requirements or missing deliverables

4. Unrealistic timeline pressure

5. Scam-like patterns (external contact push, payment outside platform, urgency pressure)

6. Communication or tone red flags



Output format (strict):

RISK LEVEL: Low/Medium/High

RISK SCORE: X/10



RED FLAGS:

- [Short bullet]

- [Short bullet]



WHY THIS MATTERS:

[2-4 concise lines]



RECOMMENDED ACTION:

[1-3 practical steps for freelancer]



Rules:

- Keep total output under 180 words

- Be specific to this job post

- If no strong red flags exist, say so clearly and explain why

- Output only the final analysis text""",
        expected_output="A concise risk report with risk level, score, red flags, and actions",
        agent=red_flag_analyst
    )

    crew = Crew(
        agents=[red_flag_analyst],
        tasks=[task],
        process=Process.sequential,
        verbose=False
    )

    result = crew.kickoff()
    return str(result).strip()