Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ from report_generator import (
|
|
| 9 |
generate_diagram_report,
|
| 10 |
)
|
| 11 |
import cohere
|
| 12 |
-
from cohere.classify import
|
| 13 |
|
| 14 |
# Initialize the Cohere client using your provided API key.
|
| 15 |
# (For security, consider loading the API key from environment variables.)
|
|
@@ -18,10 +18,10 @@ co = cohere.Client(COHERE_API_KEY)
|
|
| 18 |
|
| 19 |
# Define some labeled examples for classification.
|
| 20 |
cohere_examples = [
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
]
|
| 26 |
|
| 27 |
def cohere_parse_command(command):
|
|
|
|
| 9 |
generate_diagram_report,
|
| 10 |
)
|
| 11 |
import cohere
|
| 12 |
+
from cohere.classify import Example # Fixed import
|
| 13 |
|
| 14 |
# Initialize the Cohere client using your provided API key.
|
| 15 |
# (For security, consider loading the API key from environment variables.)
|
|
|
|
| 18 |
|
| 19 |
# Define some labeled examples for classification.
|
| 20 |
cohere_examples = [
|
| 21 |
+
Example(text="generate a report on unemployment", label="report"),
|
| 22 |
+
Example(text="create a report on market trends", label="report"),
|
| 23 |
+
Example(text="generate diagram of sales data", label="diagram"),
|
| 24 |
+
Example(text="create a diagram of quarterly revenue", label="diagram")
|
| 25 |
]
|
| 26 |
|
| 27 |
def cohere_parse_command(command):
|