taarhissian commited on
Commit
f4ea2df
·
verified ·
1 Parent(s): cd8aa24

Rename app.py to app/main.py

Browse files
Files changed (2) hide show
  1. app.py +0 -33
  2. app/main.py +13 -0
app.py DELETED
@@ -1,33 +0,0 @@
1
- from SmolAgents import SmolAgents
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
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/main.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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]()