File size: 1,085 Bytes
01bf518
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
from random import randint

from pydantic import BaseModel

from crewai.flow import Flow, listen, start

from chatbot_gaia.src.crews.popular_culture_crew.crew import PopularCultureCrew


class AgriEnergyFlow(Flow):
    def __init__(self, user_input: str):
        super().__init__()
        self.user_input = user_input

    @start()
    def extract_info_from_query(self):
        print("Extracting information from query")
        result = (
            PopularCultureCrew()
            .crew()
            .kickoff(inputs={"user_input": self.user_input})
        )
        return result


def kickoff(user_input: str = None):
    agrienergy_flow = AgriEnergyFlow(user_input=user_input)
    result = agrienergy_flow.kickoff()
    return result


def plot():
    agrienergy_flow = AgriEnergyFlow()
    agrienergy_flow.plot()


if __name__ == "__main__":
    query = "Je suis un agriculture basé pas loin de bordeaux et je cultive du mais et je cherche des recommandations d'autres cultures mieux adapté aux changements climatiques"
    kickoff(user_input=query)