-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
4,715 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
layout: | ||
title: | ||
visible: true | ||
description: | ||
visible: false | ||
tableOfContents: | ||
visible: true | ||
outline: | ||
visible: true | ||
pagination: | ||
visible: true | ||
--- | ||
|
||
# 🌟 Welcome to TEN | ||
|
||
Welcome to TEN! TEN stands for Transformative Extensions Network, an open-source framework for quickly creating multimodal AI agents. It features the all-in-one TEN Manager, written in Rust, supports multimodal protocols, includes the TEN Runtime, offers the Graph Designer, and has an Extension Store to share in community. | ||
|
||
Here, you’ll get an overview of all the incredible features TEN offers to help you build engaging and interactive experiences. | ||
|
||
Before we get started, please click the [**star button on our GitHub repo**](https://github.com/rte-design/astra.ai) to stay updated with one of the AI agents powered by TEN. | ||
|
||
<figure><img src=".gitbook/assets/star-the-repo-confetti.gif" alt=""><figcaption><p>Star us to stay updated</p></figcaption></figure> | ||
|
||
### Jump right in | ||
|
||
<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Getting started</strong></td><td>Quickstart to build locally</td><td><a href=".gitbook/assets/1.png">1.png</a></td><td></td><td><a href="getting_started/quickstart.md">quickstart.md</a></td></tr><tr><td><strong>Customize agent</strong></td><td>Two ways to customize</td><td><a href=".gitbook/assets/4.png">4.png</a></td><td></td><td><a href="getting_started/publish_your_docs.md">publish_your_docs.md</a></td></tr><tr><td><strong>Create hello world extension</strong></td><td>Build extensions right away</td><td><a href=".gitbook/assets/3.png">3.png</a></td><td></td><td><a href="getting_started/create_a_hello_world_extension.md">create_a_hello_world_extension.md</a></td></tr></tbody></table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Table of contents | ||
|
||
* [🌟 Welcome to TEN](README.md) | ||
|
||
## 🎉 Getting Started | ||
|
||
* [Quickstart](getting_started/quickstart.md) | ||
* [Customize your agent](getting_started/publish_your_docs.md) | ||
* [Create a hello world extension](getting_started/create_a_hello_world_extension.md) | ||
|
||
## TEN framework | ||
|
||
* [Testing](ten_framework/testing.md) | ||
|
||
## TEN Service | ||
|
||
* [🚧 TEN architecture(beta)](ten_service/ten_architecture_beta.md) | ||
* [🚧 TEN schema(beta)](ten_service/ten_schema_beta.md) | ||
* [TEN API(beta)](ten_service/ten_api_beta.md) | ||
* [🚧 TEN Message type and name(beta)](ten_service/ten_message_type_and_name_beta.md) | ||
* [🚧 Astra AI agent architecture(beta)](ten_service/astra_ai_agent_architecture_beta.md) | ||
|
||
## Tutorials | ||
|
||
* [How to debug with logs](tutorials/how_to_debug_with_logs.md) | ||
* [🚧 How to build extension with Go(beta)](tutorials/how_to_build_extension_with_go_beta.md) | ||
* [🚧 How to build extension with C++(beta)](tutorials/how_to_build_extension_with_c++_beta.md) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
--- | ||
layout: | ||
title: | ||
visible: true | ||
description: | ||
visible: false | ||
tableOfContents: | ||
visible: true | ||
outline: | ||
visible: true | ||
pagination: | ||
visible: true | ||
--- | ||
|
||
# Create a hello world extension | ||
|
||
In this chapter, we are going to create a `Hello World` extension step by step, available in Python, Go, and C++. Feel free to choose whichever language you prefer. So buckle up. | ||
|
||
## Prerequisites | ||
|
||
Before diving into this chapter, you’ll need to be familiar with the [basics covered earlier](quickstart.md). Specifically, ensure you understand how to use `docker compose up` and are aware of the services running in the background. | ||
|
||
## 1. Compose up the servers | ||
|
||
First things first, let’s start by composing the servers. Run the following command: | ||
|
||
{% hint style="info" %} | ||
If the caption says `Terminal`, it means you are running the command locally. If the caption says `Bash`, it means you are running the command in the Docker container. | ||
{% endhint %} | ||
|
||
{% code title=">_ Terminal" %} | ||
|
||
```bash | ||
docker compose up | ||
``` | ||
|
||
{% endcode %} | ||
|
||
Once the command is entered, you should see output similar to this: | ||
|
||
<pre class="language-bash" data-title=">_ Terminal"><code class="lang-bash">.... | ||
Attaching to astra_agents_dev, astra_graph_designer, astra_playground | ||
astra_agents_dev | >> run graph designer server | ||
astra_agents_dev | cd agents && tman dev-server | ||
<strong>astra_agents_dev | :-) Starting server at http://0.0.0.0:49483 | ||
</strong>astra_graph_designer | ▲ Next.js 14.2.4 | ||
<strong>astra_graph_designer | - Local: http://localhost:3000 | ||
</strong>astra_graph_designer | - Network: http://0.0.0.0:3000 | ||
astra_graph_designer | | ||
astra_graph_designer | ✓ Starting... | ||
astra_playground | ▲ Next.js 14.2.4 | ||
<strong>astra_playground | - Local: http://localhost:3000 | ||
</strong>astra_playground | - Network: http://0.0.0.0:3000 | ||
astra_playground | | ||
astra_playground | ✓ Starting... | ||
astra_graph_designer | ✓ Ready in 293ms | ||
astra_playground | ✓ Ready in 293ms | ||
... | ||
</code></pre> | ||
|
||
Now, we’ve got the following services running: | ||
|
||
• `astra_agents_dev` at `http://0.0.0.0:49483` (the backend server for the Graph Designer) | ||
|
||
• `astra_graph_designer` at `http://localhost:3000` (the UI of the Graph Designer) | ||
|
||
• `astra_playground` at `http://localhost:3001` (the UI of the Astra agent) | ||
|
||
## 2. Enter the docker container | ||
|
||
To work within the isolated environment, run the following command: | ||
|
||
{% code title=">_ Terminal" %} | ||
|
||
```bash | ||
docker exec -it astra_agents_dev bash | ||
``` | ||
|
||
{% endcode %} | ||
|
||
## 3. Create the hello world extension | ||
|
||
By running the following commands, an extension called `hello_world` will be created in Python, Go, or C++. | ||
|
||
{% tabs %} | ||
{% tab title="Python" %} | ||
<pre class="language-bash" data-title=">_ Bash" data-overflow="wrap"><code class="lang-bash">cd agents/ten_packages/extension | ||
|
||
<strong>tman install extension default_extension_python --template-mode --template-data package_name=hello_world --template-data class_name_prefix=HelloWorld | ||
</strong> | ||
cd /app | ||
</code></pre> | ||
{% endtab %} | ||
|
||
{% tab title="Go" %} | ||
<pre class="language-bash" data-title=">_ Bash" data-overflow="wrap"><code class="lang-bash">cd agents/ten_packages/extension | ||
|
||
<strong>tman install extension default_extension_go --template-mode --template-data package_name=hello_world --template-data class_name_prefix=HelloWorld | ||
</strong> | ||
cd /app | ||
</code></pre> | ||
{% endtab %} | ||
|
||
{% tab title="C++" %} | ||
<pre class="language-bash" data-title=">_ Bash" data-overflow="wrap"><code class="lang-bash">cd agents/ten_packages/extension | ||
|
||
<strong>tman install extension default_extension_cpp --template-mode --template-data package_name=hello_world --template-data class_name_prefix=HelloWorld | ||
</strong> | ||
cd /app | ||
</code></pre> | ||
{% endtab %} | ||
{% endtabs %} | ||
|
||
After running the command, the log will display something like this: | ||
|
||
<pre class="language-bash" data-title=">_ Bash"><code class="lang-bash">... | ||
Resolving packages... | ||
<strong>:-) Install successfully in xxx seconds | ||
</strong>... | ||
</code></pre> | ||
|
||
## 4. Adding API to the extension | ||
|
||
Navigate into the `hello_world` directory and open manifest.json. Add the API objects with `data_in` and `cmd_out`, which we will use shortly within the Graph Designer: | ||
|
||
<pre class="language-json" data-title="./hello_world/manifest.json"><code class="lang-json">{ | ||
"type": "extension", | ||
"name": "hello_world", | ||
"version": "0.4.1", | ||
"language": "python", | ||
"dependencies": [ | ||
{ | ||
"type": "system", | ||
"name": "rte_runtime_python", | ||
"version": "0.4.1" | ||
} | ||
], | ||
"api": { | ||
<strong> "data_in": [ | ||
</strong><strong> { | ||
</strong><strong> "name": "text_data", | ||
</strong><strong> "property": { | ||
</strong><strong> "text": { | ||
</strong><strong> "type": "string" | ||
</strong><strong> }, | ||
</strong><strong> "is_final": { | ||
</strong><strong> "type": "bool" | ||
</strong><strong> } | ||
</strong><strong> } | ||
</strong><strong> } | ||
</strong><strong> ], | ||
</strong><strong> "cmd_out": [ | ||
</strong><strong> { | ||
</strong><strong> "name": "flush" | ||
</strong><strong> } | ||
</strong><strong> ] | ||
</strong> } | ||
} | ||
</code></pre> | ||
|
||
For detailed information on the API and schema, please refer to [ten_api_beta.md](../ten_service/ten_api_beta.md "mention") and [ten_schema_beta.md](../ten_service/ten_schema_beta.md "mention"). | ||
|
||
## 5. Build the extension | ||
|
||
Let's use `cd /app` command to go back to the root of the project, and run `make build` to build the extension. | ||
|
||
{% code title=">_ Bash" %} | ||
|
||
```bash | ||
cd /app | ||
|
||
make build | ||
``` | ||
|
||
{% endcode %} | ||
|
||
## 6. Restart the server | ||
|
||
You don’t need to restart the server when you first build the agent. However, after making minor updates, if refreshing the page doesn’t apply the changes, you’ll need to restart the server in Docker to ensure the updates take effect. | ||
|
||
<figure><img src="../.gitbook/assets/docker-restart-server.gif" alt=""><figcaption><p>Restart the server for astra_agents_dev</p></figcaption></figure> | ||
|
||
## 7. Verify the extension  | ||
|
||
Open `http://localhost:3001` in your browser. You should see `hello_world` in the left menu. Drag it to the canvas, and connect it to the `text_data` input and `flash` output. | ||
|
||
You see the green and red color indicting the possible routes of node connecting.  | ||
|
||
<figure><img src="../.gitbook/assets/hello-world-python.gif" alt=""><figcaption><p>hello_world extension</p></figcaption></figure> | ||
|
||
Congratulations! You’ve successfully created your first `hello_world` extension, and it’s working seamlessly within the Graph Designer canvas. | ||
|
||
## 8. Check the network requests | ||
|
||
Open Chrome DevTools, navigate to the Network panel, and monitor the requests. You should see the status codes returning as 200, indicating that the changes have been successfully processed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
layout: | ||
title: | ||
visible: true | ||
description: | ||
visible: false | ||
tableOfContents: | ||
visible: true | ||
outline: | ||
visible: true | ||
pagination: | ||
visible: true | ||
--- | ||
|
||
# Customize your agent | ||
|
||
There are two primary methods to customize the Astra agent locally: | ||
|
||
## Using the power of graph designer (recommended) | ||
|
||
<figure><img src="../.gitbook/assets/graph_designer.gif" alt=""><figcaption></figcaption></figure> | ||
|
||
The Graph Designer is a user-friendly, visual tool that allows you to create and modify the behavior and responses of the Astra agent without needing to write code. This approach is highly recommended for its ease of use and efficiency. By leveraging the Graph Designer, you can quickly design complex interactions and workflows through a graphical interface, making it accessible even for those with limited programming experience. | ||
|
||
## Editing the code yourself | ||
|
||
For those who prefer a more hands-on approach or need advanced customization, you can directly edit the source code of the Astra agent. This method requires a good understanding of the codebase and programming languages used in the project. By manually editing the code, you have full control over every aspect of the agent’s functionality, allowing for highly tailored and specific customizations. This approach is ideal for developers who need to implement unique features or integrate the agent with other systems. | ||
|
||
{% tabs %} | ||
{% tab title="property.json" %} | ||
<pre class="language-json" data-title="./agents/property.json"><code class="lang-json">// ... | ||
"nodes": [ | ||
{ | ||
"type": "extension", | ||
"extension_group": "default", | ||
"addon": "agora_rtc", | ||
"name": "agora_rtc", | ||
"property": { | ||
<strong> "app_id": "app-id", | ||
</strong> "token": "<agora_token>", | ||
"channel": "astra_agents_test", | ||
"stream_id": 1234, | ||
"remote_stream_id": 123, | ||
"subscribe_audio": true, | ||
"publish_audio": true, | ||
"publish_data": true, | ||
"enable_agora_asr": true, | ||
"agora_asr_vendor_name": "microsoft", | ||
"agora_asr_language": "en-US", | ||
<strong> "agora_asr_vendor_key": "stt-key", | ||
</strong><strong> "agora_asr_vendor_region": "stt-region", | ||
</strong> "agora_asr_session_control_file_path": "session_control.conf" | ||
} | ||
}, | ||
// ... | ||
</code></pre> | ||
|
||
{% endtab %} | ||
|
||
{% tab title="config.go" %} | ||
<pre class="language-go" data-title="config.go"><code class="lang-go">// ... | ||
// Default graph name | ||
<strong>graphNameDefault = "va.openai.azure" | ||
</strong>// ... | ||
</code></pre> | ||
{% endtab %} | ||
{% endtabs %} | ||
|
||
Save both files, then run `make build`. Your agent, complete with the intended extensions, should now be up and running. |
Oops, something went wrong.