Skip to content

Commit

Permalink
feat: add ai-agent-demo
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkYuan committed Jun 7, 2024
1 parent 56f70a6 commit e94708f
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 0 deletions.
20 changes: 20 additions & 0 deletions example/ai-agent-demo/dev/example_workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
modules:
opensearch:
path: oci://ghcr.io/kusionstack/opensearch
version: 0.1.0
configs:
default:
region: us-east-1
clusterConfig:
instanceType: r6g.large.search
ebsOptions:
ebsEnabled: true
volumeSize: 10
statement:
- effect: Allow
principals:
- type: AWS
identifiers:
- "*"
action:
- es:*
11 changes: 11 additions & 0 deletions example/ai-agent-demo/dev/kcl.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "example"

[dependencies]
kam = { git = "https://github.com/KusionStack/kam.git", tag = "0.2.0-beta" }
service = { oci = "oci://ghcr.io/kusionstack/service", tag = "0.1.0-beta" }
opensearch = { oci = "oci://ghcr.io/kusionstack/opensearch", tag = "0.1.0" }

[profile]
entries = ["main.k"]

41 changes: 41 additions & 0 deletions example/ai-agent-demo/dev/main.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# The configuration codes in perspective of developers.
import kam.v1.app_configuration as ac
import service as svc
import service.secret as sec
import service.container as c
import opensearch.opensearch as o

agent: ac.AppConfiguration {
# Declare the workload configurations.
workload: svc.Service {
containers: {
opensearch: c.Container {
image: "kusionstack/ai-agent-demo:v0.1.0"
env: {
"OPENAI_API_KEY": "secret://ai-agent/OPENAI_API_KEY"
# "RAG_ENABLED": "true"
# "OPEN_SEARCH_AK": "secret://ai-agent/OPEN_SEARCH_AK"
# "OPEN_SEARCH_SK": "secret://ai-agent/OPEN_SEARCH_SK"
}
}
}
# Secrets used to retrieve secret data from AWS Secrets Manager
secrets: {
"ai-agent": sec.Secret {
type: "external"
data: {
"OPENAI_API_KEY": "ref://ai-agent/OPENAI_API_KEY"
# "OPEN_SEARCH_AK": "ref://ai-agent/OPEN_SEARCH_AK"
# "OPEN_SEARCH_SK": "ref://ai-agent/OPEN_SEARCH_SK"
}
}
}
}
# Declare the openSearch module configurations.
accessories: {
"opensearch": o.OpenSearch {
domainName: "ai-agent-demo"
engineVersion: "OpenSearch_2.13"
}
}
}
1 change: 1 addition & 0 deletions example/ai-agent-demo/dev/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: dev
1 change: 1 addition & 0 deletions example/ai-agent-demo/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: ai-agent-demo

0 comments on commit e94708f

Please sign in to comment.