Skip to content

Commit

Permalink
Merge pull request #218 from rte-design/feature/ten
Browse files Browse the repository at this point in the history
TEN
  • Loading branch information
wangyoucao577 authored Aug 19, 2024
2 parents 3ea117c + dc3430e commit dabbb7a
Show file tree
Hide file tree
Showing 192 changed files with 1,265 additions and 2,561 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "astra",
"image": "ghcr.io/rte-design/astra_agents_build:0.3.6",
"image": "ghcr.io/rte-design/astra_agents_build:0.4.0",
"customizations": {
"vscode": {
"extensions": [
Expand Down
11 changes: 6 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"python.analysis.extraPaths": [
"./agents/interface",
],
"editor.formatOnSave": true,
}
"python.analysis.extraPaths": [
"./agents/ten_packages/system/ten_runtime_python/interface",
],
"C_Cpp.intelliSenseEngine": "disabled",
"editor.formatOnSave": true,
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/rte-design/astra_agents_build:0.3.6 AS builder
FROM ghcr.io/rte-design/astra_agents_build:0.4.0 AS builder

ARG SESSION_CONTROL_CONF=session_control.conf

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ clean: clean-agents

clean-agents:
@echo ">> clean agents"
rm -rf agents/bin agents/out agents/interface agents/include agents/lib agents/lib64 agents/addon/system agents/addon/extension_group agents/.release
rm -rf agents/bin agents/out agents/interface agents/include agents/lib agents/lib64 agents/ten_packages/system agents/ten_packages/extension_group agents/.release
@echo ">> done"

docker-build-playground:
Expand All @@ -40,7 +40,7 @@ docker-build-server:

run-gd-server:
@echo ">> run graph designer server"
cd agents && arpm dev-server
cd agents && tman dev-server
@echo ">> done"

run-server:
Expand Down
11 changes: 6 additions & 5 deletions agents/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
*.log
addon/extension_group/
addon/extension/agora_rtc
addon/extension/py_init_extension_cpp
addon/system
.rte
ten_packages/extension_group/
ten_packages/extension/agora_rtc
ten_packages/extension/py_init_extension_cpp
ten_packages/system
.ten
agoradns.dat
agorareport.dat
bin/
Expand All @@ -26,4 +26,5 @@ session_control.conf.agora
xdump_config
.vscode
*.pyc
*.pyc.*
/property.json
75 changes: 0 additions & 75 deletions agents/addon/extension/azure_tts/BUILD.gn

This file was deleted.

10 changes: 0 additions & 10 deletions agents/addon/extension/chat_transcriber/go.mod

This file was deleted.

10 changes: 0 additions & 10 deletions agents/addon/extension/elevenlabs_tts/go.mod

This file was deleted.

7 changes: 0 additions & 7 deletions agents/addon/extension/interrupt_detector/go.mod

This file was deleted.

9 changes: 9 additions & 0 deletions agents/bin/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

cd "$(dirname "${BASH_SOURCE[0]}")/.."

export LD_LIBRARY_PATH=$(pwd)/ten_packages/system/agora_rtc_sdk/lib:$(pwd)/ten_packages/system/azure_speech_sdk/lib

exec bin/worker "$@"
4 changes: 2 additions & 2 deletions agents/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module app

go 1.20

replace agora.io/rte => ./interface
replace ten_framework => ./ten_packages/system/ten_runtime_go/interface

require agora.io/rte v0.0.0-00010101000000-000000000000
require ten_framework v0.0.0-00010101000000-000000000000
22 changes: 13 additions & 9 deletions agents/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,38 @@ package main
import (
"flag"
"log"
"os"

"agora.io/rte/rte"
"ten_framework/ten"
)

type appConfig struct {
PropertyFilePath string
}

type defaultApp struct {
rte.DefaultApp
ten.DefaultApp

cfg *appConfig
}

func (p *defaultApp) OnInit(
rteEnv rte.RteEnv,
property rte.MetadataInfo,
tenEnv ten.TenEnv,
) {
// Using the default property.json if not specified.
if len(p.cfg.PropertyFilePath) > 0 {
property.Set(rte.MetadataTypeJSONFileName, p.cfg.PropertyFilePath)
if b, err := os.ReadFile(p.cfg.PropertyFilePath); err != nil {
log.Fatalf("Failed to read property file %s, err %v\n", p.cfg.PropertyFilePath, err)
}else{
tenEnv.InitPropertyFromJSONBytes(b)
}
}

rteEnv.OnInitDone(property)
tenEnv.OnInitDone()
}

func startAppBlocking(cfg *appConfig) {
appInstance, err := rte.NewApp(&defaultApp{
appInstance, err := ten.NewApp(&defaultApp{
cfg: cfg,
})
if err != nil {
Expand All @@ -46,9 +50,9 @@ func startAppBlocking(cfg *appConfig) {

appInstance.Run(true)
appInstance.Wait()
rte.UnloadAllAddons()
ten.UnloadAllAddons()

rte.EnsureCleanupWhenProcessExit()
ten.EnsureCleanupWhenProcessExit()
}

func setDefaultLog() {
Expand Down
68 changes: 0 additions & 68 deletions agents/main.py

This file was deleted.

Loading

0 comments on commit dabbb7a

Please sign in to comment.