Spaces:
Runtime error
Runtime error
Eddyhzd
commited on
Commit
·
cd1e894
1
Parent(s):
bb066a6
test
Browse files
app.py
CHANGED
|
@@ -73,7 +73,54 @@ def chatbot(message, history):
|
|
| 73 |
response = clientLLM.chat.completions.create(
|
| 74 |
model="mistral-small-latest",
|
| 75 |
messages=messages,
|
| 76 |
-
tools=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
)
|
| 78 |
|
| 79 |
bot_reply = response.choices[0].message.content.strip()
|
|
|
|
| 73 |
response = clientLLM.chat.completions.create(
|
| 74 |
model="mistral-small-latest",
|
| 75 |
messages=messages,
|
| 76 |
+
tools=[
|
| 77 |
+
{
|
| 78 |
+
"type": "function",
|
| 79 |
+
"function": {
|
| 80 |
+
"name": "analyze_herbicide_trends",
|
| 81 |
+
"description": "Analyze herbicide usage trends over time.",
|
| 82 |
+
"parameters": {
|
| 83 |
+
"type": "object",
|
| 84 |
+
"properties": {
|
| 85 |
+
"years_range": {"type": "string"},
|
| 86 |
+
"plot_filter": {"type": "string"}
|
| 87 |
+
},
|
| 88 |
+
"required": ["years_range", "plot_filter"]
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"type": "function",
|
| 94 |
+
"function": {
|
| 95 |
+
"name": "predict_future_weed_pressure",
|
| 96 |
+
"description": "Predict weed pressure for the next 3 years.",
|
| 97 |
+
"parameters": {"type": "object", "properties": {}}
|
| 98 |
+
}
|
| 99 |
+
},
|
| 100 |
+
{
|
| 101 |
+
"type": "function",
|
| 102 |
+
"function": {
|
| 103 |
+
"name": "recommend_sensitive_crop_plots",
|
| 104 |
+
"description": "Recommend plots for sensitive crops.",
|
| 105 |
+
"parameters": {"type": "object", "properties": {}}
|
| 106 |
+
}
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"type": "function",
|
| 110 |
+
"function": {
|
| 111 |
+
"name": "generate_technical_alternatives",
|
| 112 |
+
"description": "Generate technical alternatives.",
|
| 113 |
+
"parameters": {
|
| 114 |
+
"type": "object",
|
| 115 |
+
"properties": {
|
| 116 |
+
"herbicide_family": {"type": "string"}
|
| 117 |
+
},
|
| 118 |
+
"required": ["herbicide_family"]
|
| 119 |
+
}
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
]
|
| 123 |
+
|
| 124 |
)
|
| 125 |
|
| 126 |
bot_reply = response.choices[0].message.content.strip()
|