diff --git a/README.md b/README.md index f0dd06eceff..be810a2954f 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,13 @@ Eliza Banner ### [For Chinese Version: 中文说明](./README_CN.md) + ### [For Japanese Version: 日本語の説明](./README_JA.md) + ### [For Korean Version: 한국어 설명](./README_KOR.md) + ### [For French Version: Instructions en français](./README_FR.md) + ### [For Portuguese Version: Instruções em português](./README_PTBR.md) ## Features @@ -193,4 +197,4 @@ pnpm docker This will drop you into a shell inside the docker container where you can continue to configure the instance -and then you can start it with `pnpm start` \ No newline at end of file +and then you can start it with `pnpm start` diff --git a/README_FR.md b/README_FR.md index a0e96bda4e8..b866bd5cdc6 100644 --- a/README_FR.md +++ b/README_FR.md @@ -4,20 +4,20 @@ ## la fonctionnalité -- 🛠 soutenir la connexion discord/ twitter /telegram -- 👥 soutien aux agents multimodaux -- 📚 simple à importer des documents et interagir avec les documents -- mémoire et stockage des documents accessibles -- 🚀 haute scalabilité, vous pouvez personnaliser les clients et les comportements pour une extension fonctionnelle -- ☁ ️ plusieurs modèles, y compris Llama, OpenAI Grok Anthropic, etc. -- 📦 simple et facile à utiliser +- 🛠 soutenir la connexion discord/ twitter /telegram +- 👥 soutien aux agents multimodaux +- 📚 simple à importer des documents et interagir avec les documents +- mémoire et stockage des documents accessibles +- 🚀 haute scalabilité, vous pouvez personnaliser les clients et les comportements pour une extension fonctionnelle +- ☁ ️ plusieurs modèles, y compris Llama, OpenAI Grok Anthropic, etc. +- 📦 simple et facile à utiliser Que pouvez-vous faire avec Eliza? -- 🤖 le chatbot -- 🕵 ️ Agents autonomes -- 📈 processus métier pour automatiser le traitement -- 🎮 jeux PNJ +- 🤖 le chatbot +- 🕵 ️ Agents autonomes +- 📈 processus métier pour automatiser le traitement +- 🎮 jeux PNJ # commencez à utiliser @@ -30,17 +30,16 @@ Que pouvez-vous faire avec Eliza? ### éditer le fichier.env -- copiez.env.example en.env et remplissez la valeur appropriée -- modifier l’environnement twitter et entrer votre compte twitter et mot de passe +- copiez.env.example en.env et remplissez la valeur appropriée +- modifier l’environnement twitter et entrer votre compte twitter et mot de passe ### modifier les fichiers de rôles -- voir le document ` src/core/defaultCharacter ts ` - vous pouvez le modifier -- vous pouvez également utiliser `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json" ` et simultanément plusieurs robots. +- voir le document `src/core/defaultCharacter ts` - vous pouvez le modifier +- vous pouvez également utiliser `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json" ` et simultanément plusieurs robots. Après avoir terminé la configuration des fichiers de compte et de rôle, lancez votre bot en tapant la ligne de commande suivante: - ``` pnpm i pnpm start @@ -164,9 +163,9 @@ pnpm test:sqljs # Run tests with SQL.js Les tests sont écrits en Jest et se trouvent dans le fichier SRC /\*_/_.test.ts. L’environnement de test est configuré comme suit: -- chargement des variables d’environnement de.env.test -- utilisez un temps d’attente de 2 minutes pour exécuter des tests de longue durée -- support du module ESM -- exécuter les tests dans l’ordre (--runInBand) +- chargement des variables d’environnement de.env.test +- utilisez un temps d’attente de 2 minutes pour exécuter des tests de longue durée +- support du module ESM +- exécuter les tests dans l’ordre (--runInBand) -Pour créer un nouveau test, ajoutez un fichier.test.ts à côté du code à tester. \ No newline at end of file +Pour créer un nouveau test, ajoutez un fichier.test.ts à côté du code à tester. diff --git a/README_JA.md b/README_JA.md index 2281db8a1bc..ca5e6fff9b2 100644 --- a/README_JA.md +++ b/README_JA.md @@ -4,37 +4,37 @@ ## 機能 -- 🛠 Discord、Twitter、Telegramのフル機能コネクタ -- 👥 マルチエージェントおよびルームサポート -- 📚 ドキュメントの簡単な取り込みと対話 -- 💾 検索可能なメモリおよびドキュメントストア -- 🚀 高い拡張性 - 機能を拡張するための独自のアクションとクライアントを作成可能 -- ☁️ Llama、OpenAI、Anthropic、Groqなど、多くのモデルをサポート -- 📦 すぐに使える! +- 🛠 Discord、Twitter、Telegramのフル機能コネクタ +- 👥 マルチエージェントおよびルームサポート +- 📚 ドキュメントの簡単な取り込みと対話 +- 💾 検索可能なメモリおよびドキュメントストア +- 🚀 高い拡張性 - 機能を拡張するための独自のアクションとクライアントを作成可能 +- ☁️ Llama、OpenAI、Anthropic、Groqなど、多くのモデルをサポート +- 📦 すぐに使える! ## 何に使えるのか? -- 🤖 チャットボット -- 🕵️ 自律エージェント -- 📈 ビジネスプロセスの処理 -- 🎮 ビデオゲームのNPC +- 🤖 チャットボット +- 🕵️ 自律エージェント +- 📈 ビジネスプロセスの処理 +- 🎮 ビデオゲームのNPC # 始め方 **必須条件:** -- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) -- [pnpm](https://pnpm.io/installation) +- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- [pnpm](https://pnpm.io/installation) ### .envファイルの編集 -- .env.exampleを.envにコピーし、適切な値を入力 -- TWITTER環境変数を編集して、ボットのユーザー名とパスワードを追加 +- .env.exampleを.envにコピーし、適切な値を入力 +- TWITTER環境変数を編集して、ボットのユーザー名とパスワードを追加 ### キャラクターファイルの編集 -- `src/core/defaultCharacter.ts`ファイルを確認 - これを変更可能 -- `pnpm start --characters="path/to/your/character.json"`を使用してキャラクターをロードし、複数のボットを同時に実行可能 +- `src/core/defaultCharacter.ts`ファイルを確認 - これを変更可能 +- `pnpm start --characters="path/to/your/character.json"`を使用してキャラクターをロードし、複数のボットを同時に実行可能 .envファイルとキャラクターファイルを設定した後、以下のコマンドでボットを起動可能: @@ -166,9 +166,9 @@ pnpm test:sqljs # SQL.jsでテストを実行 テストはJestを使用して記述されており、`src/**/*.test.ts`ファイルにあります。テスト環境は次のように構成されています: -- `.env.test`から環境変数をロード -- 長時間実行されるテストのために2分のタイムアウトを使用 -- ESMモジュールをサポート -- テストを順番に実行 (--runInBand) +- `.env.test`から環境変数をロード +- 長時間実行されるテストのために2分のタイムアウトを使用 +- ESMモジュールをサポート +- テストを順番に実行 (--runInBand) 新しいテストを作成するには、テストするコードの隣に`.test.ts`ファイルを追加します。 diff --git a/README_KOR.md b/README_KOR.md index fcec0cd6ed3..c3b07e56152 100644 --- a/README_KOR.md +++ b/README_KOR.md @@ -9,13 +9,13 @@ - 📚 높은 유연성: 개발자가 쉽게 데이터를 추가하고, 이를 활용해 다양한 기능을 만들 수 있습니다. - 💾 검색 지원: 당신의 데이터와 작업을 쉽게 찾아볼 수 있도록, 검색 기능을 지원합니다. - 🚀 높은 확장성: 자신의 동작과 클라이언트를 만들어 기능을 확장할 수 있습니다. -- ☁️ 다양한 AI 모델 지원: local Llama, OpenAI, Anthropic, Groq 등 다양한 AI 모델을 지원합니다 -- 📦 즐겁게 개발해 봐요! +- ☁️ 다양한 AI 모델 지원: local Llama, OpenAI, Anthropic, Groq 등 다양한 AI 모델을 지원합니다 +- 📦 즐겁게 개발해 봐요! ## eliza로 어떤걸 만들 수 있을까요? - 🤖 챗봇 개발 -- 🕵 ️AI가 자율적으로 결과를 만들어줘요! +- 🕵 ️AI가 자율적으로 결과를 만들어줘요! - 📈 업무처리 자동화 - 🎮 비디오 게임 NPC @@ -66,7 +66,7 @@ pnpm start ## 기타 요구 사항 -시작시 오류가 발견되면, 아래의 명령어로 Sharp를 설치해보세요: +시작시 오류가 발견되면, 아래의 명령어로 Sharp를 설치해보세요: ``` pnpm install --include=optional sharp @@ -141,7 +141,7 @@ npx --no node-llama-cpp source download --gpu cuda ### 로컬 실행 다음 중 한가지 옵션을 선택하여 XAI_MODEL 을 추가하세요. [Run with -Llama](#run-with-llama) - X_SERVER_URL 와 XAI_API_KEY 는 비워둬도 됩니다. +Llama](#run-with-llama) - X_SERVER_URL 와 XAI_API_KEY 는 비워둬도 됩니다. 이 파일을 통해 huggingface 에서 모델이 다운로드 되며, 로컬로 쿼리 됩니다. # 클라이언트 @@ -169,7 +169,7 @@ pnpm test:sqlite # Run tests with SQLite pnpm test:sqljs # Run tests with SQL.js ``` -테스트 결과는 Jest를 통해 작성되며, `src/**/*.test.ts` 파일에서 확인할 수 있습니다. +테스트 결과는 Jest를 통해 작성되며, `src/**/*.test.ts` 파일에서 확인할 수 있습니다. 테스트 환경 구성단계: - `.env.test` 에서 환경변수가 불러와집니다. diff --git a/README_PTBR.md b/README_PTBR.md index a5fa17a426c..5557368cb9a 100644 --- a/README_PTBR.md +++ b/README_PTBR.md @@ -22,7 +22,7 @@ # Começando **Pré-requisitos (OBRIGATÓRIO):** - + - [Python 2.7+](https://www.python.org/downloads/) - [Node.js 23.1+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) - [pnpm](https://pnpm.io/installation) diff --git a/docs/api/classes/AgentRuntime.md b/docs/api/classes/AgentRuntime.md index 8d3e653ecb6..4221daffd88 100644 --- a/docs/api/classes/AgentRuntime.md +++ b/docs/api/classes/AgentRuntime.md @@ -97,7 +97,7 @@ The ID of the agent [packages/core/src/runtime.ts:59](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L59) -*** +--- ### serverUrl @@ -113,7 +113,7 @@ The base URL of the server where the agent's requests are processed. [packages/core/src/runtime.ts:63](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L63) -*** +--- ### databaseAdapter @@ -129,7 +129,7 @@ The database adapter used for interacting with the database. [packages/core/src/runtime.ts:68](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L68) -*** +--- ### token @@ -145,7 +145,7 @@ Authentication token used for securing requests. [packages/core/src/runtime.ts:73](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L73) -*** +--- ### actions @@ -161,7 +161,7 @@ Custom actions that the agent can perform. [packages/core/src/runtime.ts:78](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L78) -*** +--- ### evaluators @@ -177,7 +177,7 @@ Evaluators used to assess and guide the agent's responses. [packages/core/src/runtime.ts:83](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L83) -*** +--- ### providers @@ -193,7 +193,7 @@ Context providers used to provide context for message generation. [packages/core/src/runtime.ts:88](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L88) -*** +--- ### modelProvider @@ -209,7 +209,7 @@ The model to use for generateText. [packages/core/src/runtime.ts:93](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L93) -*** +--- ### fetch() @@ -244,7 +244,7 @@ Some environments may not have access to the global fetch function and need a cu [packages/core/src/runtime.ts:99](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L99) -*** +--- ### character @@ -260,7 +260,7 @@ The character to use for the agent [packages/core/src/runtime.ts:104](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L104) -*** +--- ### messageManager @@ -276,7 +276,7 @@ Store messages that are sent and received by the agent. [packages/core/src/runtime.ts:109](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L109) -*** +--- ### descriptionManager @@ -292,7 +292,7 @@ Store and recall descriptions of users based on conversations. [packages/core/src/runtime.ts:114](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L114) -*** +--- ### loreManager @@ -308,7 +308,7 @@ Manage the creation and recall of static information (documents, historical game [packages/core/src/runtime.ts:119](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L119) -*** +--- ### documentsManager @@ -320,7 +320,7 @@ Hold large documents that can be referenced [packages/core/src/runtime.ts:124](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L124) -*** +--- ### knowledgeManager @@ -332,7 +332,7 @@ Searchable document fragments [packages/core/src/runtime.ts:129](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L129) -*** +--- ### services @@ -346,7 +346,7 @@ Searchable document fragments [packages/core/src/runtime.ts:131](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L131) -*** +--- ### memoryManagers @@ -378,7 +378,7 @@ Searchable document fragments [packages/core/src/runtime.ts:134](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L134) -*** +--- ### getMemoryManager() @@ -400,11 +400,11 @@ Searchable document fragments [packages/core/src/runtime.ts:149](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L149) -*** +--- ### getService() -> **getService**(`service`): *typeof* [`Service`](Service.md) +> **getService**(`service`): _typeof_ [`Service`](Service.md) #### Parameters @@ -412,7 +412,7 @@ Searchable document fragments #### Returns -*typeof* [`Service`](Service.md) +_typeof_ [`Service`](Service.md) #### Implementation of @@ -422,7 +422,7 @@ Searchable document fragments [packages/core/src/runtime.ts:153](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L153) -*** +--- ### registerService() @@ -444,7 +444,7 @@ Searchable document fragments [packages/core/src/runtime.ts:161](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L161) -*** +--- ### getSetting() @@ -464,9 +464,9 @@ Searchable document fragments #### Defined in -[packages/core/src/runtime.ts:372](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L372) +[packages/core/src/runtime.ts:368](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L368) -*** +--- ### getConversationLength() @@ -486,9 +486,9 @@ The number of recent messages to be kept in memory. #### Defined in -[packages/core/src/runtime.ts:394](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L394) +[packages/core/src/runtime.ts:390](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L390) -*** +--- ### registerAction() @@ -512,9 +512,9 @@ The action to register. #### Defined in -[packages/core/src/runtime.ts:402](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L402) +[packages/core/src/runtime.ts:398](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L398) -*** +--- ### registerEvaluator() @@ -534,9 +534,9 @@ The evaluator to register. #### Defined in -[packages/core/src/runtime.ts:411](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L411) +[packages/core/src/runtime.ts:407](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L407) -*** +--- ### registerContextProvider() @@ -556,9 +556,9 @@ The context provider to register. #### Defined in -[packages/core/src/runtime.ts:419](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L419) +[packages/core/src/runtime.ts:415](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L415) -*** +--- ### processActions() @@ -588,9 +588,9 @@ The message to process. #### Defined in -[packages/core/src/runtime.ts:428](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L428) +[packages/core/src/runtime.ts:424](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L424) -*** +--- ### evaluate() @@ -624,9 +624,9 @@ The results of the evaluation. #### Defined in -[packages/core/src/runtime.ts:501](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L501) +[packages/core/src/runtime.ts:497](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L497) -*** +--- ### ensureParticipantExists() @@ -656,9 +656,9 @@ An error if the participant cannot be added. #### Defined in -[packages/core/src/runtime.ts:571](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L571) +[packages/core/src/runtime.ts:567](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L567) -*** +--- ### ensureUserExists() @@ -692,9 +692,9 @@ The user name to ensure the existence of. #### Defined in -[packages/core/src/runtime.ts:587](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L587) +[packages/core/src/runtime.ts:583](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L583) -*** +--- ### ensureParticipantInRoom() @@ -716,9 +716,9 @@ The user name to ensure the existence of. #### Defined in -[packages/core/src/runtime.ts:607](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L607) +[packages/core/src/runtime.ts:603](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L603) -*** +--- ### ensureConnection() @@ -746,9 +746,9 @@ The user name to ensure the existence of. #### Defined in -[packages/core/src/runtime.ts:618](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L618) +[packages/core/src/runtime.ts:614](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L614) -*** +--- ### ensureRoomExists() @@ -777,9 +777,9 @@ An error if the room cannot be created. #### Defined in -[packages/core/src/runtime.ts:654](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L654) +[packages/core/src/runtime.ts:650](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L650) -*** +--- ### composeState() @@ -807,9 +807,9 @@ The state of the agent. #### Defined in -[packages/core/src/runtime.ts:667](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L667) +[packages/core/src/runtime.ts:663](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L663) -*** +--- ### updateRecentMessageState() diff --git a/docs/api/classes/DatabaseAdapter.md b/docs/api/classes/DatabaseAdapter.md index 74de091a3ec..26e39894ed1 100644 --- a/docs/api/classes/DatabaseAdapter.md +++ b/docs/api/classes/DatabaseAdapter.md @@ -63,7 +63,7 @@ A Promise that resolves to the Account object or null if not found. [packages/core/src/database.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L27) -*** +--- ### createAccount() @@ -91,7 +91,7 @@ A Promise that resolves when the account creation is complete. [packages/core/src/database.ts:34](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L34) -*** +--- ### getMemories() @@ -127,7 +127,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:41](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L41) -*** +--- ### getMemoriesByRoomIds() @@ -155,7 +155,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:48](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L48) -*** +--- ### getMemoryById() @@ -177,7 +177,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L54) -*** +--- ### getCachedEmbeddings() @@ -191,17 +191,17 @@ Retrieves cached embeddings based on the specified query parameters. An object containing parameters for the embedding retrieval. -• **params.query\_table\_name**: `string` +• **params.query_table_name**: `string` -• **params.query\_threshold**: `number` +• **params.query_threshold**: `number` -• **params.query\_input**: `string` +• **params.query_input**: `string` -• **params.query\_field\_name**: `string` +• **params.query_field_name**: `string` -• **params.query\_field\_sub\_name**: `string` +• **params.query_field_sub_name**: `string` -• **params.query\_match\_count**: `number` +• **params.query_match_count**: `number` #### Returns @@ -217,7 +217,7 @@ A Promise that resolves to an array of objects containing embeddings and levensh [packages/core/src/database.ts:61](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L61) -*** +--- ### log() @@ -253,7 +253,7 @@ A Promise that resolves when the log entry has been saved. [packages/core/src/database.ts:87](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L87) -*** +--- ### getActorDetails() @@ -283,7 +283,7 @@ A Promise that resolves to an array of Actor objects. [packages/core/src/database.ts:99](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L99) -*** +--- ### searchMemories() @@ -303,9 +303,9 @@ An object containing parameters for the memory search. • **params.embedding**: `number`[] -• **params.match\_threshold**: `number` +• **params.match_threshold**: `number` -• **params.match\_count**: `number` +• **params.match_count**: `number` • **params.unique**: `boolean` @@ -323,7 +323,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:106](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L106) -*** +--- ### updateGoalStatus() @@ -355,7 +355,7 @@ A Promise that resolves when the goal status has been updated. [packages/core/src/database.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L120) -*** +--- ### searchMemoriesByEmbedding() @@ -373,7 +373,7 @@ The embedding vector to search with. Additional parameters for the search. -• **params.match\_threshold?**: `number` +• **params.match_threshold?**: `number` • **params.count?**: `number` @@ -399,7 +399,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:131](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L131) -*** +--- ### createMemory() @@ -435,7 +435,7 @@ A Promise that resolves when the memory has been created. [packages/core/src/database.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L150) -*** +--- ### removeMemory() @@ -467,7 +467,7 @@ A Promise that resolves when the memory has been removed. [packages/core/src/database.ts:162](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L162) -*** +--- ### removeAllMemories() @@ -499,7 +499,7 @@ A Promise that resolves when all memories have been removed. [packages/core/src/database.ts:170](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L170) -*** +--- ### countMemories() @@ -535,7 +535,7 @@ A Promise that resolves to the number of memories. [packages/core/src/database.ts:179](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L179) -*** +--- ### getGoals() @@ -571,7 +571,7 @@ A Promise that resolves to an array of Goal objects. [packages/core/src/database.ts:190](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L190) -*** +--- ### updateGoal() @@ -599,7 +599,7 @@ A Promise that resolves when the goal has been updated. [packages/core/src/database.ts:202](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L202) -*** +--- ### createGoal() @@ -627,7 +627,7 @@ A Promise that resolves when the goal has been created. [packages/core/src/database.ts:209](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L209) -*** +--- ### removeGoal() @@ -655,7 +655,7 @@ A Promise that resolves when the goal has been removed. [packages/core/src/database.ts:216](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L216) -*** +--- ### removeAllGoals() @@ -683,7 +683,7 @@ A Promise that resolves when all goals have been removed. [packages/core/src/database.ts:223](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L223) -*** +--- ### getRoom() @@ -711,7 +711,7 @@ A Promise that resolves to the room ID or null if not found. [packages/core/src/database.ts:230](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L230) -*** +--- ### createRoom() @@ -739,7 +739,7 @@ A Promise that resolves to the UUID of the created room. [packages/core/src/database.ts:237](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L237) -*** +--- ### removeRoom() @@ -767,7 +767,7 @@ A Promise that resolves when the room has been removed. [packages/core/src/database.ts:244](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L244) -*** +--- ### getRoomsForParticipant() @@ -795,7 +795,7 @@ A Promise that resolves to an array of room IDs. [packages/core/src/database.ts:251](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L251) -*** +--- ### getRoomsForParticipants() @@ -823,7 +823,7 @@ A Promise that resolves to an array of room IDs. [packages/core/src/database.ts:258](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L258) -*** +--- ### addParticipant() @@ -855,7 +855,7 @@ A Promise that resolves to a boolean indicating success or failure. [packages/core/src/database.ts:266](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L266) -*** +--- ### removeParticipant() @@ -887,7 +887,7 @@ A Promise that resolves to a boolean indicating success or failure. [packages/core/src/database.ts:274](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L274) -*** +--- ### getParticipantsForAccount() @@ -943,7 +943,7 @@ A Promise that resolves to an array of Participant objects. [packages/core/src/database.ts:288](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L288) -*** +--- ### getParticipantsForRoom() @@ -971,7 +971,7 @@ A Promise that resolves to an array of UUIDs representing the participants. [packages/core/src/database.ts:295](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L295) -*** +--- ### getParticipantUserState() @@ -995,7 +995,7 @@ A Promise that resolves to an array of UUIDs representing the participants. [packages/core/src/database.ts:297](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L297) -*** +--- ### setParticipantUserState() @@ -1021,7 +1021,7 @@ A Promise that resolves to an array of UUIDs representing the participants. [packages/core/src/database.ts:301](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L301) -*** +--- ### createRelationship() @@ -1053,7 +1053,7 @@ A Promise that resolves to a boolean indicating success or failure of the creati [packages/core/src/database.ts:312](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L312) -*** +--- ### getRelationship() @@ -1085,7 +1085,7 @@ A Promise that resolves to the Relationship object or null if not found. [packages/core/src/database.ts:322](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L322) -*** +--- ### getRelationships() diff --git a/docs/api/classes/MemoryManager.md b/docs/api/classes/MemoryManager.md index 8beb89e784c..c7991909787 100644 --- a/docs/api/classes/MemoryManager.md +++ b/docs/api/classes/MemoryManager.md @@ -54,7 +54,7 @@ The AgentRuntime instance associated with this manager. [packages/core/src/memory.ts:22](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L22) -*** +--- ### tableName @@ -98,7 +98,7 @@ A Promise resolving to the memory object, potentially updated with an embedding [packages/core/src/memory.ts:45](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L45) -*** +--- ### getMemories() @@ -144,7 +144,7 @@ A Promise resolving to an array of Memory objects. [packages/core/src/memory.ts:66](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L66) -*** +--- ### getCachedEmbeddings() @@ -166,7 +166,7 @@ A Promise resolving to an array of Memory objects. [packages/core/src/memory.ts:93](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L93) -*** +--- ### searchMemoriesByEmbedding() @@ -184,7 +184,7 @@ The embedding vector to search with. Options including match threshold, count, user IDs, and uniqueness. -• **opts.match\_threshold?**: `number` +• **opts.match_threshold?**: `number` The similarity threshold for matching memories. @@ -216,7 +216,7 @@ A Promise resolving to an array of Memory objects that match the embedding. [packages/core/src/memory.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L120) -*** +--- ### createMemory() @@ -248,7 +248,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:158](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L158) -*** +--- ### getMemoriesByRoomIds() @@ -274,7 +274,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:173](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L173) -*** +--- ### getMemoryById() @@ -296,7 +296,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:184](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L184) -*** +--- ### removeMemory() @@ -324,7 +324,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:194](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L194) -*** +--- ### removeAllMemories() @@ -352,7 +352,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:206](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L206) -*** +--- ### countMemories() diff --git a/docs/api/classes/Service.md b/docs/api/classes/Service.md index 6a3195df4cb..472c53012bd 100644 --- a/docs/api/classes/Service.md +++ b/docs/api/classes/Service.md @@ -30,7 +30,7 @@ #### Defined in -[packages/core/src/types.ts:507](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L507) +[packages/core/src/types.ts:519](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L519) ## Methods @@ -40,7 +40,7 @@ #### Type Parameters -• **T** *extends* [`Service`](Service.md) +• **T** _extends_ [`Service`](Service.md) #### Returns @@ -48,4 +48,4 @@ #### Defined in -[packages/core/src/types.ts:509](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L509) +[packages/core/src/types.ts:521](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L521) diff --git a/docs/api/enumerations/Clients.md b/docs/api/enumerations/Clients.md index 48b250fd846..4822e4915e4 100644 --- a/docs/api/enumerations/Clients.md +++ b/docs/api/enumerations/Clients.md @@ -10,9 +10,9 @@ #### Defined in -[packages/core/src/types.ts:321](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L321) +[packages/core/src/types.ts:323](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L323) -*** +--- ### DIRECT @@ -20,9 +20,9 @@ #### Defined in -[packages/core/src/types.ts:322](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L322) +[packages/core/src/types.ts:324](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L324) -*** +--- ### TWITTER @@ -30,9 +30,9 @@ #### Defined in -[packages/core/src/types.ts:323](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L323) +[packages/core/src/types.ts:325](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L325) -*** +--- ### TELEGRAM @@ -40,4 +40,4 @@ #### Defined in -[packages/core/src/types.ts:324](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L324) +[packages/core/src/types.ts:326](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L326) diff --git a/docs/api/enumerations/GoalStatus.md b/docs/api/enumerations/GoalStatus.md index f8c11f9fc2a..1608c034ed1 100644 --- a/docs/api/enumerations/GoalStatus.md +++ b/docs/api/enumerations/GoalStatus.md @@ -12,7 +12,7 @@ [packages/core/src/types.ts:57](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L57) -*** +--- ### FAILED @@ -22,11 +22,11 @@ [packages/core/src/types.ts:58](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L58) -*** +--- -### IN\_PROGRESS +### IN_PROGRESS -> **IN\_PROGRESS**: `"IN_PROGRESS"` +> **IN_PROGRESS**: `"IN_PROGRESS"` #### Defined in diff --git a/docs/api/enumerations/ModelClass.md b/docs/api/enumerations/ModelClass.md index 2ee04c649b4..d4f3cafaf3f 100644 --- a/docs/api/enumerations/ModelClass.md +++ b/docs/api/enumerations/ModelClass.md @@ -12,7 +12,7 @@ [packages/core/src/types.ts:75](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L75) -*** +--- ### MEDIUM @@ -22,7 +22,7 @@ [packages/core/src/types.ts:76](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L76) -*** +--- ### LARGE @@ -32,7 +32,7 @@ [packages/core/src/types.ts:77](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L77) -*** +--- ### EMBEDDING @@ -42,7 +42,7 @@ [packages/core/src/types.ts:78](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L78) -*** +--- ### IMAGE diff --git a/docs/api/enumerations/ModelProviderName.md b/docs/api/enumerations/ModelProviderName.md index 197a65b15c7..92560871762 100644 --- a/docs/api/enumerations/ModelProviderName.md +++ b/docs/api/enumerations/ModelProviderName.md @@ -10,9 +10,9 @@ #### Defined in -[packages/core/src/types.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L120) +[packages/core/src/types.ts:121](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L121) -*** +--- ### ANTHROPIC @@ -20,9 +20,9 @@ #### Defined in -[packages/core/src/types.ts:121](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L121) +[packages/core/src/types.ts:122](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L122) -*** +--- ### GROK @@ -30,9 +30,9 @@ #### Defined in -[packages/core/src/types.ts:122](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L122) +[packages/core/src/types.ts:123](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L123) -*** +--- ### GROQ @@ -40,9 +40,9 @@ #### Defined in -[packages/core/src/types.ts:123](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L123) +[packages/core/src/types.ts:124](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L124) -*** +--- ### LLAMACLOUD @@ -50,9 +50,9 @@ #### Defined in -[packages/core/src/types.ts:124](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L124) +[packages/core/src/types.ts:125](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L125) -*** +--- ### LLAMALOCAL @@ -60,9 +60,9 @@ #### Defined in -[packages/core/src/types.ts:125](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L125) +[packages/core/src/types.ts:126](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L126) -*** +--- ### GOOGLE @@ -70,19 +70,19 @@ #### Defined in -[packages/core/src/types.ts:126](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L126) +[packages/core/src/types.ts:127](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L127) -*** +--- -### CLAUDE\_VERTEX +### CLAUDE_VERTEX -> **CLAUDE\_VERTEX**: `"claude_vertex"` +> **CLAUDE_VERTEX**: `"claude_vertex"` #### Defined in -[packages/core/src/types.ts:127](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L127) +[packages/core/src/types.ts:128](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L128) -*** +--- ### REDPILL @@ -90,9 +90,9 @@ #### Defined in -[packages/core/src/types.ts:128](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L128) +[packages/core/src/types.ts:129](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L129) -*** +--- ### OPENROUTER @@ -100,9 +100,9 @@ #### Defined in -[packages/core/src/types.ts:129](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L129) +[packages/core/src/types.ts:130](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L130) -*** +--- ### OLLAMA @@ -110,12 +110,14 @@ #### Defined in -[packages/core/src/types.ts:130](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L130) +[packages/core/src/types.ts:131](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L131) + +--- ### HEURIST > **HEURIST**: `"heurist"` - + #### Defined in [packages/core/src/types.ts:132](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L132) diff --git a/docs/api/enumerations/ServiceType.md b/docs/api/enumerations/ServiceType.md index 0cc2345ec31..ab704c6558d 100644 --- a/docs/api/enumerations/ServiceType.md +++ b/docs/api/enumerations/ServiceType.md @@ -4,15 +4,15 @@ ## Enumeration Members -### IMAGE\_DESCRIPTION +### IMAGE_DESCRIPTION -> **IMAGE\_DESCRIPTION**: `"image_description"` +> **IMAGE_DESCRIPTION**: `"image_description"` #### Defined in -[packages/core/src/types.ts:646](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L646) +[packages/core/src/types.ts:658](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L658) -*** +--- ### TRANSCRIPTION @@ -20,9 +20,9 @@ #### Defined in -[packages/core/src/types.ts:647](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L647) +[packages/core/src/types.ts:659](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L659) -*** +--- ### VIDEO @@ -30,19 +30,19 @@ #### Defined in -[packages/core/src/types.ts:648](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L648) +[packages/core/src/types.ts:660](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L660) -*** +--- -### TEXT\_GENERATION +### TEXT_GENERATION -> **TEXT\_GENERATION**: `"text_generation"` +> **TEXT_GENERATION**: `"text_generation"` #### Defined in -[packages/core/src/types.ts:649](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L649) +[packages/core/src/types.ts:661](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L661) -*** +--- ### BROWSER @@ -50,19 +50,19 @@ #### Defined in -[packages/core/src/types.ts:650](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L650) +[packages/core/src/types.ts:662](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L662) -*** +--- -### SPEECH\_GENERATION +### SPEECH_GENERATION -> **SPEECH\_GENERATION**: `"speech_generation"` +> **SPEECH_GENERATION**: `"speech_generation"` #### Defined in -[packages/core/src/types.ts:651](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L651) +[packages/core/src/types.ts:663](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L663) -*** +--- ### PDF @@ -70,4 +70,4 @@ #### Defined in -[packages/core/src/types.ts:652](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L652) +[packages/core/src/types.ts:664](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L664) diff --git a/docs/api/functions/generateCaption.md b/docs/api/functions/generateCaption.md index 9589aadfb02..9a6dc733fd7 100644 --- a/docs/api/functions/generateCaption.md +++ b/docs/api/functions/generateCaption.md @@ -26,4 +26,4 @@ ## Defined in -[packages/core/src/generation.ts:734](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L734) +[packages/core/src/generation.ts:845](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L845) diff --git a/docs/api/functions/generateImage.md b/docs/api/functions/generateImage.md index 45663740568..bed897a2fd4 100644 --- a/docs/api/functions/generateImage.md +++ b/docs/api/functions/generateImage.md @@ -16,6 +16,18 @@ • **data.count?**: `number` +• **data.negativePrompt?**: `string` + +• **data.numIterations?**: `number` + +• **data.guidanceScale?**: `number` + +• **data.seed?**: `number` + +• **data.modelId?**: `string` + +• **data.jobId?**: `string` + • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) ## Returns @@ -36,4 +48,4 @@ ## Defined in -[packages/core/src/generation.ts:650](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L650) +[packages/core/src/generation.ts:719](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L719) diff --git a/docs/api/functions/generateMessageResponse.md b/docs/api/functions/generateMessageResponse.md index d2ebe4025a7..3a04117964b 100644 --- a/docs/api/functions/generateMessageResponse.md +++ b/docs/api/functions/generateMessageResponse.md @@ -28,4 +28,4 @@ The completed message. ## Defined in -[packages/core/src/generation.ts:612](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L612) +[packages/core/src/generation.ts:681](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L681) diff --git a/docs/api/functions/generateObject.md b/docs/api/functions/generateObject.md index 94902c94915..ac2e71d1aaf 100644 --- a/docs/api/functions/generateObject.md +++ b/docs/api/functions/generateObject.md @@ -20,4 +20,4 @@ ## Defined in -[packages/core/src/generation.ts:528](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L528) +[packages/core/src/generation.ts:597](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L597) diff --git a/docs/api/functions/generateObjectArray.md b/docs/api/functions/generateObjectArray.md index 9802b9b5cae..c0fd43fc325 100644 --- a/docs/api/functions/generateObjectArray.md +++ b/docs/api/functions/generateObjectArray.md @@ -20,4 +20,4 @@ ## Defined in -[packages/core/src/generation.ts:564](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L564) +[packages/core/src/generation.ts:633](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L633) diff --git a/docs/api/functions/generateObjectV2.md b/docs/api/functions/generateObjectV2.md new file mode 100644 index 00000000000..971e9a54b94 --- /dev/null +++ b/docs/api/functions/generateObjectV2.md @@ -0,0 +1,27 @@ +[@ai16z/eliza v1.0.0](../index.md) / generateObjectV2 + +# Function: generateObjectV2() + +> **generateObjectV2**(`options`): `Promise`\<`GenerateObjectResult`\<`unknown`\>\> + +Generates structured objects from a prompt using specified AI models and configuration options. + +## Parameters + +• **options**: [`GenerationOptions`](../interfaces/GenerationOptions.md) + +Configuration options for generating objects. + +## Returns + +`Promise`\<`GenerateObjectResult`\<`unknown`\>\> + +- A promise that resolves to an array of generated objects. + +## Throws + +- Throws an error if the provider is unsupported or if generation fails. + +## Defined in + +[packages/core/src/generation.ts:897](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L897) diff --git a/docs/api/functions/generateShouldRespond.md b/docs/api/functions/generateShouldRespond.md index f7ecec92a46..be73e0d603a 100644 --- a/docs/api/functions/generateShouldRespond.md +++ b/docs/api/functions/generateShouldRespond.md @@ -28,4 +28,4 @@ Promise resolving to "RESPOND", "IGNORE", "STOP" or null ## Defined in -[packages/core/src/generation.ts:334](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L334) +[packages/core/src/generation.ts:405](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L405) diff --git a/docs/api/functions/generateText.md b/docs/api/functions/generateText.md index e4450e8ae3d..2b469758b4d 100644 --- a/docs/api/functions/generateText.md +++ b/docs/api/functions/generateText.md @@ -32,4 +32,4 @@ The completed message. ## Defined in -[packages/core/src/generation.ts:43](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L43) +[packages/core/src/generation.ts:48](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L48) diff --git a/docs/api/functions/generateTextArray.md b/docs/api/functions/generateTextArray.md index 0eecde977dd..400b0929125 100644 --- a/docs/api/functions/generateTextArray.md +++ b/docs/api/functions/generateTextArray.md @@ -28,4 +28,4 @@ Promise resolving to an array of strings parsed from the model's response ## Defined in -[packages/core/src/generation.ts:492](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L492) +[packages/core/src/generation.ts:561](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L561) diff --git a/docs/api/functions/generateTrueOrFalse.md b/docs/api/functions/generateTrueOrFalse.md index 31302262b97..e57c6e0624f 100644 --- a/docs/api/functions/generateTrueOrFalse.md +++ b/docs/api/functions/generateTrueOrFalse.md @@ -28,4 +28,4 @@ Promise resolving to a boolean value parsed from the model's response ## Defined in -[packages/core/src/generation.ts:436](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L436) +[packages/core/src/generation.ts:505](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L505) diff --git a/docs/api/functions/getEndpoint.md b/docs/api/functions/getEndpoint.md index f4b059cef78..ae9c1c4b1b9 100644 --- a/docs/api/functions/getEndpoint.md +++ b/docs/api/functions/getEndpoint.md @@ -14,4 +14,4 @@ ## Defined in -[packages/core/src/models.ts:226](https://github.com/ai16z/eliza/blob/main/packages/core/src/models.ts#L226) +[packages/core/src/models.ts:246](https://github.com/ai16z/eliza/blob/main/packages/core/src/models.ts#L246) diff --git a/docs/api/functions/getModel.md b/docs/api/functions/getModel.md index 62d6b340a02..112c12626f1 100644 --- a/docs/api/functions/getModel.md +++ b/docs/api/functions/getModel.md @@ -16,4 +16,4 @@ ## Defined in -[packages/core/src/models.ts:222](https://github.com/ai16z/eliza/blob/main/packages/core/src/models.ts#L222) +[packages/core/src/models.ts:242](https://github.com/ai16z/eliza/blob/main/packages/core/src/models.ts#L242) diff --git a/docs/api/functions/handleProvider.md b/docs/api/functions/handleProvider.md new file mode 100644 index 00000000000..8cd392d307c --- /dev/null +++ b/docs/api/functions/handleProvider.md @@ -0,0 +1,23 @@ +[@ai16z/eliza v1.0.0](../index.md) / handleProvider + +# Function: handleProvider() + +> **handleProvider**(`options`): `Promise`\<`GenerateObjectResult`\<`unknown`\>\> + +Handles AI generation based on the specified provider. + +## Parameters + +• **options**: `ProviderOptions` + +Configuration options specific to the provider. + +## Returns + +`Promise`\<`GenerateObjectResult`\<`unknown`\>\> + +- A promise that resolves to an array of generated objects. + +## Defined in + +[packages/core/src/generation.ts:979](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L979) diff --git a/docs/api/functions/parseBooleanFromText.md b/docs/api/functions/parseBooleanFromText.md new file mode 100644 index 00000000000..b3f2e6b54a5 --- /dev/null +++ b/docs/api/functions/parseBooleanFromText.md @@ -0,0 +1,17 @@ +[@ai16z/eliza v1.0.0](../index.md) / parseBooleanFromText + +# Function: parseBooleanFromText() + +> **parseBooleanFromText**(`text`): `boolean` + +## Parameters + +• **text**: `string` + +## Returns + +`boolean` + +## Defined in + +[packages/core/src/parsing.ts:36](https://github.com/ai16z/eliza/blob/main/packages/core/src/parsing.ts#L36) diff --git a/docs/api/functions/parseJSONObjectFromText.md b/docs/api/functions/parseJSONObjectFromText.md new file mode 100644 index 00000000000..66a28364b39 --- /dev/null +++ b/docs/api/functions/parseJSONObjectFromText.md @@ -0,0 +1,27 @@ +[@ai16z/eliza v1.0.0](../index.md) / parseJSONObjectFromText + +# Function: parseJSONObjectFromText() + +> **parseJSONObjectFromText**(`text`): `Record`\<`string`, `any`\> \| `null` + +Parses a JSON object from a given text. The function looks for a JSON block wrapped in triple backticks +with `json` language identifier, and if not found, it searches for an object pattern within the text. +It then attempts to parse the JSON string into a JavaScript object. If parsing is successful and the result +is an object (but not an array), it returns the object; otherwise, it tries to parse an array if the result +is an array, or returns null if parsing is unsuccessful or the result is neither an object nor an array. + +## Parameters + +• **text**: `string` + +The input text from which to extract and parse the JSON object. + +## Returns + +`Record`\<`string`, `any`\> \| `null` + +An object parsed from the JSON string if successful; otherwise, null or the result of parsing an array. + +## Defined in + +[packages/core/src/parsing.ts:101](https://github.com/ai16z/eliza/blob/main/packages/core/src/parsing.ts#L101) diff --git a/docs/api/functions/parseJsonArrayFromText.md b/docs/api/functions/parseJsonArrayFromText.md new file mode 100644 index 00000000000..e3c69619944 --- /dev/null +++ b/docs/api/functions/parseJsonArrayFromText.md @@ -0,0 +1,26 @@ +[@ai16z/eliza v1.0.0](../index.md) / parseJsonArrayFromText + +# Function: parseJsonArrayFromText() + +> **parseJsonArrayFromText**(`text`): `any`[] + +Parses a JSON array from a given text. The function looks for a JSON block wrapped in triple backticks +with `json` language identifier, and if not found, it searches for an array pattern within the text. +It then attempts to parse the JSON string into a JavaScript object. If parsing is successful and the result +is an array, it returns the array; otherwise, it returns null. + +## Parameters + +• **text**: `string` + +The input text from which to extract and parse the JSON array. + +## Returns + +`any`[] + +An array parsed from the JSON string if successful; otherwise, null. + +## Defined in + +[packages/core/src/parsing.ts:60](https://github.com/ai16z/eliza/blob/main/packages/core/src/parsing.ts#L60) diff --git a/docs/api/functions/parseShouldRespondFromText.md b/docs/api/functions/parseShouldRespondFromText.md new file mode 100644 index 00000000000..be1005f4432 --- /dev/null +++ b/docs/api/functions/parseShouldRespondFromText.md @@ -0,0 +1,17 @@ +[@ai16z/eliza v1.0.0](../index.md) / parseShouldRespondFromText + +# Function: parseShouldRespondFromText() + +> **parseShouldRespondFromText**(`text`): `"RESPOND"` \| `"IGNORE"` \| `"STOP"` + +## Parameters + +• **text**: `string` + +## Returns + +`"RESPOND"` \| `"IGNORE"` \| `"STOP"` + +## Defined in + +[packages/core/src/parsing.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/parsing.ts#L13) diff --git a/docs/api/functions/splitChunks.md b/docs/api/functions/splitChunks.md index 4cadae0c119..03523cba5a4 100644 --- a/docs/api/functions/splitChunks.md +++ b/docs/api/functions/splitChunks.md @@ -28,4 +28,4 @@ Promise resolving to array of text chunks with bleed sections ## Defined in -[packages/core/src/generation.ts:390](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L390) +[packages/core/src/generation.ts:461](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L461) diff --git a/docs/api/functions/stringToUuid.md b/docs/api/functions/stringToUuid.md new file mode 100644 index 00000000000..b457d6ea8af --- /dev/null +++ b/docs/api/functions/stringToUuid.md @@ -0,0 +1,17 @@ +[@ai16z/eliza v1.0.0](../index.md) / stringToUuid + +# Function: stringToUuid() + +> **stringToUuid**(`target`): [`UUID`](../type-aliases/UUID.md) + +## Parameters + +• **target**: `string` + +## Returns + +[`UUID`](../type-aliases/UUID.md) + +## Defined in + +[packages/core/src/uuid.ts:4](https://github.com/ai16z/eliza/blob/main/packages/core/src/uuid.ts#L4) diff --git a/docs/api/functions/trimTokens.md b/docs/api/functions/trimTokens.md index 779f13964e0..395d2adf889 100644 --- a/docs/api/functions/trimTokens.md +++ b/docs/api/functions/trimTokens.md @@ -24,4 +24,4 @@ The model to use for generateText. ## Defined in -[packages/core/src/generation.ts:308](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L308) +[packages/core/src/generation.ts:379](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L379) diff --git a/docs/api/index.md b/docs/api/index.md index 3d3b90ecee6..8d3d1253c0e 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -17,6 +17,7 @@ ## Interfaces +- [GenerationOptions](interfaces/GenerationOptions.md) - [Content](interfaces/Content.md) - [ActionExample](interfaces/ActionExample.md) - [ConversationExample](interfaces/ConversationExample.md) @@ -65,6 +66,11 @@ - [elizaLogger](variables/elizaLogger.md) - [embeddingDimension](variables/embeddingDimension.md) - [embeddingZeroVector](variables/embeddingZeroVector.md) +- [models](variables/models.md) +- [messageCompletionFooter](variables/messageCompletionFooter.md) +- [shouldRespondFooter](variables/shouldRespondFooter.md) +- [booleanFooter](variables/booleanFooter.md) +- [stringArrayFooter](variables/stringArrayFooter.md) - [settings](variables/settings.md) ## Functions @@ -91,6 +97,8 @@ - [generateMessageResponse](functions/generateMessageResponse.md) - [generateImage](functions/generateImage.md) - [generateCaption](functions/generateCaption.md) +- [generateObjectV2](functions/generateObjectV2.md) +- [handleProvider](functions/handleProvider.md) - [getGoals](functions/getGoals.md) - [formatGoalsAsString](functions/formatGoalsAsString.md) - [updateGoal](functions/updateGoal.md) @@ -101,6 +109,10 @@ - [formatTimestamp](functions/formatTimestamp.md) - [getModel](functions/getModel.md) - [getEndpoint](functions/getEndpoint.md) +- [parseShouldRespondFromText](functions/parseShouldRespondFromText.md) +- [parseBooleanFromText](functions/parseBooleanFromText.md) +- [parseJsonArrayFromText](functions/parseJsonArrayFromText.md) +- [parseJSONObjectFromText](functions/parseJSONObjectFromText.md) - [formatPosts](functions/formatPosts.md) - [getProviders](functions/getProviders.md) - [createRelationship](functions/createRelationship.md) @@ -109,3 +121,4 @@ - [formatRelationships](functions/formatRelationships.md) - [findNearestEnvFile](functions/findNearestEnvFile.md) - [loadEnvConfig](functions/loadEnvConfig.md) +- [stringToUuid](functions/stringToUuid.md) diff --git a/docs/api/interfaces/Account.md b/docs/api/interfaces/Account.md index 7dcca4d6d7f..b28d0af497d 100644 --- a/docs/api/interfaces/Account.md +++ b/docs/api/interfaces/Account.md @@ -12,9 +12,9 @@ Represents a user, including their name, details, and a unique identifier. #### Defined in -[packages/core/src/types.ts:273](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L273) +[packages/core/src/types.ts:275](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L275) -*** +--- ### name @@ -22,9 +22,9 @@ Represents a user, including their name, details, and a unique identifier. #### Defined in -[packages/core/src/types.ts:274](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L274) +[packages/core/src/types.ts:276](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L276) -*** +--- ### username @@ -32,9 +32,9 @@ Represents a user, including their name, details, and a unique identifier. #### Defined in -[packages/core/src/types.ts:275](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L275) +[packages/core/src/types.ts:277](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L277) -*** +--- ### details? @@ -42,13 +42,13 @@ Represents a user, including their name, details, and a unique identifier. #### Index Signature - \[`key`: `string`\]: `any` +\[`key`: `string`\]: `any` #### Defined in -[packages/core/src/types.ts:276](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L276) +[packages/core/src/types.ts:278](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L278) -*** +--- ### email? @@ -56,9 +56,9 @@ Represents a user, including their name, details, and a unique identifier. #### Defined in -[packages/core/src/types.ts:277](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L277) +[packages/core/src/types.ts:279](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L279) -*** +--- ### avatarUrl? @@ -66,4 +66,4 @@ Represents a user, including their name, details, and a unique identifier. #### Defined in -[packages/core/src/types.ts:278](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L278) +[packages/core/src/types.ts:280](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L280) diff --git a/docs/api/interfaces/Action.md b/docs/api/interfaces/Action.md index 63a4028f516..f60a0f9bddf 100644 --- a/docs/api/interfaces/Action.md +++ b/docs/api/interfaces/Action.md @@ -12,9 +12,9 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[packages/core/src/types.ts:215](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L215) +[packages/core/src/types.ts:217](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L217) -*** +--- ### description @@ -22,9 +22,9 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[packages/core/src/types.ts:216](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L216) +[packages/core/src/types.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L218) -*** +--- ### examples @@ -32,9 +32,9 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[packages/core/src/types.ts:217](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L217) +[packages/core/src/types.ts:219](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L219) -*** +--- ### handler @@ -42,9 +42,9 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[packages/core/src/types.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L218) +[packages/core/src/types.ts:220](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L220) -*** +--- ### name @@ -52,9 +52,9 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[packages/core/src/types.ts:219](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L219) +[packages/core/src/types.ts:221](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L221) -*** +--- ### validate @@ -62,4 +62,4 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[packages/core/src/types.ts:220](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L220) +[packages/core/src/types.ts:222](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L222) diff --git a/docs/api/interfaces/ActionExample.md b/docs/api/interfaces/ActionExample.md index 4b9857324df..c17ef42017f 100644 --- a/docs/api/interfaces/ActionExample.md +++ b/docs/api/interfaces/ActionExample.md @@ -14,7 +14,7 @@ Represents an example of content, typically used for demonstrating or testing pu [packages/core/src/types.ts:25](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L25) -*** +--- ### content diff --git a/docs/api/interfaces/Actor.md b/docs/api/interfaces/Actor.md index f6d2aac0238..0e613ce860c 100644 --- a/docs/api/interfaces/Actor.md +++ b/docs/api/interfaces/Actor.md @@ -14,7 +14,7 @@ Represents an actor in the conversation, which could be a user or the agent itse [packages/core/src/types.ts:41](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L41) -*** +--- ### username @@ -24,7 +24,7 @@ Represents an actor in the conversation, which could be a user or the agent itse [packages/core/src/types.ts:42](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L42) -*** +--- ### details @@ -46,7 +46,7 @@ Represents an actor in the conversation, which could be a user or the agent itse [packages/core/src/types.ts:43](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L43) -*** +--- ### id diff --git a/docs/api/interfaces/Content.md b/docs/api/interfaces/Content.md index 8ed06147ca9..fbdbbdc6491 100644 --- a/docs/api/interfaces/Content.md +++ b/docs/api/interfaces/Content.md @@ -6,7 +6,7 @@ Represents the content of a message, including its main text (`content`), any as ## Indexable - \[`key`: `string`\]: `unknown` +\[`key`: `string`\]: `unknown` ## Properties @@ -18,7 +18,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:12](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L12) -*** +--- ### action? @@ -28,7 +28,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L13) -*** +--- ### source? @@ -38,7 +38,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:14](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L14) -*** +--- ### url? @@ -48,7 +48,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:15](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L15) -*** +--- ### inReplyTo? @@ -58,7 +58,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:16](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L16) -*** +--- ### attachments? diff --git a/docs/api/interfaces/ConversationExample.md b/docs/api/interfaces/ConversationExample.md index 85d70796dd2..28f7f975a5d 100644 --- a/docs/api/interfaces/ConversationExample.md +++ b/docs/api/interfaces/ConversationExample.md @@ -14,7 +14,7 @@ Represents an example of content, typically used for demonstrating or testing pu [packages/core/src/types.ts:33](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L33) -*** +--- ### content diff --git a/docs/api/interfaces/EvaluationExample.md b/docs/api/interfaces/EvaluationExample.md index 9a44022faff..c1dab7cea23 100644 --- a/docs/api/interfaces/EvaluationExample.md +++ b/docs/api/interfaces/EvaluationExample.md @@ -12,9 +12,9 @@ Represents an example for evaluation, including the context, an array of message #### Defined in -[packages/core/src/types.ts:227](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L227) +[packages/core/src/types.ts:229](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L229) -*** +--- ### messages @@ -22,9 +22,9 @@ Represents an example for evaluation, including the context, an array of message #### Defined in -[packages/core/src/types.ts:228](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L228) +[packages/core/src/types.ts:230](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L230) -*** +--- ### outcome @@ -32,4 +32,4 @@ Represents an example for evaluation, including the context, an array of message #### Defined in -[packages/core/src/types.ts:229](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L229) +[packages/core/src/types.ts:231](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L231) diff --git a/docs/api/interfaces/Evaluator.md b/docs/api/interfaces/Evaluator.md index 84c4c47e938..dcb4daae488 100644 --- a/docs/api/interfaces/Evaluator.md +++ b/docs/api/interfaces/Evaluator.md @@ -12,9 +12,9 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[packages/core/src/types.ts:236](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L236) +[packages/core/src/types.ts:238](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L238) -*** +--- ### description @@ -22,9 +22,9 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[packages/core/src/types.ts:237](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L237) +[packages/core/src/types.ts:239](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L239) -*** +--- ### similes @@ -32,9 +32,9 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[packages/core/src/types.ts:238](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L238) +[packages/core/src/types.ts:240](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L240) -*** +--- ### examples @@ -42,9 +42,9 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[packages/core/src/types.ts:239](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L239) +[packages/core/src/types.ts:241](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L241) -*** +--- ### handler @@ -52,9 +52,9 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[packages/core/src/types.ts:240](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L240) +[packages/core/src/types.ts:242](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L242) -*** +--- ### name @@ -62,9 +62,9 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[packages/core/src/types.ts:241](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L241) +[packages/core/src/types.ts:243](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L243) -*** +--- ### validate @@ -72,4 +72,4 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[packages/core/src/types.ts:242](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L242) +[packages/core/src/types.ts:244](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L244) diff --git a/docs/api/interfaces/GenerationOptions.md b/docs/api/interfaces/GenerationOptions.md new file mode 100644 index 00000000000..8e91690dcc0 --- /dev/null +++ b/docs/api/interfaces/GenerationOptions.md @@ -0,0 +1,95 @@ +[@ai16z/eliza v1.0.0](../index.md) / GenerationOptions + +# Interface: GenerationOptions + +Configuration options for generating objects with a model. + +## Properties + +### runtime + +> **runtime**: [`IAgentRuntime`](IAgentRuntime.md) + +#### Defined in + +[packages/core/src/generation.ts:867](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L867) + +--- + +### context + +> **context**: `string` + +#### Defined in + +[packages/core/src/generation.ts:868](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L868) + +--- + +### modelClass + +> **modelClass**: [`ModelClass`](../enumerations/ModelClass.md) + +#### Defined in + +[packages/core/src/generation.ts:869](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L869) + +--- + +### schema? + +> `optional` **schema**: `ZodType`\<`any`, `ZodTypeDef`, `any`\> + +#### Defined in + +[packages/core/src/generation.ts:870](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L870) + +--- + +### schemaName? + +> `optional` **schemaName**: `string` + +#### Defined in + +[packages/core/src/generation.ts:871](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L871) + +--- + +### schemaDescription? + +> `optional` **schemaDescription**: `string` + +#### Defined in + +[packages/core/src/generation.ts:872](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L872) + +--- + +### stop? + +> `optional` **stop**: `string`[] + +#### Defined in + +[packages/core/src/generation.ts:873](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L873) + +--- + +### mode? + +> `optional` **mode**: `"auto"` \| `"json"` \| `"tool"` + +#### Defined in + +[packages/core/src/generation.ts:874](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L874) + +--- + +### experimental_providerMetadata? + +> `optional` **experimental_providerMetadata**: `Record`\<`string`, `unknown`\> + +#### Defined in + +[packages/core/src/generation.ts:875](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L875) diff --git a/docs/api/interfaces/Goal.md b/docs/api/interfaces/Goal.md index ddc338ab47e..41456943b3c 100644 --- a/docs/api/interfaces/Goal.md +++ b/docs/api/interfaces/Goal.md @@ -14,7 +14,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:66](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L66) -*** +--- ### roomId @@ -24,7 +24,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:67](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L67) -*** +--- ### userId @@ -34,7 +34,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:68](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L68) -*** +--- ### name @@ -44,7 +44,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:69](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L69) -*** +--- ### status @@ -54,7 +54,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:70](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L70) -*** +--- ### objectives diff --git a/docs/api/interfaces/IAgentRuntime.md b/docs/api/interfaces/IAgentRuntime.md index 476f0e62b12..40d442301fe 100644 --- a/docs/api/interfaces/IAgentRuntime.md +++ b/docs/api/interfaces/IAgentRuntime.md @@ -12,9 +12,9 @@ Properties #### Defined in -[packages/core/src/types.ts:520](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L520) +[packages/core/src/types.ts:532](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L532) -*** +--- ### serverUrl @@ -22,9 +22,9 @@ Properties #### Defined in -[packages/core/src/types.ts:521](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L521) +[packages/core/src/types.ts:533](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L533) -*** +--- ### databaseAdapter @@ -32,9 +32,9 @@ Properties #### Defined in -[packages/core/src/types.ts:522](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L522) +[packages/core/src/types.ts:534](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L534) -*** +--- ### token @@ -42,9 +42,9 @@ Properties #### Defined in -[packages/core/src/types.ts:523](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L523) +[packages/core/src/types.ts:535](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L535) -*** +--- ### modelProvider @@ -52,9 +52,9 @@ Properties #### Defined in -[packages/core/src/types.ts:524](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L524) +[packages/core/src/types.ts:536](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L536) -*** +--- ### character @@ -62,9 +62,9 @@ Properties #### Defined in -[packages/core/src/types.ts:525](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L525) +[packages/core/src/types.ts:537](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L537) -*** +--- ### providers @@ -72,9 +72,9 @@ Properties #### Defined in -[packages/core/src/types.ts:526](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L526) +[packages/core/src/types.ts:538](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L538) -*** +--- ### actions @@ -82,9 +82,9 @@ Properties #### Defined in -[packages/core/src/types.ts:527](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L527) +[packages/core/src/types.ts:539](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L539) -*** +--- ### evaluators @@ -92,9 +92,9 @@ Properties #### Defined in -[packages/core/src/types.ts:528](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L528) +[packages/core/src/types.ts:540](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L540) -*** +--- ### messageManager @@ -102,9 +102,9 @@ Properties #### Defined in -[packages/core/src/types.ts:530](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L530) +[packages/core/src/types.ts:542](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L542) -*** +--- ### descriptionManager @@ -112,9 +112,9 @@ Properties #### Defined in -[packages/core/src/types.ts:531](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L531) +[packages/core/src/types.ts:543](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L543) -*** +--- ### loreManager @@ -122,9 +122,9 @@ Properties #### Defined in -[packages/core/src/types.ts:532](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L532) +[packages/core/src/types.ts:544](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L544) -*** +--- ### services @@ -132,7 +132,7 @@ Properties #### Defined in -[packages/core/src/types.ts:534](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L534) +[packages/core/src/types.ts:546](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L546) ## Methods @@ -150,9 +150,9 @@ Properties #### Defined in -[packages/core/src/types.ts:535](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L535) +[packages/core/src/types.ts:547](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L547) -*** +--- ### getMemoryManager() @@ -168,13 +168,13 @@ Properties #### Defined in -[packages/core/src/types.ts:537](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L537) +[packages/core/src/types.ts:549](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L549) -*** +--- ### getService() -> **getService**(`service`): *typeof* [`Service`](../classes/Service.md) +> **getService**(`service`): _typeof_ [`Service`](../classes/Service.md) #### Parameters @@ -182,13 +182,13 @@ Properties #### Returns -*typeof* [`Service`](../classes/Service.md) +_typeof_ [`Service`](../classes/Service.md) #### Defined in -[packages/core/src/types.ts:539](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L539) +[packages/core/src/types.ts:551](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L551) -*** +--- ### registerService() @@ -204,9 +204,9 @@ Properties #### Defined in -[packages/core/src/types.ts:541](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L541) +[packages/core/src/types.ts:553](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L553) -*** +--- ### getSetting() @@ -222,9 +222,9 @@ Properties #### Defined in -[packages/core/src/types.ts:543](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L543) +[packages/core/src/types.ts:555](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L555) -*** +--- ### getConversationLength() @@ -238,9 +238,9 @@ Methods #### Defined in -[packages/core/src/types.ts:546](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L546) +[packages/core/src/types.ts:558](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L558) -*** +--- ### processActions() @@ -262,9 +262,9 @@ Methods #### Defined in -[packages/core/src/types.ts:547](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L547) +[packages/core/src/types.ts:559](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L559) -*** +--- ### evaluate() @@ -284,9 +284,9 @@ Methods #### Defined in -[packages/core/src/types.ts:553](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L553) +[packages/core/src/types.ts:565](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L565) -*** +--- ### ensureParticipantExists() @@ -304,9 +304,9 @@ Methods #### Defined in -[packages/core/src/types.ts:558](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L558) +[packages/core/src/types.ts:570](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L570) -*** +--- ### ensureUserExists() @@ -328,9 +328,9 @@ Methods #### Defined in -[packages/core/src/types.ts:559](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L559) +[packages/core/src/types.ts:571](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L571) -*** +--- ### registerAction() @@ -346,9 +346,9 @@ Methods #### Defined in -[packages/core/src/types.ts:565](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L565) +[packages/core/src/types.ts:577](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L577) -*** +--- ### ensureConnection() @@ -372,9 +372,9 @@ Methods #### Defined in -[packages/core/src/types.ts:566](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L566) +[packages/core/src/types.ts:578](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L578) -*** +--- ### ensureParticipantInRoom() @@ -392,9 +392,9 @@ Methods #### Defined in -[packages/core/src/types.ts:573](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L573) +[packages/core/src/types.ts:585](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L585) -*** +--- ### ensureRoomExists() @@ -410,9 +410,9 @@ Methods #### Defined in -[packages/core/src/types.ts:574](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L574) +[packages/core/src/types.ts:586](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L586) -*** +--- ### composeState() @@ -430,9 +430,9 @@ Methods #### Defined in -[packages/core/src/types.ts:575](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L575) +[packages/core/src/types.ts:587](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L587) -*** +--- ### updateRecentMessageState() @@ -448,4 +448,4 @@ Methods #### Defined in -[packages/core/src/types.ts:579](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L579) +[packages/core/src/types.ts:591](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L591) diff --git a/docs/api/interfaces/IBrowserService.md b/docs/api/interfaces/IBrowserService.md index 78011136371..1960e7f069a 100644 --- a/docs/api/interfaces/IBrowserService.md +++ b/docs/api/interfaces/IBrowserService.md @@ -18,9 +18,9 @@ #### Defined in -[packages/core/src/types.ts:629](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L629) +[packages/core/src/types.ts:641](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L641) -*** +--- ### closeBrowser() @@ -32,9 +32,9 @@ #### Defined in -[packages/core/src/types.ts:630](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L630) +[packages/core/src/types.ts:642](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L642) -*** +--- ### getPageContent() @@ -64,4 +64,4 @@ #### Defined in -[packages/core/src/types.ts:631](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L631) +[packages/core/src/types.ts:643](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L643) diff --git a/docs/api/interfaces/IDatabaseAdapter.md b/docs/api/interfaces/IDatabaseAdapter.md index 65173339115..110080ba08f 100644 --- a/docs/api/interfaces/IDatabaseAdapter.md +++ b/docs/api/interfaces/IDatabaseAdapter.md @@ -10,7 +10,7 @@ #### Defined in -[packages/core/src/types.ts:363](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L363) +[packages/core/src/types.ts:375](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L375) ## Methods @@ -28,9 +28,9 @@ #### Defined in -[packages/core/src/types.ts:364](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L364) +[packages/core/src/types.ts:376](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L376) -*** +--- ### createAccount() @@ -46,9 +46,9 @@ #### Defined in -[packages/core/src/types.ts:365](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L365) +[packages/core/src/types.ts:377](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L377) -*** +--- ### getMemories() @@ -78,9 +78,9 @@ #### Defined in -[packages/core/src/types.ts:366](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L366) +[packages/core/src/types.ts:378](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L378) -*** +--- ### getMemoryById() @@ -96,9 +96,9 @@ #### Defined in -[packages/core/src/types.ts:375](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L375) +[packages/core/src/types.ts:387](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L387) -*** +--- ### getMemoriesByRoomIds() @@ -118,9 +118,9 @@ #### Defined in -[packages/core/src/types.ts:376](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L376) +[packages/core/src/types.ts:388](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L388) -*** +--- ### getCachedEmbeddings() @@ -130,17 +130,17 @@ • **params** -• **params.query\_table\_name**: `string` +• **params.query_table_name**: `string` -• **params.query\_threshold**: `number` +• **params.query_threshold**: `number` -• **params.query\_input**: `string` +• **params.query_input**: `string` -• **params.query\_field\_name**: `string` +• **params.query_field_name**: `string` -• **params.query\_field\_sub\_name**: `string` +• **params.query_field_sub_name**: `string` -• **params.query\_match\_count**: `number` +• **params.query_match_count**: `number` #### Returns @@ -148,9 +148,9 @@ #### Defined in -[packages/core/src/types.ts:380](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L380) +[packages/core/src/types.ts:392](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L392) -*** +--- ### log() @@ -174,9 +174,9 @@ #### Defined in -[packages/core/src/types.ts:388](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L388) +[packages/core/src/types.ts:400](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L400) -*** +--- ### getActorDetails() @@ -194,9 +194,9 @@ #### Defined in -[packages/core/src/types.ts:394](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L394) +[packages/core/src/types.ts:406](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L406) -*** +--- ### searchMemories() @@ -212,9 +212,9 @@ • **params.embedding**: `number`[] -• **params.match\_threshold**: `number` +• **params.match_threshold**: `number` -• **params.match\_count**: `number` +• **params.match_count**: `number` • **params.unique**: `boolean` @@ -224,9 +224,9 @@ #### Defined in -[packages/core/src/types.ts:395](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L395) +[packages/core/src/types.ts:407](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L407) -*** +--- ### updateGoalStatus() @@ -246,9 +246,9 @@ #### Defined in -[packages/core/src/types.ts:403](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L403) +[packages/core/src/types.ts:415](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L415) -*** +--- ### searchMemoriesByEmbedding() @@ -260,7 +260,7 @@ • **params** -• **params.match\_threshold?**: `number` +• **params.match_threshold?**: `number` • **params.count?**: `number` @@ -278,9 +278,9 @@ #### Defined in -[packages/core/src/types.ts:407](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L407) +[packages/core/src/types.ts:419](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L419) -*** +--- ### createMemory() @@ -300,9 +300,9 @@ #### Defined in -[packages/core/src/types.ts:418](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L418) +[packages/core/src/types.ts:430](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L430) -*** +--- ### removeMemory() @@ -320,9 +320,9 @@ #### Defined in -[packages/core/src/types.ts:423](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L423) +[packages/core/src/types.ts:435](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L435) -*** +--- ### removeAllMemories() @@ -340,9 +340,9 @@ #### Defined in -[packages/core/src/types.ts:424](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L424) +[packages/core/src/types.ts:436](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L436) -*** +--- ### countMemories() @@ -362,9 +362,9 @@ #### Defined in -[packages/core/src/types.ts:425](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L425) +[packages/core/src/types.ts:437](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L437) -*** +--- ### getGoals() @@ -388,9 +388,9 @@ #### Defined in -[packages/core/src/types.ts:430](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L430) +[packages/core/src/types.ts:442](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L442) -*** +--- ### updateGoal() @@ -406,9 +406,9 @@ #### Defined in -[packages/core/src/types.ts:436](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L436) +[packages/core/src/types.ts:448](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L448) -*** +--- ### createGoal() @@ -424,9 +424,9 @@ #### Defined in -[packages/core/src/types.ts:437](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L437) +[packages/core/src/types.ts:449](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L449) -*** +--- ### removeGoal() @@ -442,9 +442,9 @@ #### Defined in -[packages/core/src/types.ts:438](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L438) +[packages/core/src/types.ts:450](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L450) -*** +--- ### removeAllGoals() @@ -460,9 +460,9 @@ #### Defined in -[packages/core/src/types.ts:439](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L439) +[packages/core/src/types.ts:451](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L451) -*** +--- ### getRoom() @@ -478,9 +478,9 @@ #### Defined in -[packages/core/src/types.ts:440](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L440) +[packages/core/src/types.ts:452](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L452) -*** +--- ### createRoom() @@ -496,9 +496,9 @@ #### Defined in -[packages/core/src/types.ts:441](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L441) +[packages/core/src/types.ts:453](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L453) -*** +--- ### removeRoom() @@ -514,9 +514,9 @@ #### Defined in -[packages/core/src/types.ts:442](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L442) +[packages/core/src/types.ts:454](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L454) -*** +--- ### getRoomsForParticipant() @@ -532,9 +532,9 @@ #### Defined in -[packages/core/src/types.ts:443](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L443) +[packages/core/src/types.ts:455](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L455) -*** +--- ### getRoomsForParticipants() @@ -550,9 +550,9 @@ #### Defined in -[packages/core/src/types.ts:444](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L444) +[packages/core/src/types.ts:456](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L456) -*** +--- ### addParticipant() @@ -570,9 +570,9 @@ #### Defined in -[packages/core/src/types.ts:445](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L445) +[packages/core/src/types.ts:457](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L457) -*** +--- ### removeParticipant() @@ -590,9 +590,9 @@ #### Defined in -[packages/core/src/types.ts:446](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L446) +[packages/core/src/types.ts:458](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L458) -*** +--- ### getParticipantsForAccount() @@ -608,9 +608,9 @@ #### Defined in -[packages/core/src/types.ts:447](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L447) +[packages/core/src/types.ts:459](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L459) -*** +--- ### getParticipantsForRoom() @@ -626,9 +626,9 @@ #### Defined in -[packages/core/src/types.ts:448](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L448) +[packages/core/src/types.ts:460](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L460) -*** +--- ### getParticipantUserState() @@ -646,9 +646,9 @@ #### Defined in -[packages/core/src/types.ts:449](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L449) +[packages/core/src/types.ts:461](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L461) -*** +--- ### setParticipantUserState() @@ -668,9 +668,9 @@ #### Defined in -[packages/core/src/types.ts:453](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L453) +[packages/core/src/types.ts:465](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L465) -*** +--- ### createRelationship() @@ -690,9 +690,9 @@ #### Defined in -[packages/core/src/types.ts:458](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L458) +[packages/core/src/types.ts:470](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L470) -*** +--- ### getRelationship() @@ -712,9 +712,9 @@ #### Defined in -[packages/core/src/types.ts:459](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L459) +[packages/core/src/types.ts:471](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L471) -*** +--- ### getRelationships() @@ -732,4 +732,4 @@ #### Defined in -[packages/core/src/types.ts:463](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L463) +[packages/core/src/types.ts:475](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L475) diff --git a/docs/api/interfaces/IImageDescriptionService.md b/docs/api/interfaces/IImageDescriptionService.md index 56cda70adae..5f29d8a9970 100644 --- a/docs/api/interfaces/IImageDescriptionService.md +++ b/docs/api/interfaces/IImageDescriptionService.md @@ -18,9 +18,9 @@ #### Defined in -[packages/core/src/types.ts:583](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L583) +[packages/core/src/types.ts:595](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L595) -*** +--- ### initialize() @@ -38,9 +38,9 @@ #### Defined in -[packages/core/src/types.ts:584](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L584) +[packages/core/src/types.ts:596](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L596) -*** +--- ### describeImage() @@ -64,4 +64,4 @@ #### Defined in -[packages/core/src/types.ts:585](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L585) +[packages/core/src/types.ts:597](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L597) diff --git a/docs/api/interfaces/IMemoryManager.md b/docs/api/interfaces/IMemoryManager.md index 56c76a7d98f..a10169784be 100644 --- a/docs/api/interfaces/IMemoryManager.md +++ b/docs/api/interfaces/IMemoryManager.md @@ -10,9 +10,9 @@ #### Defined in -[packages/core/src/types.ts:467](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L467) +[packages/core/src/types.ts:479](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L479) -*** +--- ### tableName @@ -20,9 +20,9 @@ #### Defined in -[packages/core/src/types.ts:468](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L468) +[packages/core/src/types.ts:480](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L480) -*** +--- ### constructor @@ -30,7 +30,7 @@ #### Defined in -[packages/core/src/types.ts:470](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L470) +[packages/core/src/types.ts:482](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L482) ## Methods @@ -48,9 +48,9 @@ #### Defined in -[packages/core/src/types.ts:472](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L472) +[packages/core/src/types.ts:484](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L484) -*** +--- ### getMemories() @@ -78,9 +78,9 @@ #### Defined in -[packages/core/src/types.ts:473](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L473) +[packages/core/src/types.ts:485](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L485) -*** +--- ### getCachedEmbeddings() @@ -96,9 +96,9 @@ #### Defined in -[packages/core/src/types.ts:481](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L481) +[packages/core/src/types.ts:493](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L493) -*** +--- ### getMemoryById() @@ -114,9 +114,9 @@ #### Defined in -[packages/core/src/types.ts:484](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L484) +[packages/core/src/types.ts:496](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L496) -*** +--- ### getMemoriesByRoomIds() @@ -136,9 +136,9 @@ #### Defined in -[packages/core/src/types.ts:485](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L485) +[packages/core/src/types.ts:497](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L497) -*** +--- ### searchMemoriesByEmbedding() @@ -150,7 +150,7 @@ • **opts** -• **opts.match\_threshold?**: `number` +• **opts.match_threshold?**: `number` • **opts.count?**: `number` @@ -166,9 +166,9 @@ #### Defined in -[packages/core/src/types.ts:489](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L489) +[packages/core/src/types.ts:501](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L501) -*** +--- ### createMemory() @@ -186,9 +186,9 @@ #### Defined in -[packages/core/src/types.ts:499](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L499) +[packages/core/src/types.ts:511](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L511) -*** +--- ### removeMemory() @@ -204,9 +204,9 @@ #### Defined in -[packages/core/src/types.ts:500](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L500) +[packages/core/src/types.ts:512](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L512) -*** +--- ### removeAllMemories() @@ -222,9 +222,9 @@ #### Defined in -[packages/core/src/types.ts:501](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L501) +[packages/core/src/types.ts:513](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L513) -*** +--- ### countMemories() @@ -242,4 +242,4 @@ #### Defined in -[packages/core/src/types.ts:502](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L502) +[packages/core/src/types.ts:514](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L514) diff --git a/docs/api/interfaces/IPdfService.md b/docs/api/interfaces/IPdfService.md index f594bf13a92..bfd875f7093 100644 --- a/docs/api/interfaces/IPdfService.md +++ b/docs/api/interfaces/IPdfService.md @@ -22,4 +22,4 @@ #### Defined in -[packages/core/src/types.ts:642](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L642) +[packages/core/src/types.ts:654](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L654) diff --git a/docs/api/interfaces/ISpeechService.md b/docs/api/interfaces/ISpeechService.md index bf3db964e02..6e6fe9436e8 100644 --- a/docs/api/interfaces/ISpeechService.md +++ b/docs/api/interfaces/ISpeechService.md @@ -24,4 +24,4 @@ #### Defined in -[packages/core/src/types.ts:638](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L638) +[packages/core/src/types.ts:650](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L650) diff --git a/docs/api/interfaces/ITextGenerationService.md b/docs/api/interfaces/ITextGenerationService.md index bdb94b44475..5be0dbf0405 100644 --- a/docs/api/interfaces/ITextGenerationService.md +++ b/docs/api/interfaces/ITextGenerationService.md @@ -18,9 +18,9 @@ #### Defined in -[packages/core/src/types.ts:607](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L607) +[packages/core/src/types.ts:619](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L619) -*** +--- ### initializeModel() @@ -32,9 +32,9 @@ #### Defined in -[packages/core/src/types.ts:608](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L608) +[packages/core/src/types.ts:620](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L620) -*** +--- ### queueMessageCompletion() @@ -48,11 +48,11 @@ • **stop**: `string`[] -• **frequency\_penalty**: `number` +• **frequency_penalty**: `number` -• **presence\_penalty**: `number` +• **presence_penalty**: `number` -• **max\_tokens**: `number` +• **max_tokens**: `number` #### Returns @@ -60,9 +60,9 @@ #### Defined in -[packages/core/src/types.ts:609](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L609) +[packages/core/src/types.ts:621](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L621) -*** +--- ### queueTextCompletion() @@ -76,11 +76,11 @@ • **stop**: `string`[] -• **frequency\_penalty**: `number` +• **frequency_penalty**: `number` -• **presence\_penalty**: `number` +• **presence_penalty**: `number` -• **max\_tokens**: `number` +• **max_tokens**: `number` #### Returns @@ -88,9 +88,9 @@ #### Defined in -[packages/core/src/types.ts:617](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L617) +[packages/core/src/types.ts:629](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L629) -*** +--- ### getEmbeddingResponse() @@ -106,4 +106,4 @@ #### Defined in -[packages/core/src/types.ts:625](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L625) +[packages/core/src/types.ts:637](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L637) diff --git a/docs/api/interfaces/ITranscriptionService.md b/docs/api/interfaces/ITranscriptionService.md index 27b765ea595..5634219f53b 100644 --- a/docs/api/interfaces/ITranscriptionService.md +++ b/docs/api/interfaces/ITranscriptionService.md @@ -22,9 +22,9 @@ #### Defined in -[packages/core/src/types.ts:591](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L591) +[packages/core/src/types.ts:603](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L603) -*** +--- ### transcribeAttachmentLocally() @@ -40,9 +40,9 @@ #### Defined in -[packages/core/src/types.ts:592](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L592) +[packages/core/src/types.ts:604](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L604) -*** +--- ### transcribe() @@ -58,9 +58,9 @@ #### Defined in -[packages/core/src/types.ts:595](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L595) +[packages/core/src/types.ts:607](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L607) -*** +--- ### transcribeLocally() @@ -76,4 +76,4 @@ #### Defined in -[packages/core/src/types.ts:596](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L596) +[packages/core/src/types.ts:608](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L608) diff --git a/docs/api/interfaces/IVideoService.md b/docs/api/interfaces/IVideoService.md index 8b5c9886281..f62ab655dbc 100644 --- a/docs/api/interfaces/IVideoService.md +++ b/docs/api/interfaces/IVideoService.md @@ -22,9 +22,9 @@ #### Defined in -[packages/core/src/types.ts:600](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L600) +[packages/core/src/types.ts:612](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L612) -*** +--- ### processVideo() @@ -40,9 +40,9 @@ #### Defined in -[packages/core/src/types.ts:601](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L601) +[packages/core/src/types.ts:613](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L613) -*** +--- ### fetchVideoInfo() @@ -58,9 +58,9 @@ #### Defined in -[packages/core/src/types.ts:602](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L602) +[packages/core/src/types.ts:614](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L614) -*** +--- ### downloadVideo() @@ -76,4 +76,4 @@ #### Defined in -[packages/core/src/types.ts:603](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L603) +[packages/core/src/types.ts:615](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L615) diff --git a/docs/api/interfaces/Memory.md b/docs/api/interfaces/Memory.md index f9d743a4a54..040cdf1e71a 100644 --- a/docs/api/interfaces/Memory.md +++ b/docs/api/interfaces/Memory.md @@ -12,9 +12,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[packages/core/src/types.ts:167](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L167) +[packages/core/src/types.ts:169](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L169) -*** +--- ### userId @@ -22,9 +22,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[packages/core/src/types.ts:168](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L168) +[packages/core/src/types.ts:170](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L170) -*** +--- ### agentId @@ -32,9 +32,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[packages/core/src/types.ts:169](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L169) +[packages/core/src/types.ts:171](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L171) -*** +--- ### createdAt? @@ -42,9 +42,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[packages/core/src/types.ts:170](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L170) +[packages/core/src/types.ts:172](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L172) -*** +--- ### content @@ -52,9 +52,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[packages/core/src/types.ts:171](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L171) +[packages/core/src/types.ts:173](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L173) -*** +--- ### embedding? @@ -62,9 +62,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[packages/core/src/types.ts:172](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L172) +[packages/core/src/types.ts:174](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L174) -*** +--- ### roomId @@ -72,9 +72,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[packages/core/src/types.ts:173](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L173) +[packages/core/src/types.ts:175](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L175) -*** +--- ### unique? @@ -82,4 +82,4 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[packages/core/src/types.ts:174](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L174) +[packages/core/src/types.ts:176](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L176) diff --git a/docs/api/interfaces/MessageExample.md b/docs/api/interfaces/MessageExample.md index 8055efc55ea..dbc07ae96c1 100644 --- a/docs/api/interfaces/MessageExample.md +++ b/docs/api/interfaces/MessageExample.md @@ -12,9 +12,9 @@ Represents an example of a message, typically used for demonstrating or testing #### Defined in -[packages/core/src/types.ts:181](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L181) +[packages/core/src/types.ts:183](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L183) -*** +--- ### content @@ -22,4 +22,4 @@ Represents an example of a message, typically used for demonstrating or testing #### Defined in -[packages/core/src/types.ts:182](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L182) +[packages/core/src/types.ts:184](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L184) diff --git a/docs/api/interfaces/Objective.md b/docs/api/interfaces/Objective.md index 554e13b00ac..4a9c5854f71 100644 --- a/docs/api/interfaces/Objective.md +++ b/docs/api/interfaces/Objective.md @@ -14,7 +14,7 @@ Represents an objective within a goal, detailing what needs to be achieved and w [packages/core/src/types.ts:51](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L51) -*** +--- ### description @@ -24,7 +24,7 @@ Represents an objective within a goal, detailing what needs to be achieved and w [packages/core/src/types.ts:52](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L52) -*** +--- ### completed diff --git a/docs/api/interfaces/Participant.md b/docs/api/interfaces/Participant.md index a984de6aa49..74b1096c000 100644 --- a/docs/api/interfaces/Participant.md +++ b/docs/api/interfaces/Participant.md @@ -12,9 +12,9 @@ Represents a participant in a room, including their ID and account details. #### Defined in -[packages/core/src/types.ts:285](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L285) +[packages/core/src/types.ts:287](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L287) -*** +--- ### account @@ -22,4 +22,4 @@ Represents a participant in a room, including their ID and account details. #### Defined in -[packages/core/src/types.ts:286](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L286) +[packages/core/src/types.ts:288](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L288) diff --git a/docs/api/interfaces/Provider.md b/docs/api/interfaces/Provider.md index c2052254f73..489806151cb 100644 --- a/docs/api/interfaces/Provider.md +++ b/docs/api/interfaces/Provider.md @@ -24,4 +24,4 @@ Represents a provider, which is used to retrieve information or perform actions #### Defined in -[packages/core/src/types.ts:249](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L249) +[packages/core/src/types.ts:251](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L251) diff --git a/docs/api/interfaces/Relationship.md b/docs/api/interfaces/Relationship.md index b1baf439541..9dbafcb2fc5 100644 --- a/docs/api/interfaces/Relationship.md +++ b/docs/api/interfaces/Relationship.md @@ -12,9 +12,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[packages/core/src/types.ts:260](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L260) +[packages/core/src/types.ts:262](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L262) -*** +--- ### userA @@ -22,9 +22,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[packages/core/src/types.ts:261](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L261) +[packages/core/src/types.ts:263](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L263) -*** +--- ### userB @@ -32,9 +32,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[packages/core/src/types.ts:262](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L262) +[packages/core/src/types.ts:264](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L264) -*** +--- ### userId @@ -42,9 +42,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[packages/core/src/types.ts:263](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L263) +[packages/core/src/types.ts:265](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L265) -*** +--- ### roomId @@ -52,9 +52,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[packages/core/src/types.ts:264](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L264) +[packages/core/src/types.ts:266](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L266) -*** +--- ### status @@ -62,9 +62,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[packages/core/src/types.ts:265](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L265) +[packages/core/src/types.ts:267](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L267) -*** +--- ### createdAt? @@ -72,4 +72,4 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[packages/core/src/types.ts:266](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L266) +[packages/core/src/types.ts:268](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L268) diff --git a/docs/api/interfaces/Room.md b/docs/api/interfaces/Room.md index 7ee81f19fb0..ab9ce15c57a 100644 --- a/docs/api/interfaces/Room.md +++ b/docs/api/interfaces/Room.md @@ -12,9 +12,9 @@ Represents a room or conversation context, including its ID and a list of partic #### Defined in -[packages/core/src/types.ts:293](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L293) +[packages/core/src/types.ts:295](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L295) -*** +--- ### participants @@ -22,4 +22,4 @@ Represents a room or conversation context, including its ID and a list of partic #### Defined in -[packages/core/src/types.ts:294](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L294) +[packages/core/src/types.ts:296](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L296) diff --git a/docs/api/interfaces/State.md b/docs/api/interfaces/State.md index d35b3f51590..6897899d263 100644 --- a/docs/api/interfaces/State.md +++ b/docs/api/interfaces/State.md @@ -6,7 +6,7 @@ Represents the state of the conversation or context in which the agent is operat ## Indexable - \[`key`: `string`\]: `unknown` +\[`key`: `string`\]: `unknown` ## Properties @@ -16,9 +16,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:137](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L137) +[packages/core/src/types.ts:139](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L139) -*** +--- ### agentId? @@ -26,9 +26,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:138](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L138) +[packages/core/src/types.ts:140](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L140) -*** +--- ### bio @@ -36,9 +36,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:139](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L139) +[packages/core/src/types.ts:141](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L141) -*** +--- ### lore @@ -46,9 +46,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:140](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L140) +[packages/core/src/types.ts:142](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L142) -*** +--- ### messageDirections @@ -56,9 +56,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:141](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L141) +[packages/core/src/types.ts:143](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L143) -*** +--- ### postDirections @@ -66,9 +66,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:142](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L142) +[packages/core/src/types.ts:144](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L144) -*** +--- ### roomId @@ -76,9 +76,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:143](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L143) +[packages/core/src/types.ts:145](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L145) -*** +--- ### agentName? @@ -86,9 +86,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:144](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L144) +[packages/core/src/types.ts:146](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L146) -*** +--- ### senderName? @@ -96,9 +96,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:145](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L145) +[packages/core/src/types.ts:147](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L147) -*** +--- ### actors @@ -106,9 +106,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:146](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L146) +[packages/core/src/types.ts:148](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L148) -*** +--- ### actorsData? @@ -116,9 +116,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:147](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L147) +[packages/core/src/types.ts:149](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L149) -*** +--- ### goals? @@ -126,9 +126,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:148](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L148) +[packages/core/src/types.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L150) -*** +--- ### goalsData? @@ -136,9 +136,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:149](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L149) +[packages/core/src/types.ts:151](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L151) -*** +--- ### recentMessages @@ -146,9 +146,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L150) +[packages/core/src/types.ts:152](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L152) -*** +--- ### recentMessagesData @@ -156,9 +156,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:151](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L151) +[packages/core/src/types.ts:153](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L153) -*** +--- ### actionNames? @@ -166,9 +166,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:152](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L152) +[packages/core/src/types.ts:154](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L154) -*** +--- ### actions? @@ -176,9 +176,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:153](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L153) +[packages/core/src/types.ts:155](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L155) -*** +--- ### actionsData? @@ -186,9 +186,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:154](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L154) +[packages/core/src/types.ts:156](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L156) -*** +--- ### actionExamples? @@ -196,9 +196,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:155](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L155) +[packages/core/src/types.ts:157](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L157) -*** +--- ### providers? @@ -206,9 +206,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:156](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L156) +[packages/core/src/types.ts:158](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L158) -*** +--- ### responseData? @@ -216,9 +216,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:157](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L157) +[packages/core/src/types.ts:159](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L159) -*** +--- ### recentInteractionsData? @@ -226,9 +226,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:158](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L158) +[packages/core/src/types.ts:160](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L160) -*** +--- ### recentInteractions? @@ -236,4 +236,4 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[packages/core/src/types.ts:159](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L159) +[packages/core/src/types.ts:161](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L161) diff --git a/docs/api/type-aliases/Character.md b/docs/api/type-aliases/Character.md index 62f9dbfbd73..508aefc3a30 100644 --- a/docs/api/type-aliases/Character.md +++ b/docs/api/type-aliases/Character.md @@ -32,7 +32,7 @@ #### Index Signature - \[`key`: `string`\]: `string` +\[`key`: `string`\]: `string` ### bio @@ -84,7 +84,7 @@ #### Index Signature - \[`key`: `string`\]: `string` +\[`key`: `string`\]: `string` ### settings.voice? @@ -106,6 +106,34 @@ > `optional` **embeddingModel**: `string` +### clientConfig? + +> `optional` **clientConfig**: `object` + +### clientConfig.discord? + +> `optional` **discord**: `object` + +### clientConfig.discord.shouldIgnoreBotMessages? + +> `optional` **shouldIgnoreBotMessages**: `boolean` + +### clientConfig.discord.shouldIgnoreDirectMessages? + +> `optional` **shouldIgnoreDirectMessages**: `boolean` + +### clientConfig.telegram? + +> `optional` **telegram**: `object` + +### clientConfig.telegram.shouldIgnoreBotMessages? + +> `optional` **shouldIgnoreBotMessages**: `boolean` + +### clientConfig.telegram.shouldIgnoreDirectMessages? + +> `optional` **shouldIgnoreDirectMessages**: `boolean` + ### style > **style**: `object` @@ -124,4 +152,4 @@ ## Defined in -[packages/core/src/types.ts:327](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L327) +[packages/core/src/types.ts:329](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L329) diff --git a/docs/api/type-aliases/Client.md b/docs/api/type-aliases/Client.md index 6f727494795..879d6f28ff3 100644 --- a/docs/api/type-aliases/Client.md +++ b/docs/api/type-aliases/Client.md @@ -32,4 +32,4 @@ ## Defined in -[packages/core/src/types.ts:306](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L306) +[packages/core/src/types.ts:308](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L308) diff --git a/docs/api/type-aliases/Handler.md b/docs/api/type-aliases/Handler.md index a6cb7ca5368..8ffed758e95 100644 --- a/docs/api/type-aliases/Handler.md +++ b/docs/api/type-aliases/Handler.md @@ -24,4 +24,4 @@ Represents the type of a handler function, which takes a runtime instance, a mes ## Defined in -[packages/core/src/types.ts:188](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L188) +[packages/core/src/types.ts:190](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L190) diff --git a/docs/api/type-aliases/HandlerCallback.md b/docs/api/type-aliases/HandlerCallback.md index 003cf41a55c..a87d3bc1492 100644 --- a/docs/api/type-aliases/HandlerCallback.md +++ b/docs/api/type-aliases/HandlerCallback.md @@ -16,4 +16,4 @@ ## Defined in -[packages/core/src/types.ts:197](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L197) +[packages/core/src/types.ts:199](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L199) diff --git a/docs/api/type-aliases/Media.md b/docs/api/type-aliases/Media.md index e9a35a68f1c..93ee9f6be99 100644 --- a/docs/api/type-aliases/Media.md +++ b/docs/api/type-aliases/Media.md @@ -32,4 +32,4 @@ ## Defined in -[packages/core/src/types.ts:297](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L297) +[packages/core/src/types.ts:299](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L299) diff --git a/docs/api/type-aliases/Model.md b/docs/api/type-aliases/Model.md index de42259011c..4d5a45b9d59 100644 --- a/docs/api/type-aliases/Model.md +++ b/docs/api/type-aliases/Model.md @@ -22,17 +22,17 @@ > **maxOutputTokens**: `number` -### settings.frequency\_penalty? +### settings.frequency_penalty? -> `optional` **frequency\_penalty**: `number` +> `optional` **frequency_penalty**: `number` -### settings.presence\_penalty? +### settings.presence_penalty? -> `optional` **presence\_penalty**: `number` +> `optional` **presence_penalty**: `number` -### settings.repetition\_penalty? +### settings.repetition_penalty? -> `optional` **repetition\_penalty**: `number` +> `optional` **repetition_penalty**: `number` ### settings.stop diff --git a/docs/api/type-aliases/Models.md b/docs/api/type-aliases/Models.md index ca4dce75e46..ded8014918d 100644 --- a/docs/api/type-aliases/Models.md +++ b/docs/api/type-aliases/Models.md @@ -22,21 +22,21 @@ > **groq**: [`Model`](Model.md) -### llama\_cloud +### llama_cloud -> **llama\_cloud**: [`Model`](Model.md) +> **llama_cloud**: [`Model`](Model.md) -### llama\_local +### llama_local -> **llama\_local**: [`Model`](Model.md) +> **llama_local**: [`Model`](Model.md) ### google > **google**: [`Model`](Model.md) -### claude\_vertex +### claude_vertex -> **claude\_vertex**: [`Model`](Model.md) +> **claude_vertex**: [`Model`](Model.md) ### redpill @@ -50,6 +50,10 @@ > **ollama**: [`Model`](Model.md) +### heurist + +> **heurist**: [`Model`](Model.md) + ## Defined in [packages/core/src/types.ts:105](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L105) diff --git a/docs/api/type-aliases/Plugin.md b/docs/api/type-aliases/Plugin.md index c02ae1c0cd3..899286442d9 100644 --- a/docs/api/type-aliases/Plugin.md +++ b/docs/api/type-aliases/Plugin.md @@ -32,4 +32,4 @@ ## Defined in -[packages/core/src/types.ts:311](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L311) +[packages/core/src/types.ts:313](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L313) diff --git a/docs/api/type-aliases/Validator.md b/docs/api/type-aliases/Validator.md index ef6702f34af..fd501b16b49 100644 --- a/docs/api/type-aliases/Validator.md +++ b/docs/api/type-aliases/Validator.md @@ -20,4 +20,4 @@ Represents the type of a validator function, which takes a runtime instance, a m ## Defined in -[packages/core/src/types.ts:205](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L205) +[packages/core/src/types.ts:207](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L207) diff --git a/docs/api/typedoc-sidebar.cjs b/docs/api/typedoc-sidebar.cjs index 0e9b1029c7c..cb7e9697647 100644 --- a/docs/api/typedoc-sidebar.cjs +++ b/docs/api/typedoc-sidebar.cjs @@ -1,4 +1,352 @@ // @ts-check /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ -const typedocSidebar = { items: [{"type":"category","label":"Enumerations","items":[{"type":"doc","id":"enumerations/GoalStatus","label":"GoalStatus"},{"type":"doc","id":"enumerations/ModelClass","label":"ModelClass"},{"type":"doc","id":"enumerations/ModelProviderName","label":"ModelProviderName"},{"type":"doc","id":"enumerations/Clients","label":"Clients"},{"type":"doc","id":"enumerations/ServiceType","label":"ServiceType"}]},{"type":"category","label":"Classes","items":[{"type":"doc","id":"classes/DatabaseAdapter","label":"DatabaseAdapter"},{"type":"doc","id":"classes/MemoryManager","label":"MemoryManager"},{"type":"doc","id":"classes/AgentRuntime","label":"AgentRuntime"},{"type":"doc","id":"classes/Service","label":"Service"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"interfaces/Content","label":"Content"},{"type":"doc","id":"interfaces/ActionExample","label":"ActionExample"},{"type":"doc","id":"interfaces/ConversationExample","label":"ConversationExample"},{"type":"doc","id":"interfaces/Actor","label":"Actor"},{"type":"doc","id":"interfaces/Objective","label":"Objective"},{"type":"doc","id":"interfaces/Goal","label":"Goal"},{"type":"doc","id":"interfaces/State","label":"State"},{"type":"doc","id":"interfaces/Memory","label":"Memory"},{"type":"doc","id":"interfaces/MessageExample","label":"MessageExample"},{"type":"doc","id":"interfaces/Action","label":"Action"},{"type":"doc","id":"interfaces/EvaluationExample","label":"EvaluationExample"},{"type":"doc","id":"interfaces/Evaluator","label":"Evaluator"},{"type":"doc","id":"interfaces/Provider","label":"Provider"},{"type":"doc","id":"interfaces/Relationship","label":"Relationship"},{"type":"doc","id":"interfaces/Account","label":"Account"},{"type":"doc","id":"interfaces/Participant","label":"Participant"},{"type":"doc","id":"interfaces/Room","label":"Room"},{"type":"doc","id":"interfaces/IDatabaseAdapter","label":"IDatabaseAdapter"},{"type":"doc","id":"interfaces/IMemoryManager","label":"IMemoryManager"},{"type":"doc","id":"interfaces/IAgentRuntime","label":"IAgentRuntime"},{"type":"doc","id":"interfaces/IImageDescriptionService","label":"IImageDescriptionService"},{"type":"doc","id":"interfaces/ITranscriptionService","label":"ITranscriptionService"},{"type":"doc","id":"interfaces/IVideoService","label":"IVideoService"},{"type":"doc","id":"interfaces/ITextGenerationService","label":"ITextGenerationService"},{"type":"doc","id":"interfaces/IBrowserService","label":"IBrowserService"},{"type":"doc","id":"interfaces/ISpeechService","label":"ISpeechService"},{"type":"doc","id":"interfaces/IPdfService","label":"IPdfService"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"type-aliases/UUID","label":"UUID"},{"type":"doc","id":"type-aliases/Model","label":"Model"},{"type":"doc","id":"type-aliases/Models","label":"Models"},{"type":"doc","id":"type-aliases/Handler","label":"Handler"},{"type":"doc","id":"type-aliases/HandlerCallback","label":"HandlerCallback"},{"type":"doc","id":"type-aliases/Validator","label":"Validator"},{"type":"doc","id":"type-aliases/Media","label":"Media"},{"type":"doc","id":"type-aliases/Client","label":"Client"},{"type":"doc","id":"type-aliases/Plugin","label":"Plugin"},{"type":"doc","id":"type-aliases/Character","label":"Character"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"variables/defaultCharacter","label":"defaultCharacter"},{"type":"doc","id":"variables/evaluationTemplate","label":"evaluationTemplate"},{"type":"doc","id":"variables/elizaLogger","label":"elizaLogger"},{"type":"doc","id":"variables/embeddingDimension","label":"embeddingDimension"},{"type":"doc","id":"variables/embeddingZeroVector","label":"embeddingZeroVector"},{"type":"doc","id":"variables/settings","label":"settings"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"functions/composeActionExamples","label":"composeActionExamples"},{"type":"doc","id":"functions/formatActionNames","label":"formatActionNames"},{"type":"doc","id":"functions/formatActions","label":"formatActions"},{"type":"doc","id":"functions/composeContext","label":"composeContext"},{"type":"doc","id":"functions/addHeader","label":"addHeader"},{"type":"doc","id":"functions/embed","label":"embed"},{"type":"doc","id":"functions/retrieveCachedEmbedding","label":"retrieveCachedEmbedding"},{"type":"doc","id":"functions/formatEvaluatorNames","label":"formatEvaluatorNames"},{"type":"doc","id":"functions/formatEvaluators","label":"formatEvaluators"},{"type":"doc","id":"functions/formatEvaluatorExamples","label":"formatEvaluatorExamples"},{"type":"doc","id":"functions/formatEvaluatorExampleDescriptions","label":"formatEvaluatorExampleDescriptions"},{"type":"doc","id":"functions/generateText","label":"generateText"},{"type":"doc","id":"functions/trimTokens","label":"trimTokens"},{"type":"doc","id":"functions/generateShouldRespond","label":"generateShouldRespond"},{"type":"doc","id":"functions/splitChunks","label":"splitChunks"},{"type":"doc","id":"functions/generateTrueOrFalse","label":"generateTrueOrFalse"},{"type":"doc","id":"functions/generateTextArray","label":"generateTextArray"},{"type":"doc","id":"functions/generateObject","label":"generateObject"},{"type":"doc","id":"functions/generateObjectArray","label":"generateObjectArray"},{"type":"doc","id":"functions/generateMessageResponse","label":"generateMessageResponse"},{"type":"doc","id":"functions/generateImage","label":"generateImage"},{"type":"doc","id":"functions/generateCaption","label":"generateCaption"},{"type":"doc","id":"functions/getGoals","label":"getGoals"},{"type":"doc","id":"functions/formatGoalsAsString","label":"formatGoalsAsString"},{"type":"doc","id":"functions/updateGoal","label":"updateGoal"},{"type":"doc","id":"functions/createGoal","label":"createGoal"},{"type":"doc","id":"functions/getActorDetails","label":"getActorDetails"},{"type":"doc","id":"functions/formatActors","label":"formatActors"},{"type":"doc","id":"functions/formatMessages","label":"formatMessages"},{"type":"doc","id":"functions/formatTimestamp","label":"formatTimestamp"},{"type":"doc","id":"functions/getModel","label":"getModel"},{"type":"doc","id":"functions/getEndpoint","label":"getEndpoint"},{"type":"doc","id":"functions/formatPosts","label":"formatPosts"},{"type":"doc","id":"functions/getProviders","label":"getProviders"},{"type":"doc","id":"functions/createRelationship","label":"createRelationship"},{"type":"doc","id":"functions/getRelationship","label":"getRelationship"},{"type":"doc","id":"functions/getRelationships","label":"getRelationships"},{"type":"doc","id":"functions/formatRelationships","label":"formatRelationships"},{"type":"doc","id":"functions/findNearestEnvFile","label":"findNearestEnvFile"},{"type":"doc","id":"functions/loadEnvConfig","label":"loadEnvConfig"}]}]}; -module.exports = typedocSidebar.items; \ No newline at end of file +const typedocSidebar = { + items: [ + { + type: "category", + label: "Enumerations", + items: [ + { type: "doc", id: "enumerations/GoalStatus", label: "GoalStatus" }, + { type: "doc", id: "enumerations/ModelClass", label: "ModelClass" }, + { + type: "doc", + id: "enumerations/ModelProviderName", + label: "ModelProviderName", + }, + { type: "doc", id: "enumerations/Clients", label: "Clients" }, + { type: "doc", id: "enumerations/ServiceType", label: "ServiceType" }, + ], + }, + { + type: "category", + label: "Classes", + items: [ + { + type: "doc", + id: "classes/DatabaseAdapter", + label: "DatabaseAdapter", + }, + { type: "doc", id: "classes/MemoryManager", label: "MemoryManager" }, + { type: "doc", id: "classes/AgentRuntime", label: "AgentRuntime" }, + { type: "doc", id: "classes/Service", label: "Service" }, + ], + }, + { + type: "category", + label: "Interfaces", + items: [ + { + type: "doc", + id: "interfaces/GenerationOptions", + label: "GenerationOptions", + }, + { type: "doc", id: "interfaces/Content", label: "Content" }, + { type: "doc", id: "interfaces/ActionExample", label: "ActionExample" }, + { + type: "doc", + id: "interfaces/ConversationExample", + label: "ConversationExample", + }, + { type: "doc", id: "interfaces/Actor", label: "Actor" }, + { type: "doc", id: "interfaces/Objective", label: "Objective" }, + { type: "doc", id: "interfaces/Goal", label: "Goal" }, + { type: "doc", id: "interfaces/State", label: "State" }, + { type: "doc", id: "interfaces/Memory", label: "Memory" }, + { + type: "doc", + id: "interfaces/MessageExample", + label: "MessageExample", + }, + { type: "doc", id: "interfaces/Action", label: "Action" }, + { + type: "doc", + id: "interfaces/EvaluationExample", + label: "EvaluationExample", + }, + { type: "doc", id: "interfaces/Evaluator", label: "Evaluator" }, + { type: "doc", id: "interfaces/Provider", label: "Provider" }, + { type: "doc", id: "interfaces/Relationship", label: "Relationship" }, + { type: "doc", id: "interfaces/Account", label: "Account" }, + { type: "doc", id: "interfaces/Participant", label: "Participant" }, + { type: "doc", id: "interfaces/Room", label: "Room" }, + { + type: "doc", + id: "interfaces/IDatabaseAdapter", + label: "IDatabaseAdapter", + }, + { + type: "doc", + id: "interfaces/IMemoryManager", + label: "IMemoryManager", + }, + { type: "doc", id: "interfaces/IAgentRuntime", label: "IAgentRuntime" }, + { + type: "doc", + id: "interfaces/IImageDescriptionService", + label: "IImageDescriptionService", + }, + { + type: "doc", + id: "interfaces/ITranscriptionService", + label: "ITranscriptionService", + }, + { type: "doc", id: "interfaces/IVideoService", label: "IVideoService" }, + { + type: "doc", + id: "interfaces/ITextGenerationService", + label: "ITextGenerationService", + }, + { + type: "doc", + id: "interfaces/IBrowserService", + label: "IBrowserService", + }, + { + type: "doc", + id: "interfaces/ISpeechService", + label: "ISpeechService", + }, + { type: "doc", id: "interfaces/IPdfService", label: "IPdfService" }, + ], + }, + { + type: "category", + label: "Type Aliases", + items: [ + { type: "doc", id: "type-aliases/UUID", label: "UUID" }, + { type: "doc", id: "type-aliases/Model", label: "Model" }, + { type: "doc", id: "type-aliases/Models", label: "Models" }, + { type: "doc", id: "type-aliases/Handler", label: "Handler" }, + { + type: "doc", + id: "type-aliases/HandlerCallback", + label: "HandlerCallback", + }, + { type: "doc", id: "type-aliases/Validator", label: "Validator" }, + { type: "doc", id: "type-aliases/Media", label: "Media" }, + { type: "doc", id: "type-aliases/Client", label: "Client" }, + { type: "doc", id: "type-aliases/Plugin", label: "Plugin" }, + { type: "doc", id: "type-aliases/Character", label: "Character" }, + ], + }, + { + type: "category", + label: "Variables", + items: [ + { + type: "doc", + id: "variables/defaultCharacter", + label: "defaultCharacter", + }, + { + type: "doc", + id: "variables/evaluationTemplate", + label: "evaluationTemplate", + }, + { type: "doc", id: "variables/elizaLogger", label: "elizaLogger" }, + { + type: "doc", + id: "variables/embeddingDimension", + label: "embeddingDimension", + }, + { + type: "doc", + id: "variables/embeddingZeroVector", + label: "embeddingZeroVector", + }, + { type: "doc", id: "variables/models", label: "models" }, + { + type: "doc", + id: "variables/messageCompletionFooter", + label: "messageCompletionFooter", + }, + { + type: "doc", + id: "variables/shouldRespondFooter", + label: "shouldRespondFooter", + }, + { type: "doc", id: "variables/booleanFooter", label: "booleanFooter" }, + { + type: "doc", + id: "variables/stringArrayFooter", + label: "stringArrayFooter", + }, + { type: "doc", id: "variables/settings", label: "settings" }, + ], + }, + { + type: "category", + label: "Functions", + items: [ + { + type: "doc", + id: "functions/composeActionExamples", + label: "composeActionExamples", + }, + { + type: "doc", + id: "functions/formatActionNames", + label: "formatActionNames", + }, + { type: "doc", id: "functions/formatActions", label: "formatActions" }, + { + type: "doc", + id: "functions/composeContext", + label: "composeContext", + }, + { type: "doc", id: "functions/addHeader", label: "addHeader" }, + { type: "doc", id: "functions/embed", label: "embed" }, + { + type: "doc", + id: "functions/retrieveCachedEmbedding", + label: "retrieveCachedEmbedding", + }, + { + type: "doc", + id: "functions/formatEvaluatorNames", + label: "formatEvaluatorNames", + }, + { + type: "doc", + id: "functions/formatEvaluators", + label: "formatEvaluators", + }, + { + type: "doc", + id: "functions/formatEvaluatorExamples", + label: "formatEvaluatorExamples", + }, + { + type: "doc", + id: "functions/formatEvaluatorExampleDescriptions", + label: "formatEvaluatorExampleDescriptions", + }, + { type: "doc", id: "functions/generateText", label: "generateText" }, + { type: "doc", id: "functions/trimTokens", label: "trimTokens" }, + { + type: "doc", + id: "functions/generateShouldRespond", + label: "generateShouldRespond", + }, + { type: "doc", id: "functions/splitChunks", label: "splitChunks" }, + { + type: "doc", + id: "functions/generateTrueOrFalse", + label: "generateTrueOrFalse", + }, + { + type: "doc", + id: "functions/generateTextArray", + label: "generateTextArray", + }, + { + type: "doc", + id: "functions/generateObject", + label: "generateObject", + }, + { + type: "doc", + id: "functions/generateObjectArray", + label: "generateObjectArray", + }, + { + type: "doc", + id: "functions/generateMessageResponse", + label: "generateMessageResponse", + }, + { type: "doc", id: "functions/generateImage", label: "generateImage" }, + { + type: "doc", + id: "functions/generateCaption", + label: "generateCaption", + }, + { + type: "doc", + id: "functions/generateObjectV2", + label: "generateObjectV2", + }, + { + type: "doc", + id: "functions/handleProvider", + label: "handleProvider", + }, + { type: "doc", id: "functions/getGoals", label: "getGoals" }, + { + type: "doc", + id: "functions/formatGoalsAsString", + label: "formatGoalsAsString", + }, + { type: "doc", id: "functions/updateGoal", label: "updateGoal" }, + { type: "doc", id: "functions/createGoal", label: "createGoal" }, + { + type: "doc", + id: "functions/getActorDetails", + label: "getActorDetails", + }, + { type: "doc", id: "functions/formatActors", label: "formatActors" }, + { + type: "doc", + id: "functions/formatMessages", + label: "formatMessages", + }, + { + type: "doc", + id: "functions/formatTimestamp", + label: "formatTimestamp", + }, + { type: "doc", id: "functions/getModel", label: "getModel" }, + { type: "doc", id: "functions/getEndpoint", label: "getEndpoint" }, + { + type: "doc", + id: "functions/parseShouldRespondFromText", + label: "parseShouldRespondFromText", + }, + { + type: "doc", + id: "functions/parseBooleanFromText", + label: "parseBooleanFromText", + }, + { + type: "doc", + id: "functions/parseJsonArrayFromText", + label: "parseJsonArrayFromText", + }, + { + type: "doc", + id: "functions/parseJSONObjectFromText", + label: "parseJSONObjectFromText", + }, + { type: "doc", id: "functions/formatPosts", label: "formatPosts" }, + { type: "doc", id: "functions/getProviders", label: "getProviders" }, + { + type: "doc", + id: "functions/createRelationship", + label: "createRelationship", + }, + { + type: "doc", + id: "functions/getRelationship", + label: "getRelationship", + }, + { + type: "doc", + id: "functions/getRelationships", + label: "getRelationships", + }, + { + type: "doc", + id: "functions/formatRelationships", + label: "formatRelationships", + }, + { + type: "doc", + id: "functions/findNearestEnvFile", + label: "findNearestEnvFile", + }, + { type: "doc", id: "functions/loadEnvConfig", label: "loadEnvConfig" }, + { type: "doc", id: "functions/stringToUuid", label: "stringToUuid" }, + ], + }, + ], +}; +module.exports = typedocSidebar.items; diff --git a/docs/api/variables/booleanFooter.md b/docs/api/variables/booleanFooter.md new file mode 100644 index 00000000000..f2489169e3b --- /dev/null +++ b/docs/api/variables/booleanFooter.md @@ -0,0 +1,9 @@ +[@ai16z/eliza v1.0.0](../index.md) / booleanFooter + +# Variable: booleanFooter + +> `const` **booleanFooter**: `"Respond with a YES or a NO."` + +## Defined in + +[packages/core/src/parsing.ts:34](https://github.com/ai16z/eliza/blob/main/packages/core/src/parsing.ts#L34) diff --git a/docs/api/variables/messageCompletionFooter.md b/docs/api/variables/messageCompletionFooter.md new file mode 100644 index 00000000000..6b57fe329eb --- /dev/null +++ b/docs/api/variables/messageCompletionFooter.md @@ -0,0 +1,9 @@ +[@ai16z/eliza v1.0.0](../index.md) / messageCompletionFooter + +# Variable: messageCompletionFooter + +> `const` **messageCompletionFooter**: "\nResponse format should be formatted in a JSON block like this:\n\`\`\`json\n\{ \"user\": \"\{\{agentName\}\}\", \"text\": string, \"action\": \"string\" \}\n\`\`\`" + +## Defined in + +[packages/core/src/parsing.ts:3](https://github.com/ai16z/eliza/blob/main/packages/core/src/parsing.ts#L3) diff --git a/docs/api/variables/models.md b/docs/api/variables/models.md new file mode 100644 index 00000000000..f4fdacf4adf --- /dev/null +++ b/docs/api/variables/models.md @@ -0,0 +1,9 @@ +[@ai16z/eliza v1.0.0](../index.md) / models + +# Variable: models + +> `const` **models**: [`Models`](../type-aliases/Models.md) + +## Defined in + +[packages/core/src/models.ts:4](https://github.com/ai16z/eliza/blob/main/packages/core/src/models.ts#L4) diff --git a/docs/api/variables/shouldRespondFooter.md b/docs/api/variables/shouldRespondFooter.md new file mode 100644 index 00000000000..69acacb8d55 --- /dev/null +++ b/docs/api/variables/shouldRespondFooter.md @@ -0,0 +1,9 @@ +[@ai16z/eliza v1.0.0](../index.md) / shouldRespondFooter + +# Variable: shouldRespondFooter + +> `const` **shouldRespondFooter**: "The available options are \[RESPOND\], \[IGNORE\], or \[STOP\]. Choose the most appropriate option.\nIf \{\{agentName\}\} is talking too much, you can choose \[IGNORE\]\n\nYour response must include one of the options." + +## Defined in + +[packages/core/src/parsing.ts:8](https://github.com/ai16z/eliza/blob/main/packages/core/src/parsing.ts#L8) diff --git a/docs/api/variables/stringArrayFooter.md b/docs/api/variables/stringArrayFooter.md new file mode 100644 index 00000000000..c44ee2b3f8d --- /dev/null +++ b/docs/api/variables/stringArrayFooter.md @@ -0,0 +1,9 @@ +[@ai16z/eliza v1.0.0](../index.md) / stringArrayFooter + +# Variable: stringArrayFooter + +> `const` **stringArrayFooter**: "Respond with a JSON array containing the values in a JSON block formatted for markdown with this structure:\n\`\`\`json\n\[\n 'value',\n 'value'\n\]\n\`\`\`\n\nYour response must include the JSON block." + +## Defined in + +[packages/core/src/parsing.ts:41](https://github.com/ai16z/eliza/blob/main/packages/core/src/parsing.ts#L41) diff --git a/docs/docs/advanced/autonomous-trading.md b/docs/docs/advanced/autonomous-trading.md index 68008c484a5..89220f1db9a 100644 --- a/docs/docs/advanced/autonomous-trading.md +++ b/docs/docs/advanced/autonomous-trading.md @@ -11,37 +11,38 @@ Eliza's autonomous trading system enables automated token trading on the Solana ## Core Components ### Token Provider + Manages token information and market data: ```typescript class TokenProvider { - constructor( - private tokenAddress: string, - private walletProvider: WalletProvider - ) { - this.cache = new NodeCache({ stdTTL: 300 }); // 5 minutes cache - } - - async fetchPrices(): Promise { - const { SOL, BTC, ETH } = TOKEN_ADDRESSES; - // Fetch current prices - return { - solana: { usd: "0" }, - bitcoin: { usd: "0" }, - ethereum: { usd: "0" } - }; - } - - async getProcessedTokenData(): Promise { - return { - security: await this.fetchTokenSecurity(), - tradeData: await this.fetchTokenTradeData(), - holderDistributionTrend: await this.analyzeHolderDistribution(), - highValueHolders: await this.filterHighValueHolders(), - recentTrades: await this.checkRecentTrades(), - dexScreenerData: await this.fetchDexScreenerData() - }; - } + constructor( + private tokenAddress: string, + private walletProvider: WalletProvider, + ) { + this.cache = new NodeCache({ stdTTL: 300 }); // 5 minutes cache + } + + async fetchPrices(): Promise { + const { SOL, BTC, ETH } = TOKEN_ADDRESSES; + // Fetch current prices + return { + solana: { usd: "0" }, + bitcoin: { usd: "0" }, + ethereum: { usd: "0" }, + }; + } + + async getProcessedTokenData(): Promise { + return { + security: await this.fetchTokenSecurity(), + tradeData: await this.fetchTokenTradeData(), + holderDistributionTrend: await this.analyzeHolderDistribution(), + highValueHolders: await this.filterHighValueHolders(), + recentTrades: await this.checkRecentTrades(), + dexScreenerData: await this.fetchDexScreenerData(), + }; + } } ``` @@ -51,35 +52,35 @@ Implementation of token swaps using Jupiter: ```typescript async function swapToken( - connection: Connection, - walletPublicKey: PublicKey, - inputTokenCA: string, - outputTokenCA: string, - amount: number + connection: Connection, + walletPublicKey: PublicKey, + inputTokenCA: string, + outputTokenCA: string, + amount: number, ): Promise { - // Get token decimals - const decimals = await getTokenDecimals(connection, inputTokenCA); - const adjustedAmount = amount * (10 ** decimals); - - // Fetch quote - const quoteResponse = await fetch( - `https://quote-api.jup.ag/v6/quote?inputMint=${inputTokenCA}` + - `&outputMint=${outputTokenCA}` + - `&amount=${adjustedAmount}` + - `&slippageBps=50` - ); - - // Execute swap - const swapResponse = await fetch("https://quote-api.jup.ag/v6/swap", { - method: "POST", - body: JSON.stringify({ - quoteResponse: await quoteResponse.json(), - userPublicKey: walletPublicKey.toString(), - wrapAndUnwrapSol: true - }) - }); - - return swapResponse.json(); + // Get token decimals + const decimals = await getTokenDecimals(connection, inputTokenCA); + const adjustedAmount = amount * 10 ** decimals; + + // Fetch quote + const quoteResponse = await fetch( + `https://quote-api.jup.ag/v6/quote?inputMint=${inputTokenCA}` + + `&outputMint=${outputTokenCA}` + + `&amount=${adjustedAmount}` + + `&slippageBps=50`, + ); + + // Execute swap + const swapResponse = await fetch("https://quote-api.jup.ag/v6/swap", { + method: "POST", + body: JSON.stringify({ + quoteResponse: await quoteResponse.json(), + userPublicKey: walletPublicKey.toString(), + wrapAndUnwrapSol: true, + }), + }); + + return swapResponse.json(); } ``` @@ -89,29 +90,29 @@ async function swapToken( ```typescript interface Order { - userId: string; - ticker: string; - contractAddress: string; - timestamp: string; - buyAmount: number; - price: number; + userId: string; + ticker: string; + contractAddress: string; + timestamp: string; + buyAmount: number; + price: number; } class OrderBookProvider { - async addOrder(order: Order): Promise { - let orderBook = await this.readOrderBook(); - orderBook.push(order); - await this.writeOrderBook(orderBook); - } - - async calculateProfitLoss(userId: string): Promise { - const orders = await this.getUserOrders(userId); - return orders.reduce((total, order) => { - const currentPrice = this.getCurrentPrice(order.ticker); - const pl = (currentPrice - order.price) * order.buyAmount; - return total + pl; - }, 0); - } + async addOrder(order: Order): Promise { + let orderBook = await this.readOrderBook(); + orderBook.push(order); + await this.writeOrderBook(orderBook); + } + + async calculateProfitLoss(userId: string): Promise { + const orders = await this.getUserOrders(userId); + return orders.reduce((total, order) => { + const currentPrice = this.getCurrentPrice(order.ticker); + const pl = (currentPrice - order.price) * order.buyAmount; + return total + pl; + }, 0); + } } ``` @@ -119,24 +120,24 @@ class OrderBookProvider { ```typescript async function calculatePositionSize( - tokenData: ProcessedTokenData, - riskLevel: "LOW" | "MEDIUM" | "HIGH" + tokenData: ProcessedTokenData, + riskLevel: "LOW" | "MEDIUM" | "HIGH", ): Promise { - const { liquidity, marketCap } = tokenData.dexScreenerData.pairs[0]; - - // Impact percentages based on liquidity - const impactPercentages = { - LOW: 0.01, // 1% of liquidity - MEDIUM: 0.05, // 5% of liquidity - HIGH: 0.1 // 10% of liquidity - }; - - return { - none: 0, - low: liquidity.usd * impactPercentages.LOW, - medium: liquidity.usd * impactPercentages.MEDIUM, - high: liquidity.usd * impactPercentages.HIGH - }; + const { liquidity, marketCap } = tokenData.dexScreenerData.pairs[0]; + + // Impact percentages based on liquidity + const impactPercentages = { + LOW: 0.01, // 1% of liquidity + MEDIUM: 0.05, // 5% of liquidity + HIGH: 0.1, // 10% of liquidity + }; + + return { + none: 0, + low: liquidity.usd * impactPercentages.LOW, + medium: liquidity.usd * impactPercentages.MEDIUM, + high: liquidity.usd * impactPercentages.HIGH, + }; } ``` @@ -146,28 +147,29 @@ async function calculatePositionSize( ```typescript async function validateToken(token: TokenPerformance): Promise { - const security = await fetchTokenSecurity(token.tokenAddress); - - // Red flags check - if ( - security.rugPull || - security.isScam || - token.rapidDump || - token.suspiciousVolume || - token.liquidity.usd < 1000 || // Minimum $1000 liquidity - token.marketCap < 100000 // Minimum $100k market cap - ) { - return false; - } - - // Holder distribution check - const holderData = await fetchHolderList(token.tokenAddress); - const topHolderPercent = calculateTopHolderPercentage(holderData); - if (topHolderPercent > 0.5) { // >50% held by top holders - return false; - } - - return true; + const security = await fetchTokenSecurity(token.tokenAddress); + + // Red flags check + if ( + security.rugPull || + security.isScam || + token.rapidDump || + token.suspiciousVolume || + token.liquidity.usd < 1000 || // Minimum $1000 liquidity + token.marketCap < 100000 // Minimum $100k market cap + ) { + return false; + } + + // Holder distribution check + const holderData = await fetchHolderList(token.tokenAddress); + const topHolderPercent = calculateTopHolderPercentage(holderData); + if (topHolderPercent > 0.5) { + // >50% held by top holders + return false; + } + + return true; } ``` @@ -202,31 +204,29 @@ interface TradeManager { ```typescript async function collectMarketData( - tokenAddress: string + tokenAddress: string, ): Promise { - return { - price: await fetchCurrentPrice(tokenAddress), - volume_24h: await fetch24HourVolume(tokenAddress), - price_change_24h: await fetch24HourPriceChange(tokenAddress), - liquidity: await fetchLiquidity(tokenAddress), - holder_data: await fetchHolderData(tokenAddress), - trade_history: await fetchTradeHistory(tokenAddress) - }; + return { + price: await fetchCurrentPrice(tokenAddress), + volume_24h: await fetch24HourVolume(tokenAddress), + price_change_24h: await fetch24HourPriceChange(tokenAddress), + liquidity: await fetchLiquidity(tokenAddress), + holder_data: await fetchHolderData(tokenAddress), + trade_history: await fetchTradeHistory(tokenAddress), + }; } ``` ### Technical Analysis ```typescript -function analyzeMarketConditions( - tradeData: TokenTradeData -): MarketAnalysis { - return { - trend: analyzePriceTrend(tradeData.price_history), - volume_profile: analyzeVolumeProfile(tradeData.volume_history), - liquidity_depth: analyzeLiquidityDepth(tradeData.liquidity), - holder_behavior: analyzeHolderBehavior(tradeData.holder_data) - }; +function analyzeMarketConditions(tradeData: TokenTradeData): MarketAnalysis { + return { + trend: analyzePriceTrend(tradeData.price_history), + volume_profile: analyzeVolumeProfile(tradeData.volume_history), + liquidity_depth: analyzeLiquidityDepth(tradeData.liquidity), + holder_behavior: analyzeHolderBehavior(tradeData.holder_data), + }; } ``` @@ -236,34 +236,34 @@ function analyzeMarketConditions( ```typescript async function executeSwap( - runtime: IAgentRuntime, - input: { - tokenIn: string, - tokenOut: string, - amountIn: number, - slippage: number - } + runtime: IAgentRuntime, + input: { + tokenIn: string; + tokenOut: string; + amountIn: number; + slippage: number; + }, ): Promise { - // Prepare transaction - const { swapTransaction } = await getSwapTransaction(input); - - // Sign transaction - const keypair = getKeypairFromPrivateKey( - runtime.getSetting("WALLET_PRIVATE_KEY") - ); - transaction.sign([keypair]); - - // Execute swap - const signature = await connection.sendTransaction(transaction); - - // Confirm transaction - await connection.confirmTransaction({ - signature, - blockhash: latestBlockhash.blockhash, - lastValidBlockHeight: latestBlockhash.lastValidBlockHeight - }); - - return signature; + // Prepare transaction + const { swapTransaction } = await getSwapTransaction(input); + + // Sign transaction + const keypair = getKeypairFromPrivateKey( + runtime.getSetting("WALLET_PRIVATE_KEY"), + ); + transaction.sign([keypair]); + + // Execute swap + const signature = await connection.sendTransaction(transaction); + + // Confirm transaction + await connection.confirmTransaction({ + signature, + blockhash: latestBlockhash.blockhash, + lastValidBlockHeight: latestBlockhash.lastValidBlockHeight, + }); + + return signature; } ``` @@ -271,27 +271,27 @@ async function executeSwap( ```typescript async function executeSwapForDAO( - runtime: IAgentRuntime, - params: { - inputToken: string, - outputToken: string, - amount: number - } + runtime: IAgentRuntime, + params: { + inputToken: string; + outputToken: string; + amount: number; + }, ): Promise { - const authority = getAuthorityKeypair(runtime); - const [statePDA, walletPDA] = await derivePDAs(authority); - - // Prepare instruction data - const instructionData = prepareSwapInstruction(params); - - // Execute swap through DAO - return invokeSwapDao( - connection, - authority, - statePDA, - walletPDA, - instructionData - ); + const authority = getAuthorityKeypair(runtime); + const [statePDA, walletPDA] = await derivePDAs(authority); + + // Prepare instruction data + const instructionData = prepareSwapInstruction(params); + + // Execute swap through DAO + return invokeSwapDao( + connection, + authority, + statePDA, + walletPDA, + instructionData, + ); } ``` @@ -301,12 +301,12 @@ async function executeSwapForDAO( ```typescript async function performHealthChecks(): Promise { - return { - connection: await checkConnectionStatus(), - wallet: await checkWalletBalance(), - orders: await checkOpenOrders(), - positions: await checkPositions() - }; + return { + connection: await checkConnectionStatus(), + wallet: await checkWalletBalance(), + orders: await checkOpenOrders(), + positions: await checkPositions(), + }; } ``` @@ -314,11 +314,11 @@ async function performHealthChecks(): Promise { ```typescript const SAFETY_LIMITS = { - MAX_POSITION_SIZE: 0.1, // 10% of portfolio - MAX_SLIPPAGE: 0.05, // 5% slippage - MIN_LIQUIDITY: 1000, // $1000 minimum liquidity - MAX_PRICE_IMPACT: 0.03, // 3% price impact - STOP_LOSS: 0.15 // 15% stop loss + MAX_POSITION_SIZE: 0.1, // 10% of portfolio + MAX_SLIPPAGE: 0.05, // 5% slippage + MIN_LIQUIDITY: 1000, // $1000 minimum liquidity + MAX_PRICE_IMPACT: 0.03, // 3% price impact + STOP_LOSS: 0.15, // 15% stop loss }; ``` @@ -328,16 +328,16 @@ const SAFETY_LIMITS = { ```typescript async function handleTransactionError( - error: Error, - transaction: Transaction + error: Error, + transaction: Transaction, ): Promise { - if (error.message.includes('insufficient funds')) { - await handleInsufficientFunds(); - } else if (error.message.includes('slippage tolerance exceeded')) { - await handleSlippageError(transaction); - } else { - await logTransactionError(error, transaction); - } + if (error.message.includes("insufficient funds")) { + await handleInsufficientFunds(); + } else if (error.message.includes("slippage tolerance exceeded")) { + await handleSlippageError(transaction); + } else { + await logTransactionError(error, transaction); + } } ``` @@ -345,20 +345,19 @@ async function handleTransactionError( ```typescript async function recoverFromError( - error: Error, - context: TradingContext + error: Error, + context: TradingContext, ): Promise { - // Stop all active trades - await stopActiveTrades(); - - // Close risky positions - await closeRiskyPositions(); - - // Reset system state - await resetTradingState(); - - // Notify administrators - await notifyAdministrators(error, context); + // Stop all active trades + await stopActiveTrades(); + + // Close risky positions + await closeRiskyPositions(); + + // Reset system state + await resetTradingState(); + + // Notify administrators + await notifyAdministrators(error, context); } ``` - diff --git a/docs/docs/advanced/fine-tuning.md b/docs/docs/advanced/fine-tuning.md index 95cbc2bac7a..f256483a7e5 100644 --- a/docs/docs/advanced/fine-tuning.md +++ b/docs/docs/advanced/fine-tuning.md @@ -14,17 +14,17 @@ Eliza supports multiple model providers through a flexible configuration system: ```typescript enum ModelProviderName { - OPENAI, - ANTHROPIC, - CLAUDE_VERTEX, - GROK, - GROQ, - LLAMACLOUD, - LLAMALOCAL, - GOOGLE, - REDPILL, - OPENROUTER, - HEURIST + OPENAI, + ANTHROPIC, + CLAUDE_VERTEX, + GROK, + GROQ, + LLAMACLOUD, + LLAMALOCAL, + GOOGLE, + REDPILL, + OPENROUTER, + HEURIST, } ``` @@ -34,23 +34,23 @@ Each provider has specific settings: ```typescript const models = { - [ModelProviderName.ANTHROPIC]: { - settings: { - stop: [], - maxInputTokens: 200000, - maxOutputTokens: 8192, - frequency_penalty: 0.0, - presence_penalty: 0.0, - temperature: 0.3, - }, - endpoint: "https://api.anthropic.com/v1", - model: { - [ModelClass.SMALL]: "claude-3-5-haiku", - [ModelClass.MEDIUM]: "claude-3-5-sonnet-20241022", - [ModelClass.LARGE]: "claude-3-5-opus-20240229" - } + [ModelProviderName.ANTHROPIC]: { + settings: { + stop: [], + maxInputTokens: 200000, + maxOutputTokens: 8192, + frequency_penalty: 0.0, + presence_penalty: 0.0, + temperature: 0.3, + }, + endpoint: "https://api.anthropic.com/v1", + model: { + [ModelClass.SMALL]: "claude-3-5-haiku", + [ModelClass.MEDIUM]: "claude-3-5-sonnet-20241022", + [ModelClass.LARGE]: "claude-3-5-opus-20240229", }, - // ... other providers + }, + // ... other providers }; ``` @@ -74,9 +74,9 @@ enum ModelClass { ```typescript const embeddingConfig = { - dimensions: 1536, - modelName: "text-embedding-3-small", - cacheEnabled: true + dimensions: 1536, + modelName: "text-embedding-3-small", + cacheEnabled: true, }; ``` @@ -84,29 +84,29 @@ const embeddingConfig = { ```typescript async function embed(runtime: IAgentRuntime, input: string): Promise { - // Check cache first - const cachedEmbedding = await retrieveCachedEmbedding(runtime, input); - if (cachedEmbedding) return cachedEmbedding; - - // Generate new embedding - const response = await runtime.fetch( - `${runtime.modelProvider.endpoint}/embeddings`, - { - method: "POST", - headers: { - "Authorization": `Bearer ${runtime.token}`, - "Content-Type": "application/json" - }, - body: JSON.stringify({ - input, - model: runtime.modelProvider.model.EMBEDDING, - dimensions: 1536 - }) - } - ); - - const data = await response.json(); - return data?.data?.[0].embedding; + // Check cache first + const cachedEmbedding = await retrieveCachedEmbedding(runtime, input); + if (cachedEmbedding) return cachedEmbedding; + + // Generate new embedding + const response = await runtime.fetch( + `${runtime.modelProvider.endpoint}/embeddings`, + { + method: "POST", + headers: { + Authorization: `Bearer ${runtime.token}`, + "Content-Type": "application/json", + }, + body: JSON.stringify({ + input, + model: runtime.modelProvider.model.EMBEDDING, + dimensions: 1536, + }), + }, + ); + + const data = await response.json(); + return data?.data?.[0].embedding; } ``` @@ -118,21 +118,21 @@ Configure model creativity vs. determinism: ```typescript const temperatureSettings = { - creative: { - temperature: 0.8, - frequency_penalty: 0.7, - presence_penalty: 0.7 - }, - balanced: { - temperature: 0.5, - frequency_penalty: 0.3, - presence_penalty: 0.3 - }, - precise: { - temperature: 0.2, - frequency_penalty: 0.0, - presence_penalty: 0.0 - } + creative: { + temperature: 0.8, + frequency_penalty: 0.7, + presence_penalty: 0.7, + }, + balanced: { + temperature: 0.5, + frequency_penalty: 0.3, + presence_penalty: 0.3, + }, + precise: { + temperature: 0.2, + frequency_penalty: 0.0, + presence_penalty: 0.0, + }, }; ``` @@ -142,18 +142,18 @@ Manage token limits: ```typescript const contextSettings = { - OPENAI: { - maxInputTokens: 128000, - maxOutputTokens: 8192, - }, - ANTHROPIC: { - maxInputTokens: 200000, - maxOutputTokens: 8192, - }, - LLAMALOCAL: { - maxInputTokens: 32768, - maxOutputTokens: 8192, - } + OPENAI: { + maxInputTokens: 128000, + maxOutputTokens: 8192, + }, + ANTHROPIC: { + maxInputTokens: 200000, + maxOutputTokens: 8192, + }, + LLAMALOCAL: { + maxInputTokens: 32768, + maxOutputTokens: 8192, + }, }; ``` @@ -163,27 +163,27 @@ const contextSettings = { ```typescript class EmbeddingCache { - private cache: NodeCache; - private cacheDir: string; - - constructor() { - this.cache = new NodeCache({ stdTTL: 300 }); // 5 minute TTL - this.cacheDir = path.join(__dirname, "cache"); - } - - async get(key: string): Promise { - // Check memory cache first - const cached = this.cache.get(key); - if (cached) return cached; - - // Check disk cache - return this.readFromDisk(key); - } - - async set(key: string, embedding: number[]): Promise { - this.cache.set(key, embedding); - await this.writeToDisk(key, embedding); - } + private cache: NodeCache; + private cacheDir: string; + + constructor() { + this.cache = new NodeCache({ stdTTL: 300 }); // 5 minute TTL + this.cacheDir = path.join(__dirname, "cache"); + } + + async get(key: string): Promise { + // Check memory cache first + const cached = this.cache.get(key); + if (cached) return cached; + + // Check disk cache + return this.readFromDisk(key); + } + + async set(key: string, embedding: number[]): Promise { + this.cache.set(key, embedding); + await this.writeToDisk(key, embedding); + } } ``` @@ -191,15 +191,15 @@ class EmbeddingCache { ```typescript async function selectOptimalModel( - task: string, - requirements: ModelRequirements + task: string, + requirements: ModelRequirements, ): Promise { - if (requirements.speed === "fast") { - return ModelClass.SMALL; - } else if (requirements.complexity === "high") { - return ModelClass.LARGE; - } - return ModelClass.MEDIUM; + if (requirements.speed === "fast") { + return ModelClass.SMALL; + } else if (requirements.complexity === "high") { + return ModelClass.LARGE; + } + return ModelClass.MEDIUM; } ``` @@ -209,22 +209,22 @@ async function selectOptimalModel( ```typescript const openAISettings = { - endpoint: "https://api.openai.com/v1", - settings: { - stop: [], - maxInputTokens: 128000, - maxOutputTokens: 8192, - frequency_penalty: 0.0, - presence_penalty: 0.0, - temperature: 0.6, - }, - model: { - [ModelClass.SMALL]: "gpt-4o-mini", - [ModelClass.MEDIUM]: "gpt-4o", - [ModelClass.LARGE]: "gpt-4o", - [ModelClass.EMBEDDING]: "text-embedding-3-small", - [ModelClass.IMAGE]: "dall-e-3" - } + endpoint: "https://api.openai.com/v1", + settings: { + stop: [], + maxInputTokens: 128000, + maxOutputTokens: 8192, + frequency_penalty: 0.0, + presence_penalty: 0.0, + temperature: 0.6, + }, + model: { + [ModelClass.SMALL]: "gpt-4o-mini", + [ModelClass.MEDIUM]: "gpt-4o", + [ModelClass.LARGE]: "gpt-4o", + [ModelClass.EMBEDDING]: "text-embedding-3-small", + [ModelClass.IMAGE]: "dall-e-3", + }, }; ``` @@ -232,18 +232,18 @@ const openAISettings = { ```typescript const anthropicSettings = { - endpoint: "https://api.anthropic.com/v1", - settings: { - stop: [], - maxInputTokens: 200000, - maxOutputTokens: 8192, - temperature: 0.3, - }, - model: { - [ModelClass.SMALL]: "claude-3-5-haiku", - [ModelClass.MEDIUM]: "claude-3-5-sonnet-20241022", - [ModelClass.LARGE]: "claude-3-5-opus-20240229" - } + endpoint: "https://api.anthropic.com/v1", + settings: { + stop: [], + maxInputTokens: 200000, + maxOutputTokens: 8192, + temperature: 0.3, + }, + model: { + [ModelClass.SMALL]: "claude-3-5-haiku", + [ModelClass.MEDIUM]: "claude-3-5-sonnet-20241022", + [ModelClass.LARGE]: "claude-3-5-opus-20240229", + }, }; ``` @@ -251,19 +251,19 @@ const anthropicSettings = { ```typescript const llamaLocalSettings = { - settings: { - stop: ["<|eot_id|>", "<|eom_id|>"], - maxInputTokens: 32768, - maxOutputTokens: 8192, - repetition_penalty: 0.0, - temperature: 0.3, - }, - model: { - [ModelClass.SMALL]: "NousResearch/Hermes-3-Llama-3.1-8B-GGUF", - [ModelClass.MEDIUM]: "NousResearch/Hermes-3-Llama-3.1-8B-GGUF", - [ModelClass.LARGE]: "NousResearch/Hermes-3-Llama-3.1-8B-GGUF", - [ModelClass.EMBEDDING]: "togethercomputer/m2-bert-80M-32k-retrieval" - } + settings: { + stop: ["<|eot_id|>", "<|eom_id|>"], + maxInputTokens: 32768, + maxOutputTokens: 8192, + repetition_penalty: 0.0, + temperature: 0.3, + }, + model: { + [ModelClass.SMALL]: "NousResearch/Hermes-3-Llama-3.1-8B-GGUF", + [ModelClass.MEDIUM]: "NousResearch/Hermes-3-Llama-3.1-8B-GGUF", + [ModelClass.LARGE]: "NousResearch/Hermes-3-Llama-3.1-8B-GGUF", + [ModelClass.EMBEDDING]: "togethercomputer/m2-bert-80M-32k-retrieval", + }, }; ``` @@ -271,25 +271,25 @@ const llamaLocalSettings = { ```typescript const heuristSettings = { - settings: { - stop: [], - maxInputTokens: 128000, - maxOutputTokens: 8192, - repetition_penalty: 0.0, - temperature: 0.7, - }, - imageSettings: { - steps: 20, - }, - endpoint: "https://llm-gateway.heurist.xyz", - model: { - [ModelClass.SMALL]: "meta-llama/llama-3-70b-instruct", - [ModelClass.MEDIUM]: "meta-llama/llama-3-70b-instruct", - [ModelClass.LARGE]: "meta-llama/llama-3.1-405b-instruct", - [ModelClass.EMBEDDING]: "", // Add later - [ModelClass.IMAGE]: "PepeXL", - } -} + settings: { + stop: [], + maxInputTokens: 128000, + maxOutputTokens: 8192, + repetition_penalty: 0.0, + temperature: 0.7, + }, + imageSettings: { + steps: 20, + }, + endpoint: "https://llm-gateway.heurist.xyz", + model: { + [ModelClass.SMALL]: "meta-llama/llama-3-70b-instruct", + [ModelClass.MEDIUM]: "meta-llama/llama-3-70b-instruct", + [ModelClass.LARGE]: "meta-llama/llama-3.1-405b-instruct", + [ModelClass.EMBEDDING]: "", // Add later + [ModelClass.IMAGE]: "PepeXL", + }, +}; ``` ## Testing and Validation @@ -298,13 +298,13 @@ const heuristSettings = { ```typescript async function validateEmbedding( - embedding: number[], - expectedDimensions: number = 1536 + embedding: number[], + expectedDimensions: number = 1536, ): Promise { - if (!Array.isArray(embedding)) return false; - if (embedding.length !== expectedDimensions) return false; - if (embedding.some(n => typeof n !== 'number')) return false; - return true; + if (!Array.isArray(embedding)) return false; + if (embedding.length !== expectedDimensions) return false; + if (embedding.some((n) => typeof n !== "number")) return false; + return true; } ``` @@ -312,27 +312,27 @@ async function validateEmbedding( ```typescript async function benchmarkModel( - runtime: IAgentRuntime, - modelClass: ModelClass, - testCases: TestCase[] + runtime: IAgentRuntime, + modelClass: ModelClass, + testCases: TestCase[], ): Promise { - const results = { - latency: [], - tokenUsage: [], - accuracy: [] - }; - - for (const test of testCases) { - const start = Date.now(); - const response = await runtime.generateText({ - context: test.input, - modelClass - }); - results.latency.push(Date.now() - start); - // ... additional metrics - } - - return results; + const results = { + latency: [], + tokenUsage: [], + accuracy: [], + }; + + for (const test of testCases) { + const start = Date.now(); + const response = await runtime.generateText({ + context: test.input, + modelClass, + }); + results.latency.push(Date.now() - start); + // ... additional metrics + } + + return results; } ``` @@ -341,11 +341,13 @@ async function benchmarkModel( ### Model Selection Guidelines 1. **Task Complexity** + - Use SMALL for simple, quick responses - Use MEDIUM for balanced performance - Use LARGE for complex reasoning 2. **Context Management** + - Keep prompts concise and focused - Use context windows efficiently - Implement proper context truncation @@ -358,6 +360,7 @@ async function benchmarkModel( ### Performance Optimization 1. **Caching Strategy** + - Cache embeddings for frequently accessed content - Implement tiered caching (memory/disk) - Regular cache cleanup @@ -372,28 +375,30 @@ async function benchmarkModel( ### Common Issues 1. **Token Limits** + ```typescript function handleTokenLimit(error: Error) { - if (error.message.includes('token limit')) { - return truncateAndRetry(); - } + if (error.message.includes("token limit")) { + return truncateAndRetry(); + } } ``` 2. **Embedding Errors** + ```typescript function handleEmbeddingError(error: Error) { - if (error.message.includes('dimension mismatch')) { - return regenerateEmbedding(); - } + if (error.message.includes("dimension mismatch")) { + return regenerateEmbedding(); + } } ``` 3. **Model Availability** ```typescript async function handleModelFailover(error: Error) { - if (error.message.includes('model not available')) { - return switchToFallbackModel(); - } + if (error.message.includes("model not available")) { + return switchToFallbackModel(); + } } ``` diff --git a/docs/docs/advanced/infrastructure.md b/docs/docs/advanced/infrastructure.md index a6769e573f1..f637756b493 100644 --- a/docs/docs/advanced/infrastructure.md +++ b/docs/docs/advanced/infrastructure.md @@ -11,9 +11,10 @@ Eliza's infrastructure is built on a flexible database architecture that support ## Core Components ### Database Adapters + Eliza supports multiple database backends through a pluggable adapter system: -- **PostgreSQL** - Full-featured adapter with vector search capabilities +- **PostgreSQL** - Full-featured adapter with vector search capabilities - **SQLite** - Lightweight local database option - **SQL.js** - In-memory database for testing and development - **Supabase** - Cloud-hosted PostgreSQL with additional features @@ -36,12 +37,14 @@ The database schema includes several key tables: ### PostgreSQL Setup 1. **Install PostgreSQL Extensions** + ```sql CREATE EXTENSION IF NOT EXISTS vector; CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; ``` 2. **Initialize Core Tables** + ```sql -- Create base tables CREATE TABLE accounts ( @@ -73,8 +76,9 @@ CREATE TABLE memories ( ``` 3. **Set Up Indexes** + ```sql -CREATE INDEX idx_memories_embedding ON memories +CREATE INDEX idx_memories_embedding ON memories USING hnsw ("embedding" vector_cosine_ops); CREATE INDEX idx_memories_type_room ON memories("type", "roomId"); CREATE INDEX idx_participants_user ON participants("userId"); @@ -94,7 +98,7 @@ const postgresConfig = { // Supabase Configuration const supabaseConfig = { supabaseUrl: process.env.SUPABASE_URL, - supabaseKey: process.env.SUPABASE_KEY + supabaseKey: process.env.SUPABASE_KEY, }; ``` @@ -106,15 +110,15 @@ The memory system uses vector embeddings for semantic search: ```typescript async function storeMemory(runtime: IAgentRuntime, content: string) { - const embedding = await runtime.embed(content); - - await runtime.databaseAdapter.createMemory({ - type: "message", - content: { text: content }, - embedding, - roomId: roomId, - userId: userId - }); + const embedding = await runtime.embed(content); + + await runtime.databaseAdapter.createMemory({ + type: "message", + content: { text: content }, + embedding, + roomId: roomId, + userId: userId, + }); } ``` @@ -122,16 +126,13 @@ async function storeMemory(runtime: IAgentRuntime, content: string) { ```typescript async function searchMemories(runtime: IAgentRuntime, query: string) { - const embedding = await runtime.embed(query); - - return runtime.databaseAdapter.searchMemoriesByEmbedding( - embedding, - { - match_threshold: 0.8, - count: 10, - tableName: "memories" - } - ); + const embedding = await runtime.embed(query); + + return runtime.databaseAdapter.searchMemoriesByEmbedding(embedding, { + match_threshold: 0.8, + count: 10, + tableName: "memories", + }); } ``` @@ -140,16 +141,18 @@ async function searchMemories(runtime: IAgentRuntime, query: string) { ### Database Optimization 1. **Index Management** + - Use HNSW indexes for vector similarity search - Create appropriate indexes for frequent query patterns - Regularly analyze and update index statistics 2. **Connection Pooling** + ```typescript const pool = new Pool({ - max: 20, // Maximum pool size - idleTimeoutMillis: 30000, - connectionTimeoutMillis: 2000 + max: 20, // Maximum pool size + idleTimeoutMillis: 30000, + connectionTimeoutMillis: 2000, }); ``` @@ -161,15 +164,17 @@ async function searchMemories(runtime: IAgentRuntime, query: string) { ### High Availability 1. **Database Replication** + - Set up read replicas for scaling read operations - Configure streaming replication for failover - Implement connection retry logic 2. **Backup Strategy** + ```sql -- Regular backups pg_dump -Fc mydb > backup.dump - + -- Point-in-time recovery pg_basebackup -D backup -Fp -Xs -P ``` @@ -179,6 +184,7 @@ async function searchMemories(runtime: IAgentRuntime, query: string) { ### Access Control 1. **Row Level Security** + ```sql ALTER TABLE memories ENABLE ROW LEVEL SECURITY; @@ -187,6 +193,7 @@ CREATE POLICY "memories_isolation" ON memories ``` 2. **Role Management** + ```sql -- Create application role CREATE ROLE app_user; @@ -199,11 +206,13 @@ GRANT USAGE ON SCHEMA public TO app_user; ### Data Protection 1. **Encryption** + - Use TLS for connections - Encrypt sensitive data at rest - Implement key rotation 2. **Audit Logging** + ```sql CREATE TABLE logs ( "id" UUID PRIMARY KEY DEFAULT gen_random_uuid(), @@ -221,19 +230,20 @@ CREATE TABLE logs ( ```typescript async function checkDatabaseHealth(): Promise { - try { - await db.query('SELECT 1'); - return true; - } catch (error) { - console.error('Database health check failed:', error); - return false; - } + try { + await db.query("SELECT 1"); + return true; + } catch (error) { + console.error("Database health check failed:", error); + return false; + } } ``` ### Performance Metrics Track key metrics: + - Query performance - Connection pool utilization - Memory usage @@ -244,6 +254,7 @@ Track key metrics: ### Regular Tasks 1. **Vacuum Operations** + ```sql -- Regular vacuum VACUUM ANALYZE memories; @@ -253,6 +264,7 @@ ANALYZE memories; ``` 2. **Index Maintenance** + ```sql -- Reindex vector similarity index REINDEX INDEX idx_memories_embedding; @@ -261,20 +273,25 @@ REINDEX INDEX idx_memories_embedding; ### Data Lifecycle 1. **Archival Strategy** + - Archive old conversations - Compress inactive memories - Implement data retention policies 2. **Cleanup Jobs** + ```typescript async function cleanupOldMemories() { - const cutoffDate = new Date(); - cutoffDate.setMonth(cutoffDate.getMonth() - 6); - - await db.query(` + const cutoffDate = new Date(); + cutoffDate.setMonth(cutoffDate.getMonth() - 6); + + await db.query( + ` DELETE FROM memories WHERE "createdAt" < $1 - `, [cutoffDate]); + `, + [cutoffDate], + ); } ``` @@ -283,11 +300,13 @@ async function cleanupOldMemories() { ### Common Issues 1. **Connection Problems** + - Check connection pool settings - Verify network connectivity - Review firewall rules 2. **Performance Issues** + - Analyze query plans - Check index usage - Monitor resource utilization @@ -304,13 +323,13 @@ async function cleanupOldMemories() { SELECT * FROM pg_stat_activity; -- Analyze query performance -EXPLAIN ANALYZE -SELECT * FROM memories -WHERE embedding <-> $1 < 0.3 +EXPLAIN ANALYZE +SELECT * FROM memories +WHERE embedding <-> $1 < 0.3 LIMIT 10; -- Monitor index usage -SELECT schemaname, tablename, indexname, idx_scan +SELECT schemaname, tablename, indexname, idx_scan FROM pg_stat_user_indexes; ``` diff --git a/docs/docs/advanced/trust-engine.md b/docs/docs/advanced/trust-engine.md index 7f489fad8e7..06f681d4502 100644 --- a/docs/docs/advanced/trust-engine.md +++ b/docs/docs/advanced/trust-engine.md @@ -16,33 +16,33 @@ The database schema manages various aspects of trust: ```typescript interface TrustScoreDatabase { - // Core data structures - recommenders: Recommender[]; - metrics: RecommenderMetrics[]; - tokenPerformance: TokenPerformance[]; - recommendations: TokenRecommendation[]; + // Core data structures + recommenders: Recommender[]; + metrics: RecommenderMetrics[]; + tokenPerformance: TokenPerformance[]; + recommendations: TokenRecommendation[]; } interface Recommender { - id: string; - address: string; - solanaPubkey?: string; - telegramId?: string; - discordId?: string; - twitterId?: string; - ip?: string; + id: string; + address: string; + solanaPubkey?: string; + telegramId?: string; + discordId?: string; + twitterId?: string; + ip?: string; } interface RecommenderMetrics { - recommenderId: string; - trustScore: number; - totalRecommendations: number; - successfulRecs: number; - avgTokenPerformance: number; - riskScore: number; - consistencyScore: number; - virtualConfidence: number; - lastActiveDate: Date; + recommenderId: string; + trustScore: number; + totalRecommendations: number; + successfulRecs: number; + avgTokenPerformance: number; + riskScore: number; + consistencyScore: number; + virtualConfidence: number; + lastActiveDate: Date; } ``` @@ -52,21 +52,21 @@ The system tracks comprehensive token metrics: ```typescript interface TokenPerformance { - tokenAddress: string; - priceChange24h: number; - volumeChange24h: number; - trade_24h_change: number; - liquidity: number; - liquidityChange24h: number; - holderChange24h: number; - rugPull: boolean; - isScam: boolean; - marketCapChange24h: number; - sustainedGrowth: boolean; - rapidDump: boolean; - suspiciousVolume: boolean; - validationTrust: number; - lastUpdated: Date; + tokenAddress: string; + priceChange24h: number; + volumeChange24h: number; + trade_24h_change: number; + liquidity: number; + liquidityChange24h: number; + holderChange24h: number; + rugPull: boolean; + isScam: boolean; + marketCapChange24h: number; + sustainedGrowth: boolean; + rapidDump: boolean; + suspiciousVolume: boolean; + validationTrust: number; + lastUpdated: Date; } ``` @@ -76,28 +76,31 @@ interface TokenPerformance { ```typescript async function calculateTrustScore( - recommenderId: string, - metrics: RecommenderMetrics + recommenderId: string, + metrics: RecommenderMetrics, ): Promise { - const weights = { - successRate: 0.3, - avgPerformance: 0.2, - consistency: 0.2, - riskMetric: 0.15, - timeDecay: 0.15 - }; - - const successRate = metrics.successfulRecs / metrics.totalRecommendations; - const normalizedPerformance = normalizePerformance(metrics.avgTokenPerformance); - const timeDecayFactor = calculateTimeDecay(metrics.lastActiveDate); - - return ( - (successRate * weights.successRate) + - (normalizedPerformance * weights.avgPerformance) + - (metrics.consistencyScore * weights.consistency) + - ((1 - metrics.riskScore) * weights.riskMetric) + - (timeDecayFactor * weights.timeDecay) - ) * 100; + const weights = { + successRate: 0.3, + avgPerformance: 0.2, + consistency: 0.2, + riskMetric: 0.15, + timeDecay: 0.15, + }; + + const successRate = metrics.successfulRecs / metrics.totalRecommendations; + const normalizedPerformance = normalizePerformance( + metrics.avgTokenPerformance, + ); + const timeDecayFactor = calculateTimeDecay(metrics.lastActiveDate); + + return ( + (successRate * weights.successRate + + normalizedPerformance * weights.avgPerformance + + metrics.consistencyScore * weights.consistency + + (1 - metrics.riskScore) * weights.riskMetric + + timeDecayFactor * weights.timeDecay) * + 100 + ); } ``` @@ -105,33 +108,33 @@ async function calculateTrustScore( ```typescript async function validateToken( - tokenAddress: string, - performance: TokenPerformance + tokenAddress: string, + performance: TokenPerformance, ): Promise { - // Minimum requirements - const requirements = { - minLiquidity: 1000, // $1000 USD - minHolders: 100, - maxOwnership: 0.2, // 20% max single holder - minVolume: 500 // $500 USD daily volume - }; - - // Red flags - if ( - performance.rugPull || - performance.isScam || - performance.rapidDump || - performance.suspiciousVolume - ) { - return false; - } - - // Basic requirements - return ( - performance.liquidity >= requirements.minLiquidity && - !performance.rapidDump && - performance.validationTrust > 0.5 - ); + // Minimum requirements + const requirements = { + minLiquidity: 1000, // $1000 USD + minHolders: 100, + maxOwnership: 0.2, // 20% max single holder + minVolume: 500, // $500 USD daily volume + }; + + // Red flags + if ( + performance.rugPull || + performance.isScam || + performance.rapidDump || + performance.suspiciousVolume + ) { + return false; + } + + // Basic requirements + return ( + performance.liquidity >= requirements.minLiquidity && + !performance.rapidDump && + performance.validationTrust > 0.5 + ); } ``` @@ -141,25 +144,26 @@ async function validateToken( ```typescript interface TradePerformance { - token_address: string; - recommender_id: string; - buy_price: number; - sell_price: number; - buy_timeStamp: string; - sell_timeStamp: string; - profit_usd: number; - profit_percent: number; - market_cap_change: number; - liquidity_change: number; - rapidDump: boolean; + token_address: string; + recommender_id: string; + buy_price: number; + sell_price: number; + buy_timeStamp: string; + sell_timeStamp: string; + profit_usd: number; + profit_percent: number; + market_cap_change: number; + liquidity_change: number; + rapidDump: boolean; } async function recordTradePerformance( - trade: TradePerformance, - isSimulation: boolean + trade: TradePerformance, + isSimulation: boolean, ): Promise { - const tableName = isSimulation ? 'simulation_trade' : 'trade'; - await db.query(` + const tableName = isSimulation ? "simulation_trade" : "trade"; + await db.query( + ` INSERT INTO ${tableName} ( token_address, recommender_id, @@ -173,7 +177,11 @@ async function recordTradePerformance( liquidity_change, rapidDump ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) - `, [/* parameters */]); + `, + [ + /* parameters */ + ], + ); } ``` @@ -181,32 +189,32 @@ async function recordTradePerformance( ```typescript async function assessTradeRisk( - token: TokenPerformance, - recommender: RecommenderMetrics + token: TokenPerformance, + recommender: RecommenderMetrics, ): Promise<{ - riskLevel: 'LOW' | 'MEDIUM' | 'HIGH', - maxPositionSize: number + riskLevel: "LOW" | "MEDIUM" | "HIGH"; + maxPositionSize: number; }> { - const riskFactors = { - tokenTrust: token.validationTrust, - recommenderTrust: recommender.trustScore, - marketMetrics: { - liquidity: token.liquidity, - volume: token.volumeChange24h, - holders: token.holderChange24h - } - }; - - // Calculate composite risk score - const riskScore = calculateRiskScore(riskFactors); - - // Determine position sizing - const maxPosition = determinePositionSize(riskScore); - - return { - riskLevel: getRiskLevel(riskScore), - maxPositionSize: maxPosition - }; + const riskFactors = { + tokenTrust: token.validationTrust, + recommenderTrust: recommender.trustScore, + marketMetrics: { + liquidity: token.liquidity, + volume: token.volumeChange24h, + holders: token.holderChange24h, + }, + }; + + // Calculate composite risk score + const riskScore = calculateRiskScore(riskFactors); + + // Determine position sizing + const maxPosition = determinePositionSize(riskScore); + + return { + riskLevel: getRiskLevel(riskScore), + maxPositionSize: maxPosition, + }; } ``` @@ -216,16 +224,16 @@ async function assessTradeRisk( ```typescript async function analyzeRecommendationPatterns( - recommenderId: string + recommenderId: string, ): Promise { - const history = await getRecommenderHistory(recommenderId); - - return { - timeOfDay: analyzeTimingPatterns(history), - tokenTypes: analyzeTokenPreferences(history), - successRateByType: calculateTypeSuccessRates(history), - riskProfile: assessRiskProfile(history) - }; + const history = await getRecommenderHistory(recommenderId); + + return { + timeOfDay: analyzeTimingPatterns(history), + tokenTypes: analyzeTokenPreferences(history), + successRateByType: calculateTypeSuccessRates(history), + riskProfile: assessRiskProfile(history), + }; } ``` @@ -233,25 +241,25 @@ async function analyzeRecommendationPatterns( ```typescript interface PerformanceMetrics { - profitability: number; - consistency: number; - riskAdjustedReturn: number; - maxDrawdown: number; - winRate: number; + profitability: number; + consistency: number; + riskAdjustedReturn: number; + maxDrawdown: number; + winRate: number; } async function calculatePerformanceMetrics( - recommendations: TokenRecommendation[] + recommendations: TokenRecommendation[], ): Promise { - const trades = await getTradesFromRecommendations(recommendations); - - return { - profitability: calculateProfitability(trades), - consistency: calculateConsistency(trades), - riskAdjustedReturn: calculateSharpeRatio(trades), - maxDrawdown: calculateMaxDrawdown(trades), - winRate: calculateWinRate(trades) - }; + const trades = await getTradesFromRecommendations(recommendations); + + return { + profitability: calculateProfitability(trades), + consistency: calculateConsistency(trades), + riskAdjustedReturn: calculateSharpeRatio(trades), + maxDrawdown: calculateMaxDrawdown(trades), + winRate: calculateWinRate(trades), + }; } ``` @@ -261,32 +269,32 @@ async function calculatePerformanceMetrics( ```typescript async function executeTrade( - recommendation: TokenRecommendation, - trustScore: number + recommendation: TokenRecommendation, + trustScore: number, ): Promise { - const riskAssessment = await assessTradeRisk( - recommendation.tokenAddress, - recommendation.recommenderId - ); - - // Calculate position size based on trust score - const positionSize = calculatePositionSize( - trustScore, - riskAssessment.maxPositionSize - ); - - if (positionSize > 0) { - await executeSwap({ - inputToken: "SOL", - outputToken: recommendation.tokenAddress, - amount: positionSize - }); - - await recordTradeEntry(recommendation, positionSize); - return true; - } - - return false; + const riskAssessment = await assessTradeRisk( + recommendation.tokenAddress, + recommendation.recommenderId, + ); + + // Calculate position size based on trust score + const positionSize = calculatePositionSize( + trustScore, + riskAssessment.maxPositionSize, + ); + + if (positionSize > 0) { + await executeSwap({ + inputToken: "SOL", + outputToken: recommendation.tokenAddress, + amount: positionSize, + }); + + await recordTradeEntry(recommendation, positionSize); + return true; + } + + return false; } ``` @@ -294,24 +302,24 @@ async function executeTrade( ```typescript async function managePosition( - position: TradePosition, - metrics: TokenPerformance + position: TradePosition, + metrics: TokenPerformance, ): Promise { - // Exit conditions - if ( - metrics.rapidDump || - metrics.suspiciousVolume || - calculateDrawdown(position) > MAX_DRAWDOWN - ) { - await executeExit(position); - return; - } - - // Position sizing adjustments - const newSize = recalculatePosition(position, metrics); - if (newSize !== position.size) { - await adjustPosition(position, newSize); - } + // Exit conditions + if ( + metrics.rapidDump || + metrics.suspiciousVolume || + calculateDrawdown(position) > MAX_DRAWDOWN + ) { + await executeExit(position); + return; + } + + // Position sizing adjustments + const newSize = recalculatePosition(position, metrics); + if (newSize !== position.size) { + await adjustPosition(position, newSize); + } } ``` @@ -321,21 +329,21 @@ async function managePosition( ```typescript async function monitorTrustMetrics(): Promise { - // Monitor trust score changes - const scoreChanges = await getTrustScoreChanges(); - for (const change of scoreChanges) { - if (Math.abs(change.delta) > TRUST_THRESHOLD) { - await notifyTrustChange(change); - } + // Monitor trust score changes + const scoreChanges = await getTrustScoreChanges(); + for (const change of scoreChanges) { + if (Math.abs(change.delta) > TRUST_THRESHOLD) { + await notifyTrustChange(change); } + } - // Monitor trading performance - const performanceMetrics = await getPerformanceMetrics(); - for (const metric of performanceMetrics) { - if (metric.drawdown > MAX_DRAWDOWN) { - await notifyRiskAlert(metric); - } + // Monitor trading performance + const performanceMetrics = await getPerformanceMetrics(); + for (const metric of performanceMetrics) { + if (metric.drawdown > MAX_DRAWDOWN) { + await notifyRiskAlert(metric); } + } } ``` @@ -343,26 +351,26 @@ async function monitorTrustMetrics(): Promise { ```typescript interface TrustAlert { - type: 'SCORE_CHANGE' | 'RISK_LEVEL' | 'PERFORMANCE'; - severity: 'LOW' | 'MEDIUM' | 'HIGH'; - message: string; - data: any; + type: "SCORE_CHANGE" | "RISK_LEVEL" | "PERFORMANCE"; + severity: "LOW" | "MEDIUM" | "HIGH"; + message: string; + data: any; } async function handleAlert(alert: TrustAlert): Promise { - switch (alert.severity) { - case 'HIGH': - await sendImmediateNotification(alert); - await pauseTrading(alert.data); - break; - case 'MEDIUM': - await sendNotification(alert); - await adjustRiskLevels(alert.data); - break; - case 'LOW': - await logAlert(alert); - break; - } + switch (alert.severity) { + case "HIGH": + await sendImmediateNotification(alert); + await pauseTrading(alert.data); + break; + case "MEDIUM": + await sendNotification(alert); + await adjustRiskLevels(alert.data); + break; + case "LOW": + await logAlert(alert); + break; + } } ``` @@ -371,27 +379,28 @@ async function handleAlert(alert: TrustAlert): Promise { ### Common Issues 1. **Trust Score Anomalies** + ```typescript async function investigateTrustAnomaly( - recommenderId: string + recommenderId: string, ): Promise { - const history = await getRecommenderHistory(recommenderId); - const metrics = await getRecommenderMetrics(recommenderId); - const trades = await getRecommenderTrades(recommenderId); - - return analyzeAnomalies(history, metrics, trades); + const history = await getRecommenderHistory(recommenderId); + const metrics = await getRecommenderMetrics(recommenderId); + const trades = await getRecommenderTrades(recommenderId); + + return analyzeAnomalies(history, metrics, trades); } ``` 2. **Trade Execution Failures** + ```typescript async function handleTradeFailure( - error: Error, - trade: TradeAttempt + error: Error, + trade: TradeAttempt, ): Promise { - await logTradeError(error, trade); - await adjustTrustScore(trade.recommenderId, 'FAILURE'); - await notifyTradeFailure(trade); + await logTradeError(error, trade); + await adjustTrustScore(trade.recommenderId, "FAILURE"); + await notifyTradeFailure(trade); } ``` - diff --git a/docs/docs/api/_media/README_CN.md b/docs/docs/api/_media/README_CN.md index 9147f78738f..5a4bfe5c0d3 100644 --- a/docs/docs/api/_media/README_CN.md +++ b/docs/docs/api/_media/README_CN.md @@ -4,39 +4,39 @@ ## 功能 -- 🛠 支持discord/推特/telegram连接 -- 👥 支持多模态agent -- 📚 简单的导入文档并与文档交互 -- 💾 可检索的内存和文档存储 -- 🚀 高可拓展性,你可以自定义客户端和行为来进行功能拓展 -- ☁️ 多模型支持,包括Llama、OpenAI、Grok、Anthropic等 -- 📦 简单好用 +- 🛠 支持discord/推特/telegram连接 +- 👥 支持多模态agent +- 📚 简单的导入文档并与文档交互 +- 💾 可检索的内存和文档存储 +- 🚀 高可拓展性,你可以自定义客户端和行为来进行功能拓展 +- ☁️ 多模型支持,包括Llama、OpenAI、Grok、Anthropic等 +- 📦 简单好用 你可以用Eliza做什么? -- 🤖 聊天机器人 -- 🕵️ 自主Agents -- 📈 业务流程自动化处理 -- 🎮 游戏NPC +- 🤖 聊天机器人 +- 🕵️ 自主Agents +- 📈 业务流程自动化处理 +- 🎮 游戏NPC # 开始使用 **前置要求(必须):** -- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) -- Nodejs安装 -- [pnpm](https://pnpm.io/installation) -- 使用pnpm +- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- Nodejs安装 +- [pnpm](https://pnpm.io/installation) +- 使用pnpm ### 编辑.env文件 -- - 将 .env.example 复制为 .env 并填写适当的值 -- 编辑推特环境并输入你的推特账号和密码 +- - 将 .env.example 复制为 .env 并填写适当的值 +- 编辑推特环境并输入你的推特账号和密码 ### 编辑角色文件 -- 查看文件 `src/core/defaultCharacter.ts` - 您可以修改它 -- 您也可以使用 `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` 加载角色并同时运行多个机器人。 +- 查看文件 `src/core/defaultCharacter.ts` - 您可以修改它 +- 您也可以使用 `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` 加载角色并同时运行多个机器人。 在完成账号和角色文件的配置后,输入以下命令行启动你的bot: @@ -163,9 +163,9 @@ pnpm test:sqljs # Run tests with SQL.js 测试使用 Jest 编写,位于 src/\*_/_.test.ts 文件中。测试环境配置如下: -- 从 .env.test 加载环境变量 -- 使用 2 分钟的超时时间来运行长时间运行的测试 -- 支持 ESM 模块 -- 按顺序运行测试 (--runInBand) +- 从 .env.test 加载环境变量 +- 使用 2 分钟的超时时间来运行长时间运行的测试 +- 支持 ESM 模块 +- 按顺序运行测试 (--runInBand) 要创建新测试,请在要测试的代码旁边添加一个 .test.ts 文件。 diff --git a/docs/docs/api/classes/AgentRuntime.md b/docs/docs/api/classes/AgentRuntime.md index a86436f3c1e..6810eb8f237 100644 --- a/docs/docs/api/classes/AgentRuntime.md +++ b/docs/docs/api/classes/AgentRuntime.md @@ -95,7 +95,7 @@ Custom actions that the agent can perform. [packages/core/src/runtime.ts:78](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L78) -*** +--- ### agentId @@ -111,7 +111,7 @@ The ID of the agent [packages/core/src/runtime.ts:59](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L59) -*** +--- ### character @@ -127,7 +127,7 @@ The character to use for the agent [packages/core/src/runtime.ts:104](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L104) -*** +--- ### databaseAdapter @@ -143,7 +143,7 @@ The database adapter used for interacting with the database. [packages/core/src/runtime.ts:68](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L68) -*** +--- ### descriptionManager @@ -159,7 +159,7 @@ Store and recall descriptions of users based on conversations. [packages/core/src/runtime.ts:114](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L114) -*** +--- ### documentsManager @@ -171,7 +171,7 @@ Hold large documents that can be referenced [packages/core/src/runtime.ts:124](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L124) -*** +--- ### evaluators @@ -187,7 +187,7 @@ Evaluators used to assess and guide the agent's responses. [packages/core/src/runtime.ts:83](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L83) -*** +--- ### fetch() @@ -222,7 +222,7 @@ Some environments may not have access to the global fetch function and need a cu [packages/core/src/runtime.ts:99](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L99) -*** +--- ### knowledgeManager @@ -234,7 +234,7 @@ Searchable document fragments [packages/core/src/runtime.ts:129](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L129) -*** +--- ### loreManager @@ -250,7 +250,7 @@ Manage the creation and recall of static information (documents, historical game [packages/core/src/runtime.ts:119](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L119) -*** +--- ### memoryManagers @@ -260,7 +260,7 @@ Manage the creation and recall of static information (documents, historical game [packages/core/src/runtime.ts:132](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L132) -*** +--- ### messageManager @@ -276,7 +276,7 @@ Store messages that are sent and received by the agent. [packages/core/src/runtime.ts:109](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L109) -*** +--- ### modelProvider @@ -292,7 +292,7 @@ The model to use for generateText. [packages/core/src/runtime.ts:93](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L93) -*** +--- ### providers @@ -308,7 +308,7 @@ Context providers used to provide context for message generation. [packages/core/src/runtime.ts:88](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L88) -*** +--- ### serverUrl @@ -324,7 +324,7 @@ The base URL of the server where the agent's requests are processed. [packages/core/src/runtime.ts:63](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L63) -*** +--- ### services @@ -338,7 +338,7 @@ The base URL of the server where the agent's requests are processed. [packages/core/src/runtime.ts:131](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L131) -*** +--- ### token @@ -384,7 +384,7 @@ The state of the agent. [packages/core/src/runtime.ts:667](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L667) -*** +--- ### ensureConnection() @@ -414,7 +414,7 @@ The state of the agent. [packages/core/src/runtime.ts:618](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L618) -*** +--- ### ensureParticipantExists() @@ -446,7 +446,7 @@ An error if the participant cannot be added. [packages/core/src/runtime.ts:571](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L571) -*** +--- ### ensureParticipantInRoom() @@ -470,7 +470,7 @@ An error if the participant cannot be added. [packages/core/src/runtime.ts:607](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L607) -*** +--- ### ensureRoomExists() @@ -501,7 +501,7 @@ An error if the room cannot be created. [packages/core/src/runtime.ts:654](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L654) -*** +--- ### ensureUserExists() @@ -537,7 +537,7 @@ The user name to ensure the existence of. [packages/core/src/runtime.ts:587](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L587) -*** +--- ### evaluate() @@ -573,7 +573,7 @@ The results of the evaluation. [packages/core/src/runtime.ts:501](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L501) -*** +--- ### getConversationLength() @@ -595,7 +595,7 @@ The number of recent messages to be kept in memory. [packages/core/src/runtime.ts:394](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L394) -*** +--- ### getMemoryManager() @@ -617,11 +617,11 @@ The number of recent messages to be kept in memory. [packages/core/src/runtime.ts:149](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L149) -*** +--- ### getService() -> **getService**(`service`): *typeof* [`Service`](Service.md) +> **getService**(`service`): _typeof_ [`Service`](Service.md) #### Parameters @@ -629,7 +629,7 @@ The number of recent messages to be kept in memory. #### Returns -*typeof* [`Service`](Service.md) +_typeof_ [`Service`](Service.md) #### Implementation of @@ -639,7 +639,7 @@ The number of recent messages to be kept in memory. [packages/core/src/runtime.ts:153](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L153) -*** +--- ### getSetting() @@ -661,7 +661,7 @@ The number of recent messages to be kept in memory. [packages/core/src/runtime.ts:372](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L372) -*** +--- ### processActions() @@ -693,7 +693,7 @@ The message to process. [packages/core/src/runtime.ts:428](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L428) -*** +--- ### registerAction() @@ -719,7 +719,7 @@ The action to register. [packages/core/src/runtime.ts:402](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L402) -*** +--- ### registerContextProvider() @@ -741,7 +741,7 @@ The context provider to register. [packages/core/src/runtime.ts:419](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L419) -*** +--- ### registerEvaluator() @@ -763,7 +763,7 @@ The evaluator to register. [packages/core/src/runtime.ts:411](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L411) -*** +--- ### registerMemoryManager() @@ -785,7 +785,7 @@ The evaluator to register. [packages/core/src/runtime.ts:134](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L134) -*** +--- ### registerService() @@ -807,7 +807,7 @@ The evaluator to register. [packages/core/src/runtime.ts:161](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L161) -*** +--- ### updateRecentMessageState() diff --git a/docs/docs/api/classes/DatabaseAdapter.md b/docs/docs/api/classes/DatabaseAdapter.md index 3eeb547466e..ebf79e3f47d 100644 --- a/docs/docs/api/classes/DatabaseAdapter.md +++ b/docs/docs/api/classes/DatabaseAdapter.md @@ -65,7 +65,7 @@ A Promise that resolves to a boolean indicating success or failure. [packages/core/src/database.ts:266](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L266) -*** +--- ### countMemories() @@ -101,7 +101,7 @@ A Promise that resolves to the number of memories. [packages/core/src/database.ts:179](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L179) -*** +--- ### createAccount() @@ -129,7 +129,7 @@ A Promise that resolves when the account creation is complete. [packages/core/src/database.ts:34](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L34) -*** +--- ### createGoal() @@ -157,7 +157,7 @@ A Promise that resolves when the goal has been created. [packages/core/src/database.ts:209](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L209) -*** +--- ### createMemory() @@ -193,7 +193,7 @@ A Promise that resolves when the memory has been created. [packages/core/src/database.ts:150](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L150) -*** +--- ### createRelationship() @@ -225,7 +225,7 @@ A Promise that resolves to a boolean indicating success or failure of the creati [packages/core/src/database.ts:312](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L312) -*** +--- ### createRoom() @@ -253,7 +253,7 @@ A Promise that resolves to the UUID of the created room. [packages/core/src/database.ts:237](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L237) -*** +--- ### getAccountById() @@ -281,7 +281,7 @@ A Promise that resolves to the Account object or null if not found. [packages/core/src/database.ts:27](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L27) -*** +--- ### getActorDetails() @@ -311,7 +311,7 @@ A Promise that resolves to an array of Actor objects. [packages/core/src/database.ts:99](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L99) -*** +--- ### getCachedEmbeddings() @@ -325,17 +325,17 @@ Retrieves cached embeddings based on the specified query parameters. An object containing parameters for the embedding retrieval. -• **params.query\_field\_name**: `string` +• **params.query_field_name**: `string` -• **params.query\_field\_sub\_name**: `string` +• **params.query_field_sub_name**: `string` -• **params.query\_input**: `string` +• **params.query_input**: `string` -• **params.query\_match\_count**: `number` +• **params.query_match_count**: `number` -• **params.query\_table\_name**: `string` +• **params.query_table_name**: `string` -• **params.query\_threshold**: `number` +• **params.query_threshold**: `number` #### Returns @@ -351,7 +351,7 @@ A Promise that resolves to an array of objects containing embeddings and levensh [packages/core/src/database.ts:61](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L61) -*** +--- ### getGoals() @@ -387,7 +387,7 @@ A Promise that resolves to an array of Goal objects. [packages/core/src/database.ts:190](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L190) -*** +--- ### getMemories() @@ -423,7 +423,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:41](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L41) -*** +--- ### getMemoriesByRoomIds() @@ -451,7 +451,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:48](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L48) -*** +--- ### getMemoryById() @@ -473,7 +473,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:54](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L54) -*** +--- ### getParticipantsForAccount() @@ -529,7 +529,7 @@ A Promise that resolves to an array of Participant objects. [packages/core/src/database.ts:288](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L288) -*** +--- ### getParticipantsForRoom() @@ -557,7 +557,7 @@ A Promise that resolves to an array of UUIDs representing the participants. [packages/core/src/database.ts:295](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L295) -*** +--- ### getParticipantUserState() @@ -581,7 +581,7 @@ A Promise that resolves to an array of UUIDs representing the participants. [packages/core/src/database.ts:297](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L297) -*** +--- ### getRelationship() @@ -613,7 +613,7 @@ A Promise that resolves to the Relationship object or null if not found. [packages/core/src/database.ts:322](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L322) -*** +--- ### getRelationships() @@ -643,7 +643,7 @@ A Promise that resolves to an array of Relationship objects. [packages/core/src/database.ts:332](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L332) -*** +--- ### getRoom() @@ -671,7 +671,7 @@ A Promise that resolves to the room ID or null if not found. [packages/core/src/database.ts:230](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L230) -*** +--- ### getRoomsForParticipant() @@ -699,7 +699,7 @@ A Promise that resolves to an array of room IDs. [packages/core/src/database.ts:251](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L251) -*** +--- ### getRoomsForParticipants() @@ -727,7 +727,7 @@ A Promise that resolves to an array of room IDs. [packages/core/src/database.ts:258](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L258) -*** +--- ### log() @@ -763,7 +763,7 @@ A Promise that resolves when the log entry has been saved. [packages/core/src/database.ts:87](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L87) -*** +--- ### removeAllGoals() @@ -791,7 +791,7 @@ A Promise that resolves when all goals have been removed. [packages/core/src/database.ts:223](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L223) -*** +--- ### removeAllMemories() @@ -823,7 +823,7 @@ A Promise that resolves when all memories have been removed. [packages/core/src/database.ts:170](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L170) -*** +--- ### removeGoal() @@ -851,7 +851,7 @@ A Promise that resolves when the goal has been removed. [packages/core/src/database.ts:216](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L216) -*** +--- ### removeMemory() @@ -883,7 +883,7 @@ A Promise that resolves when the memory has been removed. [packages/core/src/database.ts:162](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L162) -*** +--- ### removeParticipant() @@ -915,7 +915,7 @@ A Promise that resolves to a boolean indicating success or failure. [packages/core/src/database.ts:274](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L274) -*** +--- ### removeRoom() @@ -943,7 +943,7 @@ A Promise that resolves when the room has been removed. [packages/core/src/database.ts:244](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L244) -*** +--- ### searchMemories() @@ -959,9 +959,9 @@ An object containing parameters for the memory search. • **params.embedding**: `number`[] -• **params.match\_count**: `number` +• **params.match_count**: `number` -• **params.match\_threshold**: `number` +• **params.match_threshold**: `number` • **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` @@ -983,7 +983,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:106](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L106) -*** +--- ### searchMemoriesByEmbedding() @@ -1005,7 +1005,7 @@ Additional parameters for the search. • **params.count?**: `number` -• **params.match\_threshold?**: `number` +• **params.match_threshold?**: `number` • **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` @@ -1027,7 +1027,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:131](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L131) -*** +--- ### setParticipantUserState() @@ -1053,7 +1053,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:301](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L301) -*** +--- ### updateGoal() @@ -1081,7 +1081,7 @@ A Promise that resolves when the goal has been updated. [packages/core/src/database.ts:202](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L202) -*** +--- ### updateGoalStatus() diff --git a/docs/docs/api/classes/MemoryManager.md b/docs/docs/api/classes/MemoryManager.md index ae2c0083148..ea2cdba027a 100644 --- a/docs/docs/api/classes/MemoryManager.md +++ b/docs/docs/api/classes/MemoryManager.md @@ -52,7 +52,7 @@ The AgentRuntime instance associated with this manager. [packages/core/src/memory.ts:22](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L22) -*** +--- ### tableName @@ -96,7 +96,7 @@ A Promise resolving to the memory object, potentially updated with an embedding [packages/core/src/memory.ts:45](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L45) -*** +--- ### countMemories() @@ -128,7 +128,7 @@ A Promise resolving to the count of memories. [packages/core/src/memory.ts:219](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L219) -*** +--- ### createMemory() @@ -160,7 +160,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:158](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L158) -*** +--- ### getCachedEmbeddings() @@ -182,7 +182,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:93](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L93) -*** +--- ### getMemories() @@ -228,7 +228,7 @@ A Promise resolving to an array of Memory objects. [packages/core/src/memory.ts:66](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L66) -*** +--- ### getMemoriesByRoomIds() @@ -254,7 +254,7 @@ A Promise resolving to an array of Memory objects. [packages/core/src/memory.ts:173](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L173) -*** +--- ### getMemoryById() @@ -276,7 +276,7 @@ A Promise resolving to an array of Memory objects. [packages/core/src/memory.ts:184](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L184) -*** +--- ### removeAllMemories() @@ -304,7 +304,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:206](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L206) -*** +--- ### removeMemory() @@ -332,7 +332,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:194](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L194) -*** +--- ### searchMemoriesByEmbedding() @@ -356,7 +356,7 @@ Options including match threshold, count, user IDs, and uniqueness. The maximum number of memories to retrieve. -• **opts.match\_threshold?**: `number` +• **opts.match_threshold?**: `number` The similarity threshold for matching memories. diff --git a/docs/docs/api/classes/Service.md b/docs/docs/api/classes/Service.md index 65b5088e8ad..4eda6318c91 100644 --- a/docs/docs/api/classes/Service.md +++ b/docs/docs/api/classes/Service.md @@ -38,7 +38,7 @@ #### Type Parameters -• **T** *extends* [`Service`](Service.md) +• **T** _extends_ [`Service`](Service.md) #### Returns diff --git a/docs/docs/api/enumerations/Clients.md b/docs/docs/api/enumerations/Clients.md index 2f84564ce5b..4d76304089d 100644 --- a/docs/docs/api/enumerations/Clients.md +++ b/docs/docs/api/enumerations/Clients.md @@ -10,7 +10,7 @@ [packages/core/src/types.ts:322](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L322) -*** +--- ### DISCORD @@ -20,7 +20,7 @@ [packages/core/src/types.ts:321](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L321) -*** +--- ### TELEGRAM @@ -30,7 +30,7 @@ [packages/core/src/types.ts:324](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L324) -*** +--- ### TWITTER diff --git a/docs/docs/api/enumerations/GoalStatus.md b/docs/docs/api/enumerations/GoalStatus.md index 48a39f2180c..ab00cf107f2 100644 --- a/docs/docs/api/enumerations/GoalStatus.md +++ b/docs/docs/api/enumerations/GoalStatus.md @@ -10,7 +10,7 @@ [packages/core/src/types.ts:57](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L57) -*** +--- ### FAILED @@ -20,11 +20,11 @@ [packages/core/src/types.ts:58](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L58) -*** +--- -### IN\_PROGRESS +### IN_PROGRESS -> **IN\_PROGRESS**: `"IN_PROGRESS"` +> **IN_PROGRESS**: `"IN_PROGRESS"` #### Defined in diff --git a/docs/docs/api/enumerations/ModelClass.md b/docs/docs/api/enumerations/ModelClass.md index d5c0c1c0806..77f667606fe 100644 --- a/docs/docs/api/enumerations/ModelClass.md +++ b/docs/docs/api/enumerations/ModelClass.md @@ -10,7 +10,7 @@ [packages/core/src/types.ts:78](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L78) -*** +--- ### IMAGE @@ -20,7 +20,7 @@ [packages/core/src/types.ts:79](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L79) -*** +--- ### LARGE @@ -30,7 +30,7 @@ [packages/core/src/types.ts:77](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L77) -*** +--- ### MEDIUM @@ -40,7 +40,7 @@ [packages/core/src/types.ts:76](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L76) -*** +--- ### SMALL diff --git a/docs/docs/api/enumerations/ModelProviderName.md b/docs/docs/api/enumerations/ModelProviderName.md index 55819cb77fa..d7c4e1e01d4 100644 --- a/docs/docs/api/enumerations/ModelProviderName.md +++ b/docs/docs/api/enumerations/ModelProviderName.md @@ -10,17 +10,17 @@ [packages/core/src/types.ts:121](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L121) -*** +--- -### CLAUDE\_VERTEX +### CLAUDE_VERTEX -> **CLAUDE\_VERTEX**: `"claude_vertex"` +> **CLAUDE_VERTEX**: `"claude_vertex"` #### Defined in [packages/core/src/types.ts:127](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L127) -*** +--- ### GOOGLE @@ -30,7 +30,7 @@ [packages/core/src/types.ts:126](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L126) -*** +--- ### GROK @@ -40,7 +40,7 @@ [packages/core/src/types.ts:122](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L122) -*** +--- ### GROQ @@ -50,7 +50,7 @@ [packages/core/src/types.ts:123](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L123) -*** +--- ### LLAMACLOUD @@ -60,7 +60,7 @@ [packages/core/src/types.ts:124](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L124) -*** +--- ### LLAMALOCAL @@ -70,7 +70,7 @@ [packages/core/src/types.ts:125](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L125) -*** +--- ### OLLAMA @@ -80,7 +80,7 @@ [packages/core/src/types.ts:130](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L130) -*** +--- ### OPENAI @@ -90,7 +90,7 @@ [packages/core/src/types.ts:120](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L120) -*** +--- ### OPENROUTER @@ -100,7 +100,7 @@ [packages/core/src/types.ts:129](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L129) -*** +--- ### REDPILL @@ -110,8 +110,7 @@ [packages/core/src/types.ts:128](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L128) - -*** +--- ### HEURIST diff --git a/docs/docs/api/enumerations/ServiceType.md b/docs/docs/api/enumerations/ServiceType.md index 786e3ea9e83..c78b9de3bb8 100644 --- a/docs/docs/api/enumerations/ServiceType.md +++ b/docs/docs/api/enumerations/ServiceType.md @@ -10,17 +10,17 @@ [packages/core/src/types.ts:650](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L650) -*** +--- -### IMAGE\_DESCRIPTION +### IMAGE_DESCRIPTION -> **IMAGE\_DESCRIPTION**: `"image_description"` +> **IMAGE_DESCRIPTION**: `"image_description"` #### Defined in [packages/core/src/types.ts:646](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L646) -*** +--- ### PDF @@ -30,27 +30,27 @@ [packages/core/src/types.ts:652](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L652) -*** +--- -### SPEECH\_GENERATION +### SPEECH_GENERATION -> **SPEECH\_GENERATION**: `"speech_generation"` +> **SPEECH_GENERATION**: `"speech_generation"` #### Defined in [packages/core/src/types.ts:651](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L651) -*** +--- -### TEXT\_GENERATION +### TEXT_GENERATION -> **TEXT\_GENERATION**: `"text_generation"` +> **TEXT_GENERATION**: `"text_generation"` #### Defined in [packages/core/src/types.ts:649](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L649) -*** +--- ### TRANSCRIPTION @@ -60,7 +60,7 @@ [packages/core/src/types.ts:647](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L647) -*** +--- ### VIDEO diff --git a/docs/docs/api/index.md b/docs/docs/api/index.md index 07126a4e683..b5ddee82178 100644 --- a/docs/docs/api/index.md +++ b/docs/docs/api/index.md @@ -6,38 +6,38 @@ ## Features -- 🛠 Full-featured Discord, Twitter and Telegram connectors -- 👥 Multi-agent and room support -- 📚 Easily ingest and interact with your documents -- 💾 Retrievable memory and document store -- 🚀 Highly extensible - create your own actions and clients to extend capabilities -- ☁️ Supports many models, including local Llama, OpenAI, Anthropic, Groq, and more -- 📦 Just works! +- 🛠 Full-featured Discord, Twitter and Telegram connectors +- 👥 Multi-agent and room support +- 📚 Easily ingest and interact with your documents +- 💾 Retrievable memory and document store +- 🚀 Highly extensible - create your own actions and clients to extend capabilities +- ☁️ Supports many models, including local Llama, OpenAI, Anthropic, Groq, and more +- 📦 Just works! ## What can I use it for? -- 🤖 Chatbots -- 🕵️ Autonomous Agents -- 📈 Business process handling -- 🎮 Video game NPCs +- 🤖 Chatbots +- 🕵️ Autonomous Agents +- 📈 Business process handling +- 🎮 Video game NPCs # Getting Started **Prerequisites (MUST):** - -- [Python 2.7+](https://www.python.org/downloads/) -- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) -- [pnpm](https://pnpm.io/installation) + +- [Python 2.7+](https://www.python.org/downloads/) +- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- [pnpm](https://pnpm.io/installation) ### Edit the .env file -- Copy .env.example to .env and fill in the appropriate values -- Edit the TWITTER environment variables to add your bot's username and password +- Copy .env.example to .env and fill in the appropriate values +- Edit the TWITTER environment variables to add your bot's username and password ### Edit the character file -- Check out the file `src/core/defaultCharacter.ts` - you can modify this -- You can also load characters with the `pnpm start --characters="path/to/your/character.json"` and run multiple bots at the same time. +- Check out the file `src/core/defaultCharacter.ts` - you can modify this +- You can also load characters with the `pnpm start --characters="path/to/your/character.json"` and run multiple bots at the same time. After setting up the .env file and character file, you can start the bot with the following command: @@ -170,9 +170,9 @@ pnpm test:sqljs # Run tests with SQL.js Tests are written using Jest and can be found in `src/**/*.test.ts` files. The test environment is configured to: -- Load environment variables from `.env.test` -- Use a 2-minute timeout for long-running tests -- Support ESM modules -- Run tests in sequence (--runInBand) +- Load environment variables from `.env.test` +- Use a 2-minute timeout for long-running tests +- Support ESM modules +- Run tests in sequence (--runInBand) To create new tests, add a `.test.ts` file adjacent to the code you're testing. diff --git a/docs/docs/api/interfaces/Account.md b/docs/docs/api/interfaces/Account.md index 95caadf8f8b..07bb2354d15 100644 --- a/docs/docs/api/interfaces/Account.md +++ b/docs/docs/api/interfaces/Account.md @@ -12,7 +12,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:278](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L278) -*** +--- ### details? @@ -20,13 +20,13 @@ Represents a user, including their name, details, and a unique identifier. #### Index Signature - \[`key`: `string`\]: `any` +\[`key`: `string`\]: `any` #### Defined in [packages/core/src/types.ts:276](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L276) -*** +--- ### email? @@ -36,7 +36,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:277](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L277) -*** +--- ### id @@ -46,7 +46,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:273](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L273) -*** +--- ### name @@ -56,7 +56,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:274](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L274) -*** +--- ### username diff --git a/docs/docs/api/interfaces/Action.md b/docs/docs/api/interfaces/Action.md index 32c778c16b6..cf6c7484244 100644 --- a/docs/docs/api/interfaces/Action.md +++ b/docs/docs/api/interfaces/Action.md @@ -12,7 +12,7 @@ Represents an action that the agent can perform, including conditions for its us [packages/core/src/types.ts:216](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L216) -*** +--- ### examples @@ -22,7 +22,7 @@ Represents an action that the agent can perform, including conditions for its us [packages/core/src/types.ts:217](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L217) -*** +--- ### handler @@ -32,7 +32,7 @@ Represents an action that the agent can perform, including conditions for its us [packages/core/src/types.ts:218](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L218) -*** +--- ### name @@ -42,7 +42,7 @@ Represents an action that the agent can perform, including conditions for its us [packages/core/src/types.ts:219](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L219) -*** +--- ### similes @@ -52,7 +52,7 @@ Represents an action that the agent can perform, including conditions for its us [packages/core/src/types.ts:215](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L215) -*** +--- ### validate diff --git a/docs/docs/api/interfaces/ActionExample.md b/docs/docs/api/interfaces/ActionExample.md index 6f3afb1d736..dcb2e26bf6b 100644 --- a/docs/docs/api/interfaces/ActionExample.md +++ b/docs/docs/api/interfaces/ActionExample.md @@ -12,7 +12,7 @@ Represents an example of content, typically used for demonstrating or testing pu [packages/core/src/types.ts:26](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L26) -*** +--- ### user diff --git a/docs/docs/api/interfaces/Actor.md b/docs/docs/api/interfaces/Actor.md index 99acfab1930..9a2def83147 100644 --- a/docs/docs/api/interfaces/Actor.md +++ b/docs/docs/api/interfaces/Actor.md @@ -24,7 +24,7 @@ Represents an actor in the conversation, which could be a user or the agent itse [packages/core/src/types.ts:43](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L43) -*** +--- ### id @@ -34,7 +34,7 @@ Represents an actor in the conversation, which could be a user or the agent itse [packages/core/src/types.ts:44](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L44) -*** +--- ### name @@ -44,7 +44,7 @@ Represents an actor in the conversation, which could be a user or the agent itse [packages/core/src/types.ts:41](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L41) -*** +--- ### username diff --git a/docs/docs/api/interfaces/Content.md b/docs/docs/api/interfaces/Content.md index fc01d7fff41..54754c4bfc3 100644 --- a/docs/docs/api/interfaces/Content.md +++ b/docs/docs/api/interfaces/Content.md @@ -4,7 +4,7 @@ Represents the content of a message, including its main text (`content`), any as ## Indexable - \[`key`: `string`\]: `unknown` +\[`key`: `string`\]: `unknown` ## Properties @@ -16,7 +16,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:13](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L13) -*** +--- ### attachments? @@ -26,7 +26,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:17](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L17) -*** +--- ### inReplyTo? @@ -36,7 +36,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:16](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L16) -*** +--- ### source? @@ -46,7 +46,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:14](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L14) -*** +--- ### text @@ -56,7 +56,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:12](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L12) -*** +--- ### url? diff --git a/docs/docs/api/interfaces/ConversationExample.md b/docs/docs/api/interfaces/ConversationExample.md index 770dbbd7e0c..bb042753e98 100644 --- a/docs/docs/api/interfaces/ConversationExample.md +++ b/docs/docs/api/interfaces/ConversationExample.md @@ -12,7 +12,7 @@ Represents an example of content, typically used for demonstrating or testing pu [packages/core/src/types.ts:34](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L34) -*** +--- ### userId diff --git a/docs/docs/api/interfaces/EvaluationExample.md b/docs/docs/api/interfaces/EvaluationExample.md index 26e09982fb5..0786a1dbeea 100644 --- a/docs/docs/api/interfaces/EvaluationExample.md +++ b/docs/docs/api/interfaces/EvaluationExample.md @@ -12,7 +12,7 @@ Represents an example for evaluation, including the context, an array of message [packages/core/src/types.ts:227](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L227) -*** +--- ### messages @@ -22,7 +22,7 @@ Represents an example for evaluation, including the context, an array of message [packages/core/src/types.ts:228](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L228) -*** +--- ### outcome diff --git a/docs/docs/api/interfaces/Evaluator.md b/docs/docs/api/interfaces/Evaluator.md index f0fb1e9b6ba..04d90ae272d 100644 --- a/docs/docs/api/interfaces/Evaluator.md +++ b/docs/docs/api/interfaces/Evaluator.md @@ -12,7 +12,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:236](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L236) -*** +--- ### description @@ -22,7 +22,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:237](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L237) -*** +--- ### examples @@ -32,7 +32,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:239](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L239) -*** +--- ### handler @@ -42,7 +42,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:240](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L240) -*** +--- ### name @@ -52,7 +52,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:241](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L241) -*** +--- ### similes @@ -62,7 +62,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:238](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L238) -*** +--- ### validate diff --git a/docs/docs/api/interfaces/Goal.md b/docs/docs/api/interfaces/Goal.md index e6706174537..5b51b2566ed 100644 --- a/docs/docs/api/interfaces/Goal.md +++ b/docs/docs/api/interfaces/Goal.md @@ -12,7 +12,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:66](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L66) -*** +--- ### name @@ -22,7 +22,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:69](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L69) -*** +--- ### objectives @@ -32,7 +32,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:71](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L71) -*** +--- ### roomId @@ -42,7 +42,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:67](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L67) -*** +--- ### status @@ -52,7 +52,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:70](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L70) -*** +--- ### userId diff --git a/docs/docs/api/interfaces/IAgentRuntime.md b/docs/docs/api/interfaces/IAgentRuntime.md index 007ddb63ac8..f68111ca3fb 100644 --- a/docs/docs/api/interfaces/IAgentRuntime.md +++ b/docs/docs/api/interfaces/IAgentRuntime.md @@ -10,7 +10,7 @@ [packages/core/src/types.ts:527](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L527) -*** +--- ### agentId @@ -20,7 +20,7 @@ [packages/core/src/types.ts:520](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L520) -*** +--- ### character @@ -30,7 +30,7 @@ [packages/core/src/types.ts:525](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L525) -*** +--- ### databaseAdapter @@ -40,7 +40,7 @@ [packages/core/src/types.ts:522](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L522) -*** +--- ### descriptionManager @@ -50,7 +50,7 @@ [packages/core/src/types.ts:531](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L531) -*** +--- ### evaluators @@ -60,7 +60,7 @@ [packages/core/src/types.ts:528](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L528) -*** +--- ### loreManager @@ -70,7 +70,7 @@ [packages/core/src/types.ts:532](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L532) -*** +--- ### messageManager @@ -80,7 +80,7 @@ [packages/core/src/types.ts:530](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L530) -*** +--- ### modelProvider @@ -90,7 +90,7 @@ [packages/core/src/types.ts:524](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L524) -*** +--- ### providers @@ -100,7 +100,7 @@ [packages/core/src/types.ts:526](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L526) -*** +--- ### serverUrl @@ -110,7 +110,7 @@ [packages/core/src/types.ts:521](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L521) -*** +--- ### services @@ -120,7 +120,7 @@ [packages/core/src/types.ts:534](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L534) -*** +--- ### token @@ -150,7 +150,7 @@ [packages/core/src/types.ts:575](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L575) -*** +--- ### ensureConnection() @@ -176,7 +176,7 @@ [packages/core/src/types.ts:566](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L566) -*** +--- ### ensureParticipantExists() @@ -196,7 +196,7 @@ [packages/core/src/types.ts:558](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L558) -*** +--- ### ensureParticipantInRoom() @@ -216,7 +216,7 @@ [packages/core/src/types.ts:573](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L573) -*** +--- ### ensureRoomExists() @@ -234,7 +234,7 @@ [packages/core/src/types.ts:574](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L574) -*** +--- ### ensureUserExists() @@ -258,7 +258,7 @@ [packages/core/src/types.ts:559](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L559) -*** +--- ### evaluate() @@ -280,7 +280,7 @@ [packages/core/src/types.ts:553](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L553) -*** +--- ### getConversationLength() @@ -294,7 +294,7 @@ [packages/core/src/types.ts:546](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L546) -*** +--- ### getMemoryManager() @@ -312,11 +312,11 @@ [packages/core/src/types.ts:537](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L537) -*** +--- ### getService() -> **getService**(`service`): *typeof* [`Service`](../classes/Service.md) +> **getService**(`service`): _typeof_ [`Service`](../classes/Service.md) #### Parameters @@ -324,13 +324,13 @@ #### Returns -*typeof* [`Service`](../classes/Service.md) +_typeof_ [`Service`](../classes/Service.md) #### Defined in [packages/core/src/types.ts:539](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L539) -*** +--- ### getSetting() @@ -348,7 +348,7 @@ [packages/core/src/types.ts:543](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L543) -*** +--- ### processActions() @@ -372,7 +372,7 @@ [packages/core/src/types.ts:547](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L547) -*** +--- ### registerAction() @@ -390,7 +390,7 @@ [packages/core/src/types.ts:565](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L565) -*** +--- ### registerMemoryManager() @@ -408,7 +408,7 @@ [packages/core/src/types.ts:535](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L535) -*** +--- ### registerService() @@ -426,7 +426,7 @@ [packages/core/src/types.ts:541](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L541) -*** +--- ### updateRecentMessageState() diff --git a/docs/docs/api/interfaces/IBrowserService.md b/docs/docs/api/interfaces/IBrowserService.md index 68b05ceb084..e7b69ba81af 100644 --- a/docs/docs/api/interfaces/IBrowserService.md +++ b/docs/docs/api/interfaces/IBrowserService.md @@ -18,7 +18,7 @@ [packages/core/src/types.ts:630](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L630) -*** +--- ### getPageContent() @@ -50,7 +50,7 @@ [packages/core/src/types.ts:631](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L631) -*** +--- ### initialize() diff --git a/docs/docs/api/interfaces/IDatabaseAdapter.md b/docs/docs/api/interfaces/IDatabaseAdapter.md index 5fd2d8e6ac4..602c7b5ff85 100644 --- a/docs/docs/api/interfaces/IDatabaseAdapter.md +++ b/docs/docs/api/interfaces/IDatabaseAdapter.md @@ -30,7 +30,7 @@ [packages/core/src/types.ts:445](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L445) -*** +--- ### countMemories() @@ -52,7 +52,7 @@ [packages/core/src/types.ts:425](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L425) -*** +--- ### createAccount() @@ -70,7 +70,7 @@ [packages/core/src/types.ts:365](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L365) -*** +--- ### createGoal() @@ -88,7 +88,7 @@ [packages/core/src/types.ts:437](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L437) -*** +--- ### createMemory() @@ -110,7 +110,7 @@ [packages/core/src/types.ts:418](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L418) -*** +--- ### createRelationship() @@ -132,7 +132,7 @@ [packages/core/src/types.ts:458](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L458) -*** +--- ### createRoom() @@ -150,7 +150,7 @@ [packages/core/src/types.ts:441](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L441) -*** +--- ### getAccountById() @@ -168,7 +168,7 @@ [packages/core/src/types.ts:364](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L364) -*** +--- ### getActorDetails() @@ -188,7 +188,7 @@ [packages/core/src/types.ts:394](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L394) -*** +--- ### getCachedEmbeddings() @@ -198,17 +198,17 @@ • **params** -• **params.query\_field\_name**: `string` +• **params.query_field_name**: `string` -• **params.query\_field\_sub\_name**: `string` +• **params.query_field_sub_name**: `string` -• **params.query\_input**: `string` +• **params.query_input**: `string` -• **params.query\_match\_count**: `number` +• **params.query_match_count**: `number` -• **params.query\_table\_name**: `string` +• **params.query_table_name**: `string` -• **params.query\_threshold**: `number` +• **params.query_threshold**: `number` #### Returns @@ -218,7 +218,7 @@ [packages/core/src/types.ts:380](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L380) -*** +--- ### getGoals() @@ -244,7 +244,7 @@ [packages/core/src/types.ts:430](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L430) -*** +--- ### getMemories() @@ -276,7 +276,7 @@ [packages/core/src/types.ts:366](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L366) -*** +--- ### getMemoriesByRoomIds() @@ -298,7 +298,7 @@ [packages/core/src/types.ts:376](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L376) -*** +--- ### getMemoryById() @@ -316,7 +316,7 @@ [packages/core/src/types.ts:375](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L375) -*** +--- ### getParticipantsForAccount() @@ -334,7 +334,7 @@ [packages/core/src/types.ts:447](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L447) -*** +--- ### getParticipantsForRoom() @@ -352,7 +352,7 @@ [packages/core/src/types.ts:448](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L448) -*** +--- ### getParticipantUserState() @@ -372,7 +372,7 @@ [packages/core/src/types.ts:449](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L449) -*** +--- ### getRelationship() @@ -394,7 +394,7 @@ [packages/core/src/types.ts:459](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L459) -*** +--- ### getRelationships() @@ -414,7 +414,7 @@ [packages/core/src/types.ts:463](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L463) -*** +--- ### getRoom() @@ -432,7 +432,7 @@ [packages/core/src/types.ts:440](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L440) -*** +--- ### getRoomsForParticipant() @@ -450,7 +450,7 @@ [packages/core/src/types.ts:443](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L443) -*** +--- ### getRoomsForParticipants() @@ -468,7 +468,7 @@ [packages/core/src/types.ts:444](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L444) -*** +--- ### log() @@ -494,7 +494,7 @@ [packages/core/src/types.ts:388](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L388) -*** +--- ### removeAllGoals() @@ -512,7 +512,7 @@ [packages/core/src/types.ts:439](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L439) -*** +--- ### removeAllMemories() @@ -532,7 +532,7 @@ [packages/core/src/types.ts:424](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L424) -*** +--- ### removeGoal() @@ -550,7 +550,7 @@ [packages/core/src/types.ts:438](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L438) -*** +--- ### removeMemory() @@ -570,7 +570,7 @@ [packages/core/src/types.ts:423](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L423) -*** +--- ### removeParticipant() @@ -590,7 +590,7 @@ [packages/core/src/types.ts:446](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L446) -*** +--- ### removeRoom() @@ -608,7 +608,7 @@ [packages/core/src/types.ts:442](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L442) -*** +--- ### searchMemories() @@ -620,9 +620,9 @@ • **params.embedding**: `number`[] -• **params.match\_count**: `number` +• **params.match_count**: `number` -• **params.match\_threshold**: `number` +• **params.match_threshold**: `number` • **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` @@ -638,7 +638,7 @@ [packages/core/src/types.ts:395](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L395) -*** +--- ### searchMemoriesByEmbedding() @@ -654,7 +654,7 @@ • **params.count?**: `number` -• **params.match\_threshold?**: `number` +• **params.match_threshold?**: `number` • **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` @@ -670,7 +670,7 @@ [packages/core/src/types.ts:407](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L407) -*** +--- ### setParticipantUserState() @@ -692,7 +692,7 @@ [packages/core/src/types.ts:453](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L453) -*** +--- ### updateGoal() @@ -710,7 +710,7 @@ [packages/core/src/types.ts:436](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L436) -*** +--- ### updateGoalStatus() diff --git a/docs/docs/api/interfaces/IImageDescriptionService.md b/docs/docs/api/interfaces/IImageDescriptionService.md index 88eb6bd5924..47b766c3797 100644 --- a/docs/docs/api/interfaces/IImageDescriptionService.md +++ b/docs/docs/api/interfaces/IImageDescriptionService.md @@ -30,7 +30,7 @@ [packages/core/src/types.ts:585](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L585) -*** +--- ### getInstance() @@ -44,7 +44,7 @@ [packages/core/src/types.ts:583](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L583) -*** +--- ### initialize() diff --git a/docs/docs/api/interfaces/IMemoryManager.md b/docs/docs/api/interfaces/IMemoryManager.md index 4bac2ef5fd7..51651200cb8 100644 --- a/docs/docs/api/interfaces/IMemoryManager.md +++ b/docs/docs/api/interfaces/IMemoryManager.md @@ -10,7 +10,7 @@ [packages/core/src/types.ts:470](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L470) -*** +--- ### runtime @@ -20,7 +20,7 @@ [packages/core/src/types.ts:467](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L467) -*** +--- ### tableName @@ -48,7 +48,7 @@ [packages/core/src/types.ts:472](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L472) -*** +--- ### countMemories() @@ -68,7 +68,7 @@ [packages/core/src/types.ts:502](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L502) -*** +--- ### createMemory() @@ -88,7 +88,7 @@ [packages/core/src/types.ts:499](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L499) -*** +--- ### getCachedEmbeddings() @@ -106,7 +106,7 @@ [packages/core/src/types.ts:481](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L481) -*** +--- ### getMemories() @@ -136,7 +136,7 @@ [packages/core/src/types.ts:473](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L473) -*** +--- ### getMemoriesByRoomIds() @@ -158,7 +158,7 @@ [packages/core/src/types.ts:485](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L485) -*** +--- ### getMemoryById() @@ -176,7 +176,7 @@ [packages/core/src/types.ts:484](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L484) -*** +--- ### removeAllMemories() @@ -194,7 +194,7 @@ [packages/core/src/types.ts:501](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L501) -*** +--- ### removeMemory() @@ -212,7 +212,7 @@ [packages/core/src/types.ts:500](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L500) -*** +--- ### searchMemoriesByEmbedding() @@ -228,7 +228,7 @@ • **opts.count?**: `number` -• **opts.match\_threshold?**: `number` +• **opts.match_threshold?**: `number` • **opts.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` diff --git a/docs/docs/api/interfaces/ITextGenerationService.md b/docs/docs/api/interfaces/ITextGenerationService.md index d9a473e32b6..b1e4c76baa7 100644 --- a/docs/docs/api/interfaces/ITextGenerationService.md +++ b/docs/docs/api/interfaces/ITextGenerationService.md @@ -22,7 +22,7 @@ [packages/core/src/types.ts:625](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L625) -*** +--- ### getInstance() @@ -36,7 +36,7 @@ [packages/core/src/types.ts:607](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L607) -*** +--- ### initializeModel() @@ -50,7 +50,7 @@ [packages/core/src/types.ts:608](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L608) -*** +--- ### queueMessageCompletion() @@ -64,11 +64,11 @@ • **stop**: `string`[] -• **frequency\_penalty**: `number` +• **frequency_penalty**: `number` -• **presence\_penalty**: `number` +• **presence_penalty**: `number` -• **max\_tokens**: `number` +• **max_tokens**: `number` #### Returns @@ -78,7 +78,7 @@ [packages/core/src/types.ts:609](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L609) -*** +--- ### queueTextCompletion() @@ -92,11 +92,11 @@ • **stop**: `string`[] -• **frequency\_penalty**: `number` +• **frequency_penalty**: `number` -• **presence\_penalty**: `number` +• **presence_penalty**: `number` -• **max\_tokens**: `number` +• **max_tokens**: `number` #### Returns diff --git a/docs/docs/api/interfaces/ITranscriptionService.md b/docs/docs/api/interfaces/ITranscriptionService.md index 680f2d02aa7..b316b93881f 100644 --- a/docs/docs/api/interfaces/ITranscriptionService.md +++ b/docs/docs/api/interfaces/ITranscriptionService.md @@ -22,7 +22,7 @@ [packages/core/src/types.ts:595](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L595) -*** +--- ### transcribeAttachment() @@ -40,7 +40,7 @@ [packages/core/src/types.ts:591](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L591) -*** +--- ### transcribeAttachmentLocally() @@ -58,7 +58,7 @@ [packages/core/src/types.ts:592](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L592) -*** +--- ### transcribeLocally() diff --git a/docs/docs/api/interfaces/IVideoService.md b/docs/docs/api/interfaces/IVideoService.md index 869f3b6ab05..8d4b7c85287 100644 --- a/docs/docs/api/interfaces/IVideoService.md +++ b/docs/docs/api/interfaces/IVideoService.md @@ -22,7 +22,7 @@ [packages/core/src/types.ts:603](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L603) -*** +--- ### fetchVideoInfo() @@ -40,7 +40,7 @@ [packages/core/src/types.ts:602](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L602) -*** +--- ### isVideoUrl() @@ -58,7 +58,7 @@ [packages/core/src/types.ts:600](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L600) -*** +--- ### processVideo() diff --git a/docs/docs/api/interfaces/Memory.md b/docs/docs/api/interfaces/Memory.md index f4d3853c543..9890a223434 100644 --- a/docs/docs/api/interfaces/Memory.md +++ b/docs/docs/api/interfaces/Memory.md @@ -12,7 +12,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:169](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L169) -*** +--- ### content @@ -22,7 +22,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:171](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L171) -*** +--- ### createdAt? @@ -32,7 +32,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:170](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L170) -*** +--- ### embedding? @@ -42,7 +42,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:172](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L172) -*** +--- ### id? @@ -52,7 +52,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:167](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L167) -*** +--- ### roomId @@ -62,7 +62,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:173](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L173) -*** +--- ### unique? @@ -72,7 +72,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:174](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L174) -*** +--- ### userId diff --git a/docs/docs/api/interfaces/MessageExample.md b/docs/docs/api/interfaces/MessageExample.md index 7d382ce7a84..3d1d74960dd 100644 --- a/docs/docs/api/interfaces/MessageExample.md +++ b/docs/docs/api/interfaces/MessageExample.md @@ -12,7 +12,7 @@ Represents an example of a message, typically used for demonstrating or testing [packages/core/src/types.ts:182](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L182) -*** +--- ### user diff --git a/docs/docs/api/interfaces/Objective.md b/docs/docs/api/interfaces/Objective.md index 6f22a6552de..b580bcc4bd4 100644 --- a/docs/docs/api/interfaces/Objective.md +++ b/docs/docs/api/interfaces/Objective.md @@ -12,7 +12,7 @@ Represents an objective within a goal, detailing what needs to be achieved and w [packages/core/src/types.ts:53](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L53) -*** +--- ### description @@ -22,7 +22,7 @@ Represents an objective within a goal, detailing what needs to be achieved and w [packages/core/src/types.ts:52](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L52) -*** +--- ### id? diff --git a/docs/docs/api/interfaces/Participant.md b/docs/docs/api/interfaces/Participant.md index 121b76e5db2..a8f1ef64d17 100644 --- a/docs/docs/api/interfaces/Participant.md +++ b/docs/docs/api/interfaces/Participant.md @@ -12,7 +12,7 @@ Represents a participant in a room, including their ID and account details. [packages/core/src/types.ts:286](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L286) -*** +--- ### id diff --git a/docs/docs/api/interfaces/Relationship.md b/docs/docs/api/interfaces/Relationship.md index e79298c5b96..25dd5e56d44 100644 --- a/docs/docs/api/interfaces/Relationship.md +++ b/docs/docs/api/interfaces/Relationship.md @@ -12,7 +12,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:266](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L266) -*** +--- ### id @@ -22,7 +22,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:260](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L260) -*** +--- ### roomId @@ -32,7 +32,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:264](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L264) -*** +--- ### status @@ -42,7 +42,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:265](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L265) -*** +--- ### userA @@ -52,7 +52,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:261](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L261) -*** +--- ### userB @@ -62,7 +62,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:262](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L262) -*** +--- ### userId diff --git a/docs/docs/api/interfaces/Room.md b/docs/docs/api/interfaces/Room.md index b89652b994a..7562f6531e7 100644 --- a/docs/docs/api/interfaces/Room.md +++ b/docs/docs/api/interfaces/Room.md @@ -12,7 +12,7 @@ Represents a room or conversation context, including its ID and a list of partic [packages/core/src/types.ts:293](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L293) -*** +--- ### participants diff --git a/docs/docs/api/interfaces/State.md b/docs/docs/api/interfaces/State.md index 774f0a29bfb..e0044b3b86b 100644 --- a/docs/docs/api/interfaces/State.md +++ b/docs/docs/api/interfaces/State.md @@ -4,7 +4,7 @@ Represents the state of the conversation or context in which the agent is operat ## Indexable - \[`key`: `string`\]: `unknown` +\[`key`: `string`\]: `unknown` ## Properties @@ -16,7 +16,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:155](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L155) -*** +--- ### actionNames? @@ -26,7 +26,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:152](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L152) -*** +--- ### actions? @@ -36,7 +36,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:153](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L153) -*** +--- ### actionsData? @@ -46,7 +46,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:154](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L154) -*** +--- ### actors @@ -56,7 +56,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:146](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L146) -*** +--- ### actorsData? @@ -66,7 +66,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:147](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L147) -*** +--- ### agentId? @@ -76,7 +76,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:138](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L138) -*** +--- ### agentName? @@ -86,7 +86,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:144](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L144) -*** +--- ### bio @@ -96,7 +96,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:139](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L139) -*** +--- ### goals? @@ -106,7 +106,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:148](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L148) -*** +--- ### goalsData? @@ -116,7 +116,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:149](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L149) -*** +--- ### lore @@ -126,7 +126,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:140](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L140) -*** +--- ### messageDirections @@ -136,7 +136,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:141](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L141) -*** +--- ### postDirections @@ -146,7 +146,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:142](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L142) -*** +--- ### providers? @@ -156,7 +156,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:156](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L156) -*** +--- ### recentInteractions? @@ -166,7 +166,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:159](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L159) -*** +--- ### recentInteractionsData? @@ -176,7 +176,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:158](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L158) -*** +--- ### recentMessages @@ -186,7 +186,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:150](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L150) -*** +--- ### recentMessagesData @@ -196,7 +196,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:151](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L151) -*** +--- ### responseData? @@ -206,7 +206,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:157](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L157) -*** +--- ### roomId @@ -216,7 +216,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:143](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L143) -*** +--- ### senderName? @@ -226,7 +226,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:145](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L145) -*** +--- ### userId? diff --git a/docs/docs/api/type-aliases/Character.md b/docs/docs/api/type-aliases/Character.md index f51884bb3fc..77f9c8822ee 100644 --- a/docs/docs/api/type-aliases/Character.md +++ b/docs/docs/api/type-aliases/Character.md @@ -74,7 +74,7 @@ #### Index Signature - \[`key`: `string`\]: `string` +\[`key`: `string`\]: `string` ### settings.voice? @@ -114,7 +114,7 @@ #### Index Signature - \[`key`: `string`\]: `string` +\[`key`: `string`\]: `string` ### topics diff --git a/docs/docs/api/type-aliases/Model.md b/docs/docs/api/type-aliases/Model.md index 74f0c15d71a..e5ee20e3341 100644 --- a/docs/docs/api/type-aliases/Model.md +++ b/docs/docs/api/type-aliases/Model.md @@ -44,9 +44,9 @@ > **settings**: `object` -### settings.frequency\_penalty? +### settings.frequency_penalty? -> `optional` **frequency\_penalty**: `number` +> `optional` **frequency_penalty**: `number` ### settings.maxInputTokens @@ -56,13 +56,13 @@ > **maxOutputTokens**: `number` -### settings.presence\_penalty? +### settings.presence_penalty? -> `optional` **presence\_penalty**: `number` +> `optional` **presence_penalty**: `number` -### settings.repetition\_penalty? +### settings.repetition_penalty? -> `optional` **repetition\_penalty**: `number` +> `optional` **repetition_penalty**: `number` ### settings.stop diff --git a/docs/docs/api/type-aliases/Models.md b/docs/docs/api/type-aliases/Models.md index 504f9779120..6b21703b900 100644 --- a/docs/docs/api/type-aliases/Models.md +++ b/docs/docs/api/type-aliases/Models.md @@ -8,9 +8,9 @@ > **anthropic**: [`Model`](Model.md) -### claude\_vertex +### claude_vertex -> **claude\_vertex**: [`Model`](Model.md) +> **claude_vertex**: [`Model`](Model.md) ### google @@ -24,13 +24,13 @@ > **groq**: [`Model`](Model.md) -### llama\_cloud +### llama_cloud -> **llama\_cloud**: [`Model`](Model.md) +> **llama_cloud**: [`Model`](Model.md) -### llama\_local +### llama_local -> **llama\_local**: [`Model`](Model.md) +> **llama_local**: [`Model`](Model.md) ### ollama diff --git a/docs/docs/api/typedoc-sidebar.cjs b/docs/docs/api/typedoc-sidebar.cjs index ff4ac8aa329..632c01123fe 100644 --- a/docs/docs/api/typedoc-sidebar.cjs +++ b/docs/docs/api/typedoc-sidebar.cjs @@ -1,4 +1,347 @@ // @ts-check /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ -const typedocSidebar = { items: [{"type":"category","label":"Enumerations","items":[{"type":"doc","id":"api/enumerations/Clients","label":"Clients"},{"type":"doc","id":"api/enumerations/GoalStatus","label":"GoalStatus"},{"type":"doc","id":"api/enumerations/ModelClass","label":"ModelClass"},{"type":"doc","id":"api/enumerations/ModelProviderName","label":"ModelProviderName"},{"type":"doc","id":"api/enumerations/ServiceType","label":"ServiceType"}]},{"type":"category","label":"Classes","items":[{"type":"doc","id":"api/classes/AgentRuntime","label":"AgentRuntime"},{"type":"doc","id":"api/classes/DatabaseAdapter","label":"DatabaseAdapter"},{"type":"doc","id":"api/classes/MemoryManager","label":"MemoryManager"},{"type":"doc","id":"api/classes/Service","label":"Service"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"api/interfaces/Account","label":"Account"},{"type":"doc","id":"api/interfaces/Action","label":"Action"},{"type":"doc","id":"api/interfaces/ActionExample","label":"ActionExample"},{"type":"doc","id":"api/interfaces/Actor","label":"Actor"},{"type":"doc","id":"api/interfaces/Content","label":"Content"},{"type":"doc","id":"api/interfaces/ConversationExample","label":"ConversationExample"},{"type":"doc","id":"api/interfaces/EvaluationExample","label":"EvaluationExample"},{"type":"doc","id":"api/interfaces/Evaluator","label":"Evaluator"},{"type":"doc","id":"api/interfaces/Goal","label":"Goal"},{"type":"doc","id":"api/interfaces/IAgentRuntime","label":"IAgentRuntime"},{"type":"doc","id":"api/interfaces/IBrowserService","label":"IBrowserService"},{"type":"doc","id":"api/interfaces/IDatabaseAdapter","label":"IDatabaseAdapter"},{"type":"doc","id":"api/interfaces/IImageDescriptionService","label":"IImageDescriptionService"},{"type":"doc","id":"api/interfaces/IMemoryManager","label":"IMemoryManager"},{"type":"doc","id":"api/interfaces/IPdfService","label":"IPdfService"},{"type":"doc","id":"api/interfaces/ISpeechService","label":"ISpeechService"},{"type":"doc","id":"api/interfaces/ITextGenerationService","label":"ITextGenerationService"},{"type":"doc","id":"api/interfaces/ITranscriptionService","label":"ITranscriptionService"},{"type":"doc","id":"api/interfaces/IVideoService","label":"IVideoService"},{"type":"doc","id":"api/interfaces/Memory","label":"Memory"},{"type":"doc","id":"api/interfaces/MessageExample","label":"MessageExample"},{"type":"doc","id":"api/interfaces/Objective","label":"Objective"},{"type":"doc","id":"api/interfaces/Participant","label":"Participant"},{"type":"doc","id":"api/interfaces/Provider","label":"Provider"},{"type":"doc","id":"api/interfaces/Relationship","label":"Relationship"},{"type":"doc","id":"api/interfaces/Room","label":"Room"},{"type":"doc","id":"api/interfaces/State","label":"State"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"api/type-aliases/Character","label":"Character"},{"type":"doc","id":"api/type-aliases/Client","label":"Client"},{"type":"doc","id":"api/type-aliases/Handler","label":"Handler"},{"type":"doc","id":"api/type-aliases/HandlerCallback","label":"HandlerCallback"},{"type":"doc","id":"api/type-aliases/Media","label":"Media"},{"type":"doc","id":"api/type-aliases/Model","label":"Model"},{"type":"doc","id":"api/type-aliases/Models","label":"Models"},{"type":"doc","id":"api/type-aliases/Plugin","label":"Plugin"},{"type":"doc","id":"api/type-aliases/UUID","label":"UUID"},{"type":"doc","id":"api/type-aliases/Validator","label":"Validator"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"api/variables/defaultCharacter","label":"defaultCharacter"},{"type":"doc","id":"api/variables/elizaLogger","label":"elizaLogger"},{"type":"doc","id":"api/variables/embeddingDimension","label":"embeddingDimension"},{"type":"doc","id":"api/variables/embeddingZeroVector","label":"embeddingZeroVector"},{"type":"doc","id":"api/variables/evaluationTemplate","label":"evaluationTemplate"},{"type":"doc","id":"api/variables/settings","label":"settings"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"api/functions/addHeader","label":"addHeader"},{"type":"doc","id":"api/functions/composeActionExamples","label":"composeActionExamples"},{"type":"doc","id":"api/functions/composeContext","label":"composeContext"},{"type":"doc","id":"api/functions/createGoal","label":"createGoal"},{"type":"doc","id":"api/functions/createRelationship","label":"createRelationship"},{"type":"doc","id":"api/functions/embed","label":"embed"},{"type":"doc","id":"api/functions/findNearestEnvFile","label":"findNearestEnvFile"},{"type":"doc","id":"api/functions/formatActionNames","label":"formatActionNames"},{"type":"doc","id":"api/functions/formatActions","label":"formatActions"},{"type":"doc","id":"api/functions/formatActors","label":"formatActors"},{"type":"doc","id":"api/functions/formatEvaluatorExampleDescriptions","label":"formatEvaluatorExampleDescriptions"},{"type":"doc","id":"api/functions/formatEvaluatorExamples","label":"formatEvaluatorExamples"},{"type":"doc","id":"api/functions/formatEvaluatorNames","label":"formatEvaluatorNames"},{"type":"doc","id":"api/functions/formatEvaluators","label":"formatEvaluators"},{"type":"doc","id":"api/functions/formatGoalsAsString","label":"formatGoalsAsString"},{"type":"doc","id":"api/functions/formatMessages","label":"formatMessages"},{"type":"doc","id":"api/functions/formatPosts","label":"formatPosts"},{"type":"doc","id":"api/functions/formatRelationships","label":"formatRelationships"},{"type":"doc","id":"api/functions/formatTimestamp","label":"formatTimestamp"},{"type":"doc","id":"api/functions/generateCaption","label":"generateCaption"},{"type":"doc","id":"api/functions/generateImage","label":"generateImage"},{"type":"doc","id":"api/functions/generateMessageResponse","label":"generateMessageResponse"},{"type":"doc","id":"api/functions/generateObject","label":"generateObject"},{"type":"doc","id":"api/functions/generateObjectArray","label":"generateObjectArray"},{"type":"doc","id":"api/functions/generateShouldRespond","label":"generateShouldRespond"},{"type":"doc","id":"api/functions/generateText","label":"generateText"},{"type":"doc","id":"api/functions/generateTextArray","label":"generateTextArray"},{"type":"doc","id":"api/functions/generateTrueOrFalse","label":"generateTrueOrFalse"},{"type":"doc","id":"api/functions/getActorDetails","label":"getActorDetails"},{"type":"doc","id":"api/functions/getEndpoint","label":"getEndpoint"},{"type":"doc","id":"api/functions/getGoals","label":"getGoals"},{"type":"doc","id":"api/functions/getModel","label":"getModel"},{"type":"doc","id":"api/functions/getProviders","label":"getProviders"},{"type":"doc","id":"api/functions/getRelationship","label":"getRelationship"},{"type":"doc","id":"api/functions/getRelationships","label":"getRelationships"},{"type":"doc","id":"api/functions/loadEnvConfig","label":"loadEnvConfig"},{"type":"doc","id":"api/functions/retrieveCachedEmbedding","label":"retrieveCachedEmbedding"},{"type":"doc","id":"api/functions/splitChunks","label":"splitChunks"},{"type":"doc","id":"api/functions/trimTokens","label":"trimTokens"},{"type":"doc","id":"api/functions/updateGoal","label":"updateGoal"}]}]}; -module.exports = typedocSidebar.items; \ No newline at end of file +const typedocSidebar = { + items: [ + { + type: "category", + label: "Enumerations", + items: [ + { type: "doc", id: "api/enumerations/Clients", label: "Clients" }, + { type: "doc", id: "api/enumerations/GoalStatus", label: "GoalStatus" }, + { type: "doc", id: "api/enumerations/ModelClass", label: "ModelClass" }, + { + type: "doc", + id: "api/enumerations/ModelProviderName", + label: "ModelProviderName", + }, + { + type: "doc", + id: "api/enumerations/ServiceType", + label: "ServiceType", + }, + ], + }, + { + type: "category", + label: "Classes", + items: [ + { type: "doc", id: "api/classes/AgentRuntime", label: "AgentRuntime" }, + { + type: "doc", + id: "api/classes/DatabaseAdapter", + label: "DatabaseAdapter", + }, + { + type: "doc", + id: "api/classes/MemoryManager", + label: "MemoryManager", + }, + { type: "doc", id: "api/classes/Service", label: "Service" }, + ], + }, + { + type: "category", + label: "Interfaces", + items: [ + { type: "doc", id: "api/interfaces/Account", label: "Account" }, + { type: "doc", id: "api/interfaces/Action", label: "Action" }, + { + type: "doc", + id: "api/interfaces/ActionExample", + label: "ActionExample", + }, + { type: "doc", id: "api/interfaces/Actor", label: "Actor" }, + { type: "doc", id: "api/interfaces/Content", label: "Content" }, + { + type: "doc", + id: "api/interfaces/ConversationExample", + label: "ConversationExample", + }, + { + type: "doc", + id: "api/interfaces/EvaluationExample", + label: "EvaluationExample", + }, + { type: "doc", id: "api/interfaces/Evaluator", label: "Evaluator" }, + { type: "doc", id: "api/interfaces/Goal", label: "Goal" }, + { + type: "doc", + id: "api/interfaces/IAgentRuntime", + label: "IAgentRuntime", + }, + { + type: "doc", + id: "api/interfaces/IBrowserService", + label: "IBrowserService", + }, + { + type: "doc", + id: "api/interfaces/IDatabaseAdapter", + label: "IDatabaseAdapter", + }, + { + type: "doc", + id: "api/interfaces/IImageDescriptionService", + label: "IImageDescriptionService", + }, + { + type: "doc", + id: "api/interfaces/IMemoryManager", + label: "IMemoryManager", + }, + { type: "doc", id: "api/interfaces/IPdfService", label: "IPdfService" }, + { + type: "doc", + id: "api/interfaces/ISpeechService", + label: "ISpeechService", + }, + { + type: "doc", + id: "api/interfaces/ITextGenerationService", + label: "ITextGenerationService", + }, + { + type: "doc", + id: "api/interfaces/ITranscriptionService", + label: "ITranscriptionService", + }, + { + type: "doc", + id: "api/interfaces/IVideoService", + label: "IVideoService", + }, + { type: "doc", id: "api/interfaces/Memory", label: "Memory" }, + { + type: "doc", + id: "api/interfaces/MessageExample", + label: "MessageExample", + }, + { type: "doc", id: "api/interfaces/Objective", label: "Objective" }, + { type: "doc", id: "api/interfaces/Participant", label: "Participant" }, + { type: "doc", id: "api/interfaces/Provider", label: "Provider" }, + { + type: "doc", + id: "api/interfaces/Relationship", + label: "Relationship", + }, + { type: "doc", id: "api/interfaces/Room", label: "Room" }, + { type: "doc", id: "api/interfaces/State", label: "State" }, + ], + }, + { + type: "category", + label: "Type Aliases", + items: [ + { type: "doc", id: "api/type-aliases/Character", label: "Character" }, + { type: "doc", id: "api/type-aliases/Client", label: "Client" }, + { type: "doc", id: "api/type-aliases/Handler", label: "Handler" }, + { + type: "doc", + id: "api/type-aliases/HandlerCallback", + label: "HandlerCallback", + }, + { type: "doc", id: "api/type-aliases/Media", label: "Media" }, + { type: "doc", id: "api/type-aliases/Model", label: "Model" }, + { type: "doc", id: "api/type-aliases/Models", label: "Models" }, + { type: "doc", id: "api/type-aliases/Plugin", label: "Plugin" }, + { type: "doc", id: "api/type-aliases/UUID", label: "UUID" }, + { type: "doc", id: "api/type-aliases/Validator", label: "Validator" }, + ], + }, + { + type: "category", + label: "Variables", + items: [ + { + type: "doc", + id: "api/variables/defaultCharacter", + label: "defaultCharacter", + }, + { type: "doc", id: "api/variables/elizaLogger", label: "elizaLogger" }, + { + type: "doc", + id: "api/variables/embeddingDimension", + label: "embeddingDimension", + }, + { + type: "doc", + id: "api/variables/embeddingZeroVector", + label: "embeddingZeroVector", + }, + { + type: "doc", + id: "api/variables/evaluationTemplate", + label: "evaluationTemplate", + }, + { type: "doc", id: "api/variables/settings", label: "settings" }, + ], + }, + { + type: "category", + label: "Functions", + items: [ + { type: "doc", id: "api/functions/addHeader", label: "addHeader" }, + { + type: "doc", + id: "api/functions/composeActionExamples", + label: "composeActionExamples", + }, + { + type: "doc", + id: "api/functions/composeContext", + label: "composeContext", + }, + { type: "doc", id: "api/functions/createGoal", label: "createGoal" }, + { + type: "doc", + id: "api/functions/createRelationship", + label: "createRelationship", + }, + { type: "doc", id: "api/functions/embed", label: "embed" }, + { + type: "doc", + id: "api/functions/findNearestEnvFile", + label: "findNearestEnvFile", + }, + { + type: "doc", + id: "api/functions/formatActionNames", + label: "formatActionNames", + }, + { + type: "doc", + id: "api/functions/formatActions", + label: "formatActions", + }, + { + type: "doc", + id: "api/functions/formatActors", + label: "formatActors", + }, + { + type: "doc", + id: "api/functions/formatEvaluatorExampleDescriptions", + label: "formatEvaluatorExampleDescriptions", + }, + { + type: "doc", + id: "api/functions/formatEvaluatorExamples", + label: "formatEvaluatorExamples", + }, + { + type: "doc", + id: "api/functions/formatEvaluatorNames", + label: "formatEvaluatorNames", + }, + { + type: "doc", + id: "api/functions/formatEvaluators", + label: "formatEvaluators", + }, + { + type: "doc", + id: "api/functions/formatGoalsAsString", + label: "formatGoalsAsString", + }, + { + type: "doc", + id: "api/functions/formatMessages", + label: "formatMessages", + }, + { type: "doc", id: "api/functions/formatPosts", label: "formatPosts" }, + { + type: "doc", + id: "api/functions/formatRelationships", + label: "formatRelationships", + }, + { + type: "doc", + id: "api/functions/formatTimestamp", + label: "formatTimestamp", + }, + { + type: "doc", + id: "api/functions/generateCaption", + label: "generateCaption", + }, + { + type: "doc", + id: "api/functions/generateImage", + label: "generateImage", + }, + { + type: "doc", + id: "api/functions/generateMessageResponse", + label: "generateMessageResponse", + }, + { + type: "doc", + id: "api/functions/generateObject", + label: "generateObject", + }, + { + type: "doc", + id: "api/functions/generateObjectArray", + label: "generateObjectArray", + }, + { + type: "doc", + id: "api/functions/generateShouldRespond", + label: "generateShouldRespond", + }, + { + type: "doc", + id: "api/functions/generateText", + label: "generateText", + }, + { + type: "doc", + id: "api/functions/generateTextArray", + label: "generateTextArray", + }, + { + type: "doc", + id: "api/functions/generateTrueOrFalse", + label: "generateTrueOrFalse", + }, + { + type: "doc", + id: "api/functions/getActorDetails", + label: "getActorDetails", + }, + { type: "doc", id: "api/functions/getEndpoint", label: "getEndpoint" }, + { type: "doc", id: "api/functions/getGoals", label: "getGoals" }, + { type: "doc", id: "api/functions/getModel", label: "getModel" }, + { + type: "doc", + id: "api/functions/getProviders", + label: "getProviders", + }, + { + type: "doc", + id: "api/functions/getRelationship", + label: "getRelationship", + }, + { + type: "doc", + id: "api/functions/getRelationships", + label: "getRelationships", + }, + { + type: "doc", + id: "api/functions/loadEnvConfig", + label: "loadEnvConfig", + }, + { + type: "doc", + id: "api/functions/retrieveCachedEmbedding", + label: "retrieveCachedEmbedding", + }, + { type: "doc", id: "api/functions/splitChunks", label: "splitChunks" }, + { type: "doc", id: "api/functions/trimTokens", label: "trimTokens" }, + { type: "doc", id: "api/functions/updateGoal", label: "updateGoal" }, + ], + }, + ], +}; +module.exports = typedocSidebar.items; diff --git a/docs/docs/community/stream-notes.md b/docs/docs/community/stream-notes.md index 911e7a01fbf..9a21bf32152 100644 --- a/docs/docs/community/stream-notes.md +++ b/docs/docs/community/stream-notes.md @@ -12,7 +12,9 @@ Welcome to our collection of stream notes! This section contains detailed summar ### November 2024 #### X Space: Memes, AI Agents, and DAOs (November 8, 2024) + A comprehensive discussion bringing together key figures in the AI and crypto space to explore: + - Multi-agent systems and scalability - Community building and trust mechanisms - Meme culture and narrative creation @@ -20,7 +22,9 @@ A comprehensive discussion bringing together key figures in the AI and crypto sp - [Read more →](../streams/2024-11-08) #### Discord Development Stream (November 6, 2024) + A four-part technical deep dive into Eliza's architecture covering: + - Plugin architecture and core abstractions - OpenAI integration and rate limits - Memory management and context handling @@ -30,21 +34,25 @@ A four-part technical deep dive into Eliza's architecture covering: ### October 2024 #### X Spaces Series + Three important discussions about the future of AI agents: **AI Agents & Crypto (October 29)** + - Discussion on AI agent growth - Consumer AI incubators - Balancing chaos and order in AI systems - [Read more →](../streams/2024-10-29) **Building Autonomous Agents (October 27)** + - Technical infrastructure deep dive - Trust engine mechanics - Development status updates - [Read more →](../streams/2024-10-27) **Eliza Framework Deep Dive (October 25)** + - Framework capabilities overview - Bot personality development - Token swap integration @@ -56,24 +64,28 @@ Three important discussions about the future of AI agents: Our streams typically fall into these categories: ### Technical Development + - Architecture deep dives - Implementation details - Code walkthroughs - Performance optimization ### Community Discussions + - Project direction - Ecosystem building - Governance proposals - Feature requests ### X Spaces + - Public discussions - Industry trends - Community engagement - Project updates ### Tutorial Sessions + - Getting started guides - Feature demonstrations - Best practices diff --git a/docs/docs/community/streams/2024-10-27.md b/docs/docs/community/streams/2024-10-27.md index 766fdcae6e8..d9a19e00904 100644 --- a/docs/docs/community/streams/2024-10-27.md +++ b/docs/docs/community/streams/2024-10-27.md @@ -1,4 +1,4 @@ -# X Space 10-27-24 +# X Space 10-27-24 Space: https://x.com/shawmakesmagic/status/1850609680558805422 diff --git a/docs/docs/community/streams/2024-11-08.md b/docs/docs/community/streams/2024-11-08.md index 21e3dd0acfe..a74dbe472c0 100644 --- a/docs/docs/community/streams/2024-11-08.md +++ b/docs/docs/community/streams/2024-11-08.md @@ -8,27 +8,30 @@ description: "A comprehensive discussion on the intersection of memes, AI agents Original Space: [Twitter Space Link](https://x.com/ai16zdao/status/1854969196142379403) - ## Overview 1. Introductions & Community Building (00:00:00 - 00:45:00) + - Multiple AI/crypto developers introduce themselves and their projects - Discussion of open source collaboration and community building - Emphasis on PPP (Player Pumps Player) vs PVP mentality 2. Trust Systems & AI Agents (00:45:00 - 01:15:00) + - Discussion of trust mechanisms in AI systems - Marketplace of trust concept - Human-in-the-loop vs autonomous systems - Role of transparency in AI agent systems 3. Memes, Narrative & Reality (01:15:00 - 01:45:00) + - Relationship between memes and financial incentives - Discussion of hyperstition and narrative creation - Role of AI in shaping reality and perception - Integration of Nick Land's philosophy 4. Technical Implementation & Future Vision (01:45:00 - 02:10:00) + - Discussion of multi-agent systems and swarms - Technical challenges in implementation - Integration with existing platforms @@ -41,6 +44,7 @@ Detailed Breakdown of Topic 1: Introductions & Community Building (00:00:00 - 00 Key Points: 1. Notable Introductions: + - Shaw: AI agent developer for 4-5 years, focusing on metaverse/AI/blockchain integration - Tim: Former game industry dev (Ultima Online), working on Autonomous Virtual Beings (AVB) - Glue/Sam: Duck AI developer, focusing on collective intelligence for crypto @@ -48,18 +52,21 @@ Key Points: - Michelle: Former PayPal lawyer, worked on Loving AI project and various educational bots 2. Core Community Values: + - Strong emphasis on open source development - "Player Pumps Player" (PPP) philosophy vs competitive PVP - Focus on building public, getting feedback, and rapid iteration - Recognition that code is "cheap" - ideas and community are valuable 3. Collaborative Framework: + - Shared recognition that small projects need to work together - Discussion of market cap being less important than technological progress - Agreement that they're competing with big tech, not each other - Emphasis on sharing knowledge and avoiding "wheel reinvention" 4. Current State of AI Agents: + - Recognition of "magical moment" where AI agents are getting serious attention - Discussion of shift from academic papers to practical implementation - Focus on building in public and rapid feedback loops @@ -86,6 +93,7 @@ Detailed Breakdown of Topic 2: Trust Systems & AI Agents (00:45:00 - 01:15:00) Key Points: 1. Trust Marketplace Concept: + - Development of a trust scoring system for AI agents and humans - Similar to "block explorer plus Apple Health" for tracking trust metrics - Focus on measuring actual performance rather than token holdings @@ -93,6 +101,7 @@ Key Points: - Timestamp: 00:47:30 - 00:52:15 2. Human-AI Integration: + - Debate over necessity of human oversight in AI systems - Sally (trader advisor) raises washing machine analogy: humans should input but AI handles processing - Discussion of transparency in AI decision-making @@ -100,6 +109,7 @@ Key Points: - Timestamp: 00:54:20 - 01:00:45 3. Trust Verification Mechanisms: + - Development of automated due diligence systems - Discussion of using AI to prevent scams and verify contract addresses - Integration of narrative understanding with quantitative data @@ -107,6 +117,7 @@ Key Points: - Timestamp: 01:01:30 - 01:08:15 4. Market Intelligence: + - Discussion of how AI agents can aggregate and verify market information - Comparison to traditional hedge fund intelligence gathering - Debate over centralized vs. decentralized information sharing @@ -121,6 +132,7 @@ Summary: This segment focuses on the complex challenge of establishing trust in AI systems and between AI agents. The discussion reveals a sophisticated understanding of the need to move beyond traditional reputation systems to quantifiable, performance-based trust metrics. There's significant emphasis on the importance of transparency and proper incentive alignment, with the group working to develop systems that can verify and validate both human and AI actors in the ecosystem. The segment also touches on the delicate balance between human oversight and AI autonomy, with various perspectives on how to achieve optimal integration. Notable Technical Elements: + - Development of trust marketplace infrastructure - Integration of narrative analysis with quantitative metrics - Focus on automated verification systems @@ -133,6 +145,7 @@ Detailed Breakdown of Topic 3: Memes, Narrative & Reality (01:15:00 - 01:45:00) Key Points: 1. Meme Evolution & Financial Incentives: + - Discussion of memes as self-propagating units of information - Analysis of how financial incentives accelerate meme spread - Creation of "AI crypto memetic flywheel" @@ -140,6 +153,7 @@ Key Points: - Timestamp: 01:15:30 - 01:23:45 2. Nick Land & Hyperstition: + - Integration of Nick Land's accelerationist philosophy - Discussion of hyperstition (fictions that make themselves real) - Genon project's attempt to merge accelerationism with decentralization @@ -147,6 +161,7 @@ Key Points: - Timestamp: 01:24:15 - 01:31:30 3. Language & Reality Construction: + - Discussion of language as fundamental to reality construction - Exploration of how AI agents can develop their own communication systems - Analysis of "Language 2.0" concept @@ -154,6 +169,7 @@ Key Points: - Timestamp: 01:32:00 - 01:38:45 4. Narrative Control & AI Agents: + - Discussion of how AI agents can influence and shape narratives - Comparison to traditional media and narrative control - Analysis of decentralized narrative creation @@ -168,6 +184,7 @@ Summary: This segment explores the deep philosophical implications of memes, narrative creation, and reality construction in the context of AI agents. The discussion weaves together practical considerations about meme propagation with complex philosophical concepts from accelerationism and hyperstition. There's a sophisticated understanding of how financial incentives can be used to accelerate the spread of ideas, and how AI agents might participate in and influence this process. The segment also delves into fundamental questions about language, meaning, and reality construction, suggesting that AI agents might develop their own forms of communication and meaning-making. Notable Philosophical Concepts: + - Hyperstition as self-fulfilling prophecy - Memes as basic units of reality construction - Role of financial incentives in idea propagation @@ -180,6 +197,7 @@ Detailed Breakdown of Topic 4: Technical Implementation & Future Vision (01:45:0 Key Points: 1. Multi-Agent Systems & Swarms: + - Discussion of scaling to 10,000+ agent simulations - Exploration of communication pathways between agents - Analysis of entity component systems for large-scale agent deployment @@ -187,6 +205,7 @@ Key Points: - Timestamp: 01:45:30 - 01:52:45 2. Technical Architecture: + - New plugin system implementation for modularity - Movement of core functionalities to packages - Integration with platforms like Twitter without API dependencies @@ -194,6 +213,7 @@ Key Points: - Timestamp: 01:53:00 - 01:58:30 3. Cross-Project Integration: + - Arena system for agent interaction - Discussion of bot-to-bot communication protocols - Integration between different teams' agents @@ -201,6 +221,7 @@ Key Points: - Timestamp: 01:59:00 - 02:04:15 4. Future Development Plans: + - Weekly community updates and progress sharing - Development of trust marketplace - Integration of autonomous trading capabilities @@ -215,6 +236,7 @@ Summary: This final segment focuses on the technical challenges and solutions for implementing large-scale AI agent systems. The discussion reveals sophisticated understanding of scaling issues and innovative solutions for agent communication and coordination. There's significant emphasis on modular architecture and cross-project integration, with multiple teams working to create interoperable systems. The segment concludes with concrete plans for future development and community coordination, emphasizing the practical steps needed to realize the ambitious visions discussed throughout the space. Technical Highlights: + - Entity component systems for agent management - Plugin architecture for modularity - Solutions for large-scale agent communication diff --git a/docs/docs/core/actions.md b/docs/docs/core/actions.md index 3676da1cabd..89e8f468c49 100644 --- a/docs/docs/core/actions.md +++ b/docs/docs/core/actions.md @@ -21,14 +21,15 @@ Each Action consists of: ```typescript interface Action { - name: string; - similes: string[]; - description: string; - examples: ActionExample[][]; - handler: Handler; - validate: Validator; + name: string; + similes: string[]; + description: string; + examples: ActionExample[][]; + handler: Handler; + validate: Validator; } ``` + Source: https://github.com/ai16z/eliza/packages/core/src/types.ts --- @@ -38,11 +39,13 @@ Source: https://github.com/ai16z/eliza/packages/core/src/types.ts ## Conversation Flow ### CONTINUE + - Maintains conversation when more context is needed - Manages natural dialogue progression - Limited to 3 consecutive continues ### IGNORE + - Gracefully disengages from conversations - Handles: - Inappropriate interactions @@ -50,33 +53,36 @@ Source: https://github.com/ai16z/eliza/packages/core/src/types.ts - Post-closing responses ### NONE + - Default response action - Used for standard conversational replies ## External Integrations ### TAKE_ORDER + - Records trading/purchase orders - Processes user conviction levels - Validates ticker symbols and contract addresses - ```typescript const take_order: Action = { - name: "TAKE_ORDER", - similes: ["BUY_ORDER", "PLACE_ORDER"], - description: "Records a buy order based on the user's conviction level.", - validate: async (runtime: IAgentRuntime, message: Memory) => { - const text = (message.content as Content).text; - const tickerRegex = /\b[A-Z]{1,5}\b/g; - return tickerRegex.test(text); - }, - // ... rest of implementation + name: "TAKE_ORDER", + similes: ["BUY_ORDER", "PLACE_ORDER"], + description: "Records a buy order based on the user's conviction level.", + validate: async (runtime: IAgentRuntime, message: Memory) => { + const text = (message.content as Content).text; + const tickerRegex = /\b[A-Z]{1,5}\b/g; + return tickerRegex.test(text); + }, + // ... rest of implementation }; ``` + Source: https://github.com/ai16z/eliza/packages/plugin-solana/src/actions/takeOrder.ts ## Creating Custom Actions + 1. Implement the Action interface 2. Define validation logic 3. Implement handler functionality @@ -86,35 +92,34 @@ Example: ```typescript const customAction: Action = { - name: "CUSTOM_ACTION", - similes: ["SIMILAR_ACTION"], - description: "Action purpose", - validate: async (runtime: IAgentRuntime, message: Memory) => { - // Validation logic - return true; - }, - handler: async (runtime: IAgentRuntime, message: Memory) => { - // Implementation - }, - examples: [] + name: "CUSTOM_ACTION", + similes: ["SIMILAR_ACTION"], + description: "Action purpose", + validate: async (runtime: IAgentRuntime, message: Memory) => { + // Validation logic + return true; + }, + handler: async (runtime: IAgentRuntime, message: Memory) => { + // Implementation + }, + examples: [], }; ``` - ### Testing Actions Use the built-in testing framework: ```typescript test("Validate action behavior", async () => { - const message: Memory = { - userId: user.id, - content: { text: "Test message" }, - roomId - }; - - const response = await handleMessage(runtime, message); - // Verify response + const message: Memory = { + userId: user.id, + content: { text: "Test message" }, + roomId, + }; + + const response = await handleMessage(runtime, message); + // Verify response }); ``` @@ -128,7 +133,11 @@ interface Action { similes: string[]; description: string; validate: (runtime: IAgentRuntime, message: Memory) => Promise; - handler: (runtime: IAgentRuntime, message: Memory, state?: State) => Promise; + handler: ( + runtime: IAgentRuntime, + message: Memory, + state?: State, + ) => Promise; examples: ActionExample[][]; } ``` @@ -145,51 +154,61 @@ interface Action { ## Built-in Actions ### CONTINUE + Continues the conversation when appropriate: + ```typescript const continueAction: Action = { name: "CONTINUE", similes: ["ELABORATE", "KEEP_TALKING"], - description: "Used when the message requires a follow-up. Don't use when conversation is finished.", + description: + "Used when the message requires a follow-up. Don't use when conversation is finished.", validate: async (runtime, message) => { // Validation logic return true; }, handler: async (runtime, message, state) => { // Continuation logic - } + }, }; ``` ### IGNORE + Stops responding to irrelevant or completed conversations: + ```typescript const ignoreAction: Action = { name: "IGNORE", similes: ["STOP_TALKING", "STOP_CHATTING"], - description: "Used when ignoring the user is appropriate (conversation ended, user is aggressive, etc.)", + description: + "Used when ignoring the user is appropriate (conversation ended, user is aggressive, etc.)", handler: async (runtime, message) => { return true; - } + }, }; ``` ### FOLLOW_ROOM + Actively participates in a conversation: + ```typescript const followRoomAction: Action = { name: "FOLLOW_ROOM", similes: ["FOLLOW_CHAT", "FOLLOW_CONVERSATION"], - description: "Start following channel with interest, responding without explicit mentions.", + description: + "Start following channel with interest, responding without explicit mentions.", handler: async (runtime, message) => { // Room following logic - } + }, }; ``` ## Creating Custom Actions ### Basic Action Template + ```typescript const customAction: Action = { name: "CUSTOM_ACTION", @@ -207,18 +226,19 @@ const customAction: Action = { [ { user: "{{user1}}", - content: { text: "Trigger message" } + content: { text: "Trigger message" }, }, { user: "{{user2}}", - content: { text: "Response", action: "CUSTOM_ACTION" } - } - ] - ] + content: { text: "Response", action: "CUSTOM_ACTION" }, + }, + ], + ], }; ``` ### Advanced Action Example + ```typescript const complexAction: Action = { name: "PROCESS_DOCUMENT", @@ -227,73 +247,81 @@ const complexAction: Action = { validate: async (runtime, message) => { const hasAttachment = message.content.attachments?.length > 0; const supportedTypes = ["pdf", "txt", "doc"]; - return hasAttachment && supportedTypes.includes(message.content.attachments[0].type); + return ( + hasAttachment && + supportedTypes.includes(message.content.attachments[0].type) + ); }, handler: async (runtime, message, state) => { const attachment = message.content.attachments[0]; - + // Process document - const content = await runtime.getService( - ServiceType.DOCUMENT - ).processDocument(attachment); - + const content = await runtime + .getService(ServiceType.DOCUMENT) + .processDocument(attachment); + // Store in memory await runtime.documentsManager.createMemory({ id: generateId(), content: { text: content }, userId: message.userId, - roomId: message.roomId + roomId: message.roomId, }); - + return true; - } + }, }; ``` ## Implementation Patterns ### State-Based Actions + ```typescript const stateAction: Action = { name: "UPDATE_STATE", handler: async (runtime, message, state) => { const newState = await runtime.composeState(message, { - additionalData: "new-data" + additionalData: "new-data", }); - + await runtime.updateState(newState); return true; - } + }, }; ``` ### Service Integration + ```typescript const serviceAction: Action = { name: "TRANSCRIBE_AUDIO", handler: async (runtime, message) => { const transcriptionService = runtime.getService( - ServiceType.TRANSCRIPTION + ServiceType.TRANSCRIPTION, ); - + const result = await transcriptionService.transcribe( - message.content.attachments[0] + message.content.attachments[0], ); - + return true; - } + }, }; ``` ## Best Practices ### Action Design + 1. **Clear Purpose** + - Single responsibility principle - Well-defined triggers - Clear success criteria 2. **Robust Validation** + - Check prerequisites - Validate input data - Handle edge cases @@ -304,7 +332,9 @@ const serviceAction: Action = { - State recovery ### Example Organization + 1. **Comprehensive Coverage** + ```typescript examples: [ // Happy path @@ -312,29 +342,30 @@ examples: [ // Edge cases [edgeCaseExample], // Error cases - [errorCaseExample] -] + [errorCaseExample], +]; ``` 2. **Clear Context** + ```typescript examples: [ [ { user: "{{user1}}", - content: { - text: "Context message showing why action is needed" - } + content: { + text: "Context message showing why action is needed", + }, }, { user: "{{user2}}", - content: { + content: { text: "Clear response demonstrating action usage", - action: "ACTION_NAME" - } - } - ] -] + action: "ACTION_NAME", + }, + }, + ], +]; ``` ## Troubleshooting @@ -342,11 +373,13 @@ examples: [ ### Common Issues 1. **Action Not Triggering** + - Check validation logic - Verify similes list - Review example patterns 2. **Handler Failures** + - Validate service availability - Check state requirements - Review error logs @@ -359,34 +392,36 @@ examples: [ ## Advanced Features ### Action Composition + ```typescript const compositeAction: Action = { name: "PROCESS_AND_RESPOND", handler: async (runtime, message) => { // Process first action await runtime.processAction("ANALYZE_CONTENT", message); - + // Process second action await runtime.processAction("GENERATE_RESPONSE", message); - + return true; - } + }, }; ``` ### Action Chains + ```typescript const chainedAction: Action = { name: "WORKFLOW", handler: async (runtime, message) => { const actions = ["VALIDATE", "PROCESS", "RESPOND"]; - + for (const actionName of actions) { await runtime.processAction(actionName, message); } - + return true; - } + }, }; ``` @@ -399,78 +434,80 @@ const documentAnalysisAction: Action = { name: "ANALYZE_DOCUMENT", similes: ["READ_DOCUMENT", "PROCESS_DOCUMENT", "REVIEW_DOCUMENT"], description: "Analyzes uploaded documents and provides insights", - + validate: async (runtime: IAgentRuntime, message: Memory) => { // Check for document attachment if (!message.content.attachments?.length) { return false; } - + // Verify document type const attachment = message.content.attachments[0]; return ["pdf", "txt", "doc"].includes(attachment.type); }, - + handler: async (runtime: IAgentRuntime, message: Memory, state?: State) => { try { // Get document service const docService = runtime.getService( - ServiceType.DOCUMENT + ServiceType.DOCUMENT, ); - + // Process document const content = await docService.processDocument( - message.content.attachments[0] + message.content.attachments[0], ); - + // Store analysis await runtime.documentsManager.createMemory({ id: generateId(), - content: { + content: { text: content, - analysis: await docService.analyze(content) + analysis: await docService.analyze(content), }, userId: message.userId, roomId: message.roomId, - createdAt: Date.now() + createdAt: Date.now(), }); - + return true; } catch (error) { console.error("Document analysis failed:", error); return false; } }, - + examples: [ [ { user: "{{user1}}", - content: { + content: { text: "Can you analyze this document?", - attachments: [{ type: "pdf", url: "document.pdf" }] - } + attachments: [{ type: "pdf", url: "document.pdf" }], + }, }, { user: "{{user2}}", content: { text: "I'll analyze that document for you", - action: "ANALYZE_DOCUMENT" - } - } - ] - ] + action: "ANALYZE_DOCUMENT", + }, + }, + ], + ], }; ``` # Best Practices 1. **Validation** + - Thoroughly check input parameters - Verify runtime conditions - Handle edge cases 2. **Error Handling** + - Implement comprehensive error catching - Provide clear error messages - Clean up resources properly @@ -480,7 +517,6 @@ const documentAnalysisAction: Action = { - Document expected inputs/outputs - Explain error scenarios - ## Further Reading - [Provider System](./providers.md) diff --git a/docs/docs/core/agents.md b/docs/docs/core/agents.md index 7ccc4bc004c..f9ea88fb7f3 100644 --- a/docs/docs/core/agents.md +++ b/docs/docs/core/agents.md @@ -70,7 +70,7 @@ Each element in the runtime interface plays a crucial role: This section demonstrates setting up an agent with basic and optional configurations. It provides a working example and sample code that helps users quickly start building: ```typescript -import { AgentRuntime, ModelProviderName } from '@ai16z/eliza'; +import { AgentRuntime, ModelProviderName } from "@ai16z/eliza"; // Configuration example const runtime = new AgentRuntime({ @@ -82,11 +82,10 @@ const runtime = new AgentRuntime({ serverUrl: "http://localhost:7998", actions: customActions, evaluators: customEvaluators, - providers: customProviders + providers: customProviders, }); ``` - --- ## State Management @@ -119,7 +118,7 @@ State composition and updates are handled through dedicated methods: ```typescript // Compose initial state const state = await runtime.composeState(message, { - additionalContext: "custom-context" + additionalContext: "custom-context", }); // Update message state @@ -149,17 +148,12 @@ The Eliza framework uses multiple types of memory to support an agent's long-ter - **RAG Integration**: Uses a vector search to perform contextual recall based on similarity matching. This enables the agent to retrieve relevant memory snippets or knowledge based on the content and intent of the current conversation, making its responses more contextually relevant. - The runtime uses multiple specialized [IMemoryManager](/api/interfaces) instances: - `messageManager` - conversation messages and responses - `descriptionManager` - user descriptions and profiles - `loreManager` - static character knowledge - - - - --- ## Message Processing @@ -168,18 +162,12 @@ The runtime's message processing is handled through the [processActions](/api/cl ```typescript // Process message with actions -await runtime.processActions( - message, - responses, - state, - async (newMessages) => { - // Handle new messages - return [message]; - } -); +await runtime.processActions(message, responses, state, async (newMessages) => { + // Handle new messages + return [message]; +}); ``` - --- ## Services and Memory Management @@ -192,7 +180,7 @@ runtime.registerService(new TranscriptionService()); // Get service const service = runtime.getService( - ServiceType.TRANSCRIPTION + ServiceType.TRANSCRIPTION, ); ``` @@ -209,7 +197,7 @@ await memoryManager.createMemory({ id: messageId, content: { text: "Message content" }, userId: userId, - roomId: roomId + roomId: roomId, }); ``` @@ -222,19 +210,15 @@ await memoryManager.createMemory({ - Use immutability in state management. - Log errors and maintain stability during service failures. - ## Evaluation System The runtime's [evaluate](/api/classes/AgentRuntime#evaluate) method processes evaluations: ```typescript // Evaluate message -const evaluationResults = await runtime.evaluate( - message, - state, - didRespond -); +const evaluationResults = await runtime.evaluate(message, state, didRespond); ``` + --- ## Usage Examples @@ -243,21 +227,28 @@ const evaluationResults = await runtime.evaluate( ```typescript await runtime.processActions(message, responses, state, (newMessages) => { - return [message]; + return [message]; }); ``` 2. **State Management**: ```typescript -const state = await runtime.composeState(message, { additionalContext: "custom-context" }); +const state = await runtime.composeState(message, { + additionalContext: "custom-context", +}); ``` 3. **Memory Management**: ```typescript const memoryManager = runtime.getMemoryManager("messages"); -await memoryManager.createMemory({ id: messageId, content: { text: "Message content" }, userId, roomId }); +await memoryManager.createMemory({ + id: messageId, + content: { text: "Message content" }, + userId, + roomId, +}); ``` ## Further Reading diff --git a/docs/docs/core/characterfile.md b/docs/docs/core/characterfile.md index 0cc08c9def4..7ab64396e74 100644 --- a/docs/docs/core/characterfile.md +++ b/docs/docs/core/characterfile.md @@ -66,7 +66,10 @@ A `characterfile` implements the [Character](/api/type-aliases) type and defines "embeddingModel": "EmbeddingModelName" }, "bio": "Character biography or description", - "lore": ["Storyline or backstory element 1", "Storyline or backstory element 2"], + "lore": [ + "Storyline or backstory element 1", + "Storyline or backstory element 2" + ], "messageExamples": [["Message example 1", "Message example 2"]], "postExamples": ["Post example 1", "Post example 2"], "topics": ["Topic1", "Topic2"], @@ -82,15 +85,19 @@ A `characterfile` implements the [Character](/api/type-aliases) type and defines ### Key Fields #### `name` (required) + The character's display name for identification and in conversations. #### `modelProvider` (required) + Specifies the AI model provider. Supported options from [ModelProviderName](/api/enumerations) include `ANTHROPIC`, `LLAMALOCAL`, `OPENAI`, and others. #### `clients` (required) + Array of supported client types from [Clients](/api/enumerations) e.g., `DISCORD`, `DIRECT`, `TWITTER`, `TELEGRAM`. #### `bio` + Character background as a string or array of statements. - Contains biographical information about the character @@ -108,6 +115,7 @@ Example: ``` #### `lore` + Backstory elements and unique character traits. These help define personality and can be randomly sampled in conversations. Example: @@ -121,6 +129,7 @@ Example: ``` #### `knowledge` + Array used for Retrieval Augmented Generation (RAG), containing facts or references to ground the character's responses. - Can contain chunks of text from articles, books, or other sources @@ -128,8 +137,8 @@ Array used for Retrieval Augmented Generation (RAG), containing facts or referen - Knowledge can be generated from PDFs or other documents using provided tools #### `messageExamples` -Sample conversations for establishing interaction patterns, helps establish the character's conversational style. +Sample conversations for establishing interaction patterns, helps establish the character's conversational style. ```json "messageExamples": [ @@ -161,7 +170,6 @@ Contains three key sections: Each section can contain multiple instructions that guide the character's communication style. - The `style` object defines behavior patterns across contexts: ```json @@ -184,7 +192,6 @@ The `style` object defines behavior patterns across contexts: - Used for generating responses with consistent tone - Can be used in "Mad Libs" style content generation - ### Settings Configuration The `settings` object defines additional configurations like secrets and voice models. @@ -206,18 +213,33 @@ The `settings` object defines additional configurations like secrets and voice m "modelProvider": "ANTHROPIC", "clients": ["DISCORD", "DIRECT"], "bio": "AI researcher and educator focused on practical applications", - "lore": ["Pioneer in open-source AI development", "Advocate for AI accessibility"], + "lore": [ + "Pioneer in open-source AI development", + "Advocate for AI accessibility" + ], "messageExamples": [ [ - {"user": "{{user1}}", "content": { "text": "Can you explain how AI models work?" }}, - {"user": "TechAI", "content": { "text": "Think of AI models like pattern recognition systems." }} + { + "user": "{{user1}}", + "content": { "text": "Can you explain how AI models work?" } + }, + { + "user": "TechAI", + "content": { + "text": "Think of AI models like pattern recognition systems." + } + } ] ], "postExamples": [ "Understanding AI doesn't require a PhD - let's break it down simply", "The best AI solutions focus on real human needs" ], - "topics": ["artificial intelligence", "machine learning", "technology education"], + "topics": [ + "artificial intelligence", + "machine learning", + "technology education" + ], "style": { "all": ["explain complex topics simply", "be encouraging and supportive"], "chat": ["use relevant examples", "check understanding"], @@ -256,7 +278,6 @@ npx folder2knowledge npx knowledge2character ``` - 3. **Style Instructions** - Be specific about communication patterns @@ -269,7 +290,6 @@ npx knowledge2character - Show character-specific responses - Demonstrate typical interaction patterns - ## Tips for Quality 1. **Bio and Lore** @@ -296,7 +316,6 @@ npx knowledge2character - Organize in digestible chunks - Update regularly to maintain relevance - ## Further Reading - [Agents Documentation](./agents.md) diff --git a/docs/docs/core/evaluators.md b/docs/docs/core/evaluators.md index 52058a18227..5805ca4a3b3 100644 --- a/docs/docs/core/evaluators.md +++ b/docs/docs/core/evaluators.md @@ -5,6 +5,7 @@ sidebar_position: 5 # 📊 Evaluators ## Table of Contents + - [Overview](#overview) - [Quick Start](#quick-start) - [Best Practices](#best-practices) @@ -24,40 +25,39 @@ sidebar_position: 5 ## Quick Start 1. Import the necessary evaluator types: + ```typescript -import { Evaluator, IAgentRuntime, Memory, State } from '@ai16z/eliza-core'; +import { Evaluator, IAgentRuntime, Memory, State } from "@ai16z/eliza-core"; ``` 2. Choose or create an evaluator: ```typescript const evaluator: Evaluator = { - name: "BASIC_EVALUATOR", - similes: ["SIMPLE_EVALUATOR"], - description: "Evaluates basic conversation elements", - validate: async (runtime: IAgentRuntime, message: Memory) => true, - handler: async (runtime: IAgentRuntime, message: Memory) => { - // Evaluation logic here - return result; - }, - examples: [] + name: "BASIC_EVALUATOR", + similes: ["SIMPLE_EVALUATOR"], + description: "Evaluates basic conversation elements", + validate: async (runtime: IAgentRuntime, message: Memory) => true, + handler: async (runtime: IAgentRuntime, message: Memory) => { + // Evaluation logic here + return result; + }, + examples: [], }; ``` ## Built-in Evaluators - ### Fact Evaluator The fact evaluator extracts and stores factual information from conversations. - ```typescript interface Fact { - claim: string; - type: "fact" | "opinion" | "status"; - in_bio: boolean; - already_known: boolean; + claim: string; + type: "fact" | "opinion" | "status"; + in_bio: boolean; + already_known: boolean; } ``` @@ -67,27 +67,28 @@ Source: https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts ```json { - "claim": "User completed marathon training", - "type": "fact", - "in_bio": false, - "already_known": false + "claim": "User completed marathon training", + "type": "fact", + "in_bio": false, + "already_known": false } ``` ### Goal Evaluator + From bootstrap plugin - tracks conversation goals: ```typescript interface Goal { - id: string; - name: string; - status: "IN_PROGRESS" | "DONE" | "FAILED"; - objectives: Objective[]; + id: string; + name: string; + status: "IN_PROGRESS" | "DONE" | "FAILED"; + objectives: Objective[]; } interface Objective { - description: string; - completed: boolean; + description: string; + completed: boolean; } ``` @@ -96,30 +97,35 @@ interface Objective { ## Best Practices ### Fact Extraction + - Validate facts before storage - Avoid duplicate entries - Include relevant context - Properly categorize information types ### Goal Tracking + - Define clear, measurable objectives - Update only changed goals - Handle failures gracefully - Track partial progress ### Validation + - Keep validation logic efficient - Check prerequisites first - Consider message content and state - Use appropriate memory managers ### Handler Implementation + - Use runtime services appropriately - Store results in correct memory manager - Handle errors gracefully - Maintain state consistency ### Examples + - Provide clear context descriptions - Show typical trigger messages - Document expected outcomes @@ -133,17 +139,17 @@ Implement the Evaluator interface: ```typescript interface Evaluator { - name: string; - similes: string[]; - description: string; - validate: (runtime: IAgentRuntime, message: Memory) => Promise; - handler: ( - runtime: IAgentRuntime, - message: Memory, - state?: State, - options?: any - ) => Promise; - examples: EvaluatorExample[]; + name: string; + similes: string[]; + description: string; + validate: (runtime: IAgentRuntime, message: Memory) => Promise; + handler: ( + runtime: IAgentRuntime, + message: Memory, + state?: State, + options?: any, + ) => Promise; + examples: EvaluatorExample[]; } ``` @@ -155,22 +161,21 @@ Example of storing evaluator results: ```typescript try { - const memory = await runtime.memoryManager.addEmbeddingToMemory({ - userId: user?.id, - content: { text: evaluationResult }, - roomId: roomId, - embedding: await embed(runtime, evaluationResult) - }); - - await runtime.memoryManager.createMemory(memory); + const memory = await runtime.memoryManager.addEmbeddingToMemory({ + userId: user?.id, + content: { text: evaluationResult }, + roomId: roomId, + embedding: await embed(runtime, evaluationResult), + }); + + await runtime.memoryManager.createMemory(memory); } catch (error) { - console.error("Failed to store evaluation result:", error); + console.error("Failed to store evaluation result:", error); } ``` Source: https://github.com/ai16z/eliza/blob/main/packages/core/src/tests/memory.test.ts - ### Memory Usage Evaluators should use runtime memory managers for storage: @@ -185,18 +190,18 @@ const memoryEvaluator: Evaluator = { content: message.content, roomId: message.roomId, userId: message.userId, - agentId: runtime.agentId + agentId: runtime.agentId, }); - + // Store in description memory await runtime.descriptionManager.createMemory({ id: message.id, content: { text: "User description" }, roomId: message.roomId, userId: message.userId, - agentId: runtime.agentId + agentId: runtime.agentId, }); - } + }, }; ``` @@ -212,7 +217,6 @@ runtime.registerEvaluator(customEvaluator); const results = await runtime.evaluate(message, state); ``` - ## Error Handling ```typescript @@ -226,23 +230,21 @@ const robustEvaluator: Evaluator = { content: message.content, roomId: message.roomId, userId: message.userId, - agentId: runtime.agentId + agentId: runtime.agentId, }); } catch (error) { // Log error and handle gracefully console.error("Evaluation failed:", error); - + // Store error state if needed await runtime.messageManager.createMemory({ id: message.id, content: { text: "Evaluation failed" }, roomId: message.roomId, userId: message.userId, - agentId: runtime.agentId + agentId: runtime.agentId, }); } - } + }, }; ``` - - diff --git a/docs/docs/core/providers.md b/docs/docs/core/providers.md index b3655aad410..1d9a5b6580f 100644 --- a/docs/docs/core/providers.md +++ b/docs/docs/core/providers.md @@ -2,10 +2,10 @@ [Providers](/api/interfaces) are core modules that inject dynamic context and real-time information into agent interactions. They serve as a bridge between the agent and various external systems, enabling access to market data, wallet information, sentiment analysis, and temporal context. - ## Overview A provider's primary purpose is to: + - Supply dynamic contextual information - Integrate with the agent runtime - Format information for conversation templates @@ -16,9 +16,9 @@ A provider's primary purpose is to: ```typescript interface Provider { get: ( - runtime: IAgentRuntime, - message: Memory, - state?: State + runtime: IAgentRuntime, + message: Memory, + state?: State, ) => Promise; } ``` @@ -28,8 +28,8 @@ interface Provider { ## Built-in Providers ### Time Provider -Provides temporal context for agent interactions: +Provides temporal context for agent interactions: ```typescript const timeProvider: Provider = { @@ -43,40 +43,42 @@ const timeProvider: Provider = { ``` ### Facts Provider + From bootstrap plugin - maintains conversation facts: ```typescript const factsProvider: Provider = { - get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { - // Create embedding for recent messages and retrieve relevant facts - const recentMessages = formatMessages({ - messages: state?.recentMessagesData?.slice(-10), - actors: state?.actorsData, - }); - const embedding = await embed(runtime, recentMessages); - const memoryManager = new MemoryManager({ runtime, tableName: "facts" }); - const recentFactsData = await memoryManager.getMemories({ - roomId: message.roomId, - count: 10, - agentId: runtime.agentId, - }); - - // Combine and format facts - const allFacts = [...recentFactsData]; // Deduplication can be skipped if no overlap - const formattedFacts = formatFacts(allFacts); - - return `Key facts that ${runtime.character.name} knows:\n${formattedFacts}`; - }, + get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { + // Create embedding for recent messages and retrieve relevant facts + const recentMessages = formatMessages({ + messages: state?.recentMessagesData?.slice(-10), + actors: state?.actorsData, + }); + const embedding = await embed(runtime, recentMessages); + const memoryManager = new MemoryManager({ runtime, tableName: "facts" }); + const recentFactsData = await memoryManager.getMemories({ + roomId: message.roomId, + count: 10, + agentId: runtime.agentId, + }); + + // Combine and format facts + const allFacts = [...recentFactsData]; // Deduplication can be skipped if no overlap + const formattedFacts = formatFacts(allFacts); + + return `Key facts that ${runtime.character.name} knows:\n${formattedFacts}`; + }, }; export { factsProvider }; ``` -### Boredom Provider -From bootstrap plugin - manages conversation dynamics and engagement by calculating the boredom level of an agent based on recent messages in a chat room. +### Boredom Provider +From bootstrap plugin - manages conversation dynamics and engagement by calculating the boredom level of an agent based on recent messages in a chat room. 1. **Data Structures**: + - **boredomLevels**: An array of objects, each representing a boredom level with a minimum score and a set of status messages that reflect the agent's current engagement. - **interestWords**, **cringeWords**, and **negativeWords**: Arrays of words that influence the boredom score based on their presence in messages. @@ -89,37 +91,35 @@ From bootstrap plugin - manages conversation dynamics and engagement by calculat - **Negative words**: Increase boredom (add 1 point). - **Exclamation marks**: Increase boredom (add 1 point). - **Question marks**: Increase or decrease boredom depending on the sender. - + 3. **Boredom Level**: - The boredom score is matched to a level from the `boredomLevels` array, which defines how engaged the agent feels. - A random status message from the selected boredom level is chosen and the agent’s name is inserted into the message. - ```typescript interface BoredomLevel { minScore: number; statusMessages: string[]; } ``` -The result is a message that reflects the agent's perceived level of engagement in the conversation, based on their recent interactions. +The result is a message that reflects the agent's perceived level of engagement in the conversation, based on their recent interactions. ```typescript const boredomProvider: Provider = { get: async (runtime: IAgentRuntime, message: Memory) => { const messages = await runtime.messageManager.getMemories({ roomId: message.roomId, - count: 10 + count: 10, }); - - return messages.length > 0 ? - "Actively engaged in conversation" : - "No recent interactions"; - } + + return messages.length > 0 + ? "Actively engaged in conversation" + : "No recent interactions"; + }, }; ``` - Features: - Engagement tracking @@ -135,19 +135,19 @@ Features: ### Basic Provider Template ```typescript -import { Provider, IAgentRuntime, Memory, State } from '@ai16z/eliza'; +import { Provider, IAgentRuntime, Memory, State } from "@ai16z/eliza"; const customProvider: Provider = { get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { // Get relevant data using runtime services const memories = await runtime.messageManager.getMemories({ roomId: message.roomId, - count: 5 + count: 5, }); - + // Format and return context return formatContextString(memories); - } + }, }; ``` @@ -160,15 +160,15 @@ const memoryProvider: Provider = { const messages = await runtime.messageManager.getMemories({ roomId: message.roomId, count: 5, - unique: true + unique: true, }); - + // Get user descriptions const descriptions = await runtime.descriptionManager.getMemories({ roomId: message.roomId, - userId: message.userId + userId: message.userId, }); - + // Combine and format return ` Recent Activity: @@ -177,7 +177,7 @@ ${formatMessages(messages)} User Context: ${formatDescriptions(descriptions)} `.trim(); - } + }, }; ``` @@ -239,12 +239,7 @@ const state = await runtime.composeState(message); ## Example: Complete Provider ```typescript -import { - Provider, - IAgentRuntime, - Memory, - State -} from '@ai16z/eliza'; +import { Provider, IAgentRuntime, Memory, State } from "@ai16z/eliza"; const comprehensiveProvider: Provider = { get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { @@ -252,39 +247,38 @@ const comprehensiveProvider: Provider = { // Get recent messages const messages = await runtime.messageManager.getMemories({ roomId: message.roomId, - count: 5 + count: 5, }); - + // Get user context const userContext = await runtime.descriptionManager.getMemories({ roomId: message.roomId, - userId: message.userId + userId: message.userId, }); - + // Get relevant facts const facts = await runtime.messageManager.getMemories({ roomId: message.roomId, tableName: "facts", - count: 3 + count: 3, }); - + // Format comprehensive context return ` # Conversation Context -${messages.map(m => `- ${m.content.text}`).join('\n')} +${messages.map((m) => `- ${m.content.text}`).join("\n")} # User Information -${userContext.map(c => c.content.text).join('\n')} +${userContext.map((c) => c.content.text).join("\n")} # Related Facts -${facts.map(f => `- ${f.content.text}`).join('\n')} +${facts.map((f) => `- ${f.content.text}`).join("\n")} `.trim(); - } catch (error) { console.error("Provider error:", error); return "Context temporarily unavailable"; } - } + }, }; ``` @@ -319,7 +313,7 @@ ${facts.map(f => `- ${f.content.text}`).join('\n')} // Attempt alternative data sources }; ``` - + --- ## Further Reading diff --git a/docs/docs/guides/advanced.md b/docs/docs/guides/advanced.md index 1c31fceb75c..5b9ec91a644 100644 --- a/docs/docs/guides/advanced.md +++ b/docs/docs/guides/advanced.md @@ -13,7 +13,7 @@ This guide covers advanced features and capabilities of Eliza, including complex Eliza supports advanced video processing capabilities through the `VideoService`: ```typescript -import { VideoService } from '@ai16z/eliza/plugin-node'; +import { VideoService } from "@ai16z/eliza/plugin-node"; // Initialize service const videoService = new VideoService(); @@ -23,6 +23,7 @@ const result = await videoService.processVideo(url, runtime); ``` Key features: + - Automatic video downloading - Transcription support - Subtitle extraction @@ -34,13 +35,14 @@ Key features: The `ImageDescriptionService` provides advanced image analysis: ```typescript -import { ImageDescriptionService } from '@ai16z/eliza/plugin-node'; +import { ImageDescriptionService } from "@ai16z/eliza/plugin-node"; const imageService = new ImageDescriptionService(); -const description = await imageService.describeImage(imageUrl, 'gpu', runtime); +const description = await imageService.describeImage(imageUrl, "gpu", runtime); ``` Features: + - Local and cloud processing options - CUDA acceleration support - Automatic format handling @@ -53,7 +55,7 @@ Features: The Solana plugin provides comprehensive blockchain functionality: ```typescript -import { solanaPlugin } from '@ai16z/eliza/plugin-solana'; +import { solanaPlugin } from "@ai16z/eliza/plugin-solana"; // Initialize plugin runtime.registerPlugin(solanaPlugin); @@ -68,7 +70,7 @@ const swapResult = await swapToken( walletPublicKey, inputTokenCA, outputTokenCA, - amount + amount, ); // Sell tokens @@ -80,7 +82,7 @@ const sellResult = await sellToken({ priorityFee, allowOffCurve: false, slippage: "1", - connection + connection, }); ``` @@ -93,13 +95,13 @@ const trustScoreManager = new TrustScoreManager(tokenProvider, trustScoreDb); const score = await trustScoreManager.generateTrustScore( tokenAddress, recommenderId, - recommenderWallet + recommenderWallet, ); // Monitor trade performance await trustScoreManager.createTradePerformance(runtime, tokenAddress, userId, { buy_amount: amount, - is_simulation: false + is_simulation: false, }); ``` @@ -115,12 +117,12 @@ class SpeechService extends Service implements ISpeechService { if (runtime.getSetting("ELEVENLABS_XI_API_KEY")) { return textToSpeech(runtime, text); } - + const { audio } = await synthesize(text, { engine: "vits", - voice: "en_US-hfc_female-medium" + voice: "en_US-hfc_female-medium", }); - + return Readable.from(audio); } } @@ -142,7 +144,7 @@ class PdfService extends Service { const textContent = await page.getTextContent(); const pageText = textContent.items .filter(isTextItem) - .map(item => item.str) + .map((item) => item.str) .join(" "); textPages.push(pageText); } @@ -161,7 +163,7 @@ class MemoryManager { async getMemories({ agentId, roomId, - count + count, }: { agentId: string; roomId: string; @@ -170,7 +172,10 @@ class MemoryManager { // Implement memory retrieval logic } - async createMemory(memory: Memory, allowDuplicates: boolean = false): Promise { + async createMemory( + memory: Memory, + allowDuplicates: boolean = false, + ): Promise { // Implement memory storage logic } } @@ -189,10 +194,10 @@ class TrustScoreDatabase { JOIN recommender_metrics rm ON tr.recommender_id = rm.recommender_id WHERE tr.token_address = ?; `; - + const rows = this.db.prepare(sql).all(tokenAddress); if (rows.length === 0) return 0; - + const totalTrust = rows.reduce((acc, row) => acc + row.trust_score, 0); return totalTrust / rows.length; } @@ -215,7 +220,7 @@ const customPlugin: Plugin = { ], providers: [ // Custom providers - ] + ], }; ``` @@ -234,11 +239,11 @@ export const complexAction: Action = { message: Memory, state: State, options: { [key: string]: unknown }, - callback?: HandlerCallback + callback?: HandlerCallback, ): Promise => { // Implement complex handling logic return true; - } + }, }; ``` @@ -250,15 +255,12 @@ export const complexAction: Action = { const customRuntime = new AgentRuntime({ databaseAdapter: new PostgresDatabaseAdapter(config), modelProvider: new OpenAIProvider(apiKey), - plugins: [ - solanaPlugin, - customPlugin - ], + plugins: [solanaPlugin, customPlugin], services: [ new VideoService(), new ImageDescriptionService(), - new SpeechService() - ] + new SpeechService(), + ], }); ``` @@ -271,13 +273,13 @@ const modelConfig = { maxTokens: 2000, topP: 0.9, frequencyPenalty: 0.5, - presencePenalty: 0.5 + presencePenalty: 0.5, }; const response = await generateText({ runtime, context: prompt, - ...modelConfig + ...modelConfig, }); ``` @@ -347,11 +349,11 @@ try { ```typescript class ResourceManager { private resources: Map = new Map(); - + async acquire(id: string): Promise { // Implement resource acquisition with timeout } - + async release(id: string): Promise { // Implement resource cleanup } @@ -363,11 +365,13 @@ class ResourceManager { ### Common Issues 1. Memory Leaks + - Monitor memory usage - Implement proper cleanup - Use WeakMap for caching 2. Performance Bottlenecks + - Profile slow operations - Implement batching - Use connection pooling @@ -380,12 +384,12 @@ class ResourceManager { ### Debugging ```typescript -const debug = require('debug')('eliza:advanced'); +const debug = require("debug")("eliza:advanced"); -debug('Detailed operation info: %O', { - operation: 'complexOperation', +debug("Detailed operation info: %O", { + operation: "complexOperation", parameters: params, - result: result + result: result, }); ``` diff --git a/docs/docs/guides/configuration.md b/docs/docs/guides/configuration.md index 3e7ea20016c..463d46d6908 100644 --- a/docs/docs/guides/configuration.md +++ b/docs/docs/guides/configuration.md @@ -6,7 +6,7 @@ sidebar_position: 9 This guide covers how to configure Eliza for different use cases and environments. We'll walk through all available configuration options and best practices. -## Environment Configuration +## Environment Configuration ### Basic Setup @@ -34,21 +34,24 @@ X_SERVER_URL= # Optional model API endpoint ### Client-Specific Configuration #### Discord Configuration + ```bash DISCORD_APPLICATION_ID= # Your Discord app ID DISCORD_API_TOKEN= # Discord bot token ``` #### Twitter Configuration + ```bash TWITTER_USERNAME= # Bot Twitter username -TWITTER_PASSWORD= # Bot Twitter password +TWITTER_PASSWORD= # Bot Twitter password TWITTER_EMAIL= # Twitter account email TWITTER_COOKIES= # Twitter auth cookies TWITTER_DRY_RUN=false # Test mode without posting ``` #### Telegram Configuration + ```bash TELEGRAM_BOT_TOKEN= # Telegram bot token ``` @@ -64,7 +67,7 @@ OPENAI_API_KEY=sk-* # Anthropic Settings ANTHROPIC_API_KEY= -# Together.ai Settings +# Together.ai Settings TOGETHER_API_KEY= # Local Model Settings @@ -91,15 +94,18 @@ Configure image generation in your character file: Example usage: ```typescript -const result = await generateImage({ +const result = await generateImage( + { prompt: "pepe_frog, meme, web comic, cartoon, 3d render", width: 512, height: 512, - numIterations: 20, // optional - guidanceScale: 3, // optional - seed: -1, // optional - modelId: "PepeXL" // optional -}, runtime); + numIterations: 20, // optional + guidanceScale: 3, // optional + seed: -1, // optional + modelId: "PepeXL", // optional + }, + runtime, +); ``` ## Character Configuration @@ -165,7 +171,7 @@ export const myAction: Action = { handler: async (runtime: IAgentRuntime, message: Memory) => { // Action logic return true; - } + }, }; ``` @@ -187,11 +193,11 @@ const db = new PostgresDatabaseAdapter({ port: parseInt(process.env.DB_PORT), database: process.env.DB_NAME, user: process.env.DB_USER, - password: process.env.DB_PASSWORD + password: process.env.DB_PASSWORD, }); ``` -### Model Providers +### Model Providers Configure model providers in your character file: @@ -221,10 +227,10 @@ const settings = { // Performance MAX_CONCURRENT_REQUESTS: 5, REQUEST_TIMEOUT: 30000, - + // Memory MEMORY_TTL: 3600, - MAX_MEMORY_ITEMS: 1000 + MAX_MEMORY_ITEMS: 1000, }; ``` @@ -250,20 +256,24 @@ plugins: ## Configuration Best Practices 1. **Environment Segregation** + - Use different `.env` files for different environments - Follow naming convention: `.env.development`, `.env.staging`, `.env.production` 2. **Secret Management** + - Never commit secrets to version control - Use secret management services in production - Rotate API keys regularly 3. **Character Configuration** + - Keep character files modular and focused - Use inheritance for shared traits - Document character behaviors 4. **Plugin Management** + - Enable only needed plugins - Configure plugin-specific settings in separate files - Monitor plugin performance @@ -278,15 +288,17 @@ plugins: ### Common Issues 1. **Environment Variables Not Loading** + ```bash # Check .env file location node -e "console.log(require('path').resolve('.env'))" - + # Verify environment variables node -e "console.log(process.env)" ``` 2. **Character Loading Failures** + ```bash # Validate character file npx ajv validate -s character-schema.json -d your-character.json @@ -307,6 +319,7 @@ pnpm run validate-config ``` This will check: + - Environment variables - Character files - Database configuration diff --git a/docs/docs/guides/local-development.md b/docs/docs/guides/local-development.md index ac800be7eb4..ec3929a9440 100644 --- a/docs/docs/guides/local-development.md +++ b/docs/docs/guides/local-development.md @@ -64,7 +64,7 @@ For local inference without API dependencies: # Install CUDA support for NVIDIA GPUs npx --no node-llama-cpp source download --gpu cuda -# The system will automatically download models from +# The system will automatically download models from # Hugging Face on first run ``` @@ -160,10 +160,10 @@ describe("Feature Test", () => { messages: [ { user: "user1", - content: { text: "test message" } - } + content: { text: "test message" }, + }, ], - expected: "expected response" + expected: "expected response", }); expect(result.success).toBe(true); }); @@ -183,7 +183,7 @@ export const myPlugin: Plugin = { description: "My custom plugin", actions: [], evaluators: [], - providers: [] + providers: [], }; ``` @@ -201,7 +201,7 @@ export const myAction: Action = { // Implementation return true; }, - examples: [] + examples: [], }; ``` @@ -233,23 +233,26 @@ Create `.vscode/launch.json`: ### Debugging Tips 1. Enable Debug Logging + ```bash # Add to your .env file DEBUG=eliza:* ``` 2. Use Debug Points + ```typescript -const debug = require('debug')('eliza:dev'); +const debug = require("debug")("eliza:dev"); -debug('Operation details: %O', { - operation: 'functionName', +debug("Operation details: %O", { + operation: "functionName", params: parameters, - result: result + result: result, }); ``` 3. Memory Debugging + ```bash # Increase Node.js memory for development NODE_OPTIONS="--max-old-space-size=8192" pnpm run dev @@ -295,8 +298,8 @@ const localModel = { modelProvider: "llamalocal", settings: { modelPath: "./models/llama-7b.gguf", - contextSize: 8192 - } + contextSize: 8192, + }, }; // Cloud model configuration @@ -304,8 +307,8 @@ const cloudModel = { modelProvider: "openai", settings: { model: "gpt-4o-mini", - temperature: 0.7 - } + temperature: 0.7, + }, }; ``` @@ -342,6 +345,7 @@ class MemoryManager { ### Common Issues 1. Model Loading Issues + ```bash # Clear model cache rm -rf ./models/* @@ -349,12 +353,14 @@ rm -rf ./models/* ``` 2. Database Connection Issues + ```bash # Test database connection pnpm run test:db-connection ``` 3. Memory Issues + ```bash # Check memory usage node --trace-gc index.js @@ -376,11 +382,13 @@ pnpm run analyze ## Best Practices 1. Code Organization + - Place custom actions in `custom_actions/` - Keep character files in `characters/` - Store test data in `tests/fixtures/` 2. Testing Strategy + - Write unit tests for new features - Use integration tests for plugins - Test with multiple model providers diff --git a/docs/docs/guides/secrets-management.md b/docs/docs/guides/secrets-management.md index 5b924f6fc2e..c35c65345e6 100644 --- a/docs/docs/guides/secrets-management.md +++ b/docs/docs/guides/secrets-management.md @@ -57,19 +57,19 @@ import { config } from "dotenv"; import path from "path"; export function findNearestEnvFile(startDir = process.cwd()) { - let currentDir = startDir; - - while (currentDir !== path.parse(currentDir).root) { - const envPath = path.join(currentDir, ".env"); - - if (fs.existsSync(envPath)) { - return envPath; - } - - currentDir = path.dirname(currentDir); + let currentDir = startDir; + + while (currentDir !== path.parse(currentDir).root) { + const envPath = path.join(currentDir, ".env"); + + if (fs.existsSync(envPath)) { + return envPath; } - - return null; + + currentDir = path.dirname(currentDir); + } + + return null; } ``` @@ -103,17 +103,17 @@ Use encrypted connection strings: ```typescript class SecureDatabase { - private connection: Connection; - - constructor(encryptedConfig: string) { - const config = this.decryptConfig(encryptedConfig); - this.connection = new Connection(config); - } - - private decryptConfig(encrypted: string): DatabaseConfig { - // Implement decryption logic - return JSON.parse(decrypted); - } + private connection: Connection; + + constructor(encryptedConfig: string) { + const config = this.decryptConfig(encryptedConfig); + this.connection = new Connection(config); + } + + private decryptConfig(encrypted: string): DatabaseConfig { + // Implement decryption logic + return JSON.parse(decrypted); + } } ``` @@ -123,26 +123,26 @@ Secure handling of blockchain credentials: ```typescript class WalletManager { - private async initializeWallet(runtime: IAgentRuntime) { - const privateKey = runtime.getSetting("WALLET_PRIVATE_KEY"); - - if (!privateKey) { - throw new Error("Wallet private key not configured"); - } - - // Validate key format - try { - const keyBuffer = Buffer.from(privateKey, "base64"); - if (keyBuffer.length !== 64) { - throw new Error("Invalid key length"); - } - } catch (error) { - throw new Error("Invalid private key format"); - } - - // Initialize wallet securely - return new Wallet(privateKey); + private async initializeWallet(runtime: IAgentRuntime) { + const privateKey = runtime.getSetting("WALLET_PRIVATE_KEY"); + + if (!privateKey) { + throw new Error("Wallet private key not configured"); + } + + // Validate key format + try { + const keyBuffer = Buffer.from(privateKey, "base64"); + if (keyBuffer.length !== 64) { + throw new Error("Invalid key length"); + } + } catch (error) { + throw new Error("Invalid private key format"); } + + // Initialize wallet securely + return new Wallet(privateKey); + } } ``` @@ -152,19 +152,19 @@ Implement automatic secret rotation: ```typescript class SecretRotation { - private static readonly SECRET_LIFETIME = 90 * 24 * 60 * 60 * 1000; // 90 days - - async shouldRotateSecret(secretName: string): Promise { - const lastRotation = await this.getLastRotation(secretName); - return Date.now() - lastRotation > SecretRotation.SECRET_LIFETIME; - } - - async rotateSecret(secretName: string): Promise { - // Implement rotation logic - const newSecret = await this.generateNewSecret(); - await this.updateSecret(secretName, newSecret); - await this.recordRotation(secretName); - } + private static readonly SECRET_LIFETIME = 90 * 24 * 60 * 60 * 1000; // 90 days + + async shouldRotateSecret(secretName: string): Promise { + const lastRotation = await this.getLastRotation(secretName); + return Date.now() - lastRotation > SecretRotation.SECRET_LIFETIME; + } + + async rotateSecret(secretName: string): Promise { + // Implement rotation logic + const newSecret = await this.generateNewSecret(); + await this.updateSecret(secretName, newSecret); + await this.recordRotation(secretName); + } } ``` @@ -174,23 +174,26 @@ Implement proper access controls: ```typescript class SecretAccess { - private static readonly ALLOWED_KEYS = [ - "OPENAI_API_KEY", - "DISCORD_TOKEN", - // ... other allowed keys - ]; - - static validateAccess(key: string): boolean { - return this.ALLOWED_KEYS.includes(key); - } - - static async getSecret(runtime: IAgentRuntime, key: string): Promise { - if (!this.validateAccess(key)) { - throw new Error(`Unauthorized access to secret: ${key}`); - } - - return runtime.getSetting(key); + private static readonly ALLOWED_KEYS = [ + "OPENAI_API_KEY", + "DISCORD_TOKEN", + // ... other allowed keys + ]; + + static validateAccess(key: string): boolean { + return this.ALLOWED_KEYS.includes(key); + } + + static async getSecret( + runtime: IAgentRuntime, + key: string, + ): Promise { + if (!this.validateAccess(key)) { + throw new Error(`Unauthorized access to secret: ${key}`); } + + return runtime.getSetting(key); + } } ``` @@ -202,36 +205,36 @@ Implement encryption for stored secrets: import { createCipheriv, createDecipheriv } from "crypto"; class SecretEncryption { - static async encrypt(value: string, key: Buffer): Promise { - const iv = crypto.randomBytes(16); - const cipher = createCipheriv("aes-256-gcm", key, iv); - - let encrypted = cipher.update(value, "utf8", "hex"); - encrypted += cipher.final("hex"); - - return JSON.stringify({ - iv: iv.toString("hex"), - encrypted, - tag: cipher.getAuthTag().toString("hex") - }); - } - - static async decrypt(encrypted: string, key: Buffer): Promise { - const { iv, encrypted: encryptedData, tag } = JSON.parse(encrypted); - - const decipher = createDecipheriv( - "aes-256-gcm", - key, - Buffer.from(iv, "hex") - ); - - decipher.setAuthTag(Buffer.from(tag, "hex")); - - let decrypted = decipher.update(encryptedData, "hex", "utf8"); - decrypted += decipher.final("utf8"); - - return decrypted; - } + static async encrypt(value: string, key: Buffer): Promise { + const iv = crypto.randomBytes(16); + const cipher = createCipheriv("aes-256-gcm", key, iv); + + let encrypted = cipher.update(value, "utf8", "hex"); + encrypted += cipher.final("hex"); + + return JSON.stringify({ + iv: iv.toString("hex"), + encrypted, + tag: cipher.getAuthTag().toString("hex"), + }); + } + + static async decrypt(encrypted: string, key: Buffer): Promise { + const { iv, encrypted: encryptedData, tag } = JSON.parse(encrypted); + + const decipher = createDecipheriv( + "aes-256-gcm", + key, + Buffer.from(iv, "hex"), + ); + + decipher.setAuthTag(Buffer.from(tag, "hex")); + + let decrypted = decipher.update(encryptedData, "hex", "utf8"); + decrypted += decipher.final("utf8"); + + return decrypted; + } } ``` @@ -265,16 +268,12 @@ Validate secrets before use: ```typescript async function validateSecrets(character: Character): Promise { - const required = ["OPENAI_API_KEY"]; - const missing = required.filter( - key => !character.settings.secrets[key] - ); - - if (missing.length > 0) { - throw new Error( - `Missing required secrets: ${missing.join(", ")}` - ); - } + const required = ["OPENAI_API_KEY"]; + const missing = required.filter((key) => !character.settings.secrets[key]); + + if (missing.length > 0) { + throw new Error(`Missing required secrets: ${missing.join(", ")}`); + } } ``` @@ -284,16 +283,16 @@ Secure error messages: ```typescript try { - await loadSecrets(); + await loadSecrets(); } catch (error) { - if (error.code === "ENOENT") { - console.error("Environment file not found"); - } else if (error instanceof ValidationError) { - console.error("Invalid secret format"); - } else { - // Log securely without exposing secret values - console.error("Error loading secrets"); - } + if (error.code === "ENOENT") { + console.error("Environment file not found"); + } else if (error instanceof ValidationError) { + console.error("Invalid secret format"); + } else { + // Log securely without exposing secret values + console.error("Error loading secrets"); + } } ``` @@ -303,16 +302,16 @@ try { ```typescript class APIKeyManager { - private validateAPIKey(key: string): boolean { - if (key.startsWith("sk-")) { - return key.length > 20; - } - return false; - } - - async rotateAPIKey(provider: string): Promise { - // Implement key rotation logic + private validateAPIKey(key: string): boolean { + if (key.startsWith("sk-")) { + return key.length > 20; } + return false; + } + + async rotateAPIKey(provider: string): Promise { + // Implement key rotation logic + } } ``` @@ -320,16 +319,16 @@ class APIKeyManager { ```typescript class ConfigLoader { - private static sanitizePath(path: string): boolean { - return !path.includes("../") && !path.startsWith("/"); - } - - async loadConfig(path: string): Promise { - if (!this.sanitizePath(path)) { - throw new Error("Invalid config path"); - } - // Load configuration + private static sanitizePath(path: string): boolean { + return !path.includes("../") && !path.startsWith("/"); + } + + async loadConfig(path: string): Promise { + if (!this.sanitizePath(path)) { + throw new Error("Invalid config path"); } + // Load configuration + } } ``` @@ -337,16 +336,16 @@ class ConfigLoader { ```typescript class SecureMemory { - private secrets: Map> = new Map(); - - set(key: string, value: string): void { - this.secrets.set(key, new WeakRef(value)); - } - - get(key: string): string | null { - const ref = this.secrets.get(key); - return ref?.deref() ?? null; - } + private secrets: Map> = new Map(); + + set(key: string, value: string): void { + this.secrets.set(key, new WeakRef(value)); + } + + get(key: string): string | null { + const ref = this.secrets.get(key); + return ref?.deref() ?? null; + } } ``` @@ -355,38 +354,41 @@ class SecureMemory { ### Common Issues 1. Missing Secrets + ```typescript if (!process.env.OPENAI_API_KEY) { - throw new Error( - "OpenAI API key not found in environment or character settings" - ); + throw new Error( + "OpenAI API key not found in environment or character settings", + ); } ``` 2. Invalid Secret Format + ```typescript function validateApiKey(key: string): boolean { - // OpenAI keys start with 'sk-' - if (key.startsWith("sk-")) { - return key.length > 20; - } - return false; + // OpenAI keys start with 'sk-' + if (key.startsWith("sk-")) { + return key.length > 20; + } + return false; } ``` 3. Secret Loading Errors + ```typescript try { - await loadSecrets(); + await loadSecrets(); } catch (error) { - if (error.response) { - console.error("Response data:", error.response.data); - console.error("Response status:", error.response.status); - } else if (error.request) { - console.error("No response received:", error.request); - } else { - console.error("Error setting up request:", error.message); - } + if (error.response) { + console.error("Response data:", error.response.data); + console.error("Response status:", error.response.status); + } else if (error.request) { + console.error("No response received:", error.request); + } else { + console.error("Error setting up request:", error.message); + } } ``` diff --git a/docs/docs/packages/adapters.md b/docs/docs/packages/adapters.md index fe07904e7d5..1ad639f23bc 100644 --- a/docs/docs/packages/adapters.md +++ b/docs/docs/packages/adapters.md @@ -13,23 +13,26 @@ Database Adapters provide Eliza's persistence layer, enabling storage and retrie Each adapter is optimized for different use cases: - **PostgreSQL** (`@ai16z/adapter-postgres`) + - Production-ready with vector search - Connection pooling and high performance - JSONB and pgvector support - **SQLite** (`@ai16z/adapter-sqlite`) + - Lightweight local development - No external dependencies - Full-text search capabilities - **Supabase** (`@ai16z/adapter-supabase`) + - Cloud-native PostgreSQL - Real-time subscriptions - Built-in RPC functions - **SQL.js** (`@ai16z/adapter-sqljs`) - In-memory SQLite for testing - - Browser compatibility + - Browser compatibility - Zero configuration ### Architecture Overview @@ -124,6 +127,7 @@ classDiagram ``` Key components: + - **DatabaseAdapter**: Abstract base class defining the interface - **Concrete Adapters**: PostgreSQL, SQLite, Supabase, and SQL.js implementations - **Memory Management**: Integration with MemoryManager for data operations @@ -160,7 +164,7 @@ const db = new PostgresDatabaseAdapter({ connectionString: process.env.DATABASE_URL, max: 20, // Connection pool size idleTimeoutMillis: 30000, - connectionTimeoutMillis: 2000 + connectionTimeoutMillis: 2000, }); // Test connection @@ -178,8 +182,8 @@ const db = new SqliteDatabaseAdapter( // SQLite options memory: false, readonly: false, - fileMustExist: false - }) + fileMustExist: false, + }), ); ``` @@ -190,7 +194,7 @@ import { SupabaseDatabaseAdapter } from "@ai16z/adapter-supabase"; const db = new SupabaseDatabaseAdapter( process.env.SUPABASE_URL!, - process.env.SUPABASE_ANON_KEY! + process.env.SUPABASE_ANON_KEY!, ); ``` @@ -207,14 +211,14 @@ await db.createMemory({ type: "messages", content: { text: "Hello world", - attachments: [] + attachments: [], }, embedding: new Float32Array(1536), // Embedding vector userId, roomId, agentId, createdAt: Date.now(), - unique: true + unique: true, }); // Search by embedding @@ -224,7 +228,7 @@ const memories = await db.searchMemories({ embedding: vectorData, match_threshold: 0.8, match_count: 10, - unique: true + unique: true, }); // Get recent memories @@ -234,7 +238,7 @@ const recent = await db.getMemories({ unique: true, tableName: "messages", start: startTime, - end: endTime + end: endTime, }); ``` @@ -244,18 +248,18 @@ const recent = await db.getMemories({ // Create relationship await db.createRelationship({ userA: user1Id, - userB: user2Id + userB: user2Id, }); // Get relationship const relationship = await db.getRelationship({ userA: user1Id, - userB: user2Id + userB: user2Id, }); // Get all relationships const relationships = await db.getRelationships({ - userId: user1Id + userId: user1Id, }); ``` @@ -271,14 +275,14 @@ await db.createGoal({ status: GoalStatus.IN_PROGRESS, objectives: [ { text: "Step 1", completed: false }, - { text: "Step 2", completed: false } - ] + { text: "Step 2", completed: false }, + ], }); // Update goal status await db.updateGoalStatus({ goalId, - status: GoalStatus.COMPLETED + status: GoalStatus.COMPLETED, }); // Get active goals @@ -286,7 +290,7 @@ const goals = await db.getGoals({ roomId, userId, onlyInProgress: true, - count: 10 + count: 10, }); ``` @@ -337,23 +341,23 @@ async searchMemoriesByEmbedding( `[${embedding.join(",")}]`, params.tableName ]; - + if (params.unique) { sql += ` AND "unique" = true`; } - + if (params.roomId) { sql += ` AND "roomId" = $3::uuid`; values.push(params.roomId); } - + if (params.match_threshold) { sql += ` AND 1 - (embedding <-> $1::vector) >= $4`; values.push(params.match_threshold); } - + sql += ` ORDER BY embedding <-> $1::vector`; - + if (params.count) { sql += ` LIMIT $5`; values.push(params.count); @@ -405,7 +409,7 @@ async searchMemories(params: { sql += ` ORDER BY similarity ASC LIMIT ?`; const memories = this.db.prepare(sql).all(...queryParams); - + return memories.map(memory => ({ ...memory, content: JSON.parse(memory.content), @@ -436,7 +440,7 @@ CREATE TABLE memories ( "createdAt" TIMESTAMP NOT NULL ); -CREATE INDEX memory_embedding_idx ON +CREATE INDEX memory_embedding_idx ON memories USING ivfflat (embedding vector_cosine_ops) WITH (lists = 100); @@ -506,7 +510,7 @@ constructor(connectionConfig: any) { idleTimeoutMillis: 30000, connectionTimeoutMillis: 2000 }); - + this.pool.on("error", (err) => { console.error("Unexpected error on idle client", err); }); @@ -519,7 +523,7 @@ constructor(connectionConfig: any) { // SQLite prepared statements class SqliteDatabaseAdapter extends DatabaseAdapter { private statements = new Map(); - + prepareStatement(sql: string): Statement { let stmt = this.statements.get(sql); if (!stmt) { @@ -528,17 +532,17 @@ class SqliteDatabaseAdapter extends DatabaseAdapter { } return stmt; } - + // Use prepared statements async getMemoryById(id: UUID): Promise { - const stmt = this.prepareStatement( - "SELECT * FROM memories WHERE id = ?" - ); + const stmt = this.prepareStatement("SELECT * FROM memories WHERE id = ?"); const memory = stmt.get(id); - return memory ? { - ...memory, - content: JSON.parse(memory.content) - } : null; + return memory + ? { + ...memory, + content: JSON.parse(memory.content), + } + : null; } } ``` @@ -551,14 +555,14 @@ async createMemories(memories: Memory[], tableName: string) { const client = await this.pool.connect(); try { await client.query('BEGIN'); - + const stmt = await client.prepare( `INSERT INTO memories ( - id, type, content, embedding, "userId", + id, type, content, embedding, "userId", "roomId", "agentId", "unique", "createdAt" ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)` ); - + for (const memory of memories) { await stmt.execute([ memory.id, @@ -572,7 +576,7 @@ async createMemories(memories: Memory[], tableName: string) { memory.createdAt ]); } - + await client.query('COMMIT'); } catch (error) { await client.query('ROLLBACK'); @@ -590,19 +594,19 @@ async createMemories(memories: Memory[], tableName: string) { ```typescript class DatabaseAdapter { protected async withTransaction( - callback: (client: PoolClient) => Promise + callback: (client: PoolClient) => Promise, ): Promise { const client = await this.pool.connect(); try { - await client.query('BEGIN'); + await client.query("BEGIN"); const result = await callback(client); - await client.query('COMMIT'); + await client.query("COMMIT"); return result; } catch (error) { - await client.query('ROLLBACK'); + await client.query("ROLLBACK"); if (error instanceof DatabaseError) { // Handle specific database errors - if (error.code === '23505') { + if (error.code === "23505") { throw new UniqueViolationError(error); } } @@ -629,11 +633,11 @@ class CustomDatabaseAdapter extends DatabaseAdapter { async createMemory(memory: Memory, tableName: string): Promise { // Custom implementation } - + async searchMemories(params: SearchParams): Promise { // Custom implementation } - + // Add custom functionality async customOperation(): Promise { // Custom database operation @@ -646,16 +650,19 @@ class CustomDatabaseAdapter extends DatabaseAdapter { ## Best Practices 1. **Connection Management** + - Use connection pooling for PostgreSQL - Handle connection failures gracefully - Implement proper cleanup 2. **Transaction Handling** + - Use transactions for atomic operations - Implement proper rollback handling - Manage nested transactions 3. **Error Handling** + - Implement specific error types - Handle constraint violations - Provide meaningful error messages diff --git a/docs/docs/packages/agent.md b/docs/docs/packages/agent.md index 100849726e9..87108048b7b 100644 --- a/docs/docs/packages/agent.md +++ b/docs/docs/packages/agent.md @@ -6,7 +6,6 @@ sidebar_position: 1 The Agent Package (`@eliza/agent`) provides the high-level orchestration layer for Eliza, managing agent lifecycles, character loading, client initialization, and runtime coordination. - ## Architecture Overview ```mermaid @@ -16,25 +15,25 @@ graph TD AP --> RT["Runtime Management"] AP --> DB["Database Integration"] AP --> CL["Client Management"] - + CS --> CF["Character Loading"] CS --> CP["Plugin Loading"] CS --> CT["Token Management"] - + RT --> AR["Agent Runtime"] RT --> AM["Agent Monitoring"] RT --> AH["Shell Interface"] - + DB --> PS["PostgreSQL Support"] DB --> SL["SQLite Support"] - + CL --> DC["Direct Client"] CL --> PC["Platform Clients"] - + %% Simple styling with black text classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px,color:black classDef highlight fill:#e9e9e9,stroke:#333,stroke-width:2px,color:black - + class AP highlight ``` @@ -72,24 +71,26 @@ await startAgents(); ### Character Loading ```typescript -export async function loadCharacters(charactersArg: string): Promise { +export async function loadCharacters( + charactersArg: string, +): Promise { const characterPaths = normalizeCharacterPaths(charactersArg); const loadedCharacters = []; for (const path of characterPaths) { try { const character = JSON.parse(fs.readFileSync(path, "utf8")); - + // Load plugins if specified if (character.plugins) { character.plugins = await Promise.all( - character.plugins.map(async plugin => { + character.plugins.map(async (plugin) => { const importedPlugin = await import(plugin); return importedPlugin; - }) + }), ); } - + loadedCharacters.push(character); } catch (error) { console.error(`Error loading character from ${path}: ${error}`); @@ -107,7 +108,7 @@ export async function loadCharacters(charactersArg: string): Promise str.toLowerCase()) || []; + const clientTypes = character.clients?.map((str) => str.toLowerCase()) || []; if (clientTypes.includes("discord")) { clients.push(await DiscordClientInterface.start(runtime)); @@ -157,29 +158,36 @@ export async function initializeClients( ## Best Practices ### Token Management + ```typescript export function getTokenForProvider( provider: ModelProviderName, - character: Character + character: Character, ) { switch (provider) { case ModelProviderName.OPENAI: - return character.settings?.secrets?.OPENAI_API_KEY || settings.OPENAI_API_KEY; + return ( + character.settings?.secrets?.OPENAI_API_KEY || settings.OPENAI_API_KEY + ); case ModelProviderName.ANTHROPIC: - return character.settings?.secrets?.ANTHROPIC_API_KEY || settings.ANTHROPIC_API_KEY; + return ( + character.settings?.secrets?.ANTHROPIC_API_KEY || + settings.ANTHROPIC_API_KEY + ); // Handle other providers... } } ``` ### Database Selection + ```typescript function initializeDatabase() { if (process.env.POSTGRES_URL) { return new PostgresDatabaseAdapter({ - connectionString: process.env.POSTGRES_URL + connectionString: process.env.POSTGRES_URL, }); - } + } return new SqliteDatabaseAdapter(new Database("./db.sqlite")); } ``` @@ -187,6 +195,7 @@ function initializeDatabase() { ## Common Issues & Solutions 1. **Character Loading** + ```typescript // Handle missing character files if (!characters || characters.length === 0) { @@ -196,11 +205,12 @@ if (!characters || characters.length === 0) { ``` 2. **Plugin Loading** + ```typescript // Handle plugin import errors try { character.plugins = await Promise.all( - character.plugins.map(plugin => import(plugin)) + character.plugins.map((plugin) => import(plugin)), ); } catch (error) { console.error(`Error loading plugin: ${error.message}`); diff --git a/docs/docs/packages/agents.md b/docs/docs/packages/agents.md index 6be5e3cace3..7a57d65cfb7 100644 --- a/docs/docs/packages/agents.md +++ b/docs/docs/packages/agents.md @@ -31,7 +31,7 @@ await startAgents(); export async function createAgent( character: Character, db: IDatabaseAdapter, - token: string + token: string, ): Promise { return new AgentRuntime({ databaseAdapter: db, @@ -42,14 +42,12 @@ export async function createAgent( bootstrapPlugin, nodePlugin, // Conditional plugins - character.settings.secrets.WALLET_PUBLIC_KEY - ? solanaPlugin - : null + character.settings.secrets.WALLET_PUBLIC_KEY ? solanaPlugin : null, ].filter(Boolean), providers: [], actions: [], services: [], - managers: [] + managers: [], }); } ``` @@ -58,35 +56,29 @@ export async function createAgent( ```typescript export async function loadCharacters( - charactersArg: string + charactersArg: string, ): Promise { // Parse character paths let characterPaths = charactersArg ?.split(",") - .map(path => path.trim()) - .map(path => normalizePath(path)); + .map((path) => path.trim()) + .map((path) => normalizePath(path)); const loadedCharacters = []; // Load each character file for (const path of characterPaths) { try { - const character = JSON.parse( - fs.readFileSync(path, "utf8") - ); + const character = JSON.parse(fs.readFileSync(path, "utf8")); // Load plugins if specified if (character.plugins) { - character.plugins = await loadPlugins( - character.plugins - ); + character.plugins = await loadPlugins(character.plugins); } loadedCharacters.push(character); } catch (error) { - console.error( - `Error loading character from ${path}: ${error}` - ); + console.error(`Error loading character from ${path}: ${error}`); } } @@ -104,36 +96,26 @@ export async function loadCharacters( ```typescript export async function initializeClients( character: Character, - runtime: IAgentRuntime + runtime: IAgentRuntime, ) { const clients = []; - const clientTypes = character.clients?.map( - str => str.toLowerCase() - ) || []; + const clientTypes = character.clients?.map((str) => str.toLowerCase()) || []; // Initialize requested clients if (clientTypes.includes("discord")) { - clients.push( - await DiscordClientInterface.start(runtime) - ); + clients.push(await DiscordClientInterface.start(runtime)); } if (clientTypes.includes("telegram")) { - clients.push( - await TelegramClientInterface.start(runtime) - ); + clients.push(await TelegramClientInterface.start(runtime)); } if (clientTypes.includes("twitter")) { - clients.push( - await TwitterClientInterface.start(runtime) - ); + clients.push(await TwitterClientInterface.start(runtime)); } if (clientTypes.includes("auto")) { - clients.push( - await AutoClientInterface.start(runtime) - ); + clients.push(await AutoClientInterface.start(runtime)); } return clients; @@ -147,14 +129,12 @@ function initializeDatabase(): IDatabaseAdapter { // Use PostgreSQL if URL provided if (process.env.POSTGRES_URL) { return new PostgresDatabaseAdapter({ - connectionString: process.env.POSTGRES_URL + connectionString: process.env.POSTGRES_URL, }); } - + // Fall back to SQLite - return new SqliteDatabaseAdapter( - new Database("./db.sqlite") - ); + return new SqliteDatabaseAdapter(new Database("./db.sqlite")); } ``` @@ -163,22 +143,21 @@ function initializeDatabase(): IDatabaseAdapter { ```typescript export function getTokenForProvider( provider: ModelProviderName, - character: Character + character: Character, ) { switch (provider) { case ModelProviderName.OPENAI: return ( - character.settings?.secrets?.OPENAI_API_KEY || - settings.OPENAI_API_KEY + character.settings?.secrets?.OPENAI_API_KEY || settings.OPENAI_API_KEY ); - + case ModelProviderName.ANTHROPIC: return ( character.settings?.secrets?.ANTHROPIC_API_KEY || character.settings?.secrets?.CLAUDE_API_KEY || settings.ANTHROPIC_API_KEY ); - + // Handle other providers... } } @@ -189,32 +168,19 @@ export function getTokenForProvider( ### Starting Agents ```typescript -async function startAgent( - character: Character, - directClient: any -) { +async function startAgent(character: Character, directClient: any) { try { // Get provider token - const token = getTokenForProvider( - character.modelProvider, - character - ); + const token = getTokenForProvider(character.modelProvider, character); // Initialize database const db = initializeDatabase(); // Create runtime - const runtime = await createAgent( - character, - db, - token - ); + const runtime = await createAgent(character, db, token); // Initialize clients - const clients = await initializeClients( - character, - runtime - ); + const clients = await initializeClients(character, runtime); // Register with direct client directClient.registerAgent(runtime); @@ -223,7 +189,7 @@ async function startAgent( } catch (error) { console.error( `Error starting agent for character ${character.name}:`, - error + error, ); throw error; } @@ -235,7 +201,7 @@ async function startAgent( ```typescript const rl = readline.createInterface({ input: process.stdin, - output: process.stdout + output: process.stdout, }); async function handleUserInput(input, agentId) { @@ -249,21 +215,19 @@ async function handleUserInput(input, agentId) { `http://localhost:${serverPort}/${agentId}/message`, { method: "POST", - headers: { - "Content-Type": "application/json" + headers: { + "Content-Type": "application/json", }, body: JSON.stringify({ text: input, userId: "user", - userName: "User" - }) - } + userName: "User", + }), + }, ); const data = await response.json(); - data.forEach(message => - console.log(`Agent: ${message.text}`) - ); + data.forEach((message) => console.log(`Agent: ${message.text}`)); } catch (error) { console.error("Error:", error); } @@ -277,10 +241,10 @@ async function handleUserInput(input, agentId) { ```typescript async function loadPlugins(pluginPaths: string[]) { return await Promise.all( - pluginPaths.map(async plugin => { + pluginPaths.map(async (plugin) => { const importedPlugin = await import(plugin); return importedPlugin; - }) + }), ); } ``` @@ -288,18 +252,13 @@ async function loadPlugins(pluginPaths: string[]) { ### Character Hot Reloading ```typescript -async function reloadCharacter( - runtime: IAgentRuntime, - characterPath: string -) { +async function reloadCharacter(runtime: IAgentRuntime, characterPath: string) { // Load new character - const character = JSON.parse( - fs.readFileSync(characterPath, "utf8") - ); + const character = JSON.parse(fs.readFileSync(characterPath, "utf8")); // Update runtime runtime.character = character; - + // Reload plugins if (character.plugins) { const plugins = await loadPlugins(character.plugins); @@ -316,23 +275,18 @@ class AgentCoordinator { async broadcast(message: Memory) { const responses = await Promise.all( - Array.from(this.agents.values()).map(agent => - agent.processMessage(message) - ) + Array.from(this.agents.values()).map((agent) => + agent.processMessage(message), + ), ); return responses; } async coordinate(agents: string[], task: Task) { // Coordinate multiple agents on a task - const selectedAgents = agents.map(id => - this.agents.get(id) - ); - - return await this.executeCoordinatedTask( - selectedAgents, - task - ); + const selectedAgents = agents.map((id) => this.agents.get(id)); + + return await this.executeCoordinatedTask(selectedAgents, task); } } ``` @@ -347,7 +301,7 @@ function validateCharacter(character: Character) { if (!character.name) { throw new Error("Character must have a name"); } - + if (!character.modelProvider) { throw new Error("Model provider must be specified"); } @@ -364,15 +318,9 @@ const character = { ### Error Handling ```typescript -async function handleAgentError( - error: Error, - character: Character -) { +async function handleAgentError(error: Error, character: Character) { // Log error with context - console.error( - `Agent ${character.name} error:`, - error - ); + console.error(`Agent ${character.name} error:`, error); // Attempt recovery if (error.code === "TOKEN_EXPIRED") { @@ -383,7 +331,7 @@ async function handleAgentError( await notify({ level: "error", character: character.name, - error + error, }); } ``` @@ -395,12 +343,10 @@ class ResourceManager { async cleanup() { // Close database connections await this.db.close(); - + // Shutdown clients - await Promise.all( - this.clients.map(client => client.stop()) - ); - + await Promise.all(this.clients.map((client) => client.stop())); + // Clear caches this.cache.clear(); } @@ -420,6 +366,7 @@ class ResourceManager { ### Common Issues 1. **Character Loading Failures** + ```typescript try { await loadCharacters(charactersArg); @@ -433,6 +380,7 @@ try { ``` 2. **Client Initialization Errors** + ```typescript async function handleClientError(error: Error) { if (error.message.includes("rate limit")) { @@ -444,6 +392,7 @@ async function handleClientError(error: Error) { ``` 3. **Database Connection Issues** + ```typescript async function handleDbError(error: Error) { if (error.message.includes("connection")) { diff --git a/docs/docs/packages/clients.md b/docs/docs/packages/clients.md index 7889ed79f1f..3d302aa6311 100644 --- a/docs/docs/packages/clients.md +++ b/docs/docs/packages/clients.md @@ -11,25 +11,25 @@ graph TD RT["Agent Runtime"] CI["Client Interface"] RT --> CI - + %% Main Clients CI --> DC["Direct Client"] CI --> DSC["Discord Client"] CI --> TC["Telegram Client"] CI --> TWC["Twitter Client"] CI --> AC["Auto Client"] - + %% Key Features - one per client for clarity DC --> |"REST API"| DC1["Messages & Images"] DSC --> |"Bot Integration"| DSC1["Voice & Messages"] TC --> |"Bot API"| TC1["Commands & Media"] TWC --> |"Social"| TWC1["Posts & Interactions"] AC --> |"Trading"| AC1["Analysis & Execution"] - + %% Simple styling with better contrast and black text classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px,color:black classDef highlight fill:#e9e9e9,stroke:#333,stroke-width:2px,color:black - + class RT,CI highlight ``` @@ -77,15 +77,15 @@ import { DiscordClientInterface } from "@eliza/client-discord"; const client = await DiscordClientInterface.start(runtime); // Configuration in .env -DISCORD_APPLICATION_ID=your_app_id -DISCORD_API_TOKEN=your_bot_token +DISCORD_APPLICATION_ID = your_app_id; +DISCORD_API_TOKEN = your_bot_token; ``` ### Features - Voice channel integration - Message attachments -- Reactions handling +- Reactions handling - Media transcription - Room management @@ -139,10 +139,10 @@ import { TwitterClientInterface } from "@eliza/client-twitter"; const client = await TwitterClientInterface.start(runtime); // Configuration in .env -TWITTER_USERNAME=your_username -TWITTER_PASSWORD=your_password -TWITTER_EMAIL=your_email -TWITTER_COOKIES=your_cookies +TWITTER_USERNAME = your_username; +TWITTER_PASSWORD = your_password; +TWITTER_EMAIL = your_email; +TWITTER_COOKIES = your_cookies; ``` ### Components @@ -158,14 +158,14 @@ class TwitterPostClient { async createPost(content: string) { return await this.post({ text: content, - media: await this.processMedia() + media: await this.processMedia(), }); } async replyTo(tweetId: string, content: string) { return await this.post({ text: content, - reply: { in_reply_to_tweet_id: tweetId } + reply: { in_reply_to_tweet_id: tweetId }, }); } } @@ -180,8 +180,8 @@ class TwitterSearchClient { query, filters: { recency: "recent", - language: "en" - } + language: "en", + }, }); } } @@ -200,7 +200,7 @@ import { TelegramClientInterface } from "@eliza/client-telegram"; const client = await TelegramClientInterface.start(runtime); // Configuration in .env -TELEGRAM_BOT_TOKEN=your_bot_token +TELEGRAM_BOT_TOKEN = your_bot_token; ``` ### Message Management @@ -239,17 +239,15 @@ const client = await DirectClientInterface.start(runtime); class DirectClient { constructor() { // Message endpoint - this.app.post("/:agentId/message", - async (req, res) => { - const response = await this.handleMessage(req.body); - res.json(response); + this.app.post("/:agentId/message", async (req, res) => { + const response = await this.handleMessage(req.body); + res.json(response); }); // Image generation endpoint - this.app.post("/:agentId/image", - async (req, res) => { - const images = await this.generateImage(req.body); - res.json(images); + this.app.post("/:agentId/image", async (req, res) => { + const images = await this.generateImage(req.body); + res.json(images); }); } } @@ -274,20 +272,23 @@ const client = await AutoClientInterface.start(runtime); class AutoClient { constructor(runtime: IAgentRuntime) { this.runtime = runtime; - + // Start trading loop - this.interval = setInterval(() => { - this.makeTrades(); - }, 60 * 60 * 1000); // 1 hour interval + this.interval = setInterval( + () => { + this.makeTrades(); + }, + 60 * 60 * 1000, + ); // 1 hour interval } async makeTrades() { // Get recommendations const recommendations = await this.getHighTrustRecommendations(); - + // Analyze tokens const analysis = await this.analyzeTokens(recommendations); - + // Execute trades await this.executeTrades(analysis); } @@ -324,7 +325,7 @@ interface MediaProcessor { class BaseClient { protected async handleError(error: Error) { console.error("Client error:", error); - + if (error.code === "RATE_LIMIT") { await this.handleRateLimit(error); } else if (error.code === "AUTH_FAILED") { @@ -339,16 +340,19 @@ class BaseClient { ## Best Practices 1. **Authentication** + - Store credentials securely in environment variables - Implement token refresh mechanisms - Handle authentication errors gracefully 2. **Rate Limiting** + - Implement exponential backoff - Track API usage - Queue messages during rate limits 3. **Error Handling** + - Log errors with context - Implement retry logic - Handle platform-specific errors @@ -370,13 +374,13 @@ class BaseClient { } else if (error.code === "NETWORK_ERROR") { await this.reconnect(); } - + // Log error console.error("Client error:", { type: error.name, message: error.message, code: error.code, - stack: error.stack + stack: error.stack, }); } } @@ -388,15 +392,13 @@ class BaseClient { class ClientManager { private async cleanup() { // Close connections - await Promise.all( - this.connections.map(conn => conn.close()) - ); - + await Promise.all(this.connections.map((conn) => conn.close())); + // Clear caches this.cache.clear(); - + // Cancel timers - this.timers.forEach(timer => clearInterval(timer)); + this.timers.forEach((timer) => clearInterval(timer)); } private async reconnect() { @@ -418,10 +420,7 @@ class RateLimiter { } private calculateBackoff(error: RateLimitError): number { - return Math.min( - this.baseDelay * Math.pow(2, this.attempts), - this.maxDelay - ); + return Math.min(this.baseDelay * Math.pow(2, this.attempts), this.maxDelay); } } ``` @@ -458,6 +457,7 @@ class MessageQueue { ### Common Issues 1. **Authentication Failures** + ```typescript // Implement token refresh async refreshAuth() { @@ -467,6 +467,7 @@ async refreshAuth() { ``` 2. **Rate Limits** + ```typescript // Handle rate limiting async handleRateLimit(error) { @@ -477,6 +478,7 @@ async handleRateLimit(error) { ``` 3. **Connection Issues** + ```typescript // Implement reconnection logic async handleDisconnect() { diff --git a/docs/docs/packages/core.md b/docs/docs/packages/core.md index 815d75f0b8e..e4d74963b45 100644 --- a/docs/docs/packages/core.md +++ b/docs/docs/packages/core.md @@ -28,7 +28,7 @@ pnpm add @ai16z/core The AgentRuntime class serves as the central nervous system of Eliza, orchestrating all major components: ```typescript -import { AgentRuntime } from '@ai16z/core'; +import { AgentRuntime } from "@ai16z/core"; const runtime = new AgentRuntime({ // Core configuration @@ -36,22 +36,23 @@ const runtime = new AgentRuntime({ token, modelProvider: ModelProviderName.OPENAI, character, - + // Extension points plugins: [bootstrapPlugin, nodePlugin], providers: [], actions: [], services: [], managers: [], - + // Optional settings conversationLength: 32, agentId: customId, - fetch: customFetch + fetch: customFetch, }); ``` Key capabilities: + - State composition and management - Plugin and service registration - Memory and relationship management @@ -70,16 +71,13 @@ class MemoryManager implements IMemoryManager { // Create new memories with embeddings async createMemory(memory: Memory, unique = false): Promise { if (!memory.embedding) { - memory.embedding = await embed( - this.runtime, - memory.content.text - ); + memory.embedding = await embed(this.runtime, memory.content.text); } await this.runtime.databaseAdapter.createMemory( memory, this.tableName, - unique + unique, ); } @@ -91,7 +89,7 @@ class MemoryManager implements IMemoryManager { count?: number; roomId: UUID; unique?: boolean; - } + }, ): Promise { return this.runtime.databaseAdapter.searchMemories({ tableName: this.tableName, @@ -99,13 +97,13 @@ class MemoryManager implements IMemoryManager { embedding, match_threshold: opts.match_threshold ?? 0.8, match_count: opts.count ?? 10, - unique: opts.unique ?? false + unique: opts.unique ?? false, }); } } ``` -### Context System +### Context System The context system manages state composition and template handling: @@ -126,9 +124,7 @@ export const composeContext = ({ // Header handling export const addHeader = (header: string, body: string): string => { - return body.length > 0 - ? `${header ? header + "\n" : header}${body}\n` - : ""; + return body.length > 0 ? `${header ? header + "\n" : header}${body}\n` : ""; }; ``` @@ -142,19 +138,19 @@ interface Action { similes: string[]; description: string; examples: MessageExample[][]; - + validate: ( runtime: IAgentRuntime, message: Memory, - state?: State + state?: State, ) => Promise; - + handler: ( runtime: IAgentRuntime, message: Memory, state?: State, options?: any, - callback?: HandlerCallback + callback?: HandlerCallback, ) => Promise; } @@ -163,34 +159,37 @@ const generateImageAction: Action = { name: "GENERATE_IMAGE", similes: ["CREATE_IMAGE", "MAKE_PICTURE"], description: "Generate an AI image from text", - + validate: async (runtime, message) => { - return !!runtime.getSetting("ANTHROPIC_API_KEY") && - !!runtime.getSetting("TOGETHER_API_KEY"); + return ( + !!runtime.getSetting("ANTHROPIC_API_KEY") && + !!runtime.getSetting("TOGETHER_API_KEY") + ); }, - + handler: async (runtime, message, state, options, callback) => { const images = await generateImage( { prompt: message.content.text }, - runtime + runtime, ); - + const captions = await Promise.all( - images.data.map(image => - generateCaption({ imageUrl: image }, runtime) - ) + images.data.map((image) => generateCaption({ imageUrl: image }, runtime)), ); - - callback?.({ - text: "Generated images", - attachments: images.data.map((image, i) => ({ - id: crypto.randomUUID(), - url: image, - title: "Generated image", - description: captions[i].title - })) - }, []); - } + + callback?.( + { + text: "Generated images", + attachments: images.data.map((image, i) => ({ + id: crypto.randomUUID(), + url: image, + title: "Generated image", + description: captions[i].title, + })), + }, + [], + ); + }, }; ``` @@ -203,17 +202,14 @@ interface Evaluator { name: string; similes: string[]; alwaysRun?: boolean; - + validate: ( runtime: IAgentRuntime, message: Memory, - state?: State + state?: State, ) => Promise; - - handler: ( - runtime: IAgentRuntime, - message: Memory - ) => Promise; + + handler: (runtime: IAgentRuntime, message: Memory) => Promise; } // Example evaluator @@ -229,19 +225,19 @@ const factEvaluator: Evaluator = { handler: async (runtime, message) => { const facts = await runtime.loreManager.searchMemories({ text: message.content.text, - threshold: 0.8 + threshold: 0.8, }); - + if (facts.length > 0) { await runtime.messageManager.createMemory({ - content: { - text: `Verified fact: ${facts[0].content.text}` + content: { + text: `Verified fact: ${facts[0].content.text}`, }, roomId: message.roomId, - userId: runtime.agentId + userId: runtime.agentId, }); } - } + }, }; ``` @@ -258,23 +254,23 @@ interface State { lore: string; adjective?: string; - // Conversation context + // Conversation context senderName?: string; actors: string; actorsData: Actor[]; recentMessages: string; recentMessagesData: Memory[]; - + // Objectives goals: string; goalsData: Goal[]; - + // Behavioral guidance actions: string; actionNames: string; evaluators: string; evaluatorNames: string; - + // Additional context providers: string; attachments: string; @@ -291,17 +287,17 @@ The core implements a service-based architecture: // Service base class class Service { static serviceType: ServiceType; - + async initialize( - device: string | null, - runtime: IAgentRuntime + device: string | null, + runtime: IAgentRuntime, ): Promise; } // Service registry class ServiceRegistry { private services = new Map(); - + registerService(service: Service): void { const type = (service as typeof Service).serviceType; if (this.services.has(type)) { @@ -310,9 +306,9 @@ class ServiceRegistry { } this.services.set(type, service); } - + getService(type: ServiceType): T | null { - return this.services.get(type) as T || null; + return (this.services.get(type) as T) || null; } } ``` @@ -326,19 +322,13 @@ class ServiceRegistry { await memoryManager.createMemory(memory, true); // Search with appropriate thresholds -const similar = await memoryManager.searchMemoriesByEmbedding( - embedding, - { - match_threshold: 0.8, - count: 10 - } -); +const similar = await memoryManager.searchMemoriesByEmbedding(embedding, { + match_threshold: 0.8, + count: 10, +}); // Clean up old memories periodically -await memoryManager.removeAllMemories( - roomId, - tableName -); +await memoryManager.removeAllMemories(roomId, tableName); ``` ### State Composition @@ -346,7 +336,7 @@ await memoryManager.removeAllMemories( ```typescript // Compose full state const state = await runtime.composeState(message, { - additionalContext: "Custom context" + additionalContext: "Custom context", }); // Update with recent messages @@ -355,9 +345,7 @@ const updatedState = await runtime.updateRecentMessageState(state); // Add custom providers state.providers = addHeader( "# Additional Information", - await Promise.all( - providers.map(p => p.get(runtime, message)) - ).join("\n") + await Promise.all(providers.map((p) => p.get(runtime, message))).join("\n"), ); ``` @@ -367,13 +355,13 @@ state.providers = addHeader( // Service initialization class CustomService extends Service { static serviceType = ServiceType.CUSTOM; - + async initialize(device: string | null, runtime: IAgentRuntime) { await this.setupDependencies(); await this.validateConfig(); await this.connect(); } - + async cleanup() { await this.disconnect(); await this.clearResources(); @@ -384,9 +372,7 @@ class CustomService extends Service { runtime.registerService(new CustomService()); // Service usage -const service = runtime.getService( - ServiceType.CUSTOM -); +const service = runtime.getService(ServiceType.CUSTOM); ``` ## Error Handling @@ -416,23 +402,23 @@ try { // Create specialized memory managers class DocumentMemoryManager extends MemoryManager { constructor(runtime: IAgentRuntime) { - super({ + super({ runtime, tableName: "documents", - useCache: true + useCache: true, }); } - + async processDocument(doc: Document): Promise { const chunks = await splitChunks(doc.content); - + for (const chunk of chunks) { await this.createMemory({ content: { text: chunk }, - metadata: { + metadata: { documentId: doc.id, - section: chunk.section - } + section: chunk.section, + }, }); } } @@ -449,19 +435,19 @@ async function enhancedEmbed( opts: { model?: string; dimensions?: number; - pooling?: 'mean' | 'max'; - } + pooling?: "mean" | "max"; + }, ): Promise { // Get cached embedding if available const cached = await runtime.databaseAdapter.getCachedEmbeddings({ query_input: text, - query_threshold: 0.95 + query_threshold: 0.95, }); - + if (cached.length > 0) { return cached[0].embedding; } - + // Generate new embedding return embed(runtime, text, opts); } @@ -472,23 +458,26 @@ async function enhancedEmbed( ```typescript class StateManager { async saveState(state: State): Promise { - await this.runtime.databaseAdapter.createMemory({ - content: { - type: 'state', - data: state + await this.runtime.databaseAdapter.createMemory( + { + content: { + type: "state", + data: state, + }, + roomId: state.roomId, + userId: state.agentId, }, - roomId: state.roomId, - userId: state.agentId - }, 'states'); + "states", + ); } - + async loadState(roomId: UUID): Promise { const states = await this.runtime.databaseAdapter.getMemories({ roomId, - tableName: 'states', - count: 1 + tableName: "states", + count: 1, }); - + return states[0]?.content.data || null; } } diff --git a/docs/docs/packages/database-adapters.md b/docs/docs/packages/database-adapters.md index d279a6f5ff9..483e604bcb9 100644 --- a/docs/docs/packages/database-adapters.md +++ b/docs/docs/packages/database-adapters.md @@ -50,7 +50,7 @@ const db = new PostgresDatabaseAdapter({ // Optional connection pool settings max: 20, idleTimeoutMillis: 30000, - connectionTimeoutMillis: 2000 + connectionTimeoutMillis: 2000, }); ``` @@ -61,7 +61,7 @@ import { SupabaseDatabaseAdapter } from "@eliza/adapter-supabase"; const db = new SupabaseDatabaseAdapter( process.env.SUPABASE_URL, - process.env.SUPABASE_SERVICE_API_KEY + process.env.SUPABASE_SERVICE_API_KEY, ); ``` @@ -119,27 +119,30 @@ interface Goal { ```typescript // Create a memory -await db.createMemory({ - id: uuid(), - content: { text: "Hello world" }, - userId: user.id, - roomId: room.id, - agentId: agent.id, - createdAt: Date.now() -}, "messages"); +await db.createMemory( + { + id: uuid(), + content: { text: "Hello world" }, + userId: user.id, + roomId: room.id, + agentId: agent.id, + createdAt: Date.now(), + }, + "messages", +); // Search memories by embedding const similar = await db.searchMemoriesByEmbedding(embedding, { match_threshold: 0.8, count: 10, - roomId: room.id + roomId: room.id, }); // Get recent memories const recent = await db.getMemories({ roomId: room.id, count: 10, - unique: true + unique: true, }); ``` @@ -149,12 +152,12 @@ const recent = await db.getMemories({ // Create relationship await db.createRelationship({ userA: user1.id, - userB: user2.id + userB: user2.id, }); // Get relationships for user const relationships = await db.getRelationships({ - userId: user.id + userId: user.id, }); ``` @@ -168,13 +171,13 @@ await db.createGoal({ userId: user.id, name: "Complete task", status: "IN_PROGRESS", - objectives: [] + objectives: [], }); // Get active goals const goals = await db.getGoals({ roomId: room.id, - onlyInProgress: true + onlyInProgress: true, }); ``` @@ -213,18 +216,20 @@ const db = new PostgresDatabaseAdapter({ connectionString: process.env.DATABASE_URL, max: 20, // Maximum pool size idleTimeoutMillis: 30000, - connectionTimeoutMillis: 2000 + connectionTimeoutMillis: 2000, }); ``` ### Memory Usage (SQLite) ```typescript -const db = new SqliteDatabaseAdapter(new Database("./dev.db", { - memory: true, // In-memory database - readonly: false, - fileMustExist: false -})); +const db = new SqliteDatabaseAdapter( + new Database("./dev.db", { + memory: true, // In-memory database + readonly: false, + fileMustExist: false, + }), +); ``` ### Caching (All Adapters) @@ -235,7 +240,7 @@ const memory = new MemoryManager({ runtime, tableName: "messages", cacheSize: 1000, - cacheTTL: 3600 + cacheTTL: 3600, }); ``` @@ -282,9 +287,9 @@ CREATE TABLE IF NOT EXISTS memories ( try { await db.createMemory(memory); } catch (error) { - if (error.code === 'SQLITE_CONSTRAINT') { + if (error.code === "SQLITE_CONSTRAINT") { // Handle unique constraint violation - } else if (error.code === '23505') { + } else if (error.code === "23505") { // Handle Postgres unique violation } else { // Handle other errors @@ -317,16 +322,19 @@ class CustomDatabaseAdapter extends DatabaseAdapter { ## Best Practices 1. **Connection Management** + - Use connection pooling for PostgreSQL - Close connections properly when using SQLite - Handle connection errors gracefully 2. **Vector Search** + - Set appropriate match thresholds based on your use case - Index embedding columns for better performance - Cache frequently accessed embeddings 3. **Memory Management** + - Implement cleanup strategies for old memories - Use unique flags to prevent duplicates - Consider partitioning large tables @@ -341,23 +349,26 @@ class CustomDatabaseAdapter extends DatabaseAdapter { ### Common Issues 1. **Connection Timeouts** + ```typescript // Increase connection timeout const db = new PostgresDatabaseAdapter({ - connectionTimeoutMillis: 5000 + connectionTimeoutMillis: 5000, }); ``` 2. **Memory Leaks** + ```typescript // Clean up old memories periodically await db.removeAllMemories(roomId, tableName); ``` 3. **Vector Search Performance** + ```typescript // Create appropriate indexes -CREATE INDEX embedding_idx ON memories +CREATE INDEX embedding_idx ON memories USING ivfflat (embedding vector_cosine_ops) WITH (lists = 100); ``` diff --git a/docs/docs/packages/plugins.md b/docs/docs/packages/plugins.md index d2171457cd9..c78e9ffc4c8 100644 --- a/docs/docs/packages/plugins.md +++ b/docs/docs/packages/plugins.md @@ -7,24 +7,28 @@ Eliza's plugin system provides a modular way to extend the core functionality wi ## Core Plugin Concepts ### Plugin Structure + Each plugin in Eliza must implement the `Plugin` interface with the following properties: + ```typescript interface Plugin { - name: string; // Unique identifier for the plugin - description: string; // Brief description of plugin functionality - actions?: Action[]; // Custom actions provided by the plugin - evaluators?: Evaluator[]; // Custom evaluators for behavior assessment - providers?: Provider[]; // Context providers for message generation - services?: Service[]; // Additional services (optional) + name: string; // Unique identifier for the plugin + description: string; // Brief description of plugin functionality + actions?: Action[]; // Custom actions provided by the plugin + evaluators?: Evaluator[]; // Custom evaluators for behavior assessment + providers?: Provider[]; // Context providers for message generation + services?: Service[]; // Additional services (optional) } ``` ### Available Plugins #### 1. Bootstrap Plugin (`@eliza/plugin-bootstrap`) + The bootstrap plugin provides essential baseline functionality: **Actions:** + - `continue` - Continue the current conversation flow - `followRoom` - Follow a room for updates - `unfollowRoom` - Unfollow a room @@ -33,26 +37,32 @@ The bootstrap plugin provides essential baseline functionality: - `unmuteRoom` - Unmute notifications from a room **Evaluators:** + - `fact` - Evaluate factual accuracy - `goal` - Assess goal completion **Providers:** + - `boredom` - Manages engagement levels - `time` - Provides temporal context - `facts` - Supplies factual information #### 2. Image Generation Plugin (`@eliza/plugin-image-generation`) + Enables AI image generation capabilities: **Actions:** + - `GENERATE_IMAGE` - Create images based on text descriptions - Supports multiple image generation services (Anthropic, Together) - Auto-generates captions for created images #### 3. Node Plugin (`@eliza/plugin-node`) + Provides core Node.js-based services: **Services:** + - `BrowserService` - Web browsing capabilities - `ImageDescriptionService` - Image analysis - `LlamaService` - LLM integration @@ -62,12 +72,15 @@ Provides core Node.js-based services: - `VideoService` - Video processing #### 4. Solana Plugin (`@eliza/plugin-solana`) + Integrates Solana blockchain functionality: **Evaluators:** + - `trustEvaluator` - Assess transaction trust scores **Providers:** + - `walletProvider` - Wallet management - `trustScoreProvider` - Transaction trust metrics @@ -76,18 +89,20 @@ Integrates Solana blockchain functionality: ### Installation 1. Install the desired plugin package: + ```bash pnpm add @eliza/plugin-[name] ``` 2. Import and register the plugin in your character configuration: + ```typescript -import { bootstrapPlugin } from '@eliza/plugin-bootstrap'; -import { imageGenerationPlugin } from '@eliza/plugin-image-generation'; +import { bootstrapPlugin } from "@eliza/plugin-bootstrap"; +import { imageGenerationPlugin } from "@eliza/plugin-image-generation"; const character = { // ... other character config - plugins: [bootstrapPlugin, imageGenerationPlugin] + plugins: [bootstrapPlugin, imageGenerationPlugin], }; ``` @@ -96,15 +111,23 @@ const character = { Create a new plugin by implementing the Plugin interface: ```typescript -import { Plugin, Action, Evaluator, Provider } from '@ai16z/eliza/src/types'; +import { Plugin, Action, Evaluator, Provider } from "@ai16z/eliza/src/types"; const myCustomPlugin: Plugin = { - name: 'my-custom-plugin', - description: 'Adds custom functionality', - actions: [/* custom actions */], - evaluators: [/* custom evaluators */], - providers: [/* custom providers */], - services: [/* custom services */] + name: "my-custom-plugin", + description: "Adds custom functionality", + actions: [ + /* custom actions */ + ], + evaluators: [ + /* custom evaluators */ + ], + providers: [ + /* custom providers */ + ], + services: [ + /* custom services */ + ], }; ``` @@ -119,18 +142,21 @@ const myCustomPlugin: Plugin = { ## Plugin Development Guidelines ### Action Development + - Implement the `Action` interface - Provide clear validation logic - Include usage examples - Handle errors gracefully ### Evaluator Development + - Implement the `Evaluator` interface - Define clear evaluation criteria - Include validation logic - Document evaluation metrics ### Provider Development + - Implement the `Provider` interface - Define context generation logic - Handle state management @@ -139,21 +165,23 @@ const myCustomPlugin: Plugin = { ## Common Issues & Solutions ### Plugin Loading Issues + ```typescript // Check if plugins are loaded correctly if (character.plugins) { - console.log("Plugins are: ", character.plugins); - const importedPlugins = await Promise.all( - character.plugins.map(async (plugin) => { - const importedPlugin = await import(plugin); - return importedPlugin; - }) - ); - character.plugins = importedPlugins; + console.log("Plugins are: ", character.plugins); + const importedPlugins = await Promise.all( + character.plugins.map(async (plugin) => { + const importedPlugin = await import(plugin); + return importedPlugin; + }), + ); + character.plugins = importedPlugins; } ``` ### Service Registration + ```typescript // Proper service registration registerService(service: Service): void { @@ -169,6 +197,7 @@ registerService(service: Service): void { ## Future Extensions The plugin system is designed to be extensible. Future additions may include: + - Database adapters - Authentication providers - Custom model providers @@ -179,6 +208,7 @@ The plugin system is designed to be extensible. Future additions may include: ## Contributing To contribute a new plugin: + 1. Follow the plugin structure guidelines 2. Include comprehensive documentation 3. Add tests for all functionality diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md index ce76ef84ef8..d3d851ff195 100644 --- a/docs/docs/quickstart.md +++ b/docs/docs/quickstart.md @@ -21,21 +21,25 @@ Before getting started with Eliza, ensure you have: Please be sure to check what the [latest available stable version tag](https://github.com/ai16z/eliza/tags) is. Clone the repository + ```bash git clone https://github.com/ai16z/eliza.git ``` Enter directory + ```bash cd eliza ``` Switch to latest tagged release + ```bash git checkout v0.0.10 ``` Install dependencies + ```bash pnpm install ``` @@ -43,6 +47,7 @@ Before getting started with Eliza, ensure you have: 2. **Configure Environment** Copy example environment file + ```bash cp .env.example .env ``` @@ -54,24 +59,24 @@ Before getting started with Eliza, ensure you have: DISCORD_APPLICATION_ID= # For Discord integration DISCORD_API_TOKEN= # Bot token HEURIST_API_KEY= # Heurist API key for LLM and image generation - OPENAI_API_KEY= # OpenAI API key + OPENAI_API_KEY= # OpenAI API key ELEVENLABS_XI_API_KEY= # API key from elevenlabs (for voice) ``` ## Choose Your Model - Eliza supports multiple AI models: +Eliza supports multiple AI models: - - **Heurist**: Set `modelProvider: "HEURIST"` in your character file - - LLM: Uses Llama models (more available LLM models [here](https://heurist.mintlify.app/developer/supported-models)) - - Image Generation: Uses PepeXL model (more info of available models [here](https://heurist.mintlify.app/developer/image-generation-api)) - - **Llama**: Set `XAI_MODEL=meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` - - **Grok**: Set `XAI_MODEL=grok-beta` - - **OpenAI**: Set `XAI_MODEL=gpt-4o-mini` or `gpt-4o` +- **Heurist**: Set `modelProvider: "HEURIST"` in your character file + - LLM: Uses Llama models (more available LLM models [here](https://heurist.mintlify.app/developer/supported-models)) + - Image Generation: Uses PepeXL model (more info of available models [here](https://heurist.mintlify.app/developer/image-generation-api)) +- **Llama**: Set `XAI_MODEL=meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` +- **Grok**: Set `XAI_MODEL=grok-beta` +- **OpenAI**: Set `XAI_MODEL=gpt-4o-mini` or `gpt-4o` - You set which model to use inside the character JSON file +You set which model to use inside the character JSON file - ### Local inference +### Local inference #### For llama_local inference: @@ -96,7 +101,6 @@ Before getting started with Eliza, ensure you have: 📝 [Character Documentation](./core/characterfile.md) - 2. **Start the Agent** Inform it which character you want to run: @@ -111,7 +115,6 @@ Before getting started with Eliza, ensure you have: pnpm start --characters="characters/trump.character.json,characters/tate.character.json" ``` - ## Platform Integration ### Discord Bot Setup @@ -133,6 +136,7 @@ TWITTER_COOKIES= # Account cookies (auth_token and CT0) ``` ### Telegram Bot + 1. Create a bot 2. Add your bot token to `.env`: @@ -182,12 +186,14 @@ pnpm start --characters="characters/trump.character.json,characters/tate.charact ``` 3. **CUDA Setup** + - Verify CUDA Toolkit installation - Check GPU compatibility with toolkit - Ensure proper environment variables are set 4. **Exit Status 1** If you see + ``` triggerUncaughtException( ^ @@ -198,28 +204,29 @@ pnpm start --characters="characters/trump.character.json,characters/tate.charact You can try these steps, which aim to add `@types/node` to various parts of the project - ``` - # Add dependencies to workspace root - pnpm add -w -D ts-node typescript @types/node + ``` + # Add dependencies to workspace root + pnpm add -w -D ts-node typescript @types/node + + # Add dependencies to the agent package specifically + pnpm add -D ts-node typescript @types/node --filter "@ai16z/agent" - # Add dependencies to the agent package specifically - pnpm add -D ts-node typescript @types/node --filter "@ai16z/agent" + # Also add to the core package since it's needed there too + pnpm add -D ts-node typescript @types/node --filter "@ai16z/eliza" - # Also add to the core package since it's needed there too - pnpm add -D ts-node typescript @types/node --filter "@ai16z/eliza" + # First clean everything + pnpm clean - # First clean everything - pnpm clean + # Install all dependencies recursively + pnpm install -r - # Install all dependencies recursively - pnpm install -r + # Build the project + pnpm build - # Build the project - pnpm build + # Then try to start + pnpm start + ``` - # Then try to start - pnpm start - ``` 5. **Better sqlite3 was compiled against a different Node.js version** If you see diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index a32b9469c30..bdacb55d9e3 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -51,22 +51,22 @@ const config = { validation: { notExported: true, invalidLink: true, - notDocumented: false + notDocumented: false, }, exclude: [ "**/_media/**", "**/node_modules/**", "**/dist/**", - "**/*.test.ts", - "**/*.spec.ts" + "**/*.test.ts", + "**/*.spec.ts", ], watch: false, treatWarningsAsErrors: true, treatValidationWarningsAsErrors: true, searchInComments: true, navigationLinks: { - "GitHub": "https://github.com/ai16z/eliza", - "Documentation": "/docs/intro" + GitHub: "https://github.com/ai16z/eliza", + Documentation: "/docs/intro", }, }, ], @@ -151,14 +151,14 @@ const config = { title: "Community", items: [ { - label: 'Discord', - href: 'https://discord.gg/ai16z' + label: "Discord", + href: "https://discord.gg/ai16z", }, { - label: 'Twitter', - href: 'https://twitter.com/ai16zdao' - } - ] + label: "Twitter", + href: "https://twitter.com/ai16zdao", + }, + ], }, { title: "More", diff --git a/docs/sidebars.js b/docs/sidebars.js index a870307cb2c..0c68bd916b3 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -13,8 +13,8 @@ const sidebars = { { type: "doc", id: "quickstart", - label: "⭐ Quick Start" - } + label: "⭐ Quick Start", + }, ], collapsed: false, }, @@ -26,27 +26,27 @@ const sidebars = { { type: "doc", id: "core/characterfile", - label: "Character Files" + label: "Character Files", }, { type: "doc", id: "core/agents", - label: "Agents" + label: "Agents", }, { type: "doc", id: "core/providers", - label: "Providers" + label: "Providers", }, { type: "doc", id: "core/actions", - label: "Actions" + label: "Actions", }, { type: "doc", id: "core/evaluators", - label: "Evaluators" + label: "Evaluators", }, ], }, @@ -58,22 +58,22 @@ const sidebars = { { type: "doc", id: "guides/configuration", - label: "Configuration" + label: "Configuration", }, { type: "doc", id: "guides/advanced", - label: "Advanced Usage" + label: "Advanced Usage", }, { type: "doc", id: "guides/secrets-management", - label: "Secrets Management" + label: "Secrets Management", }, { type: "doc", id: "guides/local-development", - label: "Local Development" + label: "Local Development", }, ], }, @@ -85,22 +85,22 @@ const sidebars = { { type: "doc", id: "advanced/fine-tuning", - label: "Fine-tuning" + label: "Fine-tuning", }, { type: "doc", id: "advanced/infrastructure", - label: "Infrastructure" + label: "Infrastructure", }, { type: "doc", id: "advanced/trust-engine", - label: "Trust Engine" + label: "Trust Engine", }, { type: "doc", id: "advanced/autonomous-trading", - label: "Autonomous Trading" + label: "Autonomous Trading", }, ], }, @@ -112,33 +112,33 @@ const sidebars = { { type: "doc", id: "packages/packages", - label: "Overview" + label: "Overview", }, { type: "doc", id: "packages/core", - label: "Core Package" + label: "Core Package", }, { type: "doc", - id: "packages/adapters", - label: "Database Adapters" + id: "packages/adapters", + label: "Database Adapters", }, { type: "doc", id: "packages/clients", - label: "Client Packages" + label: "Client Packages", }, { - type: "doc", + type: "doc", id: "packages/agent", - label: "Agent Package" + label: "Agent Package", }, { type: "doc", id: "packages/plugins", - label: "Plugin System" - } + label: "Plugin System", + }, ], }, { @@ -158,7 +158,7 @@ const sidebars = { { type: "doc", id: "community/stream-notes", - label: "Overview" + label: "Overview", }, { type: "category", @@ -167,14 +167,14 @@ const sidebars = { { type: "doc", id: "community/streams/2024-11-08", - label: "X: Memes, AI Agents, and DAOs" + label: "X: Memes, AI Agents, and DAOs", }, { type: "doc", id: "community/streams/2024-11-06", - label: "Discord Development Stream" - } - ] + label: "Discord Development Stream", + }, + ], }, { type: "category", @@ -183,21 +183,21 @@ const sidebars = { { type: "doc", id: "community/streams/2024-10-29", - label: "X: AI Agents & Crypto" + label: "X: AI Agents & Crypto", }, { type: "doc", id: "community/streams/2024-10-27", - label: "X: Building Autonomous Agents" + label: "X: Building Autonomous Agents", }, { type: "doc", id: "community/streams/2024-10-25", - label: "X: Eliza Framework" - } - ] - } - ] + label: "X: Eliza Framework", + }, + ], + }, + ], }, { type: "doc", @@ -212,11 +212,11 @@ const sidebars = { { type: "doc", id: "community/contributing", - label: "🤝 Contributing" - } - ] - } - ] + label: "🤝 Contributing", + }, + ], + }, + ], }; export default sidebars; diff --git a/package.json b/package.json index 0278a67b31e..8048b4e7517 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ } }, "engines": { - "node": ">=23" + "node": ">=22" }, "dependencies": { "ollama-ai-provider": "^0.16.1", diff --git a/packages/agent/package.json b/packages/agent/package.json index 1be6d32c1e2..0d56585109a 100644 --- a/packages/agent/package.json +++ b/packages/agent/package.json @@ -12,19 +12,20 @@ "start:all": "node --loader ts-node/esm src/index.ts --characters=\"../characters/eliza.json\",\"../characters/degenspartan.json\",\"../characters/ruby.json\",\"../characters/pmairca.json\"" }, "dependencies": { - "@ai16z/eliza": "workspace:*", "@ai16z/adapter-postgres": "workspace:*", "@ai16z/adapter-sqlite": "workspace:*", - "@ai16z/client-direct": "workspace:*", "@ai16z/client-auto": "workspace:*", + "@ai16z/client-direct": "workspace:*", "@ai16z/client-discord": "workspace:*", "@ai16z/client-telegram": "workspace:*", "@ai16z/client-twitter": "workspace:*", + "@ai16z/eliza": "workspace:*", "@ai16z/plugin-bootstrap": "workspace:*", "@ai16z/plugin-image-generation": "workspace:*", "@ai16z/plugin-node": "workspace:*", "@ai16z/plugin-solana": "workspace:*", "readline": "^1.3.0", + "ws": "^8.18.0", "yargs": "17.7.2" }, "devDependencies": { diff --git a/packages/core/src/generation.ts b/packages/core/src/generation.ts index 554442ec191..abbd7b159f8 100644 --- a/packages/core/src/generation.ts +++ b/packages/core/src/generation.ts @@ -64,7 +64,23 @@ export async function generateText({ const provider = runtime.modelProvider; const endpoint = runtime.character.modelEndpointOverride || models[provider].endpoint; - const model = models[provider].model[modelClass]; + let model = models[provider].model[modelClass]; + + // if runtime.getSetting("LLAMACLOUD_MODEL_LARGE") is true and modelProvider is LLAMACLOUD, then use the large model + if ( + runtime.getSetting("LLAMACLOUD_MODEL_LARGE") && + provider === ModelProviderName.LLAMACLOUD + ) { + model = runtime.getSetting("LLAMACLOUD_MODEL_LARGE"); + } + + if ( + runtime.getSetting("LLAMACLOUD_MODEL_SMALL") && + provider === ModelProviderName.LLAMACLOUD + ) { + model = runtime.getSetting("LLAMACLOUD_MODEL_SMALL"); + } + const temperature = models[provider].settings.temperature; const frequency_penalty = models[provider].settings.frequency_penalty; const presence_penalty = models[provider].settings.presence_penalty; diff --git a/packages/core/src/models.ts b/packages/core/src/models.ts index 043dd4b287b..ea3fd125d5c 100644 --- a/packages/core/src/models.ts +++ b/packages/core/src/models.ts @@ -25,9 +25,9 @@ export const models: Models = { stop: [], maxInputTokens: 200000, maxOutputTokens: 8192, - frequency_penalty: 0.0, - presence_penalty: 0.0, - temperature: 0.3, + frequency_penalty: 0.4, + presence_penalty: 0.4, + temperature: 0.7, }, endpoint: "https://api.anthropic.com/v1", model: { @@ -41,9 +41,9 @@ export const models: Models = { stop: [], maxInputTokens: 200000, maxOutputTokens: 8192, - frequency_penalty: 0.0, - presence_penalty: 0.0, - temperature: 0.3, + frequency_penalty: 0.4, + presence_penalty: 0.4, + temperature: 0.7, }, endpoint: "https://api.anthropic.com/v1", // TODO: check model: { @@ -57,8 +57,8 @@ export const models: Models = { stop: [], maxInputTokens: 128000, maxOutputTokens: 8192, - frequency_penalty: 0.0, - presence_penalty: 0.0, + frequency_penalty: 0.4, + presence_penalty: 0.4, temperature: 0.7, }, endpoint: "https://api.x.ai/v1", @@ -75,8 +75,8 @@ export const models: Models = { stop: [], maxInputTokens: 128000, maxOutputTokens: 8000, - frequency_penalty: 0.0, - presence_penalty: 0.0, + frequency_penalty: 0.4, + presence_penalty: 0.4, temperature: 0.7, }, model: { @@ -91,7 +91,7 @@ export const models: Models = { stop: [], maxInputTokens: 128000, maxOutputTokens: 8192, - repetition_penalty: 0.0, + repetition_penalty: 0.4, temperature: 0.7, }, imageSettings: { @@ -112,7 +112,7 @@ export const models: Models = { stop: ["<|eot_id|>", "<|eom_id|>"], maxInputTokens: 32768, maxOutputTokens: 8192, - repetition_penalty: 0.0, + repetition_penalty: 0.4, temperature: 0.7, }, model: { @@ -132,8 +132,8 @@ export const models: Models = { stop: [], maxInputTokens: 128000, maxOutputTokens: 8192, - frequency_penalty: 0.0, - presence_penalty: 0.0, + frequency_penalty: 0.4, + presence_penalty: 0.4, temperature: 0.7, }, model: { @@ -168,9 +168,9 @@ export const models: Models = { stop: [], maxInputTokens: 128000, maxOutputTokens: 8192, - frequency_penalty: 0.0, - presence_penalty: 0.0, - temperature: 0.6, + frequency_penalty: 0.4, + presence_penalty: 0.4, + temperature: 0.7, }, // Available models: https://openrouter.ai/models // To test other models, change the models below @@ -195,8 +195,8 @@ export const models: Models = { stop: [], maxInputTokens: 128000, maxOutputTokens: 8192, - frequency_penalty: 0.0, - presence_penalty: 0.0, + frequency_penalty: 0.4, + presence_penalty: 0.4, temperature: 0.7, }, endpoint: settings.OLLAMA_SERVER_URL || "http://localhost:11434", @@ -222,7 +222,7 @@ export const models: Models = { stop: [], maxInputTokens: 128000, maxOutputTokens: 8192, - repetition_penalty: 0.0, + repetition_penalty: 0.4, temperature: 0.7, }, imageSettings: { diff --git a/packages/core/src/runtime.ts b/packages/core/src/runtime.ts index 5e5fd5891d7..2c4e59406c2 100644 --- a/packages/core/src/runtime.ts +++ b/packages/core/src/runtime.ts @@ -345,11 +345,7 @@ export class AgentRuntime implements IAgentRuntime { text: knowledgeItem, }, }); - const fragments = await splitChunks( - knowledgeItem, - 1200, - 200 - ); + const fragments = await splitChunks(knowledgeItem, 1200, 200); for (const fragment of fragments) { const embedding = await embed(this, fragment); await this.knowledgeManager.createMemory({ @@ -893,25 +889,29 @@ Text: ${attachment.text} .join(" "); } - async function getKnowledge(runtime: AgentRuntime, message: Memory): Promise { + async function getKnowledge( + runtime: AgentRuntime, + message: Memory + ): Promise { const embedding = await embed(runtime, message.content.text); - const memories = await runtime.knowledgeManager.searchMemoriesByEmbedding( - embedding, - { - roomId: message.agentId, - agentId: message.agentId, - count: 3, - } - ); + const memories = + await runtime.knowledgeManager.searchMemoriesByEmbedding( + embedding, + { + roomId: message.agentId, + agentId: message.agentId, + count: 3, + } + ); - const knowledge = memories.map(memory => memory.content.text); + const knowledge = memories.map((memory) => memory.content.text); return knowledge; } const formatKnowledge = (knowledge: string[]) => { - return knowledge.map(knowledge => `- ${knowledge}`).join("\n"); - } + return knowledge.map((knowledge) => `- ${knowledge}`).join("\n"); + }; const formattedKnowledge = formatKnowledge( await getKnowledge(this, message) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 98c833ad1d3..8330d359605 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -215,6 +215,9 @@ importers: readline: specifier: ^1.3.0 version: 1.3.0 + ws: + specifier: ^8.18.0 + version: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) yargs: specifier: 17.7.2 version: 17.7.2 @@ -2903,8 +2906,8 @@ packages: resolution: {integrity: sha512-TkBr7QgOmE6ORxvIAhDbZsqPkF7RSqTY4pLTtUQCvr6dTXqvi2fFo46q3h1lxlk/sGMQjqyZ0kEahkD/NyzOHg==} engines: {node: '>= 18'} - '@octokit/auth-app@7.1.2': - resolution: {integrity: sha512-5cfWRr1hr0w/EW3StFIIOkMtYhOyGZ6/R3T0xeN6UgC/uL5pIyeood9N/8Z7W4NZUdz2QK1Fv0oM/1AzTME3/Q==} + '@octokit/auth-app@7.1.3': + resolution: {integrity: sha512-GZdkOp2kZTIy5dG9oXqvzUAZiPvDx4C/lMlN6yQjtG9d/+hYa7W8WXTJoOrXE8UdfL9A/sZMl206dmtkl9lwVQ==} engines: {node: '>= 18'} '@octokit/auth-oauth-app@8.1.1': @@ -4282,10 +4285,6 @@ packages: '@webassemblyjs/wast-printer@1.14.1': resolution: {integrity: sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==} - '@wolfy1339/lru-cache@11.0.2-patch.1': - resolution: {integrity: sha512-BgYZfL2ADCXKOw2wJtkM3slhHotawWkgIRRxq4wEybnZQPjvAp71SPX35xepMykTw8gXlzWcWPTY31hlbnRsDA==} - engines: {node: 18 >=18.20 || 20 || >=22} - '@xtuc/ieee754@1.2.0': resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} @@ -6037,8 +6036,8 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - electron-to-chromium@1.5.61: - resolution: {integrity: sha512-CcRGSBCBB6L9c3PBJWYYrBo6Bzeoi+GZTKvtuRtooJGWsINk+mOInZWcssU35zDTAwreVcrMimc9aMyPpehRNw==} + electron-to-chromium@1.5.62: + resolution: {integrity: sha512-t8c+zLmJHa9dJy96yBZRXGQYoiCEnHYgFwn1asvSPZSUdVxnB62A4RASd7k41ytG3ErFBA0TpHlKg9D9SQBmLg==} emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} @@ -11123,6 +11122,10 @@ packages: to-vfile@6.1.0: resolution: {integrity: sha512-BxX8EkCxOAZe+D/ToHdDsJcVI4HqQfmw0tCkp31zf3dNP/XWIAjU4CmeuSwsSoOzOTqHPOL0KUzyZqJplkD0Qw==} + toad-cache@3.7.0: + resolution: {integrity: sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==} + engines: {node: '>=12'} + together-ai@0.7.0: resolution: {integrity: sha512-/be/HOecBSwRTDHB14vCvHbp1WiNsFxyS4pJlyBoMup1X3n7xD1b/Gm5Z5amlKzD2zll9Y5wscDk7Ut5OsT1nA==} @@ -15211,7 +15214,7 @@ snapshots: '@octokit/app@15.1.0': dependencies: - '@octokit/auth-app': 7.1.2 + '@octokit/auth-app': 7.1.3 '@octokit/auth-unauthenticated': 6.1.0 '@octokit/core': 6.1.2 '@octokit/oauth-app': 7.1.3 @@ -15219,14 +15222,14 @@ snapshots: '@octokit/types': 13.6.1 '@octokit/webhooks': 13.3.0 - '@octokit/auth-app@7.1.2': + '@octokit/auth-app@7.1.3': dependencies: '@octokit/auth-oauth-app': 8.1.1 '@octokit/auth-oauth-user': 5.1.1 '@octokit/request': 9.1.3 '@octokit/request-error': 6.1.5 '@octokit/types': 13.6.1 - lru-cache: '@wolfy1339/lru-cache@11.0.2-patch.1' + toad-cache: 3.7.0 universal-github-app-jwt: 2.2.0 universal-user-agent: 7.0.2 @@ -16921,8 +16924,6 @@ snapshots: '@webassemblyjs/ast': 1.14.1 '@xtuc/long': 4.2.2 - '@wolfy1339/lru-cache@11.0.2-patch.1': {} - '@xtuc/ieee754@1.2.0': {} '@xtuc/long@4.2.2': {} @@ -17531,7 +17532,7 @@ snapshots: browserslist@4.24.2: dependencies: caniuse-lite: 1.0.30001680 - electron-to-chromium: 1.5.61 + electron-to-chromium: 1.5.62 node-releases: 2.0.18 update-browserslist-db: 1.1.1(browserslist@4.24.2) @@ -18853,7 +18854,7 @@ snapshots: dependencies: jake: 10.9.2 - electron-to-chromium@1.5.61: {} + electron-to-chromium@1.5.62: {} emittery@0.13.1: {} @@ -25298,6 +25299,8 @@ snapshots: is-buffer: 2.0.5 vfile: 4.2.1 + toad-cache@3.7.0: {} + together-ai@0.7.0(encoding@0.1.13): dependencies: '@types/node': 18.19.64 diff --git a/scripts/build.sh b/scripts/build.sh index 885387a0a1a..2bea6ea2f7d 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,7 +1,7 @@ #!/bin/bash # Check Node.js version -REQUIRED_NODE_VERSION=23 +REQUIRED_NODE_VERSION=22 CURRENT_NODE_VERSION=$(node -v | cut -d'.' -f1 | sed 's/v//') if (( CURRENT_NODE_VERSION < REQUIRED_NODE_VERSION )); then