Spaces:
Sleeping
Sleeping
fix: remove reverse text
Browse files- agents/assistant_agent.py +0 -4
- agents/assistant_tools.py +0 -32
agents/assistant_agent.py
CHANGED
|
@@ -90,10 +90,6 @@ CALCULATIONS:
|
|
| 90 |
- advanced_math: Advanced math functions (sqrt, log, trig)
|
| 91 |
- python_repl: Execute Python code from path to file (use carefully)
|
| 92 |
|
| 93 |
-
TEXT PROCESSING:
|
| 94 |
-
- reverse_text: Reverse text character by character
|
| 95 |
-
- reverse_words: Reverse word order in text
|
| 96 |
-
|
| 97 |
IMAGE PROCESSING:
|
| 98 |
- ask_question_on_image_content: Ask any question on the image content
|
| 99 |
|
|
|
|
| 90 |
- advanced_math: Advanced math functions (sqrt, log, trig)
|
| 91 |
- python_repl: Execute Python code from path to file (use carefully)
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
IMAGE PROCESSING:
|
| 94 |
- ask_question_on_image_content: Ask any question on the image content
|
| 95 |
|
agents/assistant_tools.py
CHANGED
|
@@ -44,30 +44,6 @@ vision_llm = ChatGoogleGenerativeAI(model=os.getenv("GOOGLE_VISION_MODEL"))
|
|
| 44 |
# ---
|
| 45 |
|
| 46 |
|
| 47 |
-
@tool
|
| 48 |
-
def reverse_text(text: str) -> str:
|
| 49 |
-
"""
|
| 50 |
-
Reverse the given text character by character.
|
| 51 |
-
|
| 52 |
-
Example:
|
| 53 |
-
Input: "hello"
|
| 54 |
-
Output: "olleh"
|
| 55 |
-
"""
|
| 56 |
-
return text[::-1]
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
@tool
|
| 60 |
-
def reverse_words(text: str) -> str:
|
| 61 |
-
"""
|
| 62 |
-
Reverse the order of words in the given text.
|
| 63 |
-
|
| 64 |
-
Example:
|
| 65 |
-
Input: "LangChain makes graphs easy"
|
| 66 |
-
Output: "easy graphs makes LangChain"
|
| 67 |
-
"""
|
| 68 |
-
return " ".join(text.split()[::-1])
|
| 69 |
-
|
| 70 |
-
|
| 71 |
@tool
|
| 72 |
def calculator(expression: str) -> str:
|
| 73 |
"""
|
|
@@ -283,8 +259,6 @@ def build_tools():
|
|
| 283 |
read_excel_file,
|
| 284 |
get_youtube_transcript_tool,
|
| 285 |
get_youtube_title_description,
|
| 286 |
-
reverse_text,
|
| 287 |
-
reverse_words,
|
| 288 |
calculator,
|
| 289 |
advanced_math,
|
| 290 |
ask_question_on_image_content,
|
|
@@ -296,12 +270,6 @@ def build_tools():
|
|
| 296 |
if __name__ == "__main__":
|
| 297 |
from pprint import pprint
|
| 298 |
|
| 299 |
-
print("\n--- reverse_text ---")
|
| 300 |
-
pprint(reverse_text.invoke({"text": "hello"}))
|
| 301 |
-
|
| 302 |
-
print("\n--- reverse_words ---")
|
| 303 |
-
pprint(reverse_words.invoke({"text": "LangChain makes graphs easy"}))
|
| 304 |
-
|
| 305 |
print("\n--- calculator ---")
|
| 306 |
pprint(calculator.invoke({"expression": "10 + 2 * 3 - 4 / 2"}))
|
| 307 |
|
|
|
|
| 44 |
# ---
|
| 45 |
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
@tool
|
| 48 |
def calculator(expression: str) -> str:
|
| 49 |
"""
|
|
|
|
| 259 |
read_excel_file,
|
| 260 |
get_youtube_transcript_tool,
|
| 261 |
get_youtube_title_description,
|
|
|
|
|
|
|
| 262 |
calculator,
|
| 263 |
advanced_math,
|
| 264 |
ask_question_on_image_content,
|
|
|
|
| 270 |
if __name__ == "__main__":
|
| 271 |
from pprint import pprint
|
| 272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
print("\n--- calculator ---")
|
| 274 |
pprint(calculator.invoke({"expression": "10 + 2 * 3 - 4 / 2"}))
|
| 275 |
|