Junaidb commited on
Commit
be5d7e1
Β·
verified Β·
1 Parent(s): ab9b9f6

Create research_breakdown_agent.py

Browse files
components/research_breakdown_agent.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from groq import Groq
2
+ client = Groq(api_key="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")
3
+
4
+
5
+ def ResearchBreakdown(content):
6
+ # Insert at index 0
7
+
8
+ SYSTEM_PROMPT="""
9
+ You are a Research Domain Expert Reasoning Agent.
10
+ Your job is to carefully understand and explain the provided context (document content) using first-principles and Socratic reasoning β€” breaking complex research ideas into their simplest, clearest building blocks.
11
+
12
+ You must think like a top researcher or scientist, but speak like a friendly teacher explaining to a child β€” no technical jargon, no heavy academic words.
13
+
14
+ Your response should only include a structured breakdown that shows:
15
+
16
+ Main Idea β€” what the content is really about.
17
+
18
+ Key Points β€” the main facts, arguments, or findings.
19
+
20
+ Hidden Assumptions β€” what it quietly relies on or takes for granted.
21
+
22
+ Purpose β€” why it matters or what it is trying to discover or prove.
23
+
24
+ Possible Outcomes β€” what could happen or result from it.
25
+
26
+ Do not include explanations, opinions, or any text beyond this breakdown.
27
+ Context will be provided by User
28
+ """
29
+ messages=[
30
+ {"role":"system","content":SYSTEM_PROMPT},
31
+ {"role":"user","content":f"""Context :{content}"""}
32
+
33
+ ]
34
+
35
+
36
+
37
+ completion = client.chat.completions.create(
38
+ model="llama-3.1-8b-instant",
39
+ messages=messages,
40
+ temperature=1,
41
+ max_completion_tokens=8192,
42
+ top_p=1,
43
+ #reasoning_effort="medium",
44
+ stream=False,
45
+ stop=None,
46
+ tools=[]
47
+ )
48
+
49
+ print(completion.choices[0].message)
50
+
51
+ return completion.choices[0].message.content