Skip to content

Commit c8ca26e

Browse files
committed
update agno example
1 parent 127866f commit c8ca26e

File tree

1 file changed

+18
-9
lines changed
  • typescript-sdk/integrations/agno/examples/examples

1 file changed

+18
-9
lines changed

typescript-sdk/integrations/agno/examples/examples/__init__.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,42 @@
1010
from agno.tools import tool
1111

1212

13-
@tool(
14-
)
13+
@tool()
1514
def generate_haiku(english: List[str], japanese: List[str]) -> str: # pylint: disable=unused-argument
1615
"""
1716
Generate a haiku in Japanese and its English translation.
17+
YOU MUST PROVIDE THE ENGLISH HAIKU AND THE JAPANESE HAIKU.
1818
1919
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.
2222
2323
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
2726
return "Haiku generated"
2827

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+
2938
agent = Agent(
3039
model=OpenAIChat(id="gpt-4o"),
31-
tools=[generate_haiku],
40+
tools=[generate_haiku, change_background],
3241
description="You are a helpful assistant that can help with tasks and answer questions.",
3342
)
3443

3544
agui_app = AGUIApp(
3645
agent=agent,
3746
name="Agno Agent",
3847
app_id="agno_agent",
39-
description="An helpful assistant.",
48+
description="A helpful assistant.",
4049
)
4150

4251
app = agui_app.get_app()

0 commit comments

Comments
 (0)