Update app.py
Browse files
app.py
CHANGED
|
@@ -16,9 +16,20 @@ from tools.create_presentation import create_presentation
|
|
| 16 |
# =========================
|
| 17 |
# DOCUMENT CREATION TOOL
|
| 18 |
# =========================
|
|
|
|
|
|
|
| 19 |
@tool
|
| 20 |
def create_document(text: str, format: str = "docx") -> str:
|
| 21 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
try:
|
| 23 |
import docx
|
| 24 |
from docx.shared import Pt
|
|
@@ -54,6 +65,7 @@ def create_document(text: str, format: str = "docx") -> str:
|
|
| 54 |
return f"Error creating document: {str(e)}"
|
| 55 |
|
| 56 |
|
|
|
|
| 57 |
# =========================
|
| 58 |
# AGENT SETUP
|
| 59 |
# =========================
|
|
|
|
| 16 |
# =========================
|
| 17 |
# DOCUMENT CREATION TOOL
|
| 18 |
# =========================
|
| 19 |
+
@tool
|
| 20 |
+
|
| 21 |
@tool
|
| 22 |
def create_document(text: str, format: str = "docx") -> str:
|
| 23 |
+
"""
|
| 24 |
+
Creates a document file (DOCX or PDF) containing the provided text.
|
| 25 |
+
|
| 26 |
+
Args:
|
| 27 |
+
text: The full textual content that will be written into the document.
|
| 28 |
+
format: The output file format. Must be either "docx" or "pdf".
|
| 29 |
+
|
| 30 |
+
Returns:
|
| 31 |
+
The absolute file path to the generated document.
|
| 32 |
+
"""
|
| 33 |
try:
|
| 34 |
import docx
|
| 35 |
from docx.shared import Pt
|
|
|
|
| 65 |
return f"Error creating document: {str(e)}"
|
| 66 |
|
| 67 |
|
| 68 |
+
|
| 69 |
# =========================
|
| 70 |
# AGENT SETUP
|
| 71 |
# =========================
|