curiouscurrent commited on
Commit
8ea46ed
·
verified ·
1 Parent(s): 95ac22d

Create frontend_chain.py

Browse files
Files changed (1) hide show
  1. chains/frontend_chain.py +17 -0
chains/frontend_chain.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from langchain.prompts import PromptTemplate
2
+ from langchain.chains import LLMChain
3
+ from chains.model import get_local_model
4
+
5
+ llm = get_local_model()
6
+
7
+ prompt = PromptTemplate(
8
+ input_variables=["tasks_json"],
9
+ template=(
10
+ "You are the Frontend Agent. Based on these tasks, write React components with TailwindCSS.\n"
11
+ "Ensure the UI is clean, responsive, and functional.\n\n"
12
+ "Tasks:\n{tasks_json}\n\n"
13
+ "Output only valid React code."
14
+ ),
15
+ )
16
+
17
+ frontend_chain = LLMChain(llm=llm, prompt=prompt)