Skip to content

Commit 272c415

Browse files
committed
latest 1.5 alpha
1 parent 1961c83 commit 272c415

File tree

3 files changed

+42
-42
lines changed

3 files changed

+42
-42
lines changed

apps/dojo/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
"@ag-ui/spring-ai": "workspace:*",
2727
"@ag-ui/vercel-ai-sdk": "workspace:*",
2828
"@ai-sdk/openai": "^2.0.42",
29-
"@copilotkit/react-core": "0.0.0-feat-cpk-1-5-20251022120653",
30-
"@copilotkit/react-ui": "0.0.0-feat-cpk-1-5-20251022120653",
31-
"@copilotkit/runtime": "0.0.0-feat-cpk-1-5-20251022120653",
32-
"@copilotkit/runtime-client-gql": "0.0.0-feat-cpk-1-5-20251022120653",
33-
"@copilotkit/shared": "0.0.0-feat-cpk-1-5-20251022120653",
29+
"@copilotkit/react-core": "0.0.0-feat-cpk-1-5-20251023090044",
30+
"@copilotkit/react-ui": "0.0.0-feat-cpk-1-5-20251023090044",
31+
"@copilotkit/runtime": "0.0.0-feat-cpk-1-5-20251023090044",
32+
"@copilotkit/runtime-client-gql": "0.0.0-feat-cpk-1-5-20251023090044",
33+
"@copilotkit/shared": "0.0.0-feat-cpk-1-5-20251023090044",
3434
"@mastra/client-js": "^0.15.2",
3535
"@mastra/core": "^0.20.2",
3636
"@mastra/dynamodb": "^0.15.6",

apps/dojo/src/files.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@
12811281
},
12821282
{
12831283
"name": "agentic_chat.py",
1284-
"content": "\"\"\"Example: Agno Agent with Finance tools\n\nThis example shows how to create an Agno Agent with tools (YFinanceTools) and expose it in an AG-UI compatible way.\n\"\"\"\nfrom agno.agent.agent import Agent\nfrom agno.app.agui.app import AGUIApp\nfrom agno.models.openai import OpenAIChat\nfrom agno.tools.yfinance import YFinanceTools\nfrom agno.tools import tool\n\n\n@tool(external_execution=True)\ndef change_background(background: str) -> str: # pylint: disable=unused-argument\n \"\"\"\n Change the background color of the chat. Can be anything that the CSS background attribute accepts. Regular colors, linear of radial gradients etc.\n\n Args:\n background: str: The background color to change to. Can be anything that the CSS background attribute accepts. Regular colors, linear of radial gradients etc.\n \"\"\" # pylint: disable=line-too-long\n\nagent = Agent(\n model=OpenAIChat(id=\"gpt-4o\"),\n tools=[\n YFinanceTools(\n stock_price=True, analyst_recommendations=True, stock_fundamentals=True\n ),\n change_background,\n ],\n description=\"You are an investment analyst that researches stock prices, analyst recommendations, and stock fundamentals.\",\n instructions=\"Format your response using markdown and use tables to display data where possible.\",\n)\n\nagui_app = AGUIApp(\n agent=agent,\n name=\"Investment Analyst\",\n app_id=\"agentic_chat\",\n description=\"An investment analyst that researches stock prices, analyst recommendations, and stock fundamentals.\",\n)\n\napp = agui_app.get_app()",
1284+
"content": "\"\"\"Example: Agno Agent with Finance tools\n\nThis example shows how to create an Agno Agent with tools (YFinanceTools) and expose it in an AG-UI compatible way.\n\"\"\"\nfrom agno.agent.agent import Agent\nfrom agno.os import AgentOS\nfrom agno.os.interfaces.agui import AGUI\nfrom agno.models.openai import OpenAIChat\nfrom agno.tools.yfinance import YFinanceTools\nfrom agno.tools import tool\n\n\n@tool(external_execution=True)\ndef change_background(background: str) -> str: # pylint: disable=unused-argument\n \"\"\"\n Change the background color of the chat. Can be anything that the CSS background attribute accepts. Regular colors, linear of radial gradients etc.\n\n Args:\n background: str: The background color to change to. Can be anything that the CSS background attribute accepts. Regular colors, linear of radial gradients etc.\n \"\"\" # pylint: disable=line-too-long\n\nagent = Agent(\n model=OpenAIChat(id=\"gpt-4o\"),\n tools=[\n YFinanceTools(),\n change_background,\n ],\n description=\"You are an investment analyst that researches stock prices, analyst recommendations, and stock fundamentals.\",\n instructions=\"Format your response using markdown and use tables to display data where possible.\",\n)\n\nagent_os = AgentOS(\n agents=[agent],\n interfaces=[AGUI(agent=agent)]\n)\n\napp = agent_os.get_app()",
12851285
"language": "python",
12861286
"type": "file"
12871287
}
@@ -1307,7 +1307,7 @@
13071307
},
13081308
{
13091309
"name": "tool_based_generative_ui.py",
1310-
"content": "\"\"\"Example: Tool-based Generative UI Agent\n\nThis example shows how to create an Agno Agent with custom tools for haiku generation\nand background changing, exposed in an AG-UI compatible way.\n\"\"\"\nfrom typing import List\n\nfrom agno.agent.agent import Agent\nfrom agno.app.agui.app import AGUIApp\nfrom agno.models.openai import OpenAIChat\nfrom agno.tools import tool\n\n\n@tool(external_execution=True)\ndef generate_haiku(english: List[str], japanese: List[str], image_names: List[str]) -> str: # pylint: disable=unused-argument\n \"\"\"\n\n Generate a haiku in Japanese and its English translation.\n YOU MUST PROVIDE THE ENGLISH HAIKU AND THE JAPANESE HAIKU AND THE IMAGE NAMES.\n When picking image names, pick them from the following list:\n - \"Osaka_Castle_Turret_Stone_Wall_Pine_Trees_Daytime.jpg\",\n - \"Tokyo_Skyline_Night_Tokyo_Tower_Mount_Fuji_View.jpg\",\n - \"Itsukushima_Shrine_Miyajima_Floating_Torii_Gate_Sunset_Long_Exposure.jpg\",\n - \"Takachiho_Gorge_Waterfall_River_Lush_Greenery_Japan.jpg\",\n - \"Bonsai_Tree_Potted_Japanese_Art_Green_Foliage.jpeg\",\n - \"Shirakawa-go_Gassho-zukuri_Thatched_Roof_Village_Aerial_View.jpg\",\n - \"Ginkaku-ji_Silver_Pavilion_Kyoto_Japanese_Garden_Pond_Reflection.jpg\",\n - \"Senso-ji_Temple_Asakusa_Cherry_Blossoms_Kimono_Umbrella.jpg\",\n - \"Cherry_Blossoms_Sakura_Night_View_City_Lights_Japan.jpg\",\n - \"Mount_Fuji_Lake_Reflection_Cherry_Blossoms_Sakura_Spring.jpg\"\n\n Args:\n english: List[str]: An array of three lines of the haiku in English. YOU MUST PROVIDE THE ENGLISH HAIKU.\n japanese: List[str]: An array of three lines of the haiku in Japanese. YOU MUST PROVIDE THE JAPANESE HAIKU.\n image_names: List[str]: An array of three image names. YOU MUST PROVIDE THE IMAGE NAMES.\n\n\n Returns:\n str: A confirmation message.\n \"\"\" # pylint: disable=line-too-long\n return \"Haiku generated\"\n\nagent = Agent(\n model=OpenAIChat(id=\"gpt-4o\"),\n tools=[generate_haiku],\n description=\"Help the user with writing Haikus. If the user asks for a haiku, use the generate_haiku tool to display the haiku to the user.\",\n debug_mode=True,\n)\n\nagui_app = AGUIApp(\n agent=agent,\n name=\"Tool-based Generative UI Agent\",\n app_id=\"tool_based_generative_ui\",\n description=\"A tool-based generative UI agent with haiku generation and background changing capabilities.\",\n)\n\napp = agui_app.get_app()",
1310+
"content": "\"\"\"Example: Tool-based Generative UI Agent\n\nThis example shows how to create an Agno Agent with custom tools for haiku generation\nand background changing, exposed in an AG-UI compatible way.\n\"\"\"\nfrom typing import List\n\nfrom agno.agent.agent import Agent\nfrom agno.os import AgentOS\nfrom agno.os.interfaces.agui import AGUI\nfrom agno.models.openai import OpenAIChat\nfrom agno.tools import tool\n\n\n@tool(external_execution=True)\ndef generate_haiku(english: List[str], japanese: List[str], image_names: List[str]) -> str: # pylint: disable=unused-argument\n \"\"\"\n\n Generate a haiku in Japanese and its English translation.\n YOU MUST PROVIDE THE ENGLISH HAIKU AND THE JAPANESE HAIKU AND THE IMAGE NAMES.\n When picking image names, pick them from the following list:\n - \"Osaka_Castle_Turret_Stone_Wall_Pine_Trees_Daytime.jpg\",\n - \"Tokyo_Skyline_Night_Tokyo_Tower_Mount_Fuji_View.jpg\",\n - \"Itsukushima_Shrine_Miyajima_Floating_Torii_Gate_Sunset_Long_Exposure.jpg\",\n - \"Takachiho_Gorge_Waterfall_River_Lush_Greenery_Japan.jpg\",\n - \"Bonsai_Tree_Potted_Japanese_Art_Green_Foliage.jpeg\",\n - \"Shirakawa-go_Gassho-zukuri_Thatched_Roof_Village_Aerial_View.jpg\",\n - \"Ginkaku-ji_Silver_Pavilion_Kyoto_Japanese_Garden_Pond_Reflection.jpg\",\n - \"Senso-ji_Temple_Asakusa_Cherry_Blossoms_Kimono_Umbrella.jpg\",\n - \"Cherry_Blossoms_Sakura_Night_View_City_Lights_Japan.jpg\",\n - \"Mount_Fuji_Lake_Reflection_Cherry_Blossoms_Sakura_Spring.jpg\"\n\n Args:\n english: List[str]: An array of three lines of the haiku in English. YOU MUST PROVIDE THE ENGLISH HAIKU.\n japanese: List[str]: An array of three lines of the haiku in Japanese. YOU MUST PROVIDE THE JAPANESE HAIKU.\n image_names: List[str]: An array of three image names. YOU MUST PROVIDE THE IMAGE NAMES.\n\n\n Returns:\n str: A confirmation message.\n \"\"\" # pylint: disable=line-too-long\n return \"Haiku generated\"\n\nagent = Agent(\n model=OpenAIChat(id=\"gpt-4o\"),\n tools=[generate_haiku],\n description=\"Help the user with writing Haikus. If the user asks for a haiku, use the generate_haiku tool to display the haiku to the user.\",\n debug_mode=True,\n)\n\nagent_os = AgentOS(\n agents=[agent],\n interfaces=[AGUI(agent=agent)]\n)\n\napp = agent_os.get_app()",
13111311
"language": "python",
13121312
"type": "file"
13131313
}
@@ -1333,7 +1333,7 @@
13331333
},
13341334
{
13351335
"name": "backend_tool_rendering.py",
1336-
"content": "\"\"\"Example: Agno Agent with Finance tools\n\nThis example shows how to create an Agno Agent with tools (YFinanceTools) and expose it in an AG-UI compatible way.\n\"\"\"\n\nfrom agno.agent.agent import Agent\nfrom agno.app.agui.app import AGUIApp\nfrom agno.models.openai import OpenAIChat\nfrom agno.tools.yfinance import YFinanceTools\nfrom agno.tools import tool\nimport httpx\nimport json\n\n\ndef get_weather_condition(code: int) -> str:\n \"\"\"Map weather code to human-readable condition.\n\n Args:\n code: WMO weather code.\n\n Returns:\n Human-readable weather condition string.\n \"\"\"\n conditions = {\n 0: \"Clear sky\",\n 1: \"Mainly clear\",\n 2: \"Partly cloudy\",\n 3: \"Overcast\",\n 45: \"Foggy\",\n 48: \"Depositing rime fog\",\n 51: \"Light drizzle\",\n 53: \"Moderate drizzle\",\n 55: \"Dense drizzle\",\n 56: \"Light freezing drizzle\",\n 57: \"Dense freezing drizzle\",\n 61: \"Slight rain\",\n 63: \"Moderate rain\",\n 65: \"Heavy rain\",\n 66: \"Light freezing rain\",\n 67: \"Heavy freezing rain\",\n 71: \"Slight snow fall\",\n 73: \"Moderate snow fall\",\n 75: \"Heavy snow fall\",\n 77: \"Snow grains\",\n 80: \"Slight rain showers\",\n 81: \"Moderate rain showers\",\n 82: \"Violent rain showers\",\n 85: \"Slight snow showers\",\n 86: \"Heavy snow showers\",\n 95: \"Thunderstorm\",\n 96: \"Thunderstorm with slight hail\",\n 99: \"Thunderstorm with heavy hail\",\n }\n return conditions.get(code, \"Unknown\")\n\n\n@tool(external_execution=False)\nasync def get_weather(location: str) -> str:\n \"\"\"Get current weather for a location.\n\n Args:\n location: City name.\n\n Returns:\n A json string with weather information including temperature, feels like,\n humidity, wind speed, wind gust, conditions, and location name.\n \"\"\"\n async with httpx.AsyncClient() as client:\n # Geocode the location\n geocoding_url = (\n f\"https://geocoding-api.open-meteo.com/v1/search?name={location}&count=1\"\n )\n geocoding_response = await client.get(geocoding_url)\n geocoding_data = geocoding_response.json()\n\n if not geocoding_data.get(\"results\"):\n raise ValueError(f\"Location '{location}' not found\")\n\n result = geocoding_data[\"results\"][0]\n latitude = result[\"latitude\"]\n longitude = result[\"longitude\"]\n name = result[\"name\"]\n\n # Get weather data\n weather_url = (\n f\"https://api.open-meteo.com/v1/forecast?\"\n f\"latitude={latitude}&longitude={longitude}\"\n f\"&current=temperature_2m,apparent_temperature,relative_humidity_2m,\"\n f\"wind_speed_10m,wind_gusts_10m,weather_code\"\n )\n weather_response = await client.get(weather_url)\n weather_data = weather_response.json()\n\n current = weather_data[\"current\"]\n\n return json.dumps(\n {\n \"temperature\": current[\"temperature_2m\"],\n \"feelsLike\": current[\"apparent_temperature\"],\n \"humidity\": current[\"relative_humidity_2m\"],\n \"windSpeed\": current[\"wind_speed_10m\"],\n \"windGust\": current[\"wind_gusts_10m\"],\n \"conditions\": get_weather_condition(current[\"weather_code\"]),\n \"location\": name,\n }\n )\n\n\nagent = Agent(\n model=OpenAIChat(id=\"gpt-4o\"),\n tools=[\n get_weather,\n ],\n description=\"You are a helpful weather assistant that provides accurate weather information.\",\n instructions=\"\"\"\n Your primary function is to help users get weather details for specific locations. When responding:\n - Always ask for a location if none is provided\n - If the location name isn’t in English, please translate it\n - If giving a location with multiple parts (e.g. \"New York, NY\"), use the most relevant part (e.g. \"New York\")\n - Include relevant details like humidity, wind conditions, and precipitation\n - Keep responses concise but informative\n\n Use the get_weather tool to fetch current weather data.\n \"\"\",\n)\n\nagui_app = AGUIApp(\n agent=agent,\n name=\"Weather Agent\",\n app_id=\"backend_tool_rendering\",\n description=\"A helpful weather assistant that provides accurate weather information.\",\n)\n\napp = agui_app.get_app()\n",
1336+
"content": "\"\"\"Example: Agno Agent with Finance tools\n\nThis example shows how to create an Agno Agent with tools (YFinanceTools) and expose it in an AG-UI compatible way.\n\"\"\"\n\nfrom agno.agent.agent import Agent\nfrom agno.os import AgentOS\nfrom agno.os.interfaces.agui import AGUI\nfrom agno.models.openai import OpenAIChat\nfrom agno.tools.yfinance import YFinanceTools\nfrom agno.tools import tool\nimport httpx\nimport json\n\n\ndef get_weather_condition(code: int) -> str:\n \"\"\"Map weather code to human-readable condition.\n\n Args:\n code: WMO weather code.\n\n Returns:\n Human-readable weather condition string.\n \"\"\"\n conditions = {\n 0: \"Clear sky\",\n 1: \"Mainly clear\",\n 2: \"Partly cloudy\",\n 3: \"Overcast\",\n 45: \"Foggy\",\n 48: \"Depositing rime fog\",\n 51: \"Light drizzle\",\n 53: \"Moderate drizzle\",\n 55: \"Dense drizzle\",\n 56: \"Light freezing drizzle\",\n 57: \"Dense freezing drizzle\",\n 61: \"Slight rain\",\n 63: \"Moderate rain\",\n 65: \"Heavy rain\",\n 66: \"Light freezing rain\",\n 67: \"Heavy freezing rain\",\n 71: \"Slight snow fall\",\n 73: \"Moderate snow fall\",\n 75: \"Heavy snow fall\",\n 77: \"Snow grains\",\n 80: \"Slight rain showers\",\n 81: \"Moderate rain showers\",\n 82: \"Violent rain showers\",\n 85: \"Slight snow showers\",\n 86: \"Heavy snow showers\",\n 95: \"Thunderstorm\",\n 96: \"Thunderstorm with slight hail\",\n 99: \"Thunderstorm with heavy hail\",\n }\n return conditions.get(code, \"Unknown\")\n\n\n@tool(external_execution=False)\nasync def get_weather(location: str) -> str:\n \"\"\"Get current weather for a location.\n\n Args:\n location: City name.\n\n Returns:\n A json string with weather information including temperature, feels like,\n humidity, wind speed, wind gust, conditions, and location name.\n \"\"\"\n async with httpx.AsyncClient() as client:\n # Geocode the location\n geocoding_url = (\n f\"https://geocoding-api.open-meteo.com/v1/search?name={location}&count=1\"\n )\n geocoding_response = await client.get(geocoding_url)\n geocoding_data = geocoding_response.json()\n\n if not geocoding_data.get(\"results\"):\n raise ValueError(f\"Location '{location}' not found\")\n\n result = geocoding_data[\"results\"][0]\n latitude = result[\"latitude\"]\n longitude = result[\"longitude\"]\n name = result[\"name\"]\n\n # Get weather data\n weather_url = (\n f\"https://api.open-meteo.com/v1/forecast?\"\n f\"latitude={latitude}&longitude={longitude}\"\n f\"&current=temperature_2m,apparent_temperature,relative_humidity_2m,\"\n f\"wind_speed_10m,wind_gusts_10m,weather_code\"\n )\n weather_response = await client.get(weather_url)\n weather_data = weather_response.json()\n\n current = weather_data[\"current\"]\n\n return json.dumps(\n {\n \"temperature\": current[\"temperature_2m\"],\n \"feelsLike\": current[\"apparent_temperature\"],\n \"humidity\": current[\"relative_humidity_2m\"],\n \"windSpeed\": current[\"wind_speed_10m\"],\n \"windGust\": current[\"wind_gusts_10m\"],\n \"conditions\": get_weather_condition(current[\"weather_code\"]),\n \"location\": name,\n }\n )\n\n\nagent = Agent(\n model=OpenAIChat(id=\"gpt-4o\"),\n tools=[\n get_weather,\n ],\n description=\"You are a helpful weather assistant that provides accurate weather information.\",\n instructions=\"\"\"\n Your primary function is to help users get weather details for specific locations. When responding:\n - Always ask for a location if none is provided\n - If the location name isn't in English, please translate it\n - If giving a location with multiple parts (e.g. \"New York, NY\"), use the most relevant part (e.g. \"New York\")\n - Include relevant details like humidity, wind conditions, and precipitation\n - Keep responses concise but informative\n\n Use the get_weather tool to fetch current weather data.\n \"\"\",\n)\n\nagent_os = AgentOS(\n agents=[agent],\n interfaces=[AGUI(agent=agent)]\n)\n\napp = agent_os.get_app()\n",
13371337
"language": "python",
13381338
"type": "file"
13391339
}

0 commit comments

Comments
 (0)