Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,8 @@ qa_faq = StructuredTool.from_function(
|
|
43 |
|
44 |
Returns :
|
45 |
- string : the output as returned from the function in french.
|
46 |
-
"""
|
|
|
47 |
)
|
48 |
|
49 |
analyze_data = StructuredTool.from_function(
|
@@ -57,7 +58,7 @@ analyze_data = StructuredTool.from_function(
|
|
57 |
Example:
|
58 |
>>> analyse this data of this link : https://data.gov.ma/data/fr/dataset/evolution-des-affaires-au-cours-du-quinquennat-2018-2022
|
59 |
>>> input : https://data.gov.ma/data/fr/dataset/evolution-des-affaires-au-cours-du-quinquennat-2018-2022
|
60 |
-
"""
|
61 |
)
|
62 |
|
63 |
def request_data(query: str) -> str:
|
@@ -74,7 +75,7 @@ def request_data(query: str) -> str:
|
|
74 |
fetch_data = StructuredTool.from_function(
|
75 |
func=request_data,
|
76 |
description="""
|
77 |
-
Request and fetch data using a search keyword
|
78 |
Parameters :
|
79 |
- query (string) : the same input as the user input no more no less and always it must be in french if it isn't already.Same for other languages and the words translatted must be nouns not adjectives or verbs also the user may request data about an organization where you need to take just the main subject for example "Je veux les données de l'agence de développement digitale" you take just "développement".
|
80 |
Returns :
|
@@ -89,6 +90,7 @@ fetch_data = StructuredTool.from_function(
|
|
89 |
>>> Je veux les données de justice
|
90 |
>>> input : justice
|
91 |
""",
|
|
|
92 |
)
|
93 |
# def request_data(query: str) -> str:
|
94 |
# request = chain.invoke({"input": query})
|
|
|
43 |
|
44 |
Returns :
|
45 |
- string : the output as returned from the function in french.
|
46 |
+
""",
|
47 |
+
return_direct = True,
|
48 |
)
|
49 |
|
50 |
analyze_data = StructuredTool.from_function(
|
|
|
58 |
Example:
|
59 |
>>> analyse this data of this link : https://data.gov.ma/data/fr/dataset/evolution-des-affaires-au-cours-du-quinquennat-2018-2022
|
60 |
>>> input : https://data.gov.ma/data/fr/dataset/evolution-des-affaires-au-cours-du-quinquennat-2018-2022
|
61 |
+
""",
|
62 |
)
|
63 |
|
64 |
def request_data(query: str) -> str:
|
|
|
75 |
fetch_data = StructuredTool.from_function(
|
76 |
func=request_data,
|
77 |
description="""
|
78 |
+
Request and fetch data using a search keyword.
|
79 |
Parameters :
|
80 |
- query (string) : the same input as the user input no more no less and always it must be in french if it isn't already.Same for other languages and the words translatted must be nouns not adjectives or verbs also the user may request data about an organization where you need to take just the main subject for example "Je veux les données de l'agence de développement digitale" you take just "développement".
|
81 |
Returns :
|
|
|
90 |
>>> Je veux les données de justice
|
91 |
>>> input : justice
|
92 |
""",
|
93 |
+
return_direct = True,
|
94 |
)
|
95 |
# def request_data(query: str) -> str:
|
96 |
# request = chain.invoke({"input": query})
|