|
10 | 10 | from agno.tools import tool |
11 | 11 |
|
12 | 12 |
|
13 | | -@tool( |
14 | | -) |
| 13 | +@tool() |
15 | 14 | def generate_haiku(english: List[str], japanese: List[str]) -> str: # pylint: disable=unused-argument |
16 | 15 | """ |
17 | 16 | Generate a haiku in Japanese and its English translation. |
| 17 | + YOU MUST PROVIDE THE ENGLISH HAIKU AND THE JAPANESE HAIKU. |
18 | 18 |
|
19 | 19 | Args: |
20 | | - english: List[str]: An array of three lines of the haiku in English |
21 | | - japanese: List[str]: An array of three lines of the haiku in Japanese |
| 20 | + english: List[str]: An array of three lines of the haiku in English. YOU MUST PROVIDE THE ENGLISH HAIKU. |
| 21 | + japanese: List[str]: An array of three lines of the haiku in Japanese. YOU MUST PROVIDE THE JAPANESE HAIKU. |
22 | 22 |
|
23 | 23 | Returns: |
24 | | - str: A string containing the haiku in Japanese and its English translation |
25 | | - """ |
26 | | - print(english, japanese, flush=True) |
| 24 | + str: A confirmation message. |
| 25 | + """ # pylint: disable=line-too-long |
27 | 26 | return "Haiku generated" |
28 | 27 |
|
| 28 | + |
| 29 | +@tool(external_execution=True) |
| 30 | +def change_background(background: str) -> str: # pylint: disable=unused-argument |
| 31 | + """ |
| 32 | + Change the background color of the chat. Can be anything that the CSS background attribute accepts. Regular colors, linear of radial gradients etc. |
| 33 | +
|
| 34 | + Args: |
| 35 | + background: str: The background color to change to. Can be anything that the CSS background attribute accepts. Regular colors, linear of radial gradients etc. |
| 36 | + """ # pylint: disable=line-too-long |
| 37 | + |
29 | 38 | agent = Agent( |
30 | 39 | model=OpenAIChat(id="gpt-4o"), |
31 | | - tools=[generate_haiku], |
| 40 | + tools=[generate_haiku, change_background], |
32 | 41 | description="You are a helpful assistant that can help with tasks and answer questions.", |
33 | 42 | ) |
34 | 43 |
|
35 | 44 | agui_app = AGUIApp( |
36 | 45 | agent=agent, |
37 | 46 | name="Agno Agent", |
38 | 47 | app_id="agno_agent", |
39 | | - description="An helpful assistant.", |
| 48 | + description="A helpful assistant.", |
40 | 49 | ) |
41 | 50 |
|
42 | 51 | app = agui_app.get_app() |
|
0 commit comments