Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit c255e1f

Browse files
committed
Sun Apr 21 17:00:34 PDT 2024
1 parent e888549 commit c255e1f

File tree

24 files changed

+103
-11
lines changed

24 files changed

+103
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For documentation, visit the project website: [ava.0x77.dev](https://ava.0x77.de
1212

1313
- **Supports major LLMs**: OpenAI, Anthropic, and Ollama supported by default.
1414
- **Home Assistant Integration**: Control Home Assistant devices and get entity information.
15-
- **Extensible _(work in progress)_**: Easily add new skills via custom HTTP endpoints.
15+
- **Extensible _(work in progress)_**: Easily add new skill via custom HTTP endpoints.
1616
- **Customizable**: Highly configurable through environment variables.
1717
- **Fully private**: Can be self-hosted for complete data control.
1818
- **OpenAI compatible endpoints**: Chat with Ava using OpenAI-compatible chat completion.

bun.lockb

7.24 KB
Binary file not shown.

docs/content/index.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ features:
4848
target: '_blank'
4949
- title: 'Extensible'
5050
wip: true
51-
description: 'Easily add new skills via custom HTTP endpoints'
51+
description: 'Easily add new skill via custom HTTP endpoints'
5252
icon: 'i-heroicons-sparkles-20-solid'
5353
target: '_blank'
5454
- title: 'Customizable'

ollama/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ports:
1212
image: docker.io/ollama/ollama
1313
ingress: true
1414
ingress_port: 11434
15+
ingress_stream: true
1516
map:
1617
- config:rw
1718
environment:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "GPL-3.0",
66
"workspaces": [
77
"packages/*",
8-
"skills/*",
8+
"skill/*",
99
"docs",
1010
"server"
1111
],

server/config.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "Ava Server"
22
description: "Self-hosted personal assistant in minutes with built-in Home Assistant integration and great extensibility and customizability"
3-
version: "edge"
3+
version: "0.0.0"
44
slug: "server"
55
init: false
66
arch:
@@ -13,6 +13,7 @@ image: ghcr.io/0x77dev/ava/server
1313
homeassistant_api: true
1414
ingress: true
1515
ingress_port: 2881
16+
ingress_stream: true
1617
options:
1718
llm:
1819
namespace: anthropic
@@ -21,15 +22,21 @@ options:
2122
embeddings:
2223
namespace: ollama
2324
baseURL: "http://04c4e5a1-ollama:11434"
24-
name: nomic-embed-text
25+
name: snowflake-arctic-embed:22m
26+
skills: []
2527
schema:
2628
llm:
27-
namespace: str
29+
namespace: list(anthropic|openai|ollama)
2830
name: "str"
2931
token: "str?"
3032
baseURL: "str?"
3133
embeddings:
32-
namespace: str
34+
namespace: list(openai|ollama)
3335
name: "str"
3436
token: "str?"
3537
baseURL: "str?"
38+
skills:
39+
- name: "str"
40+
description: "str"
41+
returnDirect: "bool?"
42+
url: "str"

server/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"dependencies": {
99
"@ava/lang": "workspace:../packages/lang",
1010
"@ava/oai-types": "workspace:../packages/oai-types",
11-
"@ava/skills-homeassistant": "workspace:../packages/skills-homeassistant",
11+
"@ava/skill-homeassistant": "workspace:../skill/homeassistant",
12+
"@ava/skill-dynamic": "workspace:../skill/dynamic",
1213
"@bogeychan/elysia-logger": "^0.0.21",
1314
"@elysiajs/swagger": "^1.0.3",
1415
"elysia": "latest",

server/src/addon-config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ export const injectHassOptions = async () => {
2121
process.env.EMBEDDINGS = JSON.stringify(options.embeddings)
2222
}
2323

24+
if (options.skills) {
25+
process.env.SKILLS = JSON.stringify(options.skills)
26+
}
27+
2428
if (process.env.SUPERVISOR_TOKEN) {
2529
process.env.HOMEASSISTANT = JSON.stringify({
2630
"token": process.env.SUPERVISOR_TOKEN,

server/src/services/assistant.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ export const getAssistant = async () => {
1010
const tools: ToolInterface[] = []
1111

1212
if (process.env.HOMEASSISTANT) {
13-
const { createHomeAssistantToolkit } = await import('@ava/skills-homeassistant')
13+
const { createHomeAssistantToolkit } = await import('@ava/skill-homeassistant')
1414
tools.push(...await createHomeAssistantToolkit())
1515
}
1616

17+
if (process.env.SKILLS) {
18+
const { createDynamicToolkit } = await import('@ava/skill-dynamic')
19+
tools.push(...await createDynamicToolkit())
20+
}
21+
1722
assistant = await createAssistant(tools)
1823
return assistant
1924
}

skill/dynamic/config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { parseEnv, z } from "znv";
2+
import { SkillListSchema } from "./schema";
3+
4+
export const { SKILLS } = parseEnv(process.env, {
5+
SKILLS: {
6+
schema: z.string().transform((value) => SkillListSchema.parse(JSON.parse(value))),
7+
description: "Skills configuration"
8+
}
9+
})

0 commit comments

Comments
 (0)