Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions examples/hello_world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Hello World Example

The simplest possible VeADK example that demonstrates the basic structure of a VeADK application.

## What it does

- Creates a simple agent that responds with "Hello World!"
- Uses the `Runner` to execute the agent
- Prints the response to the console

## How to run

1. Make sure you have VeADK installed and configured properly
2. Run the example:

```bash
python main.py
```

You should see "Hello World!" printed in the console.
20 changes: 20 additions & 0 deletions examples/hello_world/README.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Hello World 示例

这是最简单的 VeADK 示例,演示了 VeADK 应用程序的基本结构。

## 功能说明

- 创建一个简单的 agent,返回 "Hello World!"
- 使用 `Runner` 来执行 agent
- 将响应打印到控制台

## 运行方式

1. 确保你已经正确安装并配置了 VeADK
2. 运行示例:

```bash
python main.py
```

你会在控制台看到 "Hello World!" 的输出。
42 changes: 42 additions & 0 deletions examples/hello_world/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""A minimal Hello World example for VeADK.

This is the simplest possible agent that responds with "Hello World!".
"""

import asyncio

from veadk import Agent, Runner


async def main() -> None:
agent = Agent(
name="hello_world_agent",
description="A simple agent that says hello world.",
instruction="When asked anything, respond exactly with 'Hello World!'.",
)

runner = Runner(agent=agent, app_name="hello_world")

answer = await runner.run(
messages="Say hello.",
session_id="hello-world-session",
)
print(answer)


if __name__ == "__main__":
asyncio.run(main())
Loading