AiWicked commited on
Commit
6fcfc6d
·
verified ·
1 Parent(s): 8435b8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -16
app.py CHANGED
@@ -3,31 +3,53 @@ import datetime
3
  import requests
4
  import pytz
5
  import yaml
 
6
  from tools.final_answer import FinalAnswerTool
7
 
8
  from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
- @tool
12
- def count_words(text: str) -> str:
13
- """A tool that counts the number of words in a given text.
14
 
 
 
 
 
15
  Args:
16
- text: Input text for word counting.
17
-
18
  Returns:
19
- A string indicating the number of words.
20
  """
21
- if not text.strip():
22
- return "Sorry: No Text - No Words to Count 😐"
23
-
24
- word_count = len(text.split())
25
- return f"The text contains {word_count} words."
26
-
27
- result = count_words("Hello world! This is an AI agent tool.")
28
- print(result)
29
-
30
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
 
33
  @tool
 
3
  import requests
4
  import pytz
5
  import yaml
6
+ import random
7
  from tools.final_answer import FinalAnswerTool
8
 
9
  from Gradio_UI import GradioUI
10
 
11
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
 
 
 
12
 
13
+
14
+ @tool
15
+ def transform_belief_and_motivate(negative_belief: str) -> str:
16
+ """A tool that transforms a negative belief into a positive one and provides a motivational phrase.
17
  Args:
18
+ negative_belief: A negative belief or thought (e.g., "Я не справлюсь с этой задачей").
 
19
  Returns:
20
+ A string containing a positive belief and a motivational phrase.
21
  """
22
+ if not negative_belief.strip():
23
+ return "Sorry: No belief provided - Nothing to transform 😐"
24
+
25
+ # Простая база позитивных убеждений для типичных ситуаций
26
+ positive_beliefs = [
27
+ "Я справлюсь со всем, что встретится на моем пути.",
28
+ "Каждый день я становлюсь сильнее и увереннее.",
29
+ "Я способен(на) на большее, чем думаю.",
30
+ "Все трудности временные, я нахожу решения.",
31
+ "Я достоин(на) успеха и добьюсь своих целей.",
32
+ "Ошибки — это опыт, который делает меня мудрее."
33
+ ]
34
+
35
+ # Простая база мотивирующих фраз
36
+ motivational_phrases = [
37
+ "Ты сильнее, чем кажется. Вперёд!",
38
+ "Каждый шаг приближает тебя к мечте.",
39
+ "Не сдавайся — успех уже рядом!",
40
+ "Ты можешь всё. Просто начни!",
41
+ "Лучший момент действовать — сейчас!",
42
+ "Дорогу осилит идущий. Иди вперёд!"
43
+ ]
44
+
45
+ positive_belief = random.choice(positive_beliefs)
46
+ motivational_phrase = random.choice(motivational_phrases)
47
+
48
+ return f"Позитивное убеждение: {positive_belief}\nМотивирующая фраза: {motivational_phrase}"
49
+
50
+
51
+ result = transform_belief_and_motivate("Я не смогу достичь своей цели")
52
+ print(result)
53
 
54
 
55
  @tool