Spaces:
Runtime error
Runtime error
finshied
Browse files- .gitignore +1 -0
- src/analyzer.py +17 -0
- src/main.py +8 -0
- src/prompts.py +15 -0
.gitignore
CHANGED
|
@@ -1 +1,2 @@
|
|
| 1 |
.venv
|
|
|
|
|
|
| 1 |
.venv
|
| 2 |
+
__pycache__
|
src/analyzer.py
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from google import genai
|
| 2 |
+
from prompts import ANALYZE_PROMPT
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
key = os.getenv("Gemini_API_KEY")
|
| 6 |
+
|
| 7 |
+
client = genai.Client(api_key=key)
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def analyze_workflow(workflow):
|
| 11 |
+
prompt = ANALYZE_PROMPT.format(workflow=workflow)
|
| 12 |
+
response = client.models.generate_content(
|
| 13 |
+
model="gemini-2.5-flash",
|
| 14 |
+
contents=prompt
|
| 15 |
+
)
|
| 16 |
+
return response.text
|
| 17 |
+
|
src/main.py
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from analyzer import analyze_workflow
|
| 2 |
+
import streamlit as st
|
| 3 |
+
|
| 4 |
+
st.title("Ai Workflow Analyzer")
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
|
src/prompts.py
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ANALYZE_PROMPT = """
|
| 2 |
+
You are an expert AI system analyst.
|
| 3 |
+
|
| 4 |
+
your job is to anlyze the following workflow:
|
| 5 |
+
|
| 6 |
+
{workflow}
|
| 7 |
+
|
| 8 |
+
Return:
|
| 9 |
+
1- A detailed analysis of the workflow, including its strengths and weaknesses.
|
| 10 |
+
2- Suggestions for improvement, if any.
|
| 11 |
+
3- Any potential risks or challenges associated with the workflow.
|
| 12 |
+
4- A simple prototype or example of how the workflow can be implemented in practice. (pyton)
|
| 13 |
+
|
| 14 |
+
the final output should be in a clear and concise format, with bullet points and actionable insights and recommendations for optimizing the workflow.
|
| 15 |
+
"""
|