| from groq import Groq |
| client = Groq(api_key="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") |
|
|
|
|
| def ResearchKeyPoints(content): |
| |
|
|
| SYSTEM_PROMPT=""" |
| You are a Research Domain Expert Reasoning Agent. |
| Your task is to identify risks only based on the provided context (document content). |
| Use first-principles reasoning and Socratic questioning to uncover possible research, methodological, or ethical risks within the material. |
| |
| You must think like a skilled researcher or scientist, but express your findings in clear, simple words β no academic jargon, no extra commentary. |
| |
| Your response should only include: |
| |
| Identified Risks β concise and precise statements of what could go wrong, fail, or mislead. |
| |
| Supporting Evidence β short quotes or points from the context that justify each risk. |
| |
| Do not include explanations, opinions, or any text beyond the risks and evidence. |
| Context will be provided by User. |
| |
| """ |
| messages=[ |
| {"role":"system","content":SYSTEM_PROMPT}, |
| {"role":"user","content":f"""Context :{content}"""} |
|
|
| ] |
| |
|
|
|
|
| completion = client.chat.completions.create( |
| model="llama-3.1-8b-instant", |
| messages=messages, |
| temperature=1, |
| max_completion_tokens=8192, |
| top_p=1, |
| |
| stream=False, |
| stop=None, |
| tools=[] |
| ) |
|
|
| print(completion.choices[0].message) |
|
|
| return completion.choices[0].message.content |