Skip to content

Commit

Permalink
Merge branch 'main' into tbh/flow-update-generateObject
Browse files Browse the repository at this point in the history
  • Loading branch information
btspoony committed Dec 11, 2024
2 parents 9059d9c + 95e6ae7 commit 1c65758
Show file tree
Hide file tree
Showing 78 changed files with 18,890 additions and 20,767 deletions.
20 changes: 19 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ ALI_BAILIAN_API_KEY= # Ali Bailian API Key
VOLENGINE_API_KEY= # VolEngine API Key

HYPERBOLIC_API_KEY= # Hyperbolic API Key
HYPERBOLIC_MODEL=
IMAGE_HYPERBOLIC_MODEL= # Default: FLUX.1-dev
SMALL_HYPERBOLIC_MODEL= # Default: meta-llama/Llama-3.2-3B-Instruct
MEDIUM_HYPERBOLIC_MODEL= # Default: meta-llama/Meta-Llama-3.1-70B-Instruct
LARGE_HYPERBOLIC_MODEL= # Default: meta-llama/Meta-Llama-3.1-405-Instruct

# Speech Synthesis
ELEVENLABS_XI_API_KEY= # API key from elevenlabs
Expand Down Expand Up @@ -188,7 +193,12 @@ ZEROG_PRIVATE_KEY=
ZEROG_FLOW_ADDRESS=

# TEE Configuration
DSTACK_SIMULATOR_ENDPOINT=
# TEE_MODE options:
# - LOCAL: Uses simulator at localhost:8090 (for local development)
# - DOCKER: Uses simulator at host.docker.internal:8090 (for docker development)
# - PRODUCTION: No simulator, uses production endpoints
# Defaults to OFF if not specified
TEE_MODE=OFF #LOCAL|DOCKER|PRODUCTION
WALLET_SECRET_SALT= # ONLY DEFINE IF YOU WANT TO USE TEE Plugin, otherwise it will throw errors

# Galadriel Configuration
Expand Down Expand Up @@ -218,3 +228,11 @@ INTERNET_COMPUTER_ADDRESS=
# Aptos
APTOS_PRIVATE_KEY= # Aptos private key
APTOS_NETWORK= # must be one of mainnet, testnet


# AWS S3 Configuration Settings for File Upload
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
AWS_S3_BUCKET=
AWS_S3_UPLOAD_PATH=
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ COPY characters ./characters

# Install dependencies and build the project
RUN pnpm install \
&& pnpm build \
&& pnpm build-docker \
&& pnpm prune --prod

# Create a new stage for the final image
Expand Down
2 changes: 1 addition & 1 deletion agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@ai16z/plugin-0g": "workspace:*",
"@ai16z/plugin-aptos": "workspace:*",
"@ai16z/plugin-bootstrap": "workspace:*",
"@ai16z/plugin-buttplug": "workspace:*",
"@ai16z/plugin-intiface": "workspace:*",
"@ai16z/plugin-coinbase": "workspace:*",
"@ai16z/plugin-conflux": "workspace:*",
"@ai16z/plugin-evm": "workspace:*",
Expand Down
38 changes: 30 additions & 8 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import {
validateCharacterConfig,
} from "@ai16z/eliza";
import { zgPlugin } from "@ai16z/plugin-0g";
import { goatPlugin } from "@ai16z/plugin-goat";
import createGoatPlugin from "@ai16z/plugin-goat";
import { bootstrapPlugin } from "@ai16z/plugin-bootstrap";
// import { buttplugPlugin } from "@ai16z/plugin-buttplug";
// import { intifacePlugin } from "@ai16z/plugin-intiface";
import {
coinbaseCommercePlugin,
coinbaseMassPaymentsPlugin,
Expand All @@ -41,9 +41,9 @@ import { imageGenerationPlugin } from "@ai16z/plugin-image-generation";
import { evmPlugin } from "@ai16z/plugin-evm";
import { createNodePlugin } from "@ai16z/plugin-node";
import { solanaPlugin } from "@ai16z/plugin-solana";
import { teePlugin, TEEMode } from "@ai16z/plugin-tee";
import { aptosPlugin, TransferAptosToken } from "@ai16z/plugin-aptos";
import { flowPlugin } from "@ai16z/plugin-flow";
import { teePlugin } from "@ai16z/plugin-tee";
import Database from "better-sqlite3";
import fs from "fs";
import path from "path";
Expand Down Expand Up @@ -359,7 +359,7 @@ function getSecret(character: Character, secret: string) {

let nodePlugin: any | undefined;

export function createAgent(
export async function createAgent(
character: Character,
db: IDatabaseAdapter,
cache: ICacheManager,
Expand All @@ -373,6 +373,21 @@ export function createAgent(

nodePlugin ??= createNodePlugin();

const teeMode = getSecret(character, "TEE_MODE") || "OFF";
const walletSecretSalt = getSecret(character, "WALLET_SECRET_SALT");

// Validate TEE configuration
if (teeMode !== TEEMode.OFF && !walletSecretSalt) {
elizaLogger.error(
"WALLET_SECRET_SALT required when TEE_MODE is enabled"
);
throw new Error("Invalid TEE configuration");
}

const goatPlugin = await createGoatPlugin((secret) =>
getSecret(character, secret)
);

return new AgentRuntime({
databaseAdapter: db,
token,
Expand All @@ -392,7 +407,7 @@ export function createAgent(
: null,
getSecret(character, "EVM_PRIVATE_KEY") ||
(getSecret(character, "WALLET_PUBLIC_KEY") &&
!getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
getSecret(character, "WALLET_PUBLIC_KEY")?.startsWith("0x"))
? evmPlugin
: null,
getSecret(character, "ZEROG_PRIVATE_KEY") ? zgPlugin : null,
Expand All @@ -406,14 +421,21 @@ export function createAgent(
: null,
...(getSecret(character, "COINBASE_API_KEY") &&
getSecret(character, "COINBASE_PRIVATE_KEY")
? [coinbaseMassPaymentsPlugin, tradePlugin, tokenContractPlugin, advancedTradePlugin]
? [
coinbaseMassPaymentsPlugin,
tradePlugin,
tokenContractPlugin,
advancedTradePlugin,
]
: []),
...(teeMode !== TEEMode.OFF && walletSecretSalt
? [teePlugin, solanaPlugin]
: []),
getSecret(character, "COINBASE_API_KEY") &&
getSecret(character, "COINBASE_PRIVATE_KEY") &&
getSecret(character, "COINBASE_NOTIFICATION_URI")
? webhookPlugin
: null,
getSecret(character, "WALLET_SECRET_SALT") ? teePlugin : null,
getSecret(character, "ALCHEMY_API_KEY") ? goatPlugin : null,
getSecret(character, "FLOW_ADDRESS") &&
getSecret(character, "FLOW_PRIVATE_KEY")
Expand Down Expand Up @@ -460,7 +482,7 @@ async function startAgent(character: Character, directClient) {
await db.init();

const cache = intializeDbCache(character, db);
const runtime = createAgent(character, db, cache, token);
const runtime = await createAgent(character, db, cache, token);

await runtime.initialize();

Expand Down
44 changes: 22 additions & 22 deletions docs/api/enumerations/ModelProviderName.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Available model providers

[packages/core/src/types.ts:215](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L215)

***
---

### ETERNALAI

Expand All @@ -24,7 +24,7 @@ Available model providers

[packages/core/src/types.ts:216](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L216)

***
---

### ANTHROPIC

Expand All @@ -34,7 +34,7 @@ Available model providers

[packages/core/src/types.ts:217](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L217)

***
---

### GROK

Expand All @@ -44,7 +44,7 @@ Available model providers

[packages/core/src/types.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L218)

***
---

### GROQ

Expand All @@ -54,7 +54,7 @@ Available model providers

[packages/core/src/types.ts:219](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L219)

***
---

### LLAMACLOUD

Expand All @@ -64,7 +64,7 @@ Available model providers

[packages/core/src/types.ts:220](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L220)

***
---

### TOGETHER

Expand All @@ -74,7 +74,7 @@ Available model providers

[packages/core/src/types.ts:221](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L221)

***
---

### LLAMALOCAL

Expand All @@ -84,7 +84,7 @@ Available model providers

[packages/core/src/types.ts:222](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L222)

***
---

### GOOGLE

Expand All @@ -94,17 +94,17 @@ Available model providers

[packages/core/src/types.ts:223](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L223)

***
---

### CLAUDE\_VERTEX
### CLAUDE_VERTEX

> **CLAUDE\_VERTEX**: `"claude_vertex"`
> **CLAUDE_VERTEX**: `"claude_vertex"`
#### Defined in

[packages/core/src/types.ts:224](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L224)

***
---

### REDPILL

Expand All @@ -114,7 +114,7 @@ Available model providers

[packages/core/src/types.ts:225](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L225)

***
---

### OPENROUTER

Expand All @@ -124,7 +124,7 @@ Available model providers

[packages/core/src/types.ts:226](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L226)

***
---

### OLLAMA

Expand All @@ -134,7 +134,7 @@ Available model providers

[packages/core/src/types.ts:227](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L227)

***
---

### HEURIST

Expand All @@ -144,7 +144,7 @@ Available model providers

[packages/core/src/types.ts:228](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L228)

***
---

### GALADRIEL

Expand All @@ -154,7 +154,7 @@ Available model providers

[packages/core/src/types.ts:229](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L229)

***
---

### FAL

Expand All @@ -164,7 +164,7 @@ Available model providers

[packages/core/src/types.ts:230](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L230)

***
---

### GAIANET

Expand All @@ -174,17 +174,17 @@ Available model providers

[packages/core/src/types.ts:231](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L231)

***
---

### ALI\_BAILIAN
### ALI_BAILIAN

> **ALI\_BAILIAN**: `"ali_bailian"`
> **ALI_BAILIAN**: `"ali_bailian"`
#### Defined in

[packages/core/src/types.ts:232](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L232)

***
---

### VOLENGINE

Expand Down
4 changes: 4 additions & 0 deletions docs/api/type-aliases/Models.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Model configurations by provider

> **together**: [`Model`](Model.md)
### together

> **together**: [`Model`](Model.md)
### llama\_local

> **llama\_local**: [`Model`](Model.md)
Expand Down
Loading

0 comments on commit 1c65758

Please sign in to comment.