taarhissian commited on
Commit
cf24ce6
·
verified ·
1 Parent(s): 242d0cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -13
app.py CHANGED
@@ -1,13 +1,33 @@
1
- import streamlit as st
2
- from app.pages import farmer, marketplace, health, advisor
3
-
4
- # Navigation between pages
5
- pages = {
6
- "Farmer Registration": farmer.show,
7
- "Marketplace": marketplace.show,
8
- "Health Benefits": health.show,
9
- "Farming Tips": advisor.show,
10
- }
11
-
12
- choice = st.sidebar.radio("Select a Page", list(pages.keys()))
13
- pages[choice]()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from smolai import SmolAgent
2
+ from langchain.chat_models import ChatOpenAI
3
+
4
+ # Initialize SmolAgents
5
+ farmer_agent = SmolAgent(
6
+ name="FarmerAgent",
7
+ description="Handles farmer registrations and crop listings.",
8
+ llm=ChatOpenAI(temperature=0.7)
9
+ )
10
+
11
+ marketplace_agent = SmolAgent(
12
+ name="MarketplaceAgent",
13
+ description="Assists customers in searching for crops and making recommendations.",
14
+ llm=ChatOpenAI(temperature=0.7)
15
+ )
16
+
17
+ health_agent = SmolAgent(
18
+ name="HealthAgent",
19
+ description="Provides health benefits of various crops to customers.",
20
+ llm=ChatOpenAI(temperature=0.7)
21
+ )
22
+
23
+ farming_advisor_agent = SmolAgent(
24
+ name="FarmingAdvisorAgent",
25
+ description="Gives farming tips and advice based on queries.",
26
+ llm=ChatOpenAI(temperature=0.7)
27
+ )
28
+
29
+ # Function to interact with agents
30
+ def interact_with_agent(agent, user_input):
31
+ response = agent.chat(user_input)
32
+ return response
33
+