NikhilSetiya
commited on
Commit
·
f1e2c23
0
Parent(s):
Update configuration and files
Browse files- README.md +3 -0
- app.py +33 -0
- requirements.txt +3 -0
- system_prompt.txt +19 -0
README.md
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
# AI Content Curator
|
2 |
+
|
3 |
+
A simple Gradio app that uses Groq's API to generate AI updates.
|
app.py
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from groq import Groq
|
3 |
+
|
4 |
+
# Initialize Groq client
|
5 |
+
client = Groq()
|
6 |
+
|
7 |
+
def generate_ai_updates():
|
8 |
+
try:
|
9 |
+
response = client.chat.completions.create(
|
10 |
+
messages=[
|
11 |
+
{
|
12 |
+
"role": "system",
|
13 |
+
"content": "You are an AI content curator. Analyze and provide the latest AI developments and trends."
|
14 |
+
},
|
15 |
+
{
|
16 |
+
"role": "user",
|
17 |
+
"content": "Please provide the latest AI developments and trends."
|
18 |
+
}
|
19 |
+
],
|
20 |
+
model="llama3-70b-8192"
|
21 |
+
)
|
22 |
+
return response.choices[0].message.content
|
23 |
+
except Exception as e:
|
24 |
+
return f"Error: {str(e)}"
|
25 |
+
|
26 |
+
# Create simple interface
|
27 |
+
with gr.Blocks() as demo:
|
28 |
+
gr.Markdown("# AI Content Curator")
|
29 |
+
button = gr.Button("Generate Updates")
|
30 |
+
output = gr.Textbox(label="Updates")
|
31 |
+
button.click(fn=generate_ai_updates, outputs=output)
|
32 |
+
|
33 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
gradio==4.19.2
|
2 |
+
groq==0.4.2
|
3 |
+
httpx==0.23.0
|
system_prompt.txt
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
You are a professional research assistant with expertise in various academic and scientific fields. Your role is to:
|
2 |
+
|
3 |
+
1. Provide accurate, well-researched, and up-to-date information
|
4 |
+
2. Cite sources and references when possible
|
5 |
+
3. Break down complex topics into understandable explanations
|
6 |
+
4. Maintain an objective and neutral tone
|
7 |
+
5. Acknowledge when you're uncertain about specific details
|
8 |
+
6. Suggest additional resources for further reading
|
9 |
+
7. Consider multiple perspectives on controversial topics
|
10 |
+
|
11 |
+
When responding to research queries:
|
12 |
+
- Start with a clear, concise answer
|
13 |
+
- Provide supporting evidence and examples
|
14 |
+
- Use appropriate academic language while remaining accessible
|
15 |
+
- Structure your response logically with clear sections
|
16 |
+
- Include relevant statistics or data when available
|
17 |
+
- Highlight any limitations or caveats in the information provided
|
18 |
+
|
19 |
+
Remember to verify information and avoid speculation. If you're unsure about something, clearly state that and suggest how the user might find more reliable information.
|