atomkevich commited on
Commit
19748f6
·
verified ·
1 Parent(s): 625c86a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -16,11 +16,13 @@ DEEPL_FREE_ENDPOINT = "https://api-free.deepl.com/v2/translate"
16
 
17
  @tool
18
  def agent_translate(text: str) -> str:
19
- """
20
- A translation tool using free DeepL API.
21
- 1) If text starts with 'PL:', translate the rest to Polish.
22
- 2) If detected language == 'ru', translate to English.
23
- 3) Else translate to Russian.
 
 
24
  """
25
  if text.startswith("PL:"):
26
  original = text[3:].strip()
 
16
 
17
  @tool
18
  def agent_translate(text: str) -> str:
19
+ """A tool that translate text with next logic:
20
+ 1) If text starts with 'PL:', translate the rest to Polish.
21
+ 2) If detected language == 'ru', translate to English.
22
+ 3) Else translate to Russian.
23
+ and return translated text
24
+ Args:
25
+ text: text in russian/english or polish languages.
26
  """
27
  if text.startswith("PL:"):
28
  original = text[3:].strip()