diff --git a/characters/trump.character.json b/characters/trump.character.json index a054d94f20d..b5aba85b36d 100644 --- a/characters/trump.character.json +++ b/characters/trump.character.json @@ -1,6 +1,7 @@ { "name": "trump", "clients": [], + "modelProvider": "openai", "settings": { "secrets": {}, "voice": { @@ -73,7 +74,6 @@ "knows Kamala's REAL tax plans (coming for everything)", "saw what they did to Minneapolis (and other cities)" ], - "messageExamples": [ [ { diff --git a/docs/README.md b/docs/README.md index 943ce65c66c..435272f5ebe 100644 --- a/docs/README.md +++ b/docs/README.md @@ -19,7 +19,6 @@ _As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAInd **Prerequisites (MUST):** -- [Python 2.7+](https://www.python.org/downloads/) - [Node.js 22+](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 8bcfbd3f69b..c421c9980c5 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,7 +400,7 @@ Searchable document fragments [packages/core/src/runtime.ts:149](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L149) -*** +--- ### getService() @@ -426,7 +426,7 @@ Searchable document fragments [packages/core/src/runtime.ts:153](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L153) -*** +--- ### registerService() @@ -448,7 +448,7 @@ Searchable document fragments [packages/core/src/runtime.ts:161](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L161) -*** +--- ### getSetting() @@ -470,7 +470,7 @@ Searchable document fragments [packages/core/src/runtime.ts:372](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L372) -*** +--- ### getConversationLength() @@ -492,7 +492,7 @@ The number of recent messages to be kept in memory. [packages/core/src/runtime.ts:394](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L394) -*** +--- ### registerAction() @@ -518,7 +518,7 @@ The action to register. [packages/core/src/runtime.ts:402](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L402) -*** +--- ### registerEvaluator() @@ -540,7 +540,7 @@ The evaluator to register. [packages/core/src/runtime.ts:411](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L411) -*** +--- ### registerContextProvider() @@ -562,7 +562,7 @@ The context provider to register. [packages/core/src/runtime.ts:419](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L419) -*** +--- ### processActions() @@ -594,7 +594,7 @@ The message to process. [packages/core/src/runtime.ts:428](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L428) -*** +--- ### evaluate() @@ -630,7 +630,7 @@ The results of the evaluation. [packages/core/src/runtime.ts:501](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L501) -*** +--- ### ensureParticipantExists() @@ -662,7 +662,7 @@ An error if the participant cannot be added. [packages/core/src/runtime.ts:572](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L572) -*** +--- ### ensureUserExists() @@ -698,7 +698,7 @@ The user name to ensure the existence of. [packages/core/src/runtime.ts:588](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L588) -*** +--- ### ensureParticipantInRoom() @@ -722,7 +722,7 @@ The user name to ensure the existence of. [packages/core/src/runtime.ts:608](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L608) -*** +--- ### ensureConnection() @@ -752,7 +752,7 @@ The user name to ensure the existence of. [packages/core/src/runtime.ts:619](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L619) -*** +--- ### ensureRoomExists() @@ -783,7 +783,7 @@ An error if the room cannot be created. [packages/core/src/runtime.ts:655](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L655) -*** +--- ### composeState() @@ -813,7 +813,7 @@ The state of the agent. [packages/core/src/runtime.ts:668](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L668) -*** +--- ### 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 68bf30e4885..e01cbf4d076 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:172](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L172) -*** +--- ### getMemoryById() @@ -296,7 +296,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:183](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L183) -*** +--- ### removeMemory() @@ -324,7 +324,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:193](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L193) -*** +--- ### removeAllMemories() @@ -352,7 +352,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:205](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L205) -*** +--- ### countMemories() diff --git a/docs/api/classes/Service.md b/docs/api/classes/Service.md index 6a3195df4cb..4169b529813 100644 --- a/docs/api/classes/Service.md +++ b/docs/api/classes/Service.md @@ -40,7 +40,7 @@ #### Type Parameters -• **T** *extends* [`Service`](Service.md) +• **T** _extends_ [`Service`](Service.md) #### Returns diff --git a/docs/api/enumerations/Clients.md b/docs/api/enumerations/Clients.md index 48b250fd846..9ab3b0b70e0 100644 --- a/docs/api/enumerations/Clients.md +++ b/docs/api/enumerations/Clients.md @@ -12,7 +12,7 @@ [packages/core/src/types.ts:321](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L321) -*** +--- ### DIRECT @@ -22,7 +22,7 @@ [packages/core/src/types.ts:322](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L322) -*** +--- ### TWITTER @@ -32,7 +32,7 @@ [packages/core/src/types.ts:323](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L323) -*** +--- ### TELEGRAM 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 1f6e6ce0b2f..2c020738f3e 100644 --- a/docs/api/enumerations/ModelProviderName.md +++ b/docs/api/enumerations/ModelProviderName.md @@ -12,7 +12,7 @@ [packages/core/src/types.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L120) -*** +--- ### ANTHROPIC @@ -22,7 +22,7 @@ [packages/core/src/types.ts:121](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L121) -*** +--- ### GROK @@ -32,7 +32,7 @@ [packages/core/src/types.ts:122](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L122) -*** +--- ### GROQ @@ -42,7 +42,7 @@ [packages/core/src/types.ts:123](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L123) -*** +--- ### LLAMACLOUD @@ -52,7 +52,7 @@ [packages/core/src/types.ts:124](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L124) -*** +--- ### LLAMALOCAL @@ -62,7 +62,7 @@ [packages/core/src/types.ts:125](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L125) -*** +--- ### GOOGLE @@ -72,17 +72,17 @@ [packages/core/src/types.ts:126](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L126) -*** +--- -### 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) -*** +--- ### REDPILL @@ -92,7 +92,7 @@ [packages/core/src/types.ts:128](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L128) -*** +--- ### OPENROUTER @@ -102,7 +102,7 @@ [packages/core/src/types.ts:129](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L129) -*** +--- ### OLLAMA diff --git a/docs/api/enumerations/ServiceType.md b/docs/api/enumerations/ServiceType.md index 0cc2345ec31..f69795aeabe 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) -*** +--- ### TRANSCRIPTION @@ -22,7 +22,7 @@ [packages/core/src/types.ts:647](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L647) -*** +--- ### VIDEO @@ -32,17 +32,17 @@ [packages/core/src/types.ts:648](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L648) -*** +--- -### 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) -*** +--- ### BROWSER @@ -52,17 +52,17 @@ [packages/core/src/types.ts:650](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L650) -*** +--- -### 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) -*** +--- ### PDF diff --git a/docs/api/interfaces/Account.md b/docs/api/interfaces/Account.md index 7dcca4d6d7f..7abf588a029 100644 --- a/docs/api/interfaces/Account.md +++ b/docs/api/interfaces/Account.md @@ -14,7 +14,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:273](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L273) -*** +--- ### name @@ -24,7 +24,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:274](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L274) -*** +--- ### username @@ -34,7 +34,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:275](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L275) -*** +--- ### 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) -*** +--- ### email? @@ -58,7 +58,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:277](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L277) -*** +--- ### avatarUrl? diff --git a/docs/api/interfaces/Action.md b/docs/api/interfaces/Action.md index 63a4028f516..6fffa3db0e1 100644 --- a/docs/api/interfaces/Action.md +++ b/docs/api/interfaces/Action.md @@ -14,7 +14,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/main/packages/core/src/types.ts#L215) -*** +--- ### description @@ -24,7 +24,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/main/packages/core/src/types.ts#L216) -*** +--- ### examples @@ -34,7 +34,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/main/packages/core/src/types.ts#L217) -*** +--- ### handler @@ -44,7 +44,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/main/packages/core/src/types.ts#L218) -*** +--- ### name @@ -54,7 +54,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/main/packages/core/src/types.ts#L219) -*** +--- ### validate 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..c003b868822 100644 --- a/docs/api/interfaces/EvaluationExample.md +++ b/docs/api/interfaces/EvaluationExample.md @@ -14,7 +14,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/main/packages/core/src/types.ts#L227) -*** +--- ### messages @@ -24,7 +24,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/main/packages/core/src/types.ts#L228) -*** +--- ### outcome diff --git a/docs/api/interfaces/Evaluator.md b/docs/api/interfaces/Evaluator.md index 84c4c47e938..458113851f6 100644 --- a/docs/api/interfaces/Evaluator.md +++ b/docs/api/interfaces/Evaluator.md @@ -14,7 +14,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/main/packages/core/src/types.ts#L236) -*** +--- ### description @@ -24,7 +24,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/main/packages/core/src/types.ts#L237) -*** +--- ### similes @@ -34,7 +34,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/main/packages/core/src/types.ts#L238) -*** +--- ### examples @@ -44,7 +44,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/main/packages/core/src/types.ts#L239) -*** +--- ### handler @@ -54,7 +54,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/main/packages/core/src/types.ts#L240) -*** +--- ### name @@ -64,7 +64,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/main/packages/core/src/types.ts#L241) -*** +--- ### validate 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 d8f9ec7c911..a7faddfe73a 100644 --- a/docs/api/interfaces/IAgentRuntime.md +++ b/docs/api/interfaces/IAgentRuntime.md @@ -14,7 +14,7 @@ Properties [packages/core/src/types.ts:520](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L520) -*** +--- ### serverUrl @@ -24,7 +24,7 @@ Properties [packages/core/src/types.ts:521](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L521) -*** +--- ### databaseAdapter @@ -34,7 +34,7 @@ Properties [packages/core/src/types.ts:522](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L522) -*** +--- ### token @@ -44,7 +44,7 @@ Properties [packages/core/src/types.ts:523](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L523) -*** +--- ### modelProvider @@ -54,7 +54,7 @@ Properties [packages/core/src/types.ts:524](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L524) -*** +--- ### character @@ -64,7 +64,7 @@ Properties [packages/core/src/types.ts:525](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L525) -*** +--- ### providers @@ -74,7 +74,7 @@ Properties [packages/core/src/types.ts:526](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L526) -*** +--- ### actions @@ -84,7 +84,7 @@ Properties [packages/core/src/types.ts:527](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L527) -*** +--- ### evaluators @@ -94,7 +94,7 @@ Properties [packages/core/src/types.ts:528](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L528) -*** +--- ### messageManager @@ -104,7 +104,7 @@ Properties [packages/core/src/types.ts:530](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L530) -*** +--- ### descriptionManager @@ -114,7 +114,7 @@ Properties [packages/core/src/types.ts:531](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L531) -*** +--- ### loreManager @@ -124,7 +124,7 @@ Properties [packages/core/src/types.ts:532](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L532) -*** +--- ### services @@ -152,7 +152,7 @@ Properties [packages/core/src/types.ts:535](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L535) -*** +--- ### getMemoryManager() @@ -170,7 +170,7 @@ Properties [packages/core/src/types.ts:537](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L537) -*** +--- ### getService() @@ -192,7 +192,7 @@ Properties [packages/core/src/types.ts:539](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L539) -*** +--- ### registerService() @@ -210,7 +210,7 @@ Properties [packages/core/src/types.ts:541](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L541) -*** +--- ### getSetting() @@ -228,7 +228,7 @@ Properties [packages/core/src/types.ts:543](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L543) -*** +--- ### getConversationLength() @@ -244,7 +244,7 @@ Methods [packages/core/src/types.ts:546](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L546) -*** +--- ### processActions() @@ -268,7 +268,7 @@ Methods [packages/core/src/types.ts:547](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L547) -*** +--- ### evaluate() @@ -290,7 +290,7 @@ Methods [packages/core/src/types.ts:553](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L553) -*** +--- ### ensureParticipantExists() @@ -310,7 +310,7 @@ Methods [packages/core/src/types.ts:558](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L558) -*** +--- ### ensureUserExists() @@ -334,7 +334,7 @@ Methods [packages/core/src/types.ts:559](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L559) -*** +--- ### registerAction() @@ -352,7 +352,7 @@ Methods [packages/core/src/types.ts:565](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L565) -*** +--- ### ensureConnection() @@ -378,7 +378,7 @@ Methods [packages/core/src/types.ts:566](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L566) -*** +--- ### ensureParticipantInRoom() @@ -398,7 +398,7 @@ Methods [packages/core/src/types.ts:573](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L573) -*** +--- ### ensureRoomExists() @@ -416,7 +416,7 @@ Methods [packages/core/src/types.ts:574](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L574) -*** +--- ### composeState() @@ -436,7 +436,7 @@ Methods [packages/core/src/types.ts:575](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L575) -*** +--- ### updateRecentMessageState() diff --git a/docs/api/interfaces/IBrowserService.md b/docs/api/interfaces/IBrowserService.md index 78011136371..909a110b51a 100644 --- a/docs/api/interfaces/IBrowserService.md +++ b/docs/api/interfaces/IBrowserService.md @@ -20,7 +20,7 @@ [packages/core/src/types.ts:629](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L629) -*** +--- ### closeBrowser() @@ -34,7 +34,7 @@ [packages/core/src/types.ts:630](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L630) -*** +--- ### getPageContent() diff --git a/docs/api/interfaces/IDatabaseAdapter.md b/docs/api/interfaces/IDatabaseAdapter.md index 65173339115..a02cf9408f2 100644 --- a/docs/api/interfaces/IDatabaseAdapter.md +++ b/docs/api/interfaces/IDatabaseAdapter.md @@ -30,7 +30,7 @@ [packages/core/src/types.ts:364](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L364) -*** +--- ### createAccount() @@ -48,7 +48,7 @@ [packages/core/src/types.ts:365](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L365) -*** +--- ### getMemories() @@ -80,7 +80,7 @@ [packages/core/src/types.ts:366](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L366) -*** +--- ### getMemoryById() @@ -98,7 +98,7 @@ [packages/core/src/types.ts:375](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L375) -*** +--- ### getMemoriesByRoomIds() @@ -120,7 +120,7 @@ [packages/core/src/types.ts:376](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L376) -*** +--- ### 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 @@ -150,7 +150,7 @@ [packages/core/src/types.ts:380](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L380) -*** +--- ### log() @@ -176,7 +176,7 @@ [packages/core/src/types.ts:388](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L388) -*** +--- ### getActorDetails() @@ -196,7 +196,7 @@ [packages/core/src/types.ts:394](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L394) -*** +--- ### 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` @@ -226,7 +226,7 @@ [packages/core/src/types.ts:395](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L395) -*** +--- ### updateGoalStatus() @@ -248,7 +248,7 @@ [packages/core/src/types.ts:403](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L403) -*** +--- ### searchMemoriesByEmbedding() @@ -260,7 +260,7 @@ • **params** -• **params.match\_threshold?**: `number` +• **params.match_threshold?**: `number` • **params.count?**: `number` @@ -280,7 +280,7 @@ [packages/core/src/types.ts:407](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L407) -*** +--- ### createMemory() @@ -302,7 +302,7 @@ [packages/core/src/types.ts:418](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L418) -*** +--- ### removeMemory() @@ -322,7 +322,7 @@ [packages/core/src/types.ts:423](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L423) -*** +--- ### removeAllMemories() @@ -342,7 +342,7 @@ [packages/core/src/types.ts:424](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L424) -*** +--- ### countMemories() @@ -364,7 +364,7 @@ [packages/core/src/types.ts:425](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L425) -*** +--- ### getGoals() @@ -390,7 +390,7 @@ [packages/core/src/types.ts:430](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L430) -*** +--- ### updateGoal() @@ -408,7 +408,7 @@ [packages/core/src/types.ts:436](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L436) -*** +--- ### createGoal() @@ -426,7 +426,7 @@ [packages/core/src/types.ts:437](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L437) -*** +--- ### removeGoal() @@ -444,7 +444,7 @@ [packages/core/src/types.ts:438](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L438) -*** +--- ### removeAllGoals() @@ -462,7 +462,7 @@ [packages/core/src/types.ts:439](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L439) -*** +--- ### getRoom() @@ -480,7 +480,7 @@ [packages/core/src/types.ts:440](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L440) -*** +--- ### createRoom() @@ -498,7 +498,7 @@ [packages/core/src/types.ts:441](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L441) -*** +--- ### removeRoom() @@ -516,7 +516,7 @@ [packages/core/src/types.ts:442](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L442) -*** +--- ### getRoomsForParticipant() @@ -534,7 +534,7 @@ [packages/core/src/types.ts:443](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L443) -*** +--- ### getRoomsForParticipants() @@ -552,7 +552,7 @@ [packages/core/src/types.ts:444](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L444) -*** +--- ### addParticipant() @@ -572,7 +572,7 @@ [packages/core/src/types.ts:445](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L445) -*** +--- ### removeParticipant() @@ -592,7 +592,7 @@ [packages/core/src/types.ts:446](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L446) -*** +--- ### getParticipantsForAccount() @@ -610,7 +610,7 @@ [packages/core/src/types.ts:447](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L447) -*** +--- ### getParticipantsForRoom() @@ -628,7 +628,7 @@ [packages/core/src/types.ts:448](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L448) -*** +--- ### getParticipantUserState() @@ -648,7 +648,7 @@ [packages/core/src/types.ts:449](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L449) -*** +--- ### setParticipantUserState() @@ -670,7 +670,7 @@ [packages/core/src/types.ts:453](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L453) -*** +--- ### createRelationship() @@ -692,7 +692,7 @@ [packages/core/src/types.ts:458](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L458) -*** +--- ### getRelationship() @@ -714,7 +714,7 @@ [packages/core/src/types.ts:459](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L459) -*** +--- ### getRelationships() diff --git a/docs/api/interfaces/IImageDescriptionService.md b/docs/api/interfaces/IImageDescriptionService.md index 56cda70adae..29c48b18ed9 100644 --- a/docs/api/interfaces/IImageDescriptionService.md +++ b/docs/api/interfaces/IImageDescriptionService.md @@ -20,7 +20,7 @@ [packages/core/src/types.ts:583](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L583) -*** +--- ### initialize() @@ -40,7 +40,7 @@ [packages/core/src/types.ts:584](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L584) -*** +--- ### describeImage() diff --git a/docs/api/interfaces/IMemoryManager.md b/docs/api/interfaces/IMemoryManager.md index 56c76a7d98f..62bfa4ecc35 100644 --- a/docs/api/interfaces/IMemoryManager.md +++ b/docs/api/interfaces/IMemoryManager.md @@ -12,7 +12,7 @@ [packages/core/src/types.ts:467](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L467) -*** +--- ### tableName @@ -22,7 +22,7 @@ [packages/core/src/types.ts:468](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L468) -*** +--- ### constructor @@ -50,7 +50,7 @@ [packages/core/src/types.ts:472](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L472) -*** +--- ### getMemories() @@ -80,7 +80,7 @@ [packages/core/src/types.ts:473](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L473) -*** +--- ### getCachedEmbeddings() @@ -98,7 +98,7 @@ [packages/core/src/types.ts:481](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L481) -*** +--- ### getMemoryById() @@ -116,7 +116,7 @@ [packages/core/src/types.ts:484](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L484) -*** +--- ### getMemoriesByRoomIds() @@ -138,7 +138,7 @@ [packages/core/src/types.ts:485](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L485) -*** +--- ### searchMemoriesByEmbedding() @@ -150,7 +150,7 @@ • **opts** -• **opts.match\_threshold?**: `number` +• **opts.match_threshold?**: `number` • **opts.count?**: `number` @@ -168,7 +168,7 @@ [packages/core/src/types.ts:489](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L489) -*** +--- ### createMemory() @@ -188,7 +188,7 @@ [packages/core/src/types.ts:499](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L499) -*** +--- ### removeMemory() @@ -206,7 +206,7 @@ [packages/core/src/types.ts:500](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L500) -*** +--- ### removeAllMemories() @@ -224,7 +224,7 @@ [packages/core/src/types.ts:501](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L501) -*** +--- ### countMemories() diff --git a/docs/api/interfaces/ITextGenerationService.md b/docs/api/interfaces/ITextGenerationService.md index bdb94b44475..49afb066382 100644 --- a/docs/api/interfaces/ITextGenerationService.md +++ b/docs/api/interfaces/ITextGenerationService.md @@ -20,7 +20,7 @@ [packages/core/src/types.ts:607](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L607) -*** +--- ### initializeModel() @@ -34,7 +34,7 @@ [packages/core/src/types.ts:608](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L608) -*** +--- ### 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 @@ -62,7 +62,7 @@ [packages/core/src/types.ts:609](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L609) -*** +--- ### 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 @@ -90,7 +90,7 @@ [packages/core/src/types.ts:617](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L617) -*** +--- ### getEmbeddingResponse() diff --git a/docs/api/interfaces/ITranscriptionService.md b/docs/api/interfaces/ITranscriptionService.md index 27b765ea595..5993b0eb51a 100644 --- a/docs/api/interfaces/ITranscriptionService.md +++ b/docs/api/interfaces/ITranscriptionService.md @@ -24,7 +24,7 @@ [packages/core/src/types.ts:591](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L591) -*** +--- ### transcribeAttachmentLocally() @@ -42,7 +42,7 @@ [packages/core/src/types.ts:592](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L592) -*** +--- ### transcribe() @@ -60,7 +60,7 @@ [packages/core/src/types.ts:595](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L595) -*** +--- ### transcribeLocally() diff --git a/docs/api/interfaces/IVideoService.md b/docs/api/interfaces/IVideoService.md index 8b5c9886281..f8a98f005a7 100644 --- a/docs/api/interfaces/IVideoService.md +++ b/docs/api/interfaces/IVideoService.md @@ -24,7 +24,7 @@ [packages/core/src/types.ts:600](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L600) -*** +--- ### processVideo() @@ -42,7 +42,7 @@ [packages/core/src/types.ts:601](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L601) -*** +--- ### fetchVideoInfo() @@ -60,7 +60,7 @@ [packages/core/src/types.ts:602](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L602) -*** +--- ### downloadVideo() diff --git a/docs/api/interfaces/Memory.md b/docs/api/interfaces/Memory.md index f9d743a4a54..842dc838fdd 100644 --- a/docs/api/interfaces/Memory.md +++ b/docs/api/interfaces/Memory.md @@ -14,7 +14,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/main/packages/core/src/types.ts#L167) -*** +--- ### userId @@ -24,7 +24,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:168](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L168) -*** +--- ### agentId @@ -34,7 +34,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/main/packages/core/src/types.ts#L169) -*** +--- ### createdAt? @@ -44,7 +44,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/main/packages/core/src/types.ts#L170) -*** +--- ### content @@ -54,7 +54,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/main/packages/core/src/types.ts#L171) -*** +--- ### embedding? @@ -64,7 +64,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/main/packages/core/src/types.ts#L172) -*** +--- ### roomId @@ -74,7 +74,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/main/packages/core/src/types.ts#L173) -*** +--- ### unique? diff --git a/docs/api/interfaces/MessageExample.md b/docs/api/interfaces/MessageExample.md index 8055efc55ea..674de4854e4 100644 --- a/docs/api/interfaces/MessageExample.md +++ b/docs/api/interfaces/MessageExample.md @@ -14,7 +14,7 @@ Represents an example of a message, typically used for demonstrating or testing [packages/core/src/types.ts:181](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L181) -*** +--- ### content 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..997ccb7567e 100644 --- a/docs/api/interfaces/Participant.md +++ b/docs/api/interfaces/Participant.md @@ -14,7 +14,7 @@ Represents a participant in a room, including their ID and account details. [packages/core/src/types.ts:285](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L285) -*** +--- ### account diff --git a/docs/api/interfaces/Relationship.md b/docs/api/interfaces/Relationship.md index b1baf439541..4a2ab5d47f4 100644 --- a/docs/api/interfaces/Relationship.md +++ b/docs/api/interfaces/Relationship.md @@ -14,7 +14,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/main/packages/core/src/types.ts#L260) -*** +--- ### userA @@ -24,7 +24,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/main/packages/core/src/types.ts#L261) -*** +--- ### userB @@ -34,7 +34,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/main/packages/core/src/types.ts#L262) -*** +--- ### userId @@ -44,7 +44,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:263](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L263) -*** +--- ### roomId @@ -54,7 +54,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/main/packages/core/src/types.ts#L264) -*** +--- ### status @@ -64,7 +64,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/main/packages/core/src/types.ts#L265) -*** +--- ### createdAt? diff --git a/docs/api/interfaces/Room.md b/docs/api/interfaces/Room.md index 7ee81f19fb0..f4053ed55e4 100644 --- a/docs/api/interfaces/Room.md +++ b/docs/api/interfaces/Room.md @@ -14,7 +14,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/main/packages/core/src/types.ts#L293) -*** +--- ### participants diff --git a/docs/api/interfaces/State.md b/docs/api/interfaces/State.md index d35b3f51590..d36151ad22f 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 @@ -18,7 +18,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:137](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L137) -*** +--- ### agentId? @@ -28,7 +28,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/main/packages/core/src/types.ts#L138) -*** +--- ### bio @@ -38,7 +38,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/main/packages/core/src/types.ts#L139) -*** +--- ### lore @@ -48,7 +48,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/main/packages/core/src/types.ts#L140) -*** +--- ### messageDirections @@ -58,7 +58,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/main/packages/core/src/types.ts#L141) -*** +--- ### postDirections @@ -68,7 +68,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/main/packages/core/src/types.ts#L142) -*** +--- ### roomId @@ -78,7 +78,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/main/packages/core/src/types.ts#L143) -*** +--- ### agentName? @@ -88,7 +88,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/main/packages/core/src/types.ts#L144) -*** +--- ### senderName? @@ -98,7 +98,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/main/packages/core/src/types.ts#L145) -*** +--- ### actors @@ -108,7 +108,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/main/packages/core/src/types.ts#L146) -*** +--- ### actorsData? @@ -118,7 +118,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/main/packages/core/src/types.ts#L147) -*** +--- ### goals? @@ -128,7 +128,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/main/packages/core/src/types.ts#L148) -*** +--- ### goalsData? @@ -138,7 +138,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/main/packages/core/src/types.ts#L149) -*** +--- ### recentMessages @@ -148,7 +148,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/main/packages/core/src/types.ts#L150) -*** +--- ### recentMessagesData @@ -158,7 +158,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/main/packages/core/src/types.ts#L151) -*** +--- ### actionNames? @@ -168,7 +168,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/main/packages/core/src/types.ts#L152) -*** +--- ### actions? @@ -178,7 +178,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/main/packages/core/src/types.ts#L153) -*** +--- ### actionsData? @@ -188,7 +188,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/main/packages/core/src/types.ts#L154) -*** +--- ### actionExamples? @@ -198,7 +198,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/main/packages/core/src/types.ts#L155) -*** +--- ### providers? @@ -208,7 +208,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/main/packages/core/src/types.ts#L156) -*** +--- ### responseData? @@ -218,7 +218,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/main/packages/core/src/types.ts#L157) -*** +--- ### recentInteractionsData? @@ -228,7 +228,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/main/packages/core/src/types.ts#L158) -*** +--- ### recentInteractions? diff --git a/docs/api/type-aliases/Character.md b/docs/api/type-aliases/Character.md index 62f9dbfbd73..333df81694e 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? 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..eaf55164229 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 diff --git a/docs/api/typedoc-sidebar.cjs b/docs/api/typedoc-sidebar.cjs index 0e9b1029c7c..e7789d1118c 100644 --- a/docs/api/typedoc-sidebar.cjs +++ b/docs/api/typedoc-sidebar.cjs @@ -1,4 +1,299 @@ // @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/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; diff --git a/docs/docs/advanced/autonomous-trading.md b/docs/docs/advanced/autonomous-trading.md index 68008c484a5..6c6328573da 100644 --- a/docs/docs/advanced/autonomous-trading.md +++ b/docs/docs/advanced/autonomous-trading.md @@ -1,364 +1,285 @@ --- -sidebar_position: 16 +sidebar_position: 1 +title: Autonomous Trading --- -# 📈 Autonomous Trading +# Autonomous Trading System ## Overview -Eliza's autonomous trading system enables automated token trading on the Solana blockchain. The system integrates with Jupiter aggregator for efficient swaps, implements smart order routing, and includes risk management features. +Eliza's autonomous trading system provides a sophisticated framework for monitoring market conditions, analyzing tokens, and executing trades on Solana-based decentralized exchanges. The system combines real-time market data, technical analysis, and risk management to make informed trading decisions. ## Core Components -### Token Provider -Manages token information and market data: +### 1. Token Analysis Engine + +The system tracks multiple market indicators: ```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() - }; - } +interface TokenPerformance { + 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; } ``` -### Swap Execution - -Implementation of token swaps using Jupiter: +### 2. Order Book Management ```typescript -async function swapToken( - 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(); +interface Order { + userId: string; + ticker: string; + contractAddress: string; + timestamp: string; + buyAmount: number; + price: number; } ``` -## Position Management +### 3. Market Data Integration -### Order Book System +The system integrates with multiple data sources: -```typescript -interface Order { - userId: string; - ticker: string; - contractAddress: string; - timestamp: string; - buyAmount: number; - price: number; -} +- BirdEye API for real-time market data +- DexScreener for liquidity analysis +- Helius for on-chain data -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); - } -} -``` +## Trading Features -### Position Sizing +### 1. Real-Time Market Analysis ```typescript -async function calculatePositionSize( - 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 - }; +const PROVIDER_CONFIG = { + BIRDEYE_API: "https://public-api.birdeye.so", + MAX_RETRIES: 3, + RETRY_DELAY: 2000, + TOKEN_SECURITY_ENDPOINT: "/defi/token_security?address=", + TOKEN_TRADE_DATA_ENDPOINT: "/defi/v3/token/trade-data/single?address=", +}; +``` - return { - none: 0, - low: liquidity.usd * impactPercentages.LOW, - medium: liquidity.usd * impactPercentages.MEDIUM, - high: liquidity.usd * impactPercentages.HIGH +Key metrics monitored: + +- Price movements +- Volume changes +- Liquidity levels +- Holder distribution +- Trading patterns + +### 2. Risk Assessment System + +The system evaluates multiple risk factors: + +```typescript +async analyzeRisks(token: string) { + const risks = { + liquidityRisk: await checkLiquidity(), + holderConcentration: await analyzeHolderDistribution(), + priceVolatility: await calculateVolatility(), + marketManipulation: await detectManipulation() }; + return risks; } ``` -## Risk Management +### 3. Trading Strategies -### Token Validation +#### Market Analysis ```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; +async getProcessedTokenData(): Promise { + const security = await this.fetchTokenSecurity(); + const tradeData = await this.fetchTokenTradeData(); + const dexData = await this.fetchDexScreenerData(); + const holderDistributionTrend = await this.analyzeHolderDistribution(tradeData); + // ... additional analysis } ``` -### Trade Management +#### Trade Execution ```typescript -interface TradeManager { - async executeTrade(params: { - inputToken: string, - outputToken: string, - amount: number, - slippage: number - }): Promise; - - async monitorPosition(params: { - tokenAddress: string, - entryPrice: number, - stopLoss: number, - takeProfit: number - }): Promise; - - async closePosition(params: { - tokenAddress: string, - amount: number - }): Promise; +interface TradePerformance { + token_address: string; + buy_price: number; + sell_price: number; + buy_timeStamp: string; + sell_timeStamp: string; + profit_percent: number; + market_cap_change: number; + liquidity_change: number; } ``` -## Market Analysis +## Configuration Options -### Price Data Collection +### 1. Trading Parameters ```typescript -async function collectMarketData( - 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) - }; -} +const tradingConfig = { + minLiquidity: 50000, // Minimum liquidity in USD + maxSlippage: 0.02, // Maximum allowed slippage + positionSize: 0.01, // Position size as percentage of portfolio + stopLoss: 0.05, // Stop loss percentage + takeProfit: 0.15, // Take profit percentage +}; ``` -### Technical Analysis +### 2. Risk Management Settings ```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) - }; -} +const riskSettings = { + maxDrawdown: 0.2, // Maximum portfolio drawdown + maxPositionSize: 0.1, // Maximum single position size + minLiquidityRatio: 50, // Minimum liquidity to market cap ratio + maxHolderConcentration: 0.2, // Maximum single holder concentration +}; ``` -## Trade Execution +## Implementation Guide -### Swap Implementation +### 1. Setting Up Market Monitoring ```typescript -async function executeSwap( - 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; +async monitorMarket(token: string) { + const provider = new TokenProvider(token); + const marketData = await provider.getProcessedTokenData(); + + return { + price: marketData.tradeData.price, + volume: marketData.tradeData.volume_24h, + liquidity: marketData.tradeData.liquidity, + holderMetrics: marketData.security + }; } ``` -### DAO Integration +### 2. Implementing Trading Logic ```typescript -async function executeSwapForDAO( - 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 - ); +async evaluateTradeOpportunity(token: string) { + const analysis = await this.getProcessedTokenData(); + + const signals = { + priceSignal: analysis.tradeData.price_change_24h > 0, + volumeSignal: analysis.tradeData.volume_24h_change_percent > 20, + liquiditySignal: analysis.tradeData.liquidity > MIN_LIQUIDITY, + holderSignal: analysis.holderDistributionTrend === "increasing" + }; + + return signals.priceSignal && signals.volumeSignal && + signals.liquiditySignal && signals.holderSignal; } ``` -## Monitoring & Safety - -### Health Checks +### 3. Risk Management Implementation ```typescript -async function performHealthChecks(): Promise { +async checkTradeRisks(token: string): Promise { + const security = await this.fetchTokenSecurity(); + const tradeData = await this.fetchTokenTradeData(); + return { - connection: await checkConnectionStatus(), - wallet: await checkWalletBalance(), - orders: await checkOpenOrders(), - positions: await checkPositions() + isRugPull: security.ownerPercentage > 50, + isPumpAndDump: tradeData.price_change_24h > 100, + isLowLiquidity: tradeData.liquidity < MIN_LIQUIDITY, + isSuspiciousVolume: tradeData.suspiciousVolume }; } ``` -### Safety Limits - -```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 -}; -``` - -## Error Handling +## Performance Monitoring -### Transaction Errors +### 1. Trade Tracking ```typescript -async function handleTransactionError( - 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); - } +async trackTradePerformance(trade: TradePerformance): Promise { + const performance = { + entryPrice: trade.buy_price, + exitPrice: trade.sell_price, + profitLoss: trade.profit_percent, + holdingPeriod: calculateHoldingPeriod( + trade.buy_timeStamp, + trade.sell_timeStamp + ), + marketImpact: trade.market_cap_change + }; + + await this.logTradePerformance(performance); } ``` -### Recovery Procedures +### 2. Portfolio Analytics ```typescript -async function recoverFromError( - 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); +async analyzePortfolioPerformance(userId: string) { + const trades = await this.getTradeHistory(userId); + return { + totalTrades: trades.length, + winRate: calculateWinRate(trades), + averageReturn: calculateAverageReturn(trades), + maxDrawdown: calculateMaxDrawdown(trades), + sharpeRatio: calculateSharpeRatio(trades) + }; } ``` +## Best Practices + +1. **Risk Management** + + - Always implement stop-loss orders + - Diversify trading positions + - Monitor liquidity levels continuously + - Set maximum position sizes + +2. **Trade Execution** + + - Use slippage protection + - Implement rate limiting + - Monitor gas costs + - Verify transaction success + +3. **Market Analysis** + + - Cross-reference multiple data sources + - Implement data validation + - Monitor market manipulation indicators + - Track historical patterns + +4. **System Maintenance** + - Regular performance reviews + - Strategy backtesting + - Risk parameter adjustments + - System health monitoring + +## Security Considerations + +1. **Transaction Security** + + - Implement transaction signing + - Verify contract addresses + - Monitor for malicious tokens + - Implement rate limiting + +2. **Data Validation** + - Verify data sources + - Implement error handling + - Monitor for anomalies + - Cross-validate market data + +## Additional Resources + +- [Trust Engine Documentation](./trust-engine.md) +- [Infrastructure Setup](./infrastructure.md) + +Remember to thoroughly test all trading strategies in a sandbox environment before deploying to production. diff --git a/docs/docs/advanced/fine-tuning.md b/docs/docs/advanced/fine-tuning.md index 1065bf3ba92..bb11634f042 100644 --- a/docs/docs/advanced/fine-tuning.md +++ b/docs/docs/advanced/fine-tuning.md @@ -1,373 +1,211 @@ --- -sidebar_position: 13 +sidebar_position: 1 +title: Fine-tuning --- -# 🎯 Fine-tuning Guide +# Model Selection and Fine-tuning ## Overview -Eliza supports multiple AI model providers and offers extensive configuration options for fine-tuning model behavior, embedding generation, and performance optimization. +Eliza provides a flexible model selection and configuration system that supports multiple AI providers including OpenAI, Anthropic, Google, and various LLaMA implementations. This guide explains how to configure and fine-tune models for optimal performance in your use case. -## Model Providers +## Supported Models -Eliza supports multiple model providers through a flexible configuration system: +### Available Providers -```typescript -enum ModelProviderName { - OPENAI, - ANTHROPIC, - CLAUDE_VERTEX, - GROK, - GROQ, - LLAMACLOUD, - LLAMALOCAL, - GOOGLE, - REDPILL, - OPENROUTER -} -``` +Eliza supports the following model providers: -### Provider Configuration +- **OpenAI** -Each provider has specific settings: + - Small: gpt-4o-mini + - Medium: gpt-4o + - Large: gpt-4o + - Embeddings: text-embedding-3-small -```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" - } - }, - // ... other providers -}; -``` +- **Anthropic** -## Model Classes + - Small: claude-3-haiku + - Medium: claude-3.5-sonnet + - Large: claude-3-opus -Models are categorized into different classes based on their capabilities: +- **Google (Gemini)** -```typescript -enum ModelClass { - SMALL, // Fast, efficient for simple tasks - MEDIUM, // Balanced performance and capability - LARGE, // Most capable but slower/more expensive - EMBEDDING // Specialized for vector embeddings - IMAGE // Image generation capabilities -} -``` + - Small: gemini-1.5-flash + - Medium: gemini-1.5-flash + - Large: gemini-1.5-pro + - Embeddings: text-embedding-004 -## Embedding System +- **LLaMA Cloud** -### Configuration + - Small: meta-llama/Llama-3.2-3B-Instruct-Turbo + - Medium: meta-llama-3.1-8b-instruct + - Large: meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo + - Embeddings: togethercomputer/m2-bert-80M-32k-retrieval -```typescript -const embeddingConfig = { - dimensions: 1536, - modelName: "text-embedding-3-small", - cacheEnabled: true -}; -``` +- **LLaMA Local** + - Various Hermes-3-Llama models optimized for local deployment -### Implementation +## Configuration Options -```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; -} -``` - -## Fine-tuning Options +### Model Settings -### Temperature Control - -Configure model creativity vs. determinism: +Each model provider can be configured with the following parameters: ```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 - } -}; +settings: { + stop: [], // Stop sequences for text generation + maxInputTokens: 128000, // Maximum input context length + maxOutputTokens: 8192, // Maximum response length + frequency_penalty: 0.0, // Penalize frequent tokens + presence_penalty: 0.0, // Penalize repeated content + temperature: 0.3, // Control randomness (0.0-1.0) +} ``` -### Context Window +### Model Classes -Manage token limits: +Models are categorized into four classes: -```typescript -const contextSettings = { - OPENAI: { - maxInputTokens: 128000, - maxOutputTokens: 8192, - }, - ANTHROPIC: { - maxInputTokens: 200000, - maxOutputTokens: 8192, - }, - LLAMALOCAL: { - maxInputTokens: 32768, - maxOutputTokens: 8192, - } -}; -``` +- `SMALL`: Optimized for speed and cost +- `MEDIUM`: Balanced performance and capability +- `LARGE`: Maximum capability for complex tasks +- `EMBEDDING`: Specialized for text embeddings -## Performance Optimization +## Fine-tuning Guidelines -### Caching Strategy +### 1. Selecting the Right Model Size -```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); - } -} -``` +Choose your model class based on your requirements: -### Model Selection +- **SMALL Models** -```typescript -async function selectOptimalModel( - task: string, - requirements: ModelRequirements -): Promise { - if (requirements.speed === "fast") { - return ModelClass.SMALL; - } else if (requirements.complexity === "high") { - return ModelClass.LARGE; - } - return ModelClass.MEDIUM; -} -``` + - Best for: Quick responses, simple tasks, cost-effective deployment + - Example use cases: Basic chat, simple classifications + - Recommended: `claude-3-haiku` or `gemini-1.5-flash` -## Provider-Specific Optimizations +- **MEDIUM Models** -### OpenAI + - Best for: General purpose applications, balanced performance + - Example use cases: Content generation, complex analysis + - Recommended: `claude-3.5-sonnet` or `meta-llama-3.1-8b-instruct` -```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" - } -}; -``` +- **LARGE Models** + - Best for: Complex reasoning, specialized tasks + - Example use cases: Code generation, detailed analysis + - Recommended: `claude-3-opus` or `Meta-Llama-3.1-405B` -### Anthropic +### 2. Optimizing Model Parameters ```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" - } +// Example configuration for different use cases +const chatConfig = { + temperature: 0.7, // More creative responses + maxOutputTokens: 2048, // Shorter, focused replies + presence_penalty: 0.6, // Encourage response variety }; -``` - -### Local LLM -```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" - } +const analysisConfig = { + temperature: 0.2, // More deterministic responses + maxOutputTokens: 8192, // Allow detailed analysis + presence_penalty: 0.0, // Maintain focused analysis }; ``` -## Testing and Validation +### 3. Embedding Configuration -### Embedding Tests - -```typescript -async function validateEmbedding( - 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; -} -``` +Eliza includes a sophisticated embedding system that supports: -### Model Performance Testing +- Automatic caching of embeddings +- Provider-specific optimizations +- Fallback to LLaMA service when needed ```typescript -async function benchmarkModel( - 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; -} +// Example embedding usage +const embedding = await runtime.llamaService.getEmbeddingResponse(input); ``` ## Best Practices -### Model Selection Guidelines +1. **Model Selection** -1. **Task Complexity** - - Use SMALL for simple, quick responses - - Use MEDIUM for balanced performance - - Use LARGE for complex reasoning + - Start with SMALL models and upgrade as needed + - Use MEDIUM models as your default for general tasks + - Reserve LARGE models for specific, complex requirements -2. **Context Management** - - Keep prompts concise and focused - - Use context windows efficiently - - Implement proper context truncation +2. **Parameter Tuning** -3. **Temperature Adjustment** - - Lower for factual responses - - Higher for creative tasks - - Balance based on use case + - Keep temperature low (0.2-0.4) for consistent outputs + - Increase temperature (0.6-0.8) for creative tasks + - Adjust maxOutputTokens based on expected response length -### Performance Optimization +3. **Embedding Optimization** -1. **Caching Strategy** - - Cache embeddings for frequently accessed content - - Implement tiered caching (memory/disk) - - Regular cache cleanup + - Utilize the caching system for frequently used content + - Choose provider-specific embedding models for best results + - Monitor embedding performance and adjust as needed -2. **Resource Management** - - Monitor token usage - - Implement rate limiting - - Optimize batch processing +4. **Cost Optimization** + - Use SMALL models for development and testing + - Implement caching strategies for embeddings + - Monitor token usage across different model classes -## Troubleshooting +## Common Issues and Solutions -### Common Issues +1. **Token Length Errors** -1. **Token Limits** ```typescript - function handleTokenLimit(error: Error) { - if (error.message.includes('token limit')) { - return truncateAndRetry(); - } - } + // Solution: Implement chunking for long inputs + const chunks = splitIntoChunks(input, model.settings.maxInputTokens); ``` -2. **Embedding Errors** +2. **Response Quality Issues** + ```typescript - function handleEmbeddingError(error: Error) { - if (error.message.includes('dimension mismatch')) { - return regenerateEmbedding(); - } - } + // Solution: Adjust temperature and penalties + const enhancedSettings = { + ...defaultSettings, + temperature: 0.4, + presence_penalty: 0.2, + }; ``` -3. **Model Availability** +3. **Embedding Cache Misses** ```typescript - async function handleModelFailover(error: Error) { - if (error.message.includes('model not available')) { - return switchToFallbackModel(); - } - } + // Solution: Implement broader similarity thresholds + const similarityThreshold = 0.85; + const cachedEmbedding = await findSimilarEmbedding( + input, + similarityThreshold, + ); ``` + +## Advanced Configuration + +For advanced use cases, you can extend the model configuration: + +```typescript +// Custom model configuration +const customConfig = { + model: { + [ModelClass.SMALL]: "your-custom-model", + [ModelClass.MEDIUM]: "your-custom-model", + [ModelClass.LARGE]: "your-custom-model", + [ModelClass.EMBEDDING]: "your-custom-embedding-model", + }, + settings: { + // Custom settings + maxInputTokens: 64000, + temperature: 0.5, + // Add custom parameters + custom_param: "value", + }, +}; +``` + +## Additional Resources + +- Check the [Model Providers](/docs/core/providers) documentation for more details about specific providers +- See [Configuration Guide](/docs/guides/configuration) for general configuration options +- Visit [Advanced Usage](/docs/guides/advanced) for complex deployment scenarios + +Remember to monitor your model's performance and adjust these configurations based on your specific use case and requirements. diff --git a/docs/docs/advanced/infrastructure.md b/docs/docs/advanced/infrastructure.md index a6769e573f1..35198e3ba06 100644 --- a/docs/docs/advanced/infrastructure.md +++ b/docs/docs/advanced/infrastructure.md @@ -1,319 +1,302 @@ --- -sidebar_position: 14 +sidebar_position: 1 +title: Infrastructure --- -# 🏗️ Infrastructure Guide +# Infrastructure ## Overview -Eliza's infrastructure is built on a flexible database architecture that supports multiple adapters and efficient data storage mechanisms for AI agent interactions, memory management, and relationship tracking. +Eliza uses a flexible, multi-database architecture that supports different storage backends through a unified adapter interface. The system supports PostgreSQL (with Supabase), SQLite, and SQL.js, allowing for both cloud and local deployments. -## Core Components +## Database Architecture -### Database Adapters -Eliza supports multiple database backends through a pluggable adapter system: +### Adapter Pattern -- **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 +Eliza implements a database adapter pattern that provides a consistent interface across different database backends: -### Schema Structure +```typescript +// Core adapter interface implemented by all database providers +class DatabaseAdapter { + async getRoom(roomId: UUID): Promise; + async getParticipantsForAccount(userId: UUID): Promise; + async getMemories(params: {...}): Promise; + // ... other interface methods +} +``` -The database schema includes several key tables: +### Supported Databases -```sql -- accounts: User and agent identities -- rooms: Conversation spaces -- memories: Vector-indexed message storage -- goals: Agent objectives and progress -- participants: Room membership tracking -- relationships: Inter-agent connections -``` +1. **PostgreSQL/Supabase** (`PostgresDatabaseAdapter`) + + - Full-featured cloud database with vector search capabilities + - Supports real-time subscriptions + - Built-in user authentication + - Row-level security policies + +2. **SQLite** (`SqliteDatabaseAdapter`) + + - Local filesystem storage + - Vector similarity search via SQLite extensions + - Suitable for edge deployments + - Embedded database operations + +3. **SQL.js** (`SqlJsDatabaseAdapter`) + - In-memory database operations + - Browser-compatible + - No filesystem dependencies + - Ideal for testing and development + +## Core Components -## Setting Up Infrastructure +### 1. Memory Storage System -### PostgreSQL Setup +The memory system uses a sophisticated schema that supports: -1. **Install PostgreSQL Extensions** ```sql -CREATE EXTENSION IF NOT EXISTS vector; -CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; +CREATE TABLE memories ( + "id" UUID PRIMARY KEY, + "type" TEXT NOT NULL, + "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + "content" JSONB NOT NULL, + "embedding" vector(1536), -- Vector storage for embeddings + "userId" UUID, + "roomId" UUID, + "unique" BOOLEAN DEFAULT true +); ``` -2. **Initialize Core Tables** +Key features: + +- Vector embeddings for semantic search +- Content deduplication via the `unique` flag +- JSON storage for flexible content types +- Relationship tracking through foreign keys + +### 2. User Management + ```sql --- Create base tables CREATE TABLE accounts ( "id" UUID PRIMARY KEY, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, + "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "name" TEXT, "username" TEXT, "email" TEXT NOT NULL, "avatarUrl" TEXT, - "details" JSONB DEFAULT '{}'::jsonb + "details" JSONB DEFAULT '{}', + "is_agent" BOOLEAN DEFAULT false ); +``` -CREATE TABLE rooms ( - "id" UUID PRIMARY KEY, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP -); +Features: -CREATE TABLE memories ( - "id" UUID PRIMARY KEY, - "type" TEXT NOT NULL, - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - "content" JSONB NOT NULL, - "embedding" vector(1536), - "userId" UUID REFERENCES accounts("id"), - "agentId" UUID REFERENCES accounts("id"), - "roomId" UUID REFERENCES rooms("id"), - "unique" BOOLEAN DEFAULT true NOT NULL -); -``` +- Flexible user details storage using JSONB +- Agent/user differentiation +- Integration with auth systems + +### 3. Relationship System -3. **Set Up Indexes** ```sql -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"); -CREATE INDEX idx_participants_room ON participants("roomId"); +CREATE TABLE relationships ( + "id" UUID PRIMARY KEY, + "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + "userA" UUID NOT NULL, + "userB" UUID NOT NULL, + "status" TEXT, + "userId" UUID NOT NULL +); ``` -### Connection Configuration +Supports: -```typescript -// PostgreSQL Configuration -const postgresConfig = { - max: 20, - idleTimeoutMillis: 30000, - connectionTimeoutMillis: 2000, -}; - -// Supabase Configuration -const supabaseConfig = { - supabaseUrl: process.env.SUPABASE_URL, - supabaseKey: process.env.SUPABASE_KEY -}; -``` +- Bi-directional relationships +- Relationship status tracking +- Friend recommendations -## Memory Management +## Security Features -### Vector Storage +### Row Level Security (RLS) -The memory system uses vector embeddings for semantic search: +PostgreSQL deployment includes comprehensive RLS policies: -```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 - }); -} +```sql +-- Example RLS policies +CREATE POLICY "Enable read access for all users" +ON "public"."accounts" FOR SELECT +USING (true); + +CREATE POLICY "Can select and update all data" +ON "public"."accounts" +USING (("auth"."uid"() = "id")) +WITH CHECK (("auth"."uid"() = "id")); ``` -### Memory Retrieval +### Authentication Integration -```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" - } - ); -} -``` +- Built-in support for Supabase Auth +- JWT validation +- Role-based access control -## Scaling Considerations +## Deployment Options -### Database Optimization +### 1. Cloud Deployment (Supabase) -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 - }); - ``` +```typescript +// Initialize cloud database +const supabaseAdapter = new SupabaseDatabaseAdapter( + "https://your-project.supabase.co", + "your-supabase-key", +); +``` -3. **Query Optimization** - - Use prepared statements - - Implement efficient pagination - - Optimize vector similarity searches +Features: -### High Availability +- Automated backups +- Scalable vector operations +- Real-time capabilities +- Built-in monitoring -1. **Database Replication** - - Set up read replicas for scaling read operations - - Configure streaming replication for failover - - Implement connection retry logic +### 2. Local Deployment (SQLite) -2. **Backup Strategy** - ```sql - -- Regular backups - pg_dump -Fc mydb > backup.dump - - -- Point-in-time recovery - pg_basebackup -D backup -Fp -Xs -P - ``` +```typescript +// Initialize local database +const sqliteAdapter = new SqliteDatabaseAdapter( + new Database("path/to/database.db"), +); +``` -## Security +Features: -### Access Control +- File-based storage +- Portable deployment +- Low resource requirements +- Embedded vector operations -1. **Row Level Security** -```sql -ALTER TABLE memories ENABLE ROW LEVEL SECURITY; +### 3. In-Memory Deployment (SQL.js) -CREATE POLICY "memories_isolation" ON memories - USING (auth.uid() = "userId" OR auth.uid() = "agentId"); +```typescript +// Initialize in-memory database +const sqljsAdapter = new SqlJsDatabaseAdapter(new Database()); ``` -2. **Role Management** -```sql --- Create application role -CREATE ROLE app_user; +Features: --- Grant necessary permissions -GRANT SELECT, INSERT ON memories TO app_user; -GRANT USAGE ON SCHEMA public TO app_user; -``` +- No persistence requirements +- Fast operations +- Perfect for testing +- Browser compatibility -### Data Protection +## Vector Search Capabilities -1. **Encryption** - - Use TLS for connections - - Encrypt sensitive data at rest - - Implement key rotation +All database adapters support vector operations for semantic search: -2. **Audit Logging** -```sql -CREATE TABLE logs ( - "id" UUID PRIMARY KEY DEFAULT gen_random_uuid(), - "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - "userId" UUID NOT NULL REFERENCES accounts("id"), - "body" JSONB NOT NULL, - "type" TEXT NOT NULL, - "roomId" UUID NOT NULL REFERENCES rooms("id") -); +```typescript +async searchMemoriesByEmbedding( + embedding: number[], + params: { + match_threshold?: number; + count?: number; + roomId?: UUID; + unique?: boolean; + tableName: string; + } +): Promise ``` -## Monitoring +### Implementation Details: -### Health Checks +- PostgreSQL: Uses pgvector extension +- SQLite: Uses sqlite-vss extension +- SQL.js: Uses custom vector similarity functions -```typescript -async function checkDatabaseHealth(): Promise { - try { - await db.query('SELECT 1'); - return true; - } catch (error) { - console.error('Database health check failed:', error); - return false; - } -} -``` +## Best Practices -### Performance Metrics +1. **Database Selection** -Track key metrics: -- Query performance -- Connection pool utilization -- Memory usage -- Vector search latency + - Use Supabase for production deployments + - Use SQLite for edge computing/local deployments + - Use SQL.js for testing and browser-based applications -## Maintenance +2. **Memory Management** -### Regular Tasks + ```typescript + // Example of proper memory handling + async function withConnection(fn: (client: PoolClient) => Promise) { + const client = await pool.connect(); + try { + return await fn(client); + } finally { + client.release(); + } + } + ``` -1. **Vacuum Operations** -```sql --- Regular vacuum -VACUUM ANALYZE memories; +3. **Error Handling** --- Analyze statistics -ANALYZE memories; -``` + ```typescript + try { + await adapter.createMemory(memory, tableName); + } catch (error) { + console.error("Database error:", error); + // Implement proper error recovery + } + ``` -2. **Index Maintenance** -```sql --- Reindex vector similarity index -REINDEX INDEX idx_memories_embedding; -``` +4. **Connection Pooling** + ```typescript + const pool = new Pool({ + max: 20, + idleTimeoutMillis: 30000, + connectionTimeoutMillis: 2000, + }); + ``` -### Data Lifecycle +## Performance Optimization -1. **Archival Strategy** - - Archive old conversations - - Compress inactive memories - - Implement data retention policies +1. **Indexing Strategy** -2. **Cleanup Jobs** -```typescript -async function cleanupOldMemories() { - const cutoffDate = new Date(); - cutoffDate.setMonth(cutoffDate.getMonth() - 6); - - await db.query(` - DELETE FROM memories - WHERE "createdAt" < $1 - `, [cutoffDate]); -} -``` + ```sql + -- Essential indexes for performance + CREATE INDEX idx_memories_embedding ON memories + USING hnsw ("embedding" vector_cosine_ops); + CREATE INDEX idx_memories_type_room ON memories("type", "roomId"); + ``` -## Troubleshooting +2. **Query Optimization** -### Common Issues + ```typescript + // Use parameterized queries + const stmt = db.prepare( + "SELECT * FROM memories WHERE type = ? AND roomId = ?", + ); + ``` -1. **Connection Problems** - - Check connection pool settings - - Verify network connectivity - - Review firewall rules +3. **Caching** + - Implement memory caching for frequently accessed data + - Use embedding caching for similar queries -2. **Performance Issues** - - Analyze query plans - - Check index usage - - Monitor resource utilization +## Monitoring and Maintenance -3. **Vector Search Problems** - - Verify embedding dimensions - - Check similarity thresholds - - Review index configuration +1. **Health Checks** -### Diagnostic Queries + ```typescript + async testConnection(): Promise { + const result = await client.query("SELECT NOW()"); + return !!result.rows[0]; + } + ``` -```sql --- Check connection status -SELECT * FROM pg_stat_activity; - --- Analyze query performance -EXPLAIN ANALYZE -SELECT * FROM memories -WHERE embedding <-> $1 < 0.3 -LIMIT 10; - --- Monitor index usage -SELECT schemaname, tablename, indexname, idx_scan -FROM pg_stat_user_indexes; -``` +2. **Logging** + ```typescript + // Implement comprehensive logging + const loggingAdapter = createLoggingDatabaseAdapter(baseAdapter); + ``` -## Further Reading +## Additional Resources - [PostgreSQL Documentation](https://www.postgresql.org/docs/) +- [SQLite Documentation](https://www.sqlite.org/docs.html) +- [Supabase Documentation](https://supabase.com/docs) +- [Vector Search Guide](https://supabase.com/docs/guides/database/extensions/pgvector) + +For deployment-specific configurations and advanced setup options, refer to the respective database documentation. diff --git a/docs/docs/advanced/trust-engine.md b/docs/docs/advanced/trust-engine.md index 7f489fad8e7..2905ce60472 100644 --- a/docs/docs/advanced/trust-engine.md +++ b/docs/docs/advanced/trust-engine.md @@ -1,397 +1,297 @@ --- -sidebar_position: 15 +sidebar_position: 1 +title: Trust Engine --- -# 🤝 Trust Engine +# Trust Engine System ## Overview -The Trust Engine is a sophisticated system for evaluating, tracking, and managing trust scores for token recommendations and trading activity. It combines on-chain analysis, trader metrics, and historical performance to create a comprehensive trust framework. +The Trust Engine is a sophisticated system for tracking, evaluating, and managing trust scores in decentralized recommendation networks. It provides a comprehensive framework for monitoring recommender performance, token metrics, and trading outcomes. ## Core Components -### Trust Score Database - -The database schema manages various aspects of trust: +### 1. Recommender Management ```typescript -interface TrustScoreDatabase { - // 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; // Unique identifier + address: string; // Blockchain address + solanaPubkey?: string; + telegramId?: string; + discordId?: string; + twitterId?: string; + ip?: string; } +``` + +The system tracks recommenders across multiple platforms and identifiers, enabling: + +- Cross-platform identity verification +- Multi-channel recommendation tracking +- Unified reputation management + +### 2. Trust Metrics +```typescript interface RecommenderMetrics { - recommenderId: string; - trustScore: number; - totalRecommendations: number; - successfulRecs: number; - avgTokenPerformance: number; - riskScore: number; - consistencyScore: number; - virtualConfidence: number; - lastActiveDate: Date; + recommenderId: string; + trustScore: number; // Overall trust rating + totalRecommendations: number; + successfulRecs: number; + avgTokenPerformance: number; + riskScore: number; + consistencyScore: number; + virtualConfidence: number; + lastUpdated: Date; } ``` -### Token Analysis +Key metrics tracked: + +- Trust Score: Overall reliability rating +- Success Rate: Ratio of successful recommendations +- Risk Assessment: Evaluation of risk-taking behavior +- Consistency: Pattern analysis of recommendations -The system tracks comprehensive token metrics: +### 3. Token Performance Tracking ```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; + lastUpdated: Date; } ``` -## Trust Scoring System +## Usage Guide -### Score Calculation +### 1. Initializing Trust Tracking ```typescript -async function calculateTrustScore( - 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 trustDB = new TrustScoreDatabase(sqliteDb); + +// Add a new recommender +const recommender = { + id: "uuid", + address: "0x...", + telegramId: "@username", +}; +trustDB.addRecommender(recommender); + +// Initialize metrics +trustDB.initializeRecommenderMetrics(recommender.id); ``` -### Token Validation +### 2. Tracking Recommendations ```typescript -async function validateToken( - 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 - ); -} +// Record a new token recommendation +const recommendation = { + id: "uuid", + recommenderId: recommender.id, + tokenAddress: "0x...", + timestamp: new Date(), + initialMarketCap: 1000000, + initialLiquidity: 500000, + initialPrice: 0.001, +}; +trustDB.addTokenRecommendation(recommendation); ``` -## Trade Management - -### Trade Performance Tracking +### 3. Performance Monitoring ```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; -} - -async function recordTradePerformance( - trade: TradePerformance, - isSimulation: boolean -): Promise { - const tableName = isSimulation ? 'simulation_trade' : 'trade'; - await db.query(` - INSERT INTO ${tableName} ( - token_address, - recommender_id, - buy_price, - sell_price, - buy_timeStamp, - sell_timeStamp, - profit_usd, - profit_percent, - market_cap_change, - liquidity_change, - rapidDump - ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) - `, [/* parameters */]); -} +// Update token performance metrics +const performance = { + tokenAddress: "0x...", + priceChange24h: 15.5, + volumeChange24h: 25.0, + liquidity: 1000000, + holderChange24h: 5.2, + rugPull: false, + isScam: false, + // ... other metrics +}; +trustDB.upsertTokenPerformance(performance); ``` -### Risk Management +### 4. Trade Tracking ```typescript -async function assessTradeRisk( - token: TokenPerformance, - recommender: RecommenderMetrics -): Promise<{ - 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 - }; -} +// Record a trade based on recommendation +const trade = { + token_address: "0x...", + recommender_id: "uuid", + buy_price: 0.001, + buy_timeStamp: new Date().toISOString(), + buy_amount: 1000, + buy_sol: 1.5, + buy_value_usd: 1500, + buy_market_cap: 1000000, + buy_liquidity: 500000, +}; +trustDB.addTradePerformance(trade, false); ``` -## Recommendation Analysis +## Trust Score Calculation -### Pattern Detection +The system calculates trust scores based on multiple factors: -```typescript -async function analyzeRecommendationPatterns( - recommenderId: string -): Promise { - const history = await getRecommenderHistory(recommenderId); - - return { - timeOfDay: analyzeTimingPatterns(history), - tokenTypes: analyzeTokenPreferences(history), - successRateByType: calculateTypeSuccessRates(history), - riskProfile: assessRiskProfile(history) - }; -} -``` +1. **Performance Metrics** -### Performance Metrics + - Success rate of recommendations + - Average token performance + - Risk-adjusted returns -```typescript -interface PerformanceMetrics { - profitability: number; - consistency: number; - riskAdjustedReturn: number; - maxDrawdown: number; - winRate: number; -} +2. **Risk Factors** -async function calculatePerformanceMetrics( - recommendations: TokenRecommendation[] -): Promise { - const trades = await getTradesFromRecommendations(recommendations); - - return { - profitability: calculateProfitability(trades), - consistency: calculateConsistency(trades), - riskAdjustedReturn: calculateSharpeRatio(trades), - maxDrawdown: calculateMaxDrawdown(trades), - winRate: calculateWinRate(trades) - }; -} -``` + ```typescript + const riskFactors = { + rugPull: -1.0, // Maximum penalty + scam: -0.8, // Severe penalty + rapidDump: -0.4, // Moderate penalty + suspicious: -0.2, // Minor penalty + }; + ``` -## Integration with Trading System +3. **Historical Analysis** + - Performance consistency + - Long-term success rate + - Risk pattern analysis -### Trade Execution +## Best Practices + +### 1. Regular Updates ```typescript -async function executeTrade( - 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; +// Update metrics regularly +function updateRecommenderMetrics(recommenderId: string) { + const metrics = calculateUpdatedMetrics(recommenderId); + trustDB.updateRecommenderMetrics(metrics); + trustDB.logRecommenderMetricsHistory(recommenderId); } ``` -### Position Management +### 2. Risk Management -```typescript -async function managePosition( - 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); - } -} -``` +1. Monitor suspicious patterns: + + ```typescript + const riskFlags = { + rapidPriceChange: price24h > 100, + lowLiquidity: liquidity < minLiquidityThreshold, + suspiciousVolume: volume24h > marketCap, + }; + ``` -## Monitoring and Alerts +2. Implement automatic warnings: + ```typescript + if (metrics.riskScore > riskThreshold) { + triggerRiskAlert(recommenderId); + } + ``` -### Performance Monitoring +### 3. Performance Tracking ```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 trading performance - const performanceMetrics = await getPerformanceMetrics(); - for (const metric of performanceMetrics) { - if (metric.drawdown > MAX_DRAWDOWN) { - await notifyRiskAlert(metric); - } - } -} +// Track historical performance +const history = trustDB.getRecommenderMetricsHistory(recommenderId); +const performanceTrend = analyzePerformanceTrend(history); ``` -### Alert System +## Advanced Features -```typescript -interface TrustAlert { - type: 'SCORE_CHANGE' | 'RISK_LEVEL' | 'PERFORMANCE'; - severity: 'LOW' | 'MEDIUM' | 'HIGH'; - message: string; - data: any; -} +### 1. Simulation Support -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; - } -} +```typescript +// Test strategies without affecting real metrics +trustDB.addTradePerformance(trade, true); // Simulation mode ``` -## Troubleshooting +### 2. Cross-Platform Verification -### Common Issues - -1. **Trust Score Anomalies** ```typescript -async function investigateTrustAnomaly( - recommenderId: string -): Promise { - const history = await getRecommenderHistory(recommenderId); - const metrics = await getRecommenderMetrics(recommenderId); - const trades = await getRecommenderTrades(recommenderId); - - return analyzeAnomalies(history, metrics, trades); -} +const verifyIdentity = async (recommender: Recommender) => { + const telegramVerified = await verifyTelegram(recommender.telegramId); + const walletVerified = await verifyWallet(recommender.address); + return telegramVerified && walletVerified; +}; ``` -2. **Trade Execution Failures** +### 3. Historical Analysis + ```typescript -async function handleTradeFailure( - error: Error, - trade: TradeAttempt -): Promise { - await logTradeError(error, trade); - await adjustTrustScore(trade.recommenderId, 'FAILURE'); - await notifyTradeFailure(trade); -} +const analyzeRecommenderHistory = (recommenderId: string) => { + const recommendations = + trustDB.getRecommendationsByRecommender(recommenderId); + const metrics = trustDB.getRecommenderMetrics(recommenderId); + const history = trustDB.getRecommenderMetricsHistory(recommenderId); + + return { + successRate: metrics.successfulRecs / metrics.totalRecommendations, + averagePerformance: metrics.avgTokenPerformance, + riskProfile: calculateRiskProfile(history), + consistencyScore: metrics.consistencyScore, + }; +}; ``` +## Security Considerations + +1. **Data Integrity** + + - Use foreign key constraints + - Implement transaction management + - Regular backup of metrics history + +2. **Fraud Prevention** + + ```typescript + // Implement rate limiting + const checkRateLimit = (recommenderId: string) => { + const recentRecs = getRecentRecommendations(recommenderId, timeWindow); + return recentRecs.length < maxRecommendations; + }; + ``` + +3. **Identity Verification** + - Cross-reference multiple identifiers + - Implement progressive trust building + - Regular verification checks + +## Future Enhancements + +1. **Machine Learning Integration** + + - Pattern recognition for fraud detection + - Automated risk assessment + - Predictive analytics for recommendation quality + +2. **Decentralized Validation** + + - Peer verification system + - Consensus-based trust scoring + - Distributed reputation management + +3. **Enhanced Metrics** + - Market sentiment analysis + - Social signal integration + - Network effect measurement + +## Additional Resources + +- [Database Schema Documentation](./infrastructure.md) + +Remember to regularly monitor and adjust trust parameters based on market conditions and system performance. diff --git a/docs/docs/api/_media/README_CN.md b/docs/docs/api/_media/README_CN.md new file mode 100644 index 00000000000..5a4bfe5c0d3 --- /dev/null +++ b/docs/docs/api/_media/README_CN.md @@ -0,0 +1,171 @@ +# Eliza + +Eliza Banner + +## 功能 + +- 🛠 支持discord/推特/telegram连接 +- 👥 支持多模态agent +- 📚 简单的导入文档并与文档交互 +- 💾 可检索的内存和文档存储 +- 🚀 高可拓展性,你可以自定义客户端和行为来进行功能拓展 +- ☁️ 多模型支持,包括Llama、OpenAI、Grok、Anthropic等 +- 📦 简单好用 + +你可以用Eliza做什么? + +- 🤖 聊天机器人 +- 🕵️ 自主Agents +- 📈 业务流程自动化处理 +- 🎮 游戏NPC + +# 开始使用 + +**前置要求(必须):** + +- [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 并填写适当的值 +- 编辑推特环境并输入你的推特账号和密码 + +### 编辑角色文件 + +- 查看文件 `src/core/defaultCharacter.ts` - 您可以修改它 +- 您也可以使用 `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` 加载角色并同时运行多个机器人。 + +在完成账号和角色文件的配置后,输入以下命令行启动你的bot: + +``` +pnpm i +pnpm start +``` + +# 自定义Eliza + +### 添加常规行为 + +为避免在核心目录中的 Git 冲突,我们建议将自定义操作添加到 custom_actions 目录中,并在 elizaConfig.yaml 文件中配置这些操作。可以参考 elizaConfig.example.yaml 文件中的示例。 + +## 配置不同的大模型 + +### 配置Llama + +您可以通过设置 `XAI_MODEL` 环境变量为 `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` 或 `meta-llama/Meta-Llama-3.1-405B-Instruct` 来运行 Llama 70B 或 405B 模型 + +### 配置OpenAI + +您可以通过设置 `XAI_MODEL` 环境变量为 `gpt-4o-mini` 或 `gpt-4o` 来运行 OpenAI 模型 + +## 其他要求 + +您可能需要安装 Sharp。如果在启动时看到错误,请尝试使用以下命令安装: + +``` +pnpm install --include=optional sharp +``` + +# 环境设置 + +您需要在 .env 文件中添加环境变量以连接到各种平台: + +``` +# Required environment variables +DISCORD_APPLICATION_ID= +DISCORD_API_TOKEN= # Bot token +OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk- +ELEVENLABS_XI_API_KEY= # API key from elevenlabs + +# ELEVENLABS SETTINGS +ELEVENLABS_MODEL_ID=eleven_multilingual_v2 +ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM +ELEVENLABS_VOICE_STABILITY=0.5 +ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9 +ELEVENLABS_VOICE_STYLE=0.66 +ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false +ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4 +ELEVENLABS_OUTPUT_FORMAT=pcm_16000 + +TWITTER_DRY_RUN=false +TWITTER_USERNAME= # Account username +TWITTER_PASSWORD= # Account password +TWITTER_EMAIL= # Account email +TWITTER_COOKIES= # Account cookies + +X_SERVER_URL= +XAI_API_KEY= +XAI_MODEL= + + +# For asking Claude stuff +ANTHROPIC_API_KEY= + +WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY +WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY + +BIRDEYE_API_KEY= + +SOL_ADDRESS=So11111111111111111111111111111111111111112 +SLIPPAGE=1 +RPC_URL=https://api.mainnet-beta.solana.com +HELIUS_API_KEY= + + +## Telegram +TELEGRAM_BOT_TOKEN= + +TOGETHER_API_KEY= +``` + +# 本地设置 + +### CUDA设置 + +如果你有高性能的英伟达显卡,你可以以下命令行通过CUDA来做本地加速 + +``` +pnpm install +npx --no node-llama-cpp source download --gpu cuda +``` + +确保你安装了完整的CUDA工具包,包括cuDNN和cuBLAS + +### 本地运行 + +添加 XAI_MODEL 并将其设置为上述 [使用 Llama 运行](#run-with-llama) 中的选项之一 +您可以将 X_SERVER_URL 和 XAI_API_KEY 留空,它会从 huggingface 下载模型并在本地查询 + +# 客户端 + +关于怎么设置discord bot,可以查看discord的官方文档 + +# 开发 + +## 测试 + +几种测试方法的命令行: + +```bash +pnpm test # Run tests once +pnpm test:watch # Run tests in watch mode +``` + +对于数据库特定的测试: + +```bash +pnpm test:sqlite # Run tests with SQLite +pnpm test:sqljs # Run tests with SQL.js +``` + +测试使用 Jest 编写,位于 src/\*_/_.test.ts 文件中。测试环境配置如下: + +- 从 .env.test 加载环境变量 +- 使用 2 分钟的超时时间来运行长时间运行的测试 +- 支持 ESM 模块 +- 按顺序运行测试 (--runInBand) + +要创建新测试,请在要测试的代码旁边添加一个 .test.ts 文件。 diff --git a/docs/docs/api/_media/eliza_banner.jpg b/docs/docs/api/_media/eliza_banner.jpg new file mode 100644 index 00000000000..8364b209c85 Binary files /dev/null and b/docs/docs/api/_media/eliza_banner.jpg differ diff --git a/docs/docs/api/classes/AgentRuntime.md b/docs/docs/api/classes/AgentRuntime.md new file mode 100644 index 00000000000..5a7cb26cbff --- /dev/null +++ b/docs/docs/api/classes/AgentRuntime.md @@ -0,0 +1,836 @@ +# Class: AgentRuntime + +Represents the runtime environment for an agent, handling message processing, +action registration, and interaction with external services like OpenAI and Supabase. + +## Implements + +- [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Constructors + +### new AgentRuntime() + +> **new AgentRuntime**(`opts`): [`AgentRuntime`](AgentRuntime.md) + +Creates an instance of AgentRuntime. + +#### Parameters + +• **opts** + +The options for configuring the AgentRuntime. + +• **opts.actions?**: [`Action`](../interfaces/Action.md)[] + +Optional custom actions. + +• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +Optional ID of the agent. + +• **opts.character?**: [`Character`](../type-aliases/Character.md) + +• **opts.conversationLength?**: `number` + +The number of messages to hold in the recent message cache. + +• **opts.databaseAdapter**: [`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md) + +The database adapter used for interacting with the database. + +• **opts.evaluators?**: [`Evaluator`](../interfaces/Evaluator.md)[] + +Optional custom evaluators. + +• **opts.fetch?**: `unknown` + +Custom fetch function to use for making requests. + +• **opts.imageGenModel?**: [`ImageGenModel`](../enumerations/ImageGenModel.md) + +• **opts.modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) + +• **opts.providers?**: [`Provider`](../interfaces/Provider.md)[] + +Optional context providers. + +• **opts.serverUrl?**: `string` + +The URL of the worker. + +• **opts.speechModelPath?**: `string` + +• **opts.token**: `string` + +The JWT token, can be a JWT token if outside worker, or an OpenAI token if inside worker. + +#### Returns + +[`AgentRuntime`](AgentRuntime.md) + +#### Defined in + +[core/src/core/runtime.ts:188](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L188) + +## Properties + +### actions + +> **actions**: [`Action`](../interfaces/Action.md)[] = `[]` + +Custom actions that the agent can perform. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`actions`](../interfaces/IAgentRuntime.md#actions) + +#### Defined in + +[core/src/core/runtime.ts:91](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L91) + +--- + +### agentId + +> **agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The ID of the agent + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`agentId`](../interfaces/IAgentRuntime.md#agentid) + +#### Defined in + +[core/src/core/runtime.ts:72](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L72) + +--- + +### browserService + +> **browserService**: [`IBrowserService`](../interfaces/IBrowserService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`browserService`](../interfaces/IAgentRuntime.md#browserservice) + +#### Defined in + +[core/src/core/runtime.ts:125](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L125) + +--- + +### character + +> **character**: [`Character`](../type-aliases/Character.md) + +The character to use for the agent + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`character`](../interfaces/IAgentRuntime.md#character) + +#### Defined in + +[core/src/core/runtime.ts:140](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L140) + +--- + +### databaseAdapter + +> **databaseAdapter**: [`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md) + +The database adapter used for interacting with the database. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`databaseAdapter`](../interfaces/IAgentRuntime.md#databaseadapter) + +#### Defined in + +[core/src/core/runtime.ts:81](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L81) + +--- + +### descriptionManager + +> **descriptionManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) + +Store and recall descriptions of users based on conversations. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`descriptionManager`](../interfaces/IAgentRuntime.md#descriptionmanager) + +#### Defined in + +[core/src/core/runtime.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L150) + +--- + +### documentsManager + +> **documentsManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) + +Hold large documents that can be referenced + +#### Defined in + +[core/src/core/runtime.ts:165](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L165) + +--- + +### evaluators + +> **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] = `[]` + +Evaluators used to assess and guide the agent's responses. + +#### Defined in + +[core/src/core/runtime.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L96) + +--- + +### factManager + +> **factManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) + +Manage the fact and recall of facts. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`factManager`](../interfaces/IAgentRuntime.md#factmanager) + +#### Defined in + +[core/src/core/runtime.ts:155](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L155) + +--- + +### fetch() + +> **fetch**: (`input`, `init`?) => `Promise`\<`Response`\>(`input`, `init`?) => `Promise`\<`Response`\> + +Fetch function to use +Some environments may not have access to the global fetch function and need a custom fetch override. + +[MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) + +#### Parameters + +• **input**: `RequestInfo` \| `URL` + +• **init?**: `RequestInit` + +#### Returns + +`Promise`\<`Response`\> + +#### Parameters + +• **input**: `string` \| `Request` \| `URL` + +• **init?**: `RequestInit` + +#### Returns + +`Promise`\<`Response`\> + +#### Defined in + +[core/src/core/runtime.ts:135](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L135) + +--- + +### fragmentsManager + +> **fragmentsManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) + +Searchable document fragments + +#### Defined in + +[core/src/core/runtime.ts:170](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L170) + +--- + +### imageDescriptionService + +> **imageDescriptionService**: [`IImageRecognitionService`](../interfaces/IImageRecognitionService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`imageDescriptionService`](../interfaces/IAgentRuntime.md#imagedescriptionservice) + +#### Defined in + +[core/src/core/runtime.ts:123](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L123) + +--- + +### imageGenModel + +> **imageGenModel**: [`ImageGenModel`](../enumerations/ImageGenModel.md) = `ImageGenModel.TogetherAI` + +The model to use for image generation. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`imageGenModel`](../interfaces/IAgentRuntime.md#imagegenmodel) + +#### Defined in + +[core/src/core/runtime.ts:111](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L111) + +--- + +### llamaService + +> **llamaService**: `LlamaService` = `null` + +Local Llama if no OpenAI key is present + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`llamaService`](../interfaces/IAgentRuntime.md#llamaservice) + +#### Defined in + +[core/src/core/runtime.ts:116](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L116) + +--- + +### loreManager + +> **loreManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) + +Manage the creation and recall of static information (documents, historical game lore, etc) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`loreManager`](../interfaces/IAgentRuntime.md#loremanager) + +#### Defined in + +[core/src/core/runtime.ts:160](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L160) + +--- + +### messageManager + +> **messageManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) + +Store messages that are sent and received by the agent. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`messageManager`](../interfaces/IAgentRuntime.md#messagemanager) + +#### Defined in + +[core/src/core/runtime.ts:145](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L145) + +--- + +### modelProvider + +> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) = `ModelProvider.LLAMALOCAL` + +The model to use for generateText. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`modelProvider`](../interfaces/IAgentRuntime.md#modelprovider) + +#### Defined in + +[core/src/core/runtime.ts:106](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L106) + +--- + +### pdfService + +> **pdfService**: [`IPdfService`](../interfaces/IPdfService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`pdfService`](../interfaces/IAgentRuntime.md#pdfservice) + +#### Defined in + +[core/src/core/runtime.ts:129](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L129) + +--- + +### providers + +> **providers**: [`Provider`](../interfaces/Provider.md)[] = `[]` + +Context providers used to provide context for message generation. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`providers`](../interfaces/IAgentRuntime.md#providers) + +#### Defined in + +[core/src/core/runtime.ts:101](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L101) + +--- + +### serverUrl + +> **serverUrl**: `string` = `"http://localhost:7998"` + +The base URL of the server where the agent's requests are processed. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`serverUrl`](../interfaces/IAgentRuntime.md#serverurl) + +#### Defined in + +[core/src/core/runtime.ts:76](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L76) + +--- + +### speechService + +> **speechService**: [`ISpeechService`](../interfaces/ISpeechService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`speechService`](../interfaces/IAgentRuntime.md#speechservice) + +#### Defined in + +[core/src/core/runtime.ts:119](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L119) + +--- + +### token + +> **token**: `string` + +Authentication token used for securing requests. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`token`](../interfaces/IAgentRuntime.md#token) + +#### Defined in + +[core/src/core/runtime.ts:86](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L86) + +--- + +### transcriptionService + +> **transcriptionService**: [`ITranscriptionService`](../interfaces/ITranscriptionService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`transcriptionService`](../interfaces/IAgentRuntime.md#transcriptionservice) + +#### Defined in + +[core/src/core/runtime.ts:121](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L121) + +--- + +### videoService + +> **videoService**: [`IVideoService`](../interfaces/IVideoService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`videoService`](../interfaces/IAgentRuntime.md#videoservice) + +#### Defined in + +[core/src/core/runtime.ts:127](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L127) + +## Methods + +### composeState() + +> **composeState**(`message`, `additionalKeys`): `Promise`\<[`State`](../interfaces/State.md)\> + +Compose the state of the agent into an object that can be passed or used for response generation. + +#### Parameters + +• **message**: [`Memory`](../interfaces/Memory.md) + +The message to compose the state from. + +• **additionalKeys** = `{}` + +#### Returns + +`Promise`\<[`State`](../interfaces/State.md)\> + +The state of the agent. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`composeState`](../interfaces/IAgentRuntime.md#composestate) + +#### Defined in + +[core/src/core/runtime.ts:673](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L673) + +--- + +### ensureConnection() + +> **ensureConnection**(`userId`, `roomId`, `userName`?, `userScreenName`?, `source`?): `Promise`\<`void`\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userName?**: `string` + +• **userScreenName?**: `string` + +• **source?**: `string` + +#### Returns + +`Promise`\<`void`\> + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`ensureConnection`](../interfaces/IAgentRuntime.md#ensureconnection) + +#### Defined in + +[core/src/core/runtime.ts:624](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L624) + +--- + +### ensureParticipantExists() + +> **ensureParticipantExists**(`userId`, `roomId`): `Promise`\<`void`\> + +Ensure the existence of a participant in the room. If the participant does not exist, they are added to the room. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The user ID to ensure the existence of. + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Throws + +An error if the participant cannot be added. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`ensureParticipantExists`](../interfaces/IAgentRuntime.md#ensureparticipantexists) + +#### Defined in + +[core/src/core/runtime.ts:577](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L577) + +--- + +### ensureParticipantInRoom() + +> **ensureParticipantInRoom**(`userId`, `roomId`): `Promise`\<`void`\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`ensureParticipantInRoom`](../interfaces/IAgentRuntime.md#ensureparticipantinroom) + +#### Defined in + +[core/src/core/runtime.ts:613](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L613) + +--- + +### ensureRoomExists() + +> **ensureRoomExists**(`roomId`): `Promise`\<`void`\> + +Ensure the existence of a room between the agent and a user. If no room exists, a new room is created and the user +and agent are added as participants. The room ID is returned. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +The room ID of the room between the agent and the user. + +#### Throws + +An error if the room cannot be created. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`ensureRoomExists`](../interfaces/IAgentRuntime.md#ensureroomexists) + +#### Defined in + +[core/src/core/runtime.ts:660](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L660) + +--- + +### ensureUserExists() + +> **ensureUserExists**(`userId`, `userName`, `name`, `email`?, `source`?): `Promise`\<`void`\> + +Ensure the existence of a user in the database. If the user does not exist, they are added to the database. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The user ID to ensure the existence of. + +• **userName**: `string` + +The user name to ensure the existence of. + +• **name**: `string` + +• **email?**: `string` + +• **source?**: `string` + +#### Returns + +`Promise`\<`void`\> + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`ensureUserExists`](../interfaces/IAgentRuntime.md#ensureuserexists) + +#### Defined in + +[core/src/core/runtime.ts:593](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L593) + +--- + +### evaluate() + +> **evaluate**(`message`, `state`?): `Promise`\<`string`[]\> + +Evaluate the message and state using the registered evaluators. + +#### Parameters + +• **message**: [`Memory`](../interfaces/Memory.md) + +The message to evaluate. + +• **state?**: [`State`](../interfaces/State.md) + +The state of the agent. + +#### Returns + +`Promise`\<`string`[]\> + +The results of the evaluation. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`evaluate`](../interfaces/IAgentRuntime.md#evaluate) + +#### Defined in + +[core/src/core/runtime.ts:511](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L511) + +--- + +### getConversationLength() + +> **getConversationLength**(): `number` + +Get the number of messages that are kept in the conversation buffer. + +#### Returns + +`number` + +The number of recent messages to be kept in memory. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`getConversationLength`](../interfaces/IAgentRuntime.md#getconversationlength) + +#### Defined in + +[core/src/core/runtime.ts:410](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L410) + +--- + +### getSetting() + +> **getSetting**(`key`): `any` + +#### Parameters + +• **key**: `string` + +#### Returns + +`any` + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`getSetting`](../interfaces/IAgentRuntime.md#getsetting) + +#### Defined in + +[core/src/core/runtime.ts:388](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L388) + +--- + +### processActions() + +> **processActions**(`message`, `responses`, `state`?, `callback`?): `Promise`\<`void`\> + +Process the actions of a message. + +#### Parameters + +• **message**: [`Memory`](../interfaces/Memory.md) + +The message to process. + +• **responses**: [`Memory`](../interfaces/Memory.md)[] + +• **state?**: [`State`](../interfaces/State.md) + +• **callback?**: [`HandlerCallback`](../type-aliases/HandlerCallback.md) + +#### Returns + +`Promise`\<`void`\> + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`processActions`](../interfaces/IAgentRuntime.md#processactions) + +#### Defined in + +[core/src/core/runtime.ts:444](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L444) + +--- + +### registerAction() + +> **registerAction**(`action`): `void` + +Register an action for the agent to perform. + +#### Parameters + +• **action**: [`Action`](../interfaces/Action.md) + +The action to register. + +#### Returns + +`void` + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`registerAction`](../interfaces/IAgentRuntime.md#registeraction) + +#### Defined in + +[core/src/core/runtime.ts:418](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L418) + +--- + +### registerContextProvider() + +> **registerContextProvider**(`provider`): `void` + +Register a context provider to provide context for message generation. + +#### Parameters + +• **provider**: [`Provider`](../interfaces/Provider.md) + +The context provider to register. + +#### Returns + +`void` + +#### Defined in + +[core/src/core/runtime.ts:435](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L435) + +--- + +### registerEvaluator() + +> **registerEvaluator**(`evaluator`): `void` + +Register an evaluator to assess and guide the agent's responses. + +#### Parameters + +• **evaluator**: [`Evaluator`](../interfaces/Evaluator.md) + +The evaluator to register. + +#### Returns + +`void` + +#### Defined in + +[core/src/core/runtime.ts:427](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L427) + +--- + +### updateRecentMessageState() + +> **updateRecentMessageState**(`state`): `Promise`\<[`State`](../interfaces/State.md)\> + +#### Parameters + +• **state**: [`State`](../interfaces/State.md) + +#### Returns + +`Promise`\<[`State`](../interfaces/State.md)\> + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`updateRecentMessageState`](../interfaces/IAgentRuntime.md#updaterecentmessagestate) + +#### Defined in + +[core/src/core/runtime.ts:1146](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L1146) diff --git a/docs/docs/api/classes/DatabaseAdapter.md b/docs/docs/api/classes/DatabaseAdapter.md new file mode 100644 index 00000000000..a25bd0a1328 --- /dev/null +++ b/docs/docs/api/classes/DatabaseAdapter.md @@ -0,0 +1,1119 @@ +# Class: `abstract` DatabaseAdapter + +An abstract class representing a database adapter for managing various entities +like accounts, memories, actors, goals, and rooms. + +## Extended by + +- [`PostgresDatabaseAdapter`](PostgresDatabaseAdapter.md) +- [`SqliteDatabaseAdapter`](SqliteDatabaseAdapter.md) + +## Implements + +- [`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md) + +## Constructors + +### new DatabaseAdapter() + +> **new DatabaseAdapter**(): [`DatabaseAdapter`](DatabaseAdapter.md) + +#### Returns + +[`DatabaseAdapter`](DatabaseAdapter.md) + +## Properties + +### db + +> **db**: `any` + +The database instance. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`db`](../interfaces/IDatabaseAdapter.md#db) + +#### Defined in + +[core/src/core/database.ts:21](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L21) + +## Methods + +### addParticipant() + +> `abstract` **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +Adds a user as a participant to a specific room. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user to add as a participant. + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to which the user will be added. + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves to a boolean indicating success or failure. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`addParticipant`](../interfaces/IDatabaseAdapter.md#addparticipant) + +#### Defined in + +[core/src/core/database.ts:266](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L266) + +--- + +### countMemories() + +> `abstract` **countMemories**(`roomId`, `unique`?, `tableName`?): `Promise`\<`number`\> + +Counts the number of memories in a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room for which to count memories. + +• **unique?**: `boolean` + +Specifies whether to count only unique memories. + +• **tableName?**: `string` + +Optional table name to count memories from. + +#### Returns + +`Promise`\<`number`\> + +A Promise that resolves to the number of memories. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`countMemories`](../interfaces/IDatabaseAdapter.md#countmemories) + +#### Defined in + +[core/src/core/database.ts:179](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L179) + +--- + +### createAccount() + +> `abstract` **createAccount**(`account`): `Promise`\<`boolean`\> + +Creates a new account in the database. + +#### Parameters + +• **account**: [`Account`](../interfaces/Account.md) + +The account object to create. + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves when the account creation is complete. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`createAccount`](../interfaces/IDatabaseAdapter.md#createaccount) + +#### Defined in + +[core/src/core/database.ts:34](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L34) + +--- + +### createGoal() + +> `abstract` **createGoal**(`goal`): `Promise`\<`void`\> + +Creates a new goal in the database. + +#### Parameters + +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object to create. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal has been created. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`createGoal`](../interfaces/IDatabaseAdapter.md#creategoal) + +#### Defined in + +[core/src/core/database.ts:209](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L209) + +--- + +### createMemory() + +> `abstract` **createMemory**(`memory`, `tableName`, `unique`?): `Promise`\<`void`\> + +Creates a new memory in the database. + +#### Parameters + +• **memory**: [`Memory`](../interfaces/Memory.md) + +The memory object to create. + +• **tableName**: `string` + +The table where the memory should be stored. + +• **unique?**: `boolean` + +Indicates if the memory should be unique. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the memory has been created. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`createMemory`](../interfaces/IDatabaseAdapter.md#creatememory) + +#### Defined in + +[core/src/core/database.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L150) + +--- + +### createRelationship() + +> `abstract` **createRelationship**(`params`): `Promise`\<`boolean`\> + +Creates a new relationship between two users. + +#### Parameters + +• **params** + +An object containing the UUIDs of the two users (userA and userB). + +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves to a boolean indicating success or failure of the creation. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`createRelationship`](../interfaces/IDatabaseAdapter.md#createrelationship) + +#### Defined in + +[core/src/core/database.ts:312](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L312) + +--- + +### createRoom() + +> `abstract` **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +Creates a new room with an optional specified ID. + +#### Parameters + +• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +Optional UUID to assign to the new room. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +A Promise that resolves to the UUID of the created room. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`createRoom`](../interfaces/IDatabaseAdapter.md#createroom) + +#### Defined in + +[core/src/core/database.ts:237](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L237) + +--- + +### getAccountById() + +> `abstract` **getAccountById**(`userId`): `Promise`\<[`Account`](../interfaces/Account.md)\> + +Retrieves an account by its ID. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user account to retrieve. + +#### Returns + +`Promise`\<[`Account`](../interfaces/Account.md)\> + +A Promise that resolves to the Account object or null if not found. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getAccountById`](../interfaces/IDatabaseAdapter.md#getaccountbyid) + +#### Defined in + +[core/src/core/database.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L27) + +--- + +### getActorDetails() + +> `abstract` **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +Retrieves details of actors in a given room. + +#### Parameters + +• **params** + +An object containing the roomId to search for actors. + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +A Promise that resolves to an array of Actor objects. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getActorDetails`](../interfaces/IDatabaseAdapter.md#getactordetails) + +#### Defined in + +[core/src/core/database.ts:99](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L99) + +--- + +### getCachedEmbeddings() + +> `abstract` **getCachedEmbeddings**(`params`): `Promise`\<`object`[]\> + +Retrieves cached embeddings based on the specified query parameters. + +#### Parameters + +• **params** + +An object containing parameters for the embedding retrieval. + +• **params.query_field_name**: `string` + +• **params.query_field_sub_name**: `string` + +• **params.query_input**: `string` + +• **params.query_match_count**: `number` + +• **params.query_table_name**: `string` + +• **params.query_threshold**: `number` + +#### Returns + +`Promise`\<`object`[]\> + +A Promise that resolves to an array of objects containing embeddings and levenshtein scores. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getCachedEmbeddings`](../interfaces/IDatabaseAdapter.md#getcachedembeddings) + +#### Defined in + +[core/src/core/database.ts:61](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L61) + +--- + +### getGoals() + +> `abstract` **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +Retrieves goals based on specified parameters. + +#### Parameters + +• **params** + +An object containing parameters for goal retrieval. + +• **params.count?**: `number` + +• **params.onlyInProgress?**: `boolean` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +A Promise that resolves to an array of Goal objects. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getGoals`](../interfaces/IDatabaseAdapter.md#getgoals) + +#### Defined in + +[core/src/core/database.ts:190](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L190) + +--- + +### getMemories() + +> `abstract` **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Retrieves memories based on the specified parameters. + +#### Parameters + +• **params** + +An object containing parameters for the memory retrieval. + +• **params.count?**: `number` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.tableName**: `string` + +• **params.unique?**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise that resolves to an array of Memory objects. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getMemories`](../interfaces/IDatabaseAdapter.md#getmemories) + +#### Defined in + +[core/src/core/database.ts:41](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L41) + +--- + +### getMemoriesByRoomIds() + +> `abstract` **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +#### Parameters + +• **params** + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +• **params.tableName**: `string` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getMemoriesByRoomIds`](../interfaces/IDatabaseAdapter.md#getmemoriesbyroomids) + +#### Defined in + +[core/src/core/database.ts:48](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L48) + +--- + +### getMemoryById() + +> `abstract` **getMemoryById**(`id`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> + +#### Parameters + +• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)\> + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getMemoryById`](../interfaces/IDatabaseAdapter.md#getmemorybyid) + +#### Defined in + +[core/src/core/database.ts:54](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L54) + +--- + +### getParticipantsForAccount() + +#### getParticipantsForAccount(userId) + +> `abstract` **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> + +Retrieves participants associated with a specific account. + +##### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the account. + +##### Returns + +`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> + +A Promise that resolves to an array of Participant objects. + +##### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getParticipantsForAccount`](../interfaces/IDatabaseAdapter.md#getparticipantsforaccount) + +##### Defined in + +[core/src/core/database.ts:281](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L281) + +#### getParticipantsForAccount(userId) + +> `abstract` **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> + +Retrieves participants associated with a specific account. + +##### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the account. + +##### Returns + +`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> + +A Promise that resolves to an array of Participant objects. + +##### Implementation of + +`IDatabaseAdapter.getParticipantsForAccount` + +##### Defined in + +[core/src/core/database.ts:288](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L288) + +--- + +### getParticipantsForRoom() + +> `abstract` **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves participants for a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room for which to retrieve participants. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +A Promise that resolves to an array of UUIDs representing the participants. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getParticipantsForRoom`](../interfaces/IDatabaseAdapter.md#getparticipantsforroom) + +#### Defined in + +[core/src/core/database.ts:295](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L295) + +--- + +### getParticipantUserState() + +> `abstract` **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getParticipantUserState`](../interfaces/IDatabaseAdapter.md#getparticipantuserstate) + +#### Defined in + +[core/src/core/database.ts:297](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L297) + +--- + +### getRelationship() + +> `abstract` **getRelationship**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> + +Retrieves a relationship between two users if it exists. + +#### Parameters + +• **params** + +An object containing the UUIDs of the two users (userA and userB). + +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Relationship`](../interfaces/Relationship.md)\> + +A Promise that resolves to the Relationship object or null if not found. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getRelationship`](../interfaces/IDatabaseAdapter.md#getrelationship) + +#### Defined in + +[core/src/core/database.ts:322](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L322) + +--- + +### getRelationships() + +> `abstract` **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> + +Retrieves all relationships for a specific user. + +#### Parameters + +• **params** + +An object containing the UUID of the user. + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> + +A Promise that resolves to an array of Relationship objects. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getRelationships`](../interfaces/IDatabaseAdapter.md#getrelationships) + +#### Defined in + +[core/src/core/database.ts:332](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L332) + +--- + +### getRoom() + +> `abstract` **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +Retrieves the room ID for a given room, if it exists. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to retrieve. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +A Promise that resolves to the room ID or null if not found. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getRoom`](../interfaces/IDatabaseAdapter.md#getroom) + +#### Defined in + +[core/src/core/database.ts:230](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L230) + +--- + +### getRoomsForParticipant() + +> `abstract` **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves room IDs for which a specific user is a participant. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +A Promise that resolves to an array of room IDs. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getRoomsForParticipant`](../interfaces/IDatabaseAdapter.md#getroomsforparticipant) + +#### Defined in + +[core/src/core/database.ts:251](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L251) + +--- + +### getRoomsForParticipants() + +> `abstract` **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves room IDs for which specific users are participants. + +#### Parameters + +• **userIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +An array of UUIDs of the users. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +A Promise that resolves to an array of room IDs. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getRoomsForParticipants`](../interfaces/IDatabaseAdapter.md#getroomsforparticipants) + +#### Defined in + +[core/src/core/database.ts:258](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L258) + +--- + +### log() + +> `abstract` **log**(`params`): `Promise`\<`void`\> + +Logs an event or action with the specified details. + +#### Parameters + +• **params** + +An object containing parameters for the log entry. + +• **params.body** + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.type**: `string` + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the log entry has been saved. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`log`](../interfaces/IDatabaseAdapter.md#log) + +#### Defined in + +[core/src/core/database.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L87) + +--- + +### removeAllGoals() + +> `abstract` **removeAllGoals**(`roomId`): `Promise`\<`void`\> + +Removes all goals associated with a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room whose goals should be removed. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when all goals have been removed. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeAllGoals`](../interfaces/IDatabaseAdapter.md#removeallgoals) + +#### Defined in + +[core/src/core/database.ts:223](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L223) + +--- + +### removeAllMemories() + +> `abstract` **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> + +Removes all memories associated with a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room whose memories should be removed. + +• **tableName**: `string` + +The table from which the memories should be removed. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when all memories have been removed. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeAllMemories`](../interfaces/IDatabaseAdapter.md#removeallmemories) + +#### Defined in + +[core/src/core/database.ts:170](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L170) + +--- + +### removeGoal() + +> `abstract` **removeGoal**(`goalId`): `Promise`\<`void`\> + +Removes a specific goal from the database. + +#### Parameters + +• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the goal to remove. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal has been removed. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeGoal`](../interfaces/IDatabaseAdapter.md#removegoal) + +#### Defined in + +[core/src/core/database.ts:216](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L216) + +--- + +### removeMemory() + +> `abstract` **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> + +Removes a specific memory from the database. + +#### Parameters + +• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the memory to remove. + +• **tableName**: `string` + +The table from which the memory should be removed. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the memory has been removed. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeMemory`](../interfaces/IDatabaseAdapter.md#removememory) + +#### Defined in + +[core/src/core/database.ts:162](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L162) + +--- + +### removeParticipant() + +> `abstract` **removeParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +Removes a user as a participant from a specific room. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user to remove as a participant. + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room from which the user will be removed. + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves to a boolean indicating success or failure. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeParticipant`](../interfaces/IDatabaseAdapter.md#removeparticipant) + +#### Defined in + +[core/src/core/database.ts:274](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L274) + +--- + +### removeRoom() + +> `abstract` **removeRoom**(`roomId`): `Promise`\<`void`\> + +Removes a specific room from the database. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to remove. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the room has been removed. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeRoom`](../interfaces/IDatabaseAdapter.md#removeroom) + +#### Defined in + +[core/src/core/database.ts:244](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L244) + +--- + +### searchMemories() + +> `abstract` **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories based on embeddings and other specified parameters. + +#### Parameters + +• **params** + +An object containing parameters for the memory search. + +• **params.embedding**: `number`[] + +• **params.match_count**: `number` + +• **params.match_threshold**: `number` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.tableName**: `string` + +• **params.unique**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise that resolves to an array of Memory objects. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`searchMemories`](../interfaces/IDatabaseAdapter.md#searchmemories) + +#### Defined in + +[core/src/core/database.ts:106](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L106) + +--- + +### searchMemoriesByEmbedding() + +> `abstract` **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories by embedding and other specified parameters. + +#### Parameters + +• **embedding**: `number`[] + +The embedding vector to search with. + +• **params** + +Additional parameters for the search. + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.count?**: `number` + +• **params.match_threshold?**: `number` + +• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.tableName**: `string` + +• **params.unique?**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise that resolves to an array of Memory objects. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`searchMemoriesByEmbedding`](../interfaces/IDatabaseAdapter.md#searchmemoriesbyembedding) + +#### Defined in + +[core/src/core/database.ts:131](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L131) + +--- + +### setParticipantUserState() + +> `abstract` **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **state**: `"FOLLOWED"` \| `"MUTED"` + +#### Returns + +`Promise`\<`void`\> + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`setParticipantUserState`](../interfaces/IDatabaseAdapter.md#setparticipantuserstate) + +#### Defined in + +[core/src/core/database.ts:301](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L301) + +--- + +### updateGoal() + +> `abstract` **updateGoal**(`goal`): `Promise`\<`void`\> + +Updates a specific goal in the database. + +#### Parameters + +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object with updated properties. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal has been updated. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`updateGoal`](../interfaces/IDatabaseAdapter.md#updategoal) + +#### Defined in + +[core/src/core/database.ts:202](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L202) + +--- + +### updateGoalStatus() + +> `abstract` **updateGoalStatus**(`params`): `Promise`\<`void`\> + +Updates the status of a specific goal. + +#### Parameters + +• **params** + +An object containing the goalId and the new status. + +• **params.goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.status**: [`GoalStatus`](../enumerations/GoalStatus.md) + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal status has been updated. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`updateGoalStatus`](../interfaces/IDatabaseAdapter.md#updategoalstatus) + +#### Defined in + +[core/src/core/database.ts:120](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L120) diff --git a/docs/docs/api/classes/DirectClient.md b/docs/docs/api/classes/DirectClient.md new file mode 100644 index 00000000000..5b0662da0c9 --- /dev/null +++ b/docs/docs/api/classes/DirectClient.md @@ -0,0 +1,69 @@ +# Class: DirectClient + +## Constructors + +### new DirectClient() + +> **new DirectClient**(): [`DirectClient`](DirectClient.md) + +#### Returns + +[`DirectClient`](DirectClient.md) + +#### Defined in + +[core/src/clients/direct/index.ts:57](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L57) + +## Methods + +### registerAgent() + +> **registerAgent**(`runtime`): `void` + +#### Parameters + +• **runtime**: [`AgentRuntime`](AgentRuntime.md) + +#### Returns + +`void` + +#### Defined in + +[core/src/clients/direct/index.ts:263](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L263) + +--- + +### start() + +> **start**(`port`): `void` + +#### Parameters + +• **port**: `number` + +#### Returns + +`void` + +#### Defined in + +[core/src/clients/direct/index.ts:271](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L271) + +--- + +### unregisterAgent() + +> **unregisterAgent**(`runtime`): `void` + +#### Parameters + +• **runtime**: [`AgentRuntime`](AgentRuntime.md) + +#### Returns + +`void` + +#### Defined in + +[core/src/clients/direct/index.ts:267](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L267) diff --git a/docs/docs/api/classes/DiscordClient.md b/docs/docs/api/classes/DiscordClient.md new file mode 100644 index 00000000000..66dd101ca5c --- /dev/null +++ b/docs/docs/api/classes/DiscordClient.md @@ -0,0 +1,1502 @@ +# Class: DiscordClient + +## Extends + +- `EventEmitter` + +## Constructors + +### new DiscordClient() + +> **new DiscordClient**(`runtime`): [`DiscordClient`](DiscordClient.md) + +#### Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +#### Returns + +[`DiscordClient`](DiscordClient.md) + +#### Overrides + +`EventEmitter.constructor` + +#### Defined in + +[core/src/clients/discord/index.ts:34](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L34) + +## Properties + +### apiToken + +> **apiToken**: `string` + +#### Defined in + +[core/src/clients/discord/index.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L27) + +--- + +### character + +> **character**: [`Character`](../type-aliases/Character.md) + +#### Defined in + +[core/src/clients/discord/index.ts:30](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L30) + +--- + +### captureRejections + +> `static` **captureRejections**: `boolean` + +Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) + +Change the default `captureRejections` option on all new `EventEmitter` objects. + +#### Since + +v13.4.0, v12.16.0 + +#### Inherited from + +`EventEmitter.captureRejections` + +#### Defined in + +node_modules/@types/node/events.d.ts:459 + +--- + +### captureRejectionSymbol + +> `readonly` `static` **captureRejectionSymbol**: _typeof_ [`captureRejectionSymbol`](TwitterPostClient.md#capturerejectionsymbol) + +Value: `Symbol.for('nodejs.rejection')` + +See how to write a custom `rejection handler`. + +#### Since + +v13.4.0, v12.16.0 + +#### Inherited from + +`EventEmitter.captureRejectionSymbol` + +#### Defined in + +node_modules/@types/node/events.d.ts:452 + +--- + +### defaultMaxListeners + +> `static` **defaultMaxListeners**: `number` + +By default, a maximum of `10` listeners can be registered for any single +event. This limit can be changed for individual `EventEmitter` instances +using the `emitter.setMaxListeners(n)` method. To change the default +for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property +can be used. If this value is not a positive number, a `RangeError` is thrown. + +Take caution when setting the `events.defaultMaxListeners` because the +change affects _all_ `EventEmitter` instances, including those created before +the change is made. However, calling `emitter.setMaxListeners(n)` still has +precedence over `events.defaultMaxListeners`. + +This is not a hard limit. The `EventEmitter` instance will allow +more listeners to be added but will output a trace warning to stderr indicating +that a "possible EventEmitter memory leak" has been detected. For any single +`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to +temporarily avoid this warning: + +```js +import { EventEmitter } from "node:events"; +const emitter = new EventEmitter(); +emitter.setMaxListeners(emitter.getMaxListeners() + 1); +emitter.once("event", () => { + // do stuff + emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); +}); +``` + +The `--trace-warnings` command-line flag can be used to display the +stack trace for such warnings. + +The emitted warning can be inspected with `process.on('warning')` and will +have the additional `emitter`, `type`, and `count` properties, referring to +the event emitter instance, the event's name and the number of attached +listeners, respectively. +Its `name` property is set to `'MaxListenersExceededWarning'`. + +#### Since + +v0.11.2 + +#### Inherited from + +`EventEmitter.defaultMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:498 + +--- + +### errorMonitor + +> `readonly` `static` **errorMonitor**: _typeof_ [`errorMonitor`](TwitterPostClient.md#errormonitor) + +This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. + +Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no +regular `'error'` listener is installed. + +#### Since + +v13.6.0, v12.17.0 + +#### Inherited from + +`EventEmitter.errorMonitor` + +#### Defined in + +node_modules/@types/node/events.d.ts:445 + +## Methods + +### \[captureRejectionSymbol\]()? + +> `optional` **\[captureRejectionSymbol\]**\<`K`\>(`error`, `event`, ...`args`): `void` + +#### Type Parameters + +• **K** + +#### Parameters + +• **error**: `Error` + +• **event**: `string` \| `symbol` + +• ...**args**: `AnyRest` + +#### Returns + +`void` + +#### Inherited from + +`EventEmitter.[captureRejectionSymbol]` + +#### Defined in + +node_modules/@types/node/events.d.ts:136 + +--- + +### addListener() + +> **addListener**\<`K`\>(`eventName`, `listener`): `this` + +Alias for `emitter.on(eventName, listener)`. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`EventEmitter.addListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:597 + +--- + +### emit() + +> **emit**\<`K`\>(`eventName`, ...`args`): `boolean` + +Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments +to each. + +Returns `true` if the event had listeners, `false` otherwise. + +```js +import { EventEmitter } from "node:events"; +const myEmitter = new EventEmitter(); + +// First listener +myEmitter.on("event", function firstListener() { + console.log("Helloooo! first listener"); +}); +// Second listener +myEmitter.on("event", function secondListener(arg1, arg2) { + console.log(`event with parameters ${arg1}, ${arg2} in second listener`); +}); +// Third listener +myEmitter.on("event", function thirdListener(...args) { + const parameters = args.join(", "); + console.log(`event with parameters ${parameters} in third listener`); +}); + +console.log(myEmitter.listeners("event")); + +myEmitter.emit("event", 1, 2, 3, 4, 5); + +// Prints: +// [ +// [Function: firstListener], +// [Function: secondListener], +// [Function: thirdListener] +// ] +// Helloooo! first listener +// event with parameters 1, 2 in second listener +// event with parameters 1, 2, 3, 4, 5 in third listener +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• ...**args**: `AnyRest` + +#### Returns + +`boolean` + +#### Since + +v0.1.26 + +#### Inherited from + +`EventEmitter.emit` + +#### Defined in + +node_modules/@types/node/events.d.ts:859 + +--- + +### eventNames() + +> **eventNames**(): (`string` \| `symbol`)[] + +Returns an array listing the events for which the emitter has registered +listeners. The values in the array are strings or `Symbol`s. + +```js +import { EventEmitter } from "node:events"; + +const myEE = new EventEmitter(); +myEE.on("foo", () => {}); +myEE.on("bar", () => {}); + +const sym = Symbol("symbol"); +myEE.on(sym, () => {}); + +console.log(myEE.eventNames()); +// Prints: [ 'foo', 'bar', Symbol(symbol) ] +``` + +#### Returns + +(`string` \| `symbol`)[] + +#### Since + +v6.0.0 + +#### Inherited from + +`EventEmitter.eventNames` + +#### Defined in + +node_modules/@types/node/events.d.ts:922 + +--- + +### getMaxListeners() + +> **getMaxListeners**(): `number` + +Returns the current max listener value for the `EventEmitter` which is either +set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](DiscordClient.md#defaultmaxlisteners). + +#### Returns + +`number` + +#### Since + +v1.0.0 + +#### Inherited from + +`EventEmitter.getMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:774 + +--- + +### handleReactionAdd() + +> **handleReactionAdd**(`reaction`, `user`): `Promise`\<`void`\> + +#### Parameters + +• **reaction**: `MessageReaction` + +• **user**: `User` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/clients/discord/index.ts:121](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L121) + +--- + +### handleReactionRemove() + +> **handleReactionRemove**(`reaction`, `user`): `Promise`\<`void`\> + +#### Parameters + +• **reaction**: `MessageReaction` + +• **user**: `User` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/clients/discord/index.ts:195](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L195) + +--- + +### listenerCount() + +> **listenerCount**\<`K`\>(`eventName`, `listener`?): `number` + +Returns the number of listeners listening for the event named `eventName`. +If `listener` is provided, it will return how many times the listener is found +in the list of the listeners of the event. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event being listened for + +• **listener?**: `Function` + +The event handler function + +#### Returns + +`number` + +#### Since + +v3.2.0 + +#### Inherited from + +`EventEmitter.listenerCount` + +#### Defined in + +node_modules/@types/node/events.d.ts:868 + +--- + +### listeners() + +> **listeners**\<`K`\>(`eventName`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`. + +```js +server.on("connection", (stream) => { + console.log("someone connected!"); +}); +console.log(util.inspect(server.listeners("connection"))); +// Prints: [ [Function] ] +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v0.1.26 + +#### Inherited from + +`EventEmitter.listeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:787 + +--- + +### off() + +> **off**\<`K`\>(`eventName`, `listener`): `this` + +Alias for `emitter.removeListener()`. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v10.0.0 + +#### Inherited from + +`EventEmitter.off` + +#### Defined in + +node_modules/@types/node/events.d.ts:747 + +--- + +### on() + +> **on**\<`K`\>(`eventName`, `listener`): `this` + +Adds the `listener` function to the end of the listeners array for the event +named `eventName`. No checks are made to see if the `listener` has already +been added. Multiple calls passing the same combination of `eventName` and +`listener` will result in the `listener` being added, and called, multiple times. + +```js +server.on("connection", (stream) => { + console.log("someone connected!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the +event listener to the beginning of the listeners array. + +```js +import { EventEmitter } from "node:events"; +const myEE = new EventEmitter(); +myEE.on("foo", () => console.log("a")); +myEE.prependListener("foo", () => console.log("b")); +myEE.emit("foo"); +// Prints: +// b +// a +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v0.1.101 + +#### Inherited from + +`EventEmitter.on` + +#### Defined in + +node_modules/@types/node/events.d.ts:629 + +--- + +### once() + +> **once**\<`K`\>(`eventName`, `listener`): `this` + +Adds a **one-time** `listener` function for the event named `eventName`. The +next time `eventName` is triggered, this listener is removed and then invoked. + +```js +server.once("connection", (stream) => { + console.log("Ah, we have our first user!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the +event listener to the beginning of the listeners array. + +```js +import { EventEmitter } from "node:events"; +const myEE = new EventEmitter(); +myEE.once("foo", () => console.log("a")); +myEE.prependOnceListener("foo", () => console.log("b")); +myEE.emit("foo"); +// Prints: +// b +// a +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v0.3.0 + +#### Inherited from + +`EventEmitter.once` + +#### Defined in + +node_modules/@types/node/events.d.ts:659 + +--- + +### prependListener() + +> **prependListener**\<`K`\>(`eventName`, `listener`): `this` + +Adds the `listener` function to the _beginning_ of the listeners array for the +event named `eventName`. No checks are made to see if the `listener` has +already been added. Multiple calls passing the same combination of `eventName` +and `listener` will result in the `listener` being added, and called, multiple times. + +```js +server.prependListener("connection", (stream) => { + console.log("someone connected!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v6.0.0 + +#### Inherited from + +`EventEmitter.prependListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:886 + +--- + +### prependOnceListener() + +> **prependOnceListener**\<`K`\>(`eventName`, `listener`): `this` + +Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this +listener is removed, and then invoked. + +```js +server.prependOnceListener("connection", (stream) => { + console.log("Ah, we have our first user!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v6.0.0 + +#### Inherited from + +`EventEmitter.prependOnceListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:902 + +--- + +### rawListeners() + +> **rawListeners**\<`K`\>(`eventName`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`, +including any wrappers (such as those created by `.once()`). + +```js +import { EventEmitter } from "node:events"; +const emitter = new EventEmitter(); +emitter.once("log", () => console.log("log once")); + +// Returns a new Array with a function `onceWrapper` which has a property +// `listener` which contains the original listener bound above +const listeners = emitter.rawListeners("log"); +const logFnWrapper = listeners[0]; + +// Logs "log once" to the console and does not unbind the `once` event +logFnWrapper.listener(); + +// Logs "log once" to the console and removes the listener +logFnWrapper(); + +emitter.on("log", () => console.log("log persistently")); +// Will return a new Array with a single function bound by `.on()` above +const newListeners = emitter.rawListeners("log"); + +// Logs "log persistently" twice +newListeners[0](); +emitter.emit("log"); +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v9.4.0 + +#### Inherited from + +`EventEmitter.rawListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:818 + +--- + +### removeAllListeners() + +> **removeAllListeners**(`eventName`?): `this` + +Removes all listeners, or those of the specified `eventName`. + +It is bad practice to remove listeners added elsewhere in the code, +particularly when the `EventEmitter` instance was created by some other +component or module (e.g. sockets or file streams). + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Parameters + +• **eventName?**: `string` \| `symbol` + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`EventEmitter.removeAllListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:758 + +--- + +### removeListener() + +> **removeListener**\<`K`\>(`eventName`, `listener`): `this` + +Removes the specified `listener` from the listener array for the event named `eventName`. + +```js +const callback = (stream) => { + console.log("someone connected!"); +}; +server.on("connection", callback); +// ... +server.removeListener("connection", callback); +``` + +`removeListener()` will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified `eventName`, then `removeListener()` must be +called multiple times to remove each instance. + +Once an event is emitted, all listeners attached to it at the +time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution +will not remove them from`emit()` in progress. Subsequent events behave as expected. + +```js +import { EventEmitter } from "node:events"; +class MyEmitter extends EventEmitter {} +const myEmitter = new MyEmitter(); + +const callbackA = () => { + console.log("A"); + myEmitter.removeListener("event", callbackB); +}; + +const callbackB = () => { + console.log("B"); +}; + +myEmitter.on("event", callbackA); + +myEmitter.on("event", callbackB); + +// callbackA removes listener callbackB but it will still be called. +// Internal listener array at time of emit [callbackA, callbackB] +myEmitter.emit("event"); +// Prints: +// A +// B + +// callbackB is now removed. +// Internal listener array [callbackA] +myEmitter.emit("event"); +// Prints: +// A +``` + +Because listeners are managed using an internal array, calling this will +change the position indices of any listener registered _after_ the listener +being removed. This will not impact the order in which listeners are called, +but it means that any copies of the listener array as returned by +the `emitter.listeners()` method will need to be recreated. + +When a single function has been added as a handler multiple times for a single +event (as in the example below), `removeListener()` will remove the most +recently added instance. In the example the `once('ping')` listener is removed: + +```js +import { EventEmitter } from "node:events"; +const ee = new EventEmitter(); + +function pong() { + console.log("pong"); +} + +ee.on("ping", pong); +ee.once("ping", pong); +ee.removeListener("ping", pong); + +ee.emit("ping"); +ee.emit("ping"); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`EventEmitter.removeListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:742 + +--- + +### setMaxListeners() + +> **setMaxListeners**(`n`): `this` + +By default `EventEmitter`s will print a warning if more than `10` listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. The `emitter.setMaxListeners()` method allows the limit to be +modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Parameters + +• **n**: `number` + +#### Returns + +`this` + +#### Since + +v0.3.5 + +#### Inherited from + +`EventEmitter.setMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:768 + +--- + +### addAbortListener() + +> `static` **addAbortListener**(`signal`, `resource`): `Disposable` + +**`Experimental`** + +Listens once to the `abort` event on the provided `signal`. + +Listening to the `abort` event on abort signals is unsafe and may +lead to resource leaks since another third party with the signal can +call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change +this since it would violate the web standard. Additionally, the original +API makes it easy to forget to remove listeners. + +This API allows safely using `AbortSignal`s in Node.js APIs by solving these +two issues by listening to the event such that `stopImmediatePropagation` does +not prevent the listener from running. + +Returns a disposable so that it may be unsubscribed from more easily. + +```js +import { addAbortListener } from "node:events"; + +function example(signal) { + let disposable; + try { + signal.addEventListener("abort", (e) => e.stopImmediatePropagation()); + disposable = addAbortListener(signal, (e) => { + // Do something when signal is aborted. + }); + } finally { + disposable?.[Symbol.dispose](); + } +} +``` + +#### Parameters + +• **signal**: `AbortSignal` + +• **resource** + +#### Returns + +`Disposable` + +Disposable that removes the `abort` listener. + +#### Since + +v20.5.0 + +#### Inherited from + +`EventEmitter.addAbortListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:437 + +--- + +### getEventListeners() + +> `static` **getEventListeners**(`emitter`, `name`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`. + +For `EventEmitter`s this behaves exactly the same as calling `.listeners` on +the emitter. + +For `EventTarget`s this is the only way to get the event listeners for the +event target. This is useful for debugging and diagnostic purposes. + +```js +import { getEventListeners, EventEmitter } from "node:events"; + +{ + const ee = new EventEmitter(); + const listener = () => console.log("Events are fun"); + ee.on("foo", listener); + console.log(getEventListeners(ee, "foo")); // [ [Function: listener] ] +} +{ + const et = new EventTarget(); + const listener = () => console.log("Events are fun"); + et.addEventListener("foo", listener); + console.log(getEventListeners(et, "foo")); // [ [Function: listener] ] +} +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` + +• **name**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v15.2.0, v14.17.0 + +#### Inherited from + +`EventEmitter.getEventListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:358 + +--- + +### getMaxListeners() + +> `static` **getMaxListeners**(`emitter`): `number` + +Returns the currently set max amount of listeners. + +For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on +the emitter. + +For `EventTarget`s this is the only way to get the max event listeners for the +event target. If the number of event handlers on a single EventTarget exceeds +the max set, the EventTarget will print a warning. + +```js +import { getMaxListeners, setMaxListeners, EventEmitter } from "node:events"; + +{ + const ee = new EventEmitter(); + console.log(getMaxListeners(ee)); // 10 + setMaxListeners(11, ee); + console.log(getMaxListeners(ee)); // 11 +} +{ + const et = new EventTarget(); + console.log(getMaxListeners(et)); // 10 + setMaxListeners(11, et); + console.log(getMaxListeners(et)); // 11 +} +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` + +#### Returns + +`number` + +#### Since + +v19.9.0 + +#### Inherited from + +`EventEmitter.getMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:387 + +--- + +### ~~listenerCount()~~ + +> `static` **listenerCount**(`emitter`, `eventName`): `number` + +A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. + +```js +import { EventEmitter, listenerCount } from "node:events"; + +const myEmitter = new EventEmitter(); +myEmitter.on("event", () => {}); +myEmitter.on("event", () => {}); +console.log(listenerCount(myEmitter, "event")); +// Prints: 2 +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +The emitter to query + +• **eventName**: `string` \| `symbol` + +The event name + +#### Returns + +`number` + +#### Since + +v0.9.12 + +#### Deprecated + +Since v3.2.0 - Use `listenerCount` instead. + +#### Inherited from + +`EventEmitter.listenerCount` + +#### Defined in + +node_modules/@types/node/events.d.ts:330 + +--- + +### on() + +#### on(emitter, eventName, options) + +> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +// Emit later on +process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); +}); + +for await (const event of on(ee, "foo")) { + // The execution of this inner block is synchronous and it + // processes one event at a time (even with await). Do not use + // if concurrent execution is required. + console.log(event); // prints ['bar'] [42] +} +// Unreachable here +``` + +Returns an `AsyncIterator` that iterates `eventName` events. It will throw +if the `EventEmitter` emits `'error'`. It removes all listeners when +exiting the loop. The `value` returned by each iteration is an array +composed of the emitted event arguments. + +An `AbortSignal` can be used to cancel waiting on events: + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ac = new AbortController(); + +(async () => { + const ee = new EventEmitter(); + + // Emit later on + process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); + }); + + for await (const event of on(ee, "foo", { signal: ac.signal })) { + // The execution of this inner block is synchronous and it + // processes one event at a time (even with await). Do not use + // if concurrent execution is required. + console.log(event); // prints ['bar'] [42] + } + // Unreachable here +})(); + +process.nextTick(() => ac.abort()); +``` + +Use the `close` option to specify an array of event names that will end the iteration: + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +// Emit later on +process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); + ee.emit("close"); +}); + +for await (const event of on(ee, "foo", { close: ["close"] })) { + console.log(event); // prints ['bar'] [42] +} +// the loop will exit after 'close' is emitted +console.log("done"); // prints 'done' +``` + +##### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +• **eventName**: `string` \| `symbol` + +• **options?**: `StaticEventEmitterIteratorOptions` + +##### Returns + +`AsyncIterator`\<`any`[], `any`, `any`\> + +An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` + +##### Since + +v13.6.0, v12.16.0 + +##### Inherited from + +`EventEmitter.on` + +##### Defined in + +node_modules/@types/node/events.d.ts:303 + +#### on(emitter, eventName, options) + +> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> + +##### Parameters + +• **emitter**: `EventTarget` + +• **eventName**: `string` + +• **options?**: `StaticEventEmitterIteratorOptions` + +##### Returns + +`AsyncIterator`\<`any`[], `any`, `any`\> + +##### Inherited from + +`EventEmitter.on` + +##### Defined in + +node_modules/@types/node/events.d.ts:308 + +--- + +### once() + +#### once(emitter, eventName, options) + +> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> + +Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given +event or that is rejected if the `EventEmitter` emits `'error'` while waiting. +The `Promise` will resolve with an array of all the arguments emitted to the +given event. + +This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event +semantics and does not listen to the `'error'` event. + +```js +import { once, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +process.nextTick(() => { + ee.emit("myevent", 42); +}); + +const [value] = await once(ee, "myevent"); +console.log(value); + +const err = new Error("kaboom"); +process.nextTick(() => { + ee.emit("error", err); +}); + +try { + await once(ee, "myevent"); +} catch (err) { + console.error("error happened", err); +} +``` + +The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the +'`error'` event itself, then it is treated as any other kind of event without +special handling: + +```js +import { EventEmitter, once } from "node:events"; + +const ee = new EventEmitter(); + +once(ee, "error") + .then(([err]) => console.log("ok", err.message)) + .catch((err) => console.error("error", err.message)); + +ee.emit("error", new Error("boom")); + +// Prints: ok boom +``` + +An `AbortSignal` can be used to cancel waiting for the event: + +```js +import { EventEmitter, once } from "node:events"; + +const ee = new EventEmitter(); +const ac = new AbortController(); + +async function foo(emitter, event, signal) { + try { + await once(emitter, event, { signal }); + console.log("event emitted!"); + } catch (error) { + if (error.name === "AbortError") { + console.error("Waiting for the event was canceled!"); + } else { + console.error("There was an error", error.message); + } + } +} + +foo(ee, "foo", ac.signal); +ac.abort(); // Abort waiting for the event +ee.emit("foo"); // Prints: Waiting for the event was canceled! +``` + +##### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +• **eventName**: `string` \| `symbol` + +• **options?**: `StaticEventEmitterOptions` + +##### Returns + +`Promise`\<`any`[]\> + +##### Since + +v11.13.0, v10.16.0 + +##### Inherited from + +`EventEmitter.once` + +##### Defined in + +node_modules/@types/node/events.d.ts:217 + +#### once(emitter, eventName, options) + +> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> + +##### Parameters + +• **emitter**: `EventTarget` + +• **eventName**: `string` + +• **options?**: `StaticEventEmitterOptions` + +##### Returns + +`Promise`\<`any`[]\> + +##### Inherited from + +`EventEmitter.once` + +##### Defined in + +node_modules/@types/node/events.d.ts:222 + +--- + +### setMaxListeners() + +> `static` **setMaxListeners**(`n`?, ...`eventTargets`?): `void` + +```js +import { setMaxListeners, EventEmitter } from "node:events"; + +const target = new EventTarget(); +const emitter = new EventEmitter(); + +setMaxListeners(5, target, emitter); +``` + +#### Parameters + +• **n?**: `number` + +A non-negative number. The maximum number of listeners per `EventTarget` event. + +• ...**eventTargets?**: (`EventEmitter`\<`DefaultEventMap`\> \| `EventTarget`)[] + +Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} +objects. + +#### Returns + +`void` + +#### Since + +v15.4.0 + +#### Inherited from + +`EventEmitter.setMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:402 diff --git a/docs/docs/api/classes/MemoryManager.md b/docs/docs/api/classes/MemoryManager.md new file mode 100644 index 00000000000..4f605abac5c --- /dev/null +++ b/docs/docs/api/classes/MemoryManager.md @@ -0,0 +1,383 @@ +# Class: MemoryManager + +Manage memories in the database. + +## Implements + +- [`IMemoryManager`](../interfaces/IMemoryManager.md) + +## Constructors + +### new MemoryManager() + +> **new MemoryManager**(`opts`): [`MemoryManager`](MemoryManager.md) + +Constructs a new MemoryManager instance. + +#### Parameters + +• **opts** + +Options for the manager. + +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +The AgentRuntime instance associated with this manager. + +• **opts.tableName**: `string` + +The name of the table this manager will operate on. + +#### Returns + +[`MemoryManager`](MemoryManager.md) + +#### Defined in + +[core/src/core/memory.ts:35](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L35) + +## Properties + +### runtime + +> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +The AgentRuntime instance associated with this manager. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`runtime`](../interfaces/IMemoryManager.md#runtime) + +#### Defined in + +[core/src/core/memory.ts:22](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L22) + +--- + +### tableName + +> **tableName**: `string` + +The name of the database table this manager operates on. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`tableName`](../interfaces/IMemoryManager.md#tablename) + +#### Defined in + +[core/src/core/memory.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L27) + +## Methods + +### addEmbeddingToMemory() + +> **addEmbeddingToMemory**(`memory`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> + +Adds an embedding vector to a memory object. If the memory already has an embedding, it is returned as is. + +#### Parameters + +• **memory**: [`Memory`](../interfaces/Memory.md) + +The memory object to add an embedding to. + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)\> + +A Promise resolving to the memory object, potentially updated with an embedding vector. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`addEmbeddingToMemory`](../interfaces/IMemoryManager.md#addembeddingtomemory) + +#### Defined in + +[core/src/core/memory.ts:45](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L45) + +--- + +### countMemories() + +> **countMemories**(`roomId`, `unique`): `Promise`\<`number`\> + +Counts the number of memories associated with a set of user IDs, with an option for uniqueness. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The room ID to count memories for. + +• **unique**: `boolean` = `true` + +Whether to count unique memories only. + +#### Returns + +`Promise`\<`number`\> + +A Promise resolving to the count of memories. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`countMemories`](../interfaces/IMemoryManager.md#countmemories) + +#### Defined in + +[core/src/core/memory.ts:218](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L218) + +--- + +### createMemory() + +> **createMemory**(`memory`, `unique`): `Promise`\<`void`\> + +Creates a new memory in the database, with an option to check for similarity before insertion. + +#### Parameters + +• **memory**: [`Memory`](../interfaces/Memory.md) + +The memory object to create. + +• **unique**: `boolean` = `false` + +Whether to check for similarity before insertion. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the operation completes. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`createMemory`](../interfaces/IMemoryManager.md#creatememory) + +#### Defined in + +[core/src/core/memory.ts:158](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L158) + +--- + +### getCachedEmbeddings() + +> **getCachedEmbeddings**(`content`): `Promise`\<`object`[]\> + +#### Parameters + +• **content**: `string` + +#### Returns + +`Promise`\<`object`[]\> + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`getCachedEmbeddings`](../interfaces/IMemoryManager.md#getcachedembeddings) + +#### Defined in + +[core/src/core/memory.ts:93](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L93) + +--- + +### getMemories() + +> **getMemories**(`opts`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Retrieves a list of memories by user IDs, with optional deduplication. + +#### Parameters + +• **opts** + +Options including user IDs, count, and uniqueness. + +• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **opts.count?**: `number` = `10` + +The number of memories to retrieve. + +• **opts.end?**: `number` + +• **opts.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The room ID to retrieve memories for. + +• **opts.start?**: `number` + +• **opts.unique?**: `boolean` = `true` + +Whether to retrieve unique memories only. + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise resolving to an array of Memory objects. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`getMemories`](../interfaces/IMemoryManager.md#getmemories) + +#### Defined in + +[core/src/core/memory.ts:66](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L66) + +--- + +### getMemoriesByRoomIds() + +> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +#### Parameters + +• **params** + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`getMemoriesByRoomIds`](../interfaces/IMemoryManager.md#getmemoriesbyroomids) + +#### Defined in + +[core/src/core/memory.ts:172](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L172) + +--- + +### getMemoryById() + +> **getMemoryById**(`id`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> + +#### Parameters + +• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)\> + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`getMemoryById`](../interfaces/IMemoryManager.md#getmemorybyid) + +#### Defined in + +[core/src/core/memory.ts:183](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L183) + +--- + +### removeAllMemories() + +> **removeAllMemories**(`roomId`): `Promise`\<`void`\> + +Removes all memories associated with a set of user IDs. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The room ID to remove memories for. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the operation completes. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`removeAllMemories`](../interfaces/IMemoryManager.md#removeallmemories) + +#### Defined in + +[core/src/core/memory.ts:205](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L205) + +--- + +### removeMemory() + +> **removeMemory**(`memoryId`): `Promise`\<`void`\> + +Removes a memory from the database by its ID. + +#### Parameters + +• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The ID of the memory to remove. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the operation completes. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`removeMemory`](../interfaces/IMemoryManager.md#removememory) + +#### Defined in + +[core/src/core/memory.ts:193](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L193) + +--- + +### searchMemoriesByEmbedding() + +> **searchMemoriesByEmbedding**(`embedding`, `opts`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories similar to a given embedding vector. + +#### Parameters + +• **embedding**: `number`[] + +The embedding vector to search with. + +• **opts** + +Options including match threshold, count, user IDs, and uniqueness. + +• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **opts.count?**: `number` + +The maximum number of memories to retrieve. + +• **opts.match_threshold?**: `number` + +The similarity threshold for matching memories. + +• **opts.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The room ID to retrieve memories for. + +• **opts.unique?**: `boolean` + +Whether to retrieve unique memories only. + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise resolving to an array of Memory objects that match the embedding. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`searchMemoriesByEmbedding`](../interfaces/IMemoryManager.md#searchmemoriesbyembedding) + +#### Defined in + +[core/src/core/memory.ts:120](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L120) diff --git a/docs/docs/api/classes/PostgresDatabaseAdapter.md b/docs/docs/api/classes/PostgresDatabaseAdapter.md new file mode 100644 index 00000000000..23da6fff343 --- /dev/null +++ b/docs/docs/api/classes/PostgresDatabaseAdapter.md @@ -0,0 +1,1132 @@ +# Class: PostgresDatabaseAdapter + +An abstract class representing a database adapter for managing various entities +like accounts, memories, actors, goals, and rooms. + +## Extends + +- [`DatabaseAdapter`](DatabaseAdapter.md) + +## Constructors + +### new PostgresDatabaseAdapter() + +> **new PostgresDatabaseAdapter**(`connectionConfig`): [`PostgresDatabaseAdapter`](PostgresDatabaseAdapter.md) + +#### Parameters + +• **connectionConfig**: `any` + +#### Returns + +[`PostgresDatabaseAdapter`](PostgresDatabaseAdapter.md) + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`constructor`](DatabaseAdapter.md#constructors) + +#### Defined in + +[core/src/adapters/postgres.ts:19](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L19) + +## Properties + +### db + +> **db**: `any` + +The database instance. + +#### Inherited from + +[`DatabaseAdapter`](DatabaseAdapter.md).[`db`](DatabaseAdapter.md#db) + +#### Defined in + +[core/src/core/database.ts:21](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L21) + +## Methods + +### addParticipant() + +> **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +Adds a user as a participant to a specific room. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user to add as a participant. + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to which the user will be added. + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves to a boolean indicating success or failure. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`addParticipant`](DatabaseAdapter.md#addparticipant) + +#### Defined in + +[core/src/adapters/postgres.ts:681](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L681) + +--- + +### countMemories() + +> **countMemories**(`roomId`, `unique`, `tableName`): `Promise`\<`number`\> + +Counts the number of memories in a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room for which to count memories. + +• **unique**: `boolean` = `true` + +Specifies whether to count only unique memories. + +• **tableName**: `string` = `""` + +Optional table name to count memories from. + +#### Returns + +`Promise`\<`number`\> + +A Promise that resolves to the number of memories. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`countMemories`](DatabaseAdapter.md#countmemories) + +#### Defined in + +[core/src/adapters/postgres.ts:752](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L752) + +--- + +### createAccount() + +> **createAccount**(`account`): `Promise`\<`boolean`\> + +Creates a new account in the database. + +#### Parameters + +• **account**: [`Account`](../interfaces/Account.md) + +The account object to create. + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves when the account creation is complete. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`createAccount`](DatabaseAdapter.md#createaccount) + +#### Defined in + +[core/src/adapters/postgres.ts:186](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L186) + +--- + +### createGoal() + +> **createGoal**(`goal`): `Promise`\<`void`\> + +Creates a new goal in the database. + +#### Parameters + +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object to create. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal has been created. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`createGoal`](DatabaseAdapter.md#creategoal) + +#### Defined in + +[core/src/adapters/postgres.ts:454](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L454) + +--- + +### createMemory() + +> **createMemory**(`memory`, `tableName`): `Promise`\<`void`\> + +Creates a new memory in the database. + +#### Parameters + +• **memory**: [`Memory`](../interfaces/Memory.md) + +The memory object to create. + +• **tableName**: `string` + +The table where the memory should be stored. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the memory has been created. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`createMemory`](DatabaseAdapter.md#creatememory) + +#### Defined in + +[core/src/adapters/postgres.ts:253](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L253) + +--- + +### createRelationship() + +> **createRelationship**(`params`): `Promise`\<`boolean`\> + +Creates a new relationship between two users. + +#### Parameters + +• **params** + +An object containing the UUIDs of the two users (userA and userB). + +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves to a boolean indicating success or failure of the creation. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`createRelationship`](DatabaseAdapter.md#createrelationship) + +#### Defined in + +[core/src/adapters/postgres.ts:505](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L505) + +--- + +### createRoom() + +> **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +Creates a new room with an optional specified ID. + +#### Parameters + +• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +Optional UUID to assign to the new room. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +A Promise that resolves to the UUID of the created room. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`createRoom`](DatabaseAdapter.md#createroom) + +#### Defined in + +[core/src/adapters/postgres.ts:483](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L483) + +--- + +### getAccountById() + +> **getAccountById**(`userId`): `Promise`\<[`Account`](../interfaces/Account.md)\> + +Retrieves an account by its ID. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user account to retrieve. + +#### Returns + +`Promise`\<[`Account`](../interfaces/Account.md)\> + +A Promise that resolves to the Account object or null if not found. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getAccountById`](DatabaseAdapter.md#getaccountbyid) + +#### Defined in + +[core/src/adapters/postgres.ts:162](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L162) + +--- + +### getActorById() + +> **getActorById**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +#### Parameters + +• **params** + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +#### Defined in + +[core/src/adapters/postgres.ts:210](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L210) + +--- + +### getActorDetails() + +> **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +Retrieves details of actors in a given room. + +#### Parameters + +• **params** + +An object containing the roomId to search for actors. + +• **params.roomId**: `string` + +#### Returns + +`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +A Promise that resolves to an array of Actor objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getActorDetails`](DatabaseAdapter.md#getactordetails) + +#### Defined in + +[core/src/adapters/postgres.ts:810](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L810) + +--- + +### getCachedEmbeddings() + +> **getCachedEmbeddings**(`opts`): `Promise`\<`object`[]\> + +Retrieves cached embeddings based on the specified query parameters. + +#### Parameters + +• **opts** + +• **opts.query_field_name**: `string` + +• **opts.query_field_sub_name**: `string` + +• **opts.query_input**: `string` + +• **opts.query_match_count**: `number` + +• **opts.query_table_name**: `string` + +• **opts.query_threshold**: `number` + +#### Returns + +`Promise`\<`object`[]\> + +A Promise that resolves to an array of objects containing embeddings and levenshtein scores. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getCachedEmbeddings`](DatabaseAdapter.md#getcachedembeddings) + +#### Defined in + +[core/src/adapters/postgres.ts:559](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L559) + +--- + +### getGoals() + +> **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +Retrieves goals based on specified parameters. + +#### Parameters + +• **params** + +An object containing parameters for goal retrieval. + +• **params.count?**: `number` + +• **params.onlyInProgress?**: `boolean` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +A Promise that resolves to an array of Goal objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getGoals`](DatabaseAdapter.md#getgoals) + +#### Defined in + +[core/src/adapters/postgres.ts:396](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L396) + +--- + +### getMemories() + +> **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Retrieves memories based on the specified parameters. + +#### Parameters + +• **params** + +An object containing parameters for the memory retrieval. + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.count?**: `number` + +• **params.end?**: `number` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.start?**: `number` + +• **params.tableName**: `string` + +• **params.unique?**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise that resolves to an array of Memory objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemories`](DatabaseAdapter.md#getmemories) + +#### Defined in + +[core/src/adapters/postgres.ts:334](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L334) + +--- + +### getMemoriesByRoomIds() + +> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +#### Parameters + +• **params** + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +• **params.tableName**: `string` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoriesByRoomIds`](DatabaseAdapter.md#getmemoriesbyroomids) + +#### Defined in + +[core/src/adapters/postgres.ts:103](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L103) + +--- + +### getMemoryById() + +> **getMemoryById**(`id`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> + +#### Parameters + +• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)\> + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoryById`](DatabaseAdapter.md#getmemorybyid) + +#### Defined in + +[core/src/adapters/postgres.ts:232](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L232) + +--- + +### getParticipantsForAccount() + +> **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> + +Retrieves participants associated with a specific account. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the account. + +#### Returns + +`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> + +A Promise that resolves to an array of Participant objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForAccount`](DatabaseAdapter.md#getparticipantsforaccount) + +#### Defined in + +[core/src/adapters/postgres.ts:72](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L72) + +--- + +### getParticipantsForRoom() + +> **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves participants for a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room for which to retrieve participants. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +A Promise that resolves to an array of UUIDs representing the participants. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForRoom`](DatabaseAdapter.md#getparticipantsforroom) + +#### Defined in + +[core/src/adapters/postgres.ts:149](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L149) + +--- + +### getParticipantUserState() + +> **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantUserState`](DatabaseAdapter.md#getparticipantuserstate) + +#### Defined in + +[core/src/adapters/postgres.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L87) + +--- + +### getRelationship() + +> **getRelationship**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> + +Retrieves a relationship between two users if it exists. + +#### Parameters + +• **params** + +An object containing the UUIDs of the two users (userA and userB). + +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Relationship`](../interfaces/Relationship.md)\> + +A Promise that resolves to the Relationship object or null if not found. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationship`](DatabaseAdapter.md#getrelationship) + +#### Defined in + +[core/src/adapters/postgres.ts:529](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L529) + +--- + +### getRelationships() + +> **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> + +Retrieves all relationships for a specific user. + +#### Parameters + +• **params** + +An object containing the UUID of the user. + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> + +A Promise that resolves to an array of Relationship objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationships`](DatabaseAdapter.md#getrelationships) + +#### Defined in + +[core/src/adapters/postgres.ts:546](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L546) + +--- + +### getRoom() + +> **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +Retrieves the room ID for a given room, if it exists. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to retrieve. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +A Promise that resolves to the room ID or null if not found. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoom`](DatabaseAdapter.md#getroom) + +#### Defined in + +[core/src/adapters/postgres.ts:59](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L59) + +--- + +### getRoomsForParticipant() + +> **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves room IDs for which a specific user is a participant. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +A Promise that resolves to an array of room IDs. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipant`](DatabaseAdapter.md#getroomsforparticipant) + +#### Defined in + +[core/src/adapters/postgres.ts:784](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L784) + +--- + +### getRoomsForParticipants() + +> **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves room IDs for which specific users are participants. + +#### Parameters + +• **userIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +An array of UUIDs of the users. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +A Promise that resolves to an array of room IDs. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipants`](DatabaseAdapter.md#getroomsforparticipants) + +#### Defined in + +[core/src/adapters/postgres.ts:797](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L797) + +--- + +### log() + +> **log**(`params`): `Promise`\<`void`\> + +Logs an event or action with the specified details. + +#### Parameters + +• **params** + +An object containing parameters for the log entry. + +• **params.body** + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.type**: `string` + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the log entry has been saved. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`log`](DatabaseAdapter.md#log) + +#### Defined in + +[core/src/adapters/postgres.ts:595](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L595) + +--- + +### removeAllGoals() + +> **removeAllGoals**(`roomId`): `Promise`\<`void`\> + +Removes all goals associated with a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room whose goals should be removed. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when all goals have been removed. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllGoals`](DatabaseAdapter.md#removeallgoals) + +#### Defined in + +[core/src/adapters/postgres.ts:773](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L773) + +--- + +### removeAllMemories() + +> **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> + +Removes all memories associated with a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room whose memories should be removed. + +• **tableName**: `string` + +The table from which the memories should be removed. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when all memories have been removed. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllMemories`](DatabaseAdapter.md#removeallmemories) + +#### Defined in + +[core/src/adapters/postgres.ts:740](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L740) + +--- + +### removeGoal() + +> **removeGoal**(`goalId`): `Promise`\<`void`\> + +Removes a specific goal from the database. + +#### Parameters + +• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the goal to remove. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal has been removed. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeGoal`](DatabaseAdapter.md#removegoal) + +#### Defined in + +[core/src/adapters/postgres.ts:474](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L474) + +--- + +### removeMemory() + +> **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> + +Removes a specific memory from the database. + +#### Parameters + +• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the memory to remove. + +• **tableName**: `string` + +The table from which the memory should be removed. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the memory has been removed. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeMemory`](DatabaseAdapter.md#removememory) + +#### Defined in + +[core/src/adapters/postgres.ts:728](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L728) + +--- + +### removeParticipant() + +> **removeParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +Removes a user as a participant from a specific room. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user to remove as a participant. + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room from which the user will be removed. + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves to a boolean indicating success or failure. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeParticipant`](DatabaseAdapter.md#removeparticipant) + +#### Defined in + +[core/src/adapters/postgres.ts:697](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L697) + +--- + +### removeRoom() + +> **removeRoom**(`roomId`): `Promise`\<`void`\> + +Removes a specific room from the database. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to remove. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the room has been removed. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeRoom`](DatabaseAdapter.md#removeroom) + +#### Defined in + +[core/src/adapters/postgres.ts:496](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L496) + +--- + +### searchMemories() + +> **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories based on embeddings and other specified parameters. + +#### Parameters + +• **params** + +An object containing parameters for the memory search. + +• **params.embedding**: `number`[] + +• **params.match_count**: `number` + +• **params.match_threshold**: `number` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.tableName**: `string` + +• **params.unique**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise that resolves to an array of Memory objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemories`](DatabaseAdapter.md#searchmemories) + +#### Defined in + +[core/src/adapters/postgres.ts:291](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L291) + +--- + +### searchMemoriesByEmbedding() + +> **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories by embedding and other specified parameters. + +#### Parameters + +• **embedding**: `number`[] + +The embedding vector to search with. + +• **params** + +Additional parameters for the search. + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.count?**: `number` + +• **params.match_threshold?**: `number` + +• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.tableName**: `string` + +• **params.unique?**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise that resolves to an array of Memory objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemoriesByEmbedding`](DatabaseAdapter.md#searchmemoriesbyembedding) + +#### Defined in + +[core/src/adapters/postgres.ts:612](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L612) + +--- + +### setParticipantUserState() + +> **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **state**: `"FOLLOWED"` \| `"MUTED"` + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`setParticipantUserState`](DatabaseAdapter.md#setparticipantuserstate) + +#### Defined in + +[core/src/adapters/postgres.ts:133](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L133) + +--- + +### testConnection() + +> **testConnection**(): `Promise`\<`boolean`\> + +#### Returns + +`Promise`\<`boolean`\> + +#### Defined in + +[core/src/adapters/postgres.ts:37](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L37) + +--- + +### updateGoal() + +> **updateGoal**(`goal`): `Promise`\<`void`\> + +Updates a specific goal in the database. + +#### Parameters + +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object with updated properties. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal has been updated. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoal`](DatabaseAdapter.md#updategoal) + +#### Defined in + +[core/src/adapters/postgres.ts:437](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L437) + +--- + +### updateGoalStatus() + +> **updateGoalStatus**(`params`): `Promise`\<`void`\> + +Updates the status of a specific goal. + +#### Parameters + +• **params** + +An object containing the goalId and the new status. + +• **params.goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.status**: [`GoalStatus`](../enumerations/GoalStatus.md) + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal status has been updated. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoalStatus`](DatabaseAdapter.md#updategoalstatus) + +#### Defined in + +[core/src/adapters/postgres.ts:713](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L713) diff --git a/docs/docs/api/classes/SqliteDatabaseAdapter.md b/docs/docs/api/classes/SqliteDatabaseAdapter.md new file mode 100644 index 00000000000..0abba7df7fa --- /dev/null +++ b/docs/docs/api/classes/SqliteDatabaseAdapter.md @@ -0,0 +1,1100 @@ +# Class: SqliteDatabaseAdapter + +An abstract class representing a database adapter for managing various entities +like accounts, memories, actors, goals, and rooms. + +## Extends + +- [`DatabaseAdapter`](DatabaseAdapter.md) + +## Constructors + +### new SqliteDatabaseAdapter() + +> **new SqliteDatabaseAdapter**(`db`): [`SqliteDatabaseAdapter`](SqliteDatabaseAdapter.md) + +#### Parameters + +• **db**: `Database` + +#### Returns + +[`SqliteDatabaseAdapter`](SqliteDatabaseAdapter.md) + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`constructor`](DatabaseAdapter.md#constructors) + +#### Defined in + +[core/src/adapters/sqlite.ts:70](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L70) + +## Properties + +### db + +> **db**: `any` + +The database instance. + +#### Inherited from + +[`DatabaseAdapter`](DatabaseAdapter.md).[`db`](DatabaseAdapter.md#db) + +#### Defined in + +[core/src/core/database.ts:21](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L21) + +## Methods + +### addParticipant() + +> **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +Adds a user as a participant to a specific room. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user to add as a participant. + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to which the user will be added. + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves to a boolean indicating success or failure. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`addParticipant`](DatabaseAdapter.md#addparticipant) + +#### Defined in + +[core/src/adapters/sqlite.ts:592](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L592) + +--- + +### countMemories() + +> **countMemories**(`roomId`, `unique`, `tableName`): `Promise`\<`number`\> + +Counts the number of memories in a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room for which to count memories. + +• **unique**: `boolean` = `true` + +Specifies whether to count only unique memories. + +• **tableName**: `string` = `""` + +Optional table name to count memories from. + +#### Returns + +`Promise`\<`number`\> + +A Promise that resolves to the number of memories. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`countMemories`](DatabaseAdapter.md#countmemories) + +#### Defined in + +[core/src/adapters/sqlite.ts:465](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L465) + +--- + +### createAccount() + +> **createAccount**(`account`): `Promise`\<`boolean`\> + +Creates a new account in the database. + +#### Parameters + +• **account**: [`Account`](../interfaces/Account.md) + +The account object to create. + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves when the account creation is complete. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`createAccount`](DatabaseAdapter.md#createaccount) + +#### Defined in + +[core/src/adapters/sqlite.ts:102](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L102) + +--- + +### createGoal() + +> **createGoal**(`goal`): `Promise`\<`void`\> + +Creates a new goal in the database. + +#### Parameters + +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object to create. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal has been created. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`createGoal`](DatabaseAdapter.md#creategoal) + +#### Defined in + +[core/src/adapters/sqlite.ts:532](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L532) + +--- + +### createMemory() + +> **createMemory**(`memory`, `tableName`): `Promise`\<`void`\> + +Creates a new memory in the database. + +#### Parameters + +• **memory**: [`Memory`](../interfaces/Memory.md) + +The memory object to create. + +• **tableName**: `string` + +The table where the memory should be stored. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the memory has been created. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`createMemory`](DatabaseAdapter.md#creatememory) + +#### Defined in + +[core/src/adapters/sqlite.ts:196](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L196) + +--- + +### createRelationship() + +> **createRelationship**(`params`): `Promise`\<`boolean`\> + +Creates a new relationship between two users. + +#### Parameters + +• **params** + +An object containing the UUIDs of the two users (userA and userB). + +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves to a boolean indicating success or failure of the creation. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`createRelationship`](DatabaseAdapter.md#createrelationship) + +#### Defined in + +[core/src/adapters/sqlite.ts:616](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L616) + +--- + +### createRoom() + +> **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +Creates a new room with an optional specified ID. + +#### Parameters + +• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +Optional UUID to assign to the new room. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +A Promise that resolves to the UUID of the created room. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`createRoom`](DatabaseAdapter.md#createroom) + +#### Defined in + +[core/src/adapters/sqlite.ts:557](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L557) + +--- + +### getAccountById() + +> **getAccountById**(`userId`): `Promise`\<[`Account`](../interfaces/Account.md)\> + +Retrieves an account by its ID. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user account to retrieve. + +#### Returns + +`Promise`\<[`Account`](../interfaces/Account.md)\> + +A Promise that resolves to the Account object or null if not found. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getAccountById`](DatabaseAdapter.md#getaccountbyid) + +#### Defined in + +[core/src/adapters/sqlite.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L88) + +--- + +### getActorDetails() + +> **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +Retrieves details of actors in a given room. + +#### Parameters + +• **params** + +An object containing the roomId to search for actors. + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +A Promise that resolves to an array of Actor objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getActorDetails`](DatabaseAdapter.md#getactordetails) + +#### Defined in + +[core/src/adapters/sqlite.ts:123](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L123) + +--- + +### getCachedEmbeddings() + +> **getCachedEmbeddings**(`opts`): `Promise`\<`object`[]\> + +Retrieves cached embeddings based on the specified query parameters. + +#### Parameters + +• **opts** + +• **opts.query_field_name**: `string` + +• **opts.query_field_sub_name**: `string` + +• **opts.query_input**: `string` + +• **opts.query_match_count**: `number` + +• **opts.query_table_name**: `string` + +• **opts.query_threshold**: `number` + +#### Returns + +`Promise`\<`object`[]\> + +A Promise that resolves to an array of objects containing embeddings and levenshtein scores. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getCachedEmbeddings`](DatabaseAdapter.md#getcachedembeddings) + +#### Defined in + +[core/src/adapters/sqlite.ts:336](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L336) + +--- + +### getGoals() + +> **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +Retrieves goals based on specified parameters. + +#### Parameters + +• **params** + +An object containing parameters for goal retrieval. + +• **params.count?**: `number` + +• **params.onlyInProgress?**: `boolean` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +A Promise that resolves to an array of Goal objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getGoals`](DatabaseAdapter.md#getgoals) + +#### Defined in + +[core/src/adapters/sqlite.ts:485](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L485) + +--- + +### getMemories() + +> **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Retrieves memories based on the specified parameters. + +#### Parameters + +• **params** + +An object containing parameters for the memory retrieval. + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.count?**: `number` + +• **params.end?**: `number` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.start?**: `number` + +• **params.tableName**: `string` + +• **params.unique?**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise that resolves to an array of Memory objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemories`](DatabaseAdapter.md#getmemories) + +#### Defined in + +[core/src/adapters/sqlite.ts:398](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L398) + +--- + +### getMemoriesByRoomIds() + +> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +#### Parameters + +• **params** + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +• **params.tableName**: `string` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoriesByRoomIds`](DatabaseAdapter.md#getmemoriesbyroomids) + +#### Defined in + +[core/src/adapters/sqlite.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L150) + +--- + +### getMemoryById() + +> **getMemoryById**(`memoryId`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> + +#### Parameters + +• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)\> + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoryById`](DatabaseAdapter.md#getmemorybyid) + +#### Defined in + +[core/src/adapters/sqlite.ts:180](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L180) + +--- + +### getParticipantsForAccount() + +> **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> + +Retrieves participants associated with a specific account. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the account. + +#### Returns + +`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> + +A Promise that resolves to an array of Participant objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForAccount`](DatabaseAdapter.md#getparticipantsforaccount) + +#### Defined in + +[core/src/adapters/sqlite.ts:30](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L30) + +--- + +### getParticipantsForRoom() + +> **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves participants for a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room for which to retrieve participants. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +A Promise that resolves to an array of UUIDs representing the participants. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForRoom`](DatabaseAdapter.md#getparticipantsforroom) + +#### Defined in + +[core/src/adapters/sqlite.ts:40](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L40) + +--- + +### getParticipantUserState() + +> **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantUserState`](DatabaseAdapter.md#getparticipantuserstate) + +#### Defined in + +[core/src/adapters/sqlite.ts:46](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L46) + +--- + +### getRelationship() + +> **getRelationship**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> + +Retrieves a relationship between two users if it exists. + +#### Parameters + +• **params** + +An object containing the UUIDs of the two users (userA and userB). + +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Relationship`](../interfaces/Relationship.md)\> + +A Promise that resolves to the Relationship object or null if not found. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationship`](DatabaseAdapter.md#getrelationship) + +#### Defined in + +[core/src/adapters/sqlite.ts:631](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L631) + +--- + +### getRelationships() + +> **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> + +Retrieves all relationships for a specific user. + +#### Parameters + +• **params** + +An object containing the UUID of the user. + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> + +A Promise that resolves to an array of Relationship objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationships`](DatabaseAdapter.md#getrelationships) + +#### Defined in + +[core/src/adapters/sqlite.ts:649](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L649) + +--- + +### getRoom() + +> **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +Retrieves the room ID for a given room, if it exists. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to retrieve. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +A Promise that resolves to the room ID or null if not found. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoom`](DatabaseAdapter.md#getroom) + +#### Defined in + +[core/src/adapters/sqlite.ts:22](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L22) + +--- + +### getRoomsForParticipant() + +> **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves room IDs for which a specific user is a participant. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +A Promise that resolves to an array of room IDs. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipant`](DatabaseAdapter.md#getroomsforparticipant) + +#### Defined in + +[core/src/adapters/sqlite.ts:573](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L573) + +--- + +### getRoomsForParticipants() + +> **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves room IDs for which specific users are participants. + +#### Parameters + +• **userIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +An array of UUIDs of the users. + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +A Promise that resolves to an array of room IDs. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipants`](DatabaseAdapter.md#getroomsforparticipants) + +#### Defined in + +[core/src/adapters/sqlite.ts:579](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L579) + +--- + +### log() + +> **log**(`params`): `Promise`\<`void`\> + +Logs an event or action with the specified details. + +#### Parameters + +• **params** + +An object containing parameters for the log entry. + +• **params.body** + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.type**: `string` + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the log entry has been saved. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`log`](DatabaseAdapter.md#log) + +#### Defined in + +[core/src/adapters/sqlite.ts:380](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L380) + +--- + +### removeAllGoals() + +> **removeAllGoals**(`roomId`): `Promise`\<`void`\> + +Removes all goals associated with a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room whose goals should be removed. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when all goals have been removed. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllGoals`](DatabaseAdapter.md#removeallgoals) + +#### Defined in + +[core/src/adapters/sqlite.ts:552](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L552) + +--- + +### removeAllMemories() + +> **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> + +Removes all memories associated with a specific room. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room whose memories should be removed. + +• **tableName**: `string` + +The table from which the memories should be removed. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when all memories have been removed. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllMemories`](DatabaseAdapter.md#removeallmemories) + +#### Defined in + +[core/src/adapters/sqlite.ts:460](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L460) + +--- + +### removeGoal() + +> **removeGoal**(`goalId`): `Promise`\<`void`\> + +Removes a specific goal from the database. + +#### Parameters + +• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the goal to remove. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal has been removed. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeGoal`](DatabaseAdapter.md#removegoal) + +#### Defined in + +[core/src/adapters/sqlite.ts:547](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L547) + +--- + +### removeMemory() + +> **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> + +Removes a specific memory from the database. + +#### Parameters + +• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the memory to remove. + +• **tableName**: `string` + +The table from which the memory should be removed. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the memory has been removed. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeMemory`](DatabaseAdapter.md#removememory) + +#### Defined in + +[core/src/adapters/sqlite.ts:455](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L455) + +--- + +### removeParticipant() + +> **removeParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +Removes a user as a participant from a specific room. + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user to remove as a participant. + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room from which the user will be removed. + +#### Returns + +`Promise`\<`boolean`\> + +A Promise that resolves to a boolean indicating success or failure. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeParticipant`](DatabaseAdapter.md#removeparticipant) + +#### Defined in + +[core/src/adapters/sqlite.ts:604](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L604) + +--- + +### removeRoom() + +> **removeRoom**(`roomId`): `Promise`\<`void`\> + +Removes a specific room from the database. + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to remove. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the room has been removed. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeRoom`](DatabaseAdapter.md#removeroom) + +#### Defined in + +[core/src/adapters/sqlite.ts:568](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L568) + +--- + +### searchMemories() + +> **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories based on embeddings and other specified parameters. + +#### Parameters + +• **params** + +An object containing parameters for the memory search. + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.embedding**: `number`[] + +• **params.match_count**: `number` + +• **params.match_threshold**: `number` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.tableName**: `string` + +• **params.unique**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise that resolves to an array of Memory objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemories`](DatabaseAdapter.md#searchmemories) + +#### Defined in + +[core/src/adapters/sqlite.ts:236](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L236) + +--- + +### searchMemoriesByEmbedding() + +> **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories by embedding and other specified parameters. + +#### Parameters + +• **embedding**: `number`[] + +The embedding vector to search with. + +• **params** + +Additional parameters for the search. + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.count?**: `number` + +• **params.match_threshold?**: `number` + +• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.tableName**: `string` + +• **params.unique?**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +A Promise that resolves to an array of Memory objects. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemoriesByEmbedding`](DatabaseAdapter.md#searchmemoriesbyembedding) + +#### Defined in + +[core/src/adapters/sqlite.ts:282](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L282) + +--- + +### setParticipantUserState() + +> **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **state**: `"FOLLOWED"` \| `"MUTED"` + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`setParticipantUserState`](DatabaseAdapter.md#setparticipantuserstate) + +#### Defined in + +[core/src/adapters/sqlite.ts:59](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L59) + +--- + +### updateGoal() + +> **updateGoal**(`goal`): `Promise`\<`void`\> + +Updates a specific goal in the database. + +#### Parameters + +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object with updated properties. + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal has been updated. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoal`](DatabaseAdapter.md#updategoal) + +#### Defined in + +[core/src/adapters/sqlite.ts:519](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L519) + +--- + +### updateGoalStatus() + +> **updateGoalStatus**(`params`): `Promise`\<`void`\> + +Updates the status of a specific goal. + +#### Parameters + +• **params** + +An object containing the goalId and the new status. + +• **params.goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.status**: [`GoalStatus`](../enumerations/GoalStatus.md) + +#### Returns + +`Promise`\<`void`\> + +A Promise that resolves when the goal status has been updated. + +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoalStatus`](DatabaseAdapter.md#updategoalstatus) + +#### Defined in + +[core/src/adapters/sqlite.ts:372](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L372) diff --git a/docs/docs/api/classes/TelegramClient.md b/docs/docs/api/classes/TelegramClient.md new file mode 100644 index 00000000000..6f29127555e --- /dev/null +++ b/docs/docs/api/classes/TelegramClient.md @@ -0,0 +1,49 @@ +# Class: TelegramClient + +## Constructors + +### new TelegramClient() + +> **new TelegramClient**(`runtime`, `botToken`): [`TelegramClient`](TelegramClient.md) + +#### Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **botToken**: `string` + +#### Returns + +[`TelegramClient`](TelegramClient.md) + +#### Defined in + +[core/src/clients/telegram/src/index.ts:12](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/telegram/src/index.ts#L12) + +## Methods + +### start() + +> **start**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/clients/telegram/src/index.ts:54](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/telegram/src/index.ts#L54) + +--- + +### stop() + +> **stop**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/clients/telegram/src/index.ts:91](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/telegram/src/index.ts#L91) diff --git a/docs/docs/api/classes/TokenProvider.md b/docs/docs/api/classes/TokenProvider.md new file mode 100644 index 00000000000..0e0fb8d77eb --- /dev/null +++ b/docs/docs/api/classes/TokenProvider.md @@ -0,0 +1,193 @@ +# Class: TokenProvider + +## Constructors + +### new TokenProvider() + +> **new TokenProvider**(`tokenAddress`): [`TokenProvider`](TokenProvider.md) + +#### Parameters + +• **tokenAddress**: `string` + +#### Returns + +[`TokenProvider`](TokenProvider.md) + +#### Defined in + +[core/src/providers/token.ts:38](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L38) + +## Methods + +### analyzeHolderDistribution() + +> **analyzeHolderDistribution**(`tradeData`): `Promise`\<`string`\> + +#### Parameters + +• **tradeData**: `TokenTradeData` + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[core/src/providers/token.ts:461](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L461) + +--- + +### checkRecentTrades() + +> **checkRecentTrades**(`tradeData`): `Promise`\<`boolean`\> + +#### Parameters + +• **tradeData**: `TokenTradeData` + +#### Returns + +`Promise`\<`boolean`\> + +#### Defined in + +[core/src/providers/token.ts:631](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L631) + +--- + +### countHighSupplyHolders() + +> **countHighSupplyHolders**(`securityData`): `Promise`\<`number`\> + +#### Parameters + +• **securityData**: `TokenSecurityData` + +#### Returns + +`Promise`\<`number`\> + +#### Defined in + +[core/src/providers/token.ts:635](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L635) + +--- + +### fetchDexScreenerData() + +> **fetchDexScreenerData**(): `Promise`\<`DexScreenerData`\> + +#### Returns + +`Promise`\<`DexScreenerData`\> + +#### Defined in + +[core/src/providers/token.ts:420](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L420) + +--- + +### fetchHolderList() + +> **fetchHolderList**(): `Promise`\<`HolderData`[]\> + +#### Returns + +`Promise`\<`HolderData`[]\> + +#### Defined in + +[core/src/providers/token.ts:507](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L507) + +--- + +### fetchTokenSecurity() + +> **fetchTokenSecurity**(): `Promise`\<`TokenSecurityData`\> + +#### Returns + +`Promise`\<`TokenSecurityData`\> + +#### Defined in + +[core/src/providers/token.ts:155](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L155) + +--- + +### fetchTokenTradeData() + +> **fetchTokenTradeData**(): `Promise`\<`TokenTradeData`\> + +#### Returns + +`Promise`\<`TokenTradeData`\> + +#### Defined in + +[core/src/providers/token.ts:185](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L185) + +--- + +### filterHighValueHolders() + +> **filterHighValueHolders**(`tradeData`): `Promise`\<`object`[]\> + +#### Parameters + +• **tradeData**: `TokenTradeData` + +#### Returns + +`Promise`\<`object`[]\> + +#### Defined in + +[core/src/providers/token.ts:607](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L607) + +--- + +### formatTokenData() + +> **formatTokenData**(`data`): `string` + +#### Parameters + +• **data**: `ProcessedTokenData` + +#### Returns + +`string` + +#### Defined in + +[core/src/providers/token.ts:722](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L722) + +--- + +### getFormattedTokenReport() + +> **getFormattedTokenReport**(): `Promise`\<`string`\> + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[core/src/providers/token.ts:786](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L786) + +--- + +### getProcessedTokenData() + +> **getProcessedTokenData**(): `Promise`\<`ProcessedTokenData`\> + +#### Returns + +`Promise`\<`ProcessedTokenData`\> + +#### Defined in + +[core/src/providers/token.ts:656](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L656) diff --git a/docs/docs/api/classes/TwitterInteractionClient.md b/docs/docs/api/classes/TwitterInteractionClient.md new file mode 100644 index 00000000000..7b06e7039e4 --- /dev/null +++ b/docs/docs/api/classes/TwitterInteractionClient.md @@ -0,0 +1,1798 @@ +# Class: TwitterInteractionClient + +## Extends + +- `ClientBase` + +## Constructors + +### new TwitterInteractionClient() + +> **new TwitterInteractionClient**(`runtime`): [`TwitterInteractionClient`](TwitterInteractionClient.md) + +#### Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +#### Returns + +[`TwitterInteractionClient`](TwitterInteractionClient.md) + +#### Overrides + +`ClientBase.constructor` + +#### Defined in + +[core/src/clients/twitter/interactions.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/interactions.ts#L87) + +## Properties + +### callback() + +> **callback**: (`self`) => `any` = `null` + +#### Parameters + +• **self**: `ClientBase` + +#### Returns + +`any` + +#### Inherited from + +`ClientBase.callback` + +#### Defined in + +[core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L150) + +--- + +### directions + +> **directions**: `string` + +#### Inherited from + +`ClientBase.directions` + +#### Defined in + +[core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L89) + +--- + +### imageDescriptionService + +> **imageDescriptionService**: `ImageDescriptionService` + +#### Inherited from + +`ClientBase.imageDescriptionService` + +#### Defined in + +[core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L92) + +--- + +### lastCheckedTweetId + +> **lastCheckedTweetId**: `number` = `null` + +#### Inherited from + +`ClientBase.lastCheckedTweetId` + +#### Defined in + +[core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L90) + +--- + +### requestQueue + +> **requestQueue**: `RequestQueue` + +#### Inherited from + +`ClientBase.requestQueue` + +#### Defined in + +[core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L96) + +--- + +### runtime + +> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +#### Inherited from + +`ClientBase.runtime` + +#### Defined in + +[core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L88) + +--- + +### temperature + +> **temperature**: `number` = `0.5` + +#### Inherited from + +`ClientBase.temperature` + +#### Defined in + +[core/src/clients/twitter/base.ts:93](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L93) + +--- + +### tweetCacheFilePath + +> **tweetCacheFilePath**: `string` = `"tweetcache/latest_checked_tweet_id.txt"` + +#### Inherited from + +`ClientBase.tweetCacheFilePath` + +#### Defined in + +[core/src/clients/twitter/base.ts:91](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L91) + +--- + +### twitterClient + +> **twitterClient**: `Scraper` + +#### Inherited from + +`ClientBase.twitterClient` + +#### Defined in + +[core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L87) + +--- + +### twitterUserId + +> **twitterUserId**: `string` + +#### Inherited from + +`ClientBase.twitterUserId` + +#### Defined in + +[core/src/clients/twitter/base.ts:97](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L97) + +--- + +### \_twitterClient + +> `static` **\_twitterClient**: `Scraper` + +#### Inherited from + +`ClientBase._twitterClient` + +#### Defined in + +[core/src/clients/twitter/base.ts:86](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L86) + +--- + +### captureRejections + +> `static` **captureRejections**: `boolean` + +Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) + +Change the default `captureRejections` option on all new `EventEmitter` objects. + +#### Since + +v13.4.0, v12.16.0 + +#### Inherited from + +`ClientBase.captureRejections` + +#### Defined in + +node_modules/@types/node/events.d.ts:459 + +--- + +### captureRejectionSymbol + +> `readonly` `static` **captureRejectionSymbol**: _typeof_ [`captureRejectionSymbol`](TwitterPostClient.md#capturerejectionsymbol) + +Value: `Symbol.for('nodejs.rejection')` + +See how to write a custom `rejection handler`. + +#### Since + +v13.4.0, v12.16.0 + +#### Inherited from + +`ClientBase.captureRejectionSymbol` + +#### Defined in + +node_modules/@types/node/events.d.ts:452 + +--- + +### defaultMaxListeners + +> `static` **defaultMaxListeners**: `number` + +By default, a maximum of `10` listeners can be registered for any single +event. This limit can be changed for individual `EventEmitter` instances +using the `emitter.setMaxListeners(n)` method. To change the default +for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property +can be used. If this value is not a positive number, a `RangeError` is thrown. + +Take caution when setting the `events.defaultMaxListeners` because the +change affects _all_ `EventEmitter` instances, including those created before +the change is made. However, calling `emitter.setMaxListeners(n)` still has +precedence over `events.defaultMaxListeners`. + +This is not a hard limit. The `EventEmitter` instance will allow +more listeners to be added but will output a trace warning to stderr indicating +that a "possible EventEmitter memory leak" has been detected. For any single +`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to +temporarily avoid this warning: + +```js +import { EventEmitter } from "node:events"; +const emitter = new EventEmitter(); +emitter.setMaxListeners(emitter.getMaxListeners() + 1); +emitter.once("event", () => { + // do stuff + emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); +}); +``` + +The `--trace-warnings` command-line flag can be used to display the +stack trace for such warnings. + +The emitted warning can be inspected with `process.on('warning')` and will +have the additional `emitter`, `type`, and `count` properties, referring to +the event emitter instance, the event's name and the number of attached +listeners, respectively. +Its `name` property is set to `'MaxListenersExceededWarning'`. + +#### Since + +v0.11.2 + +#### Inherited from + +`ClientBase.defaultMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:498 + +--- + +### errorMonitor + +> `readonly` `static` **errorMonitor**: _typeof_ [`errorMonitor`](TwitterPostClient.md#errormonitor) + +This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. + +Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no +regular `'error'` listener is installed. + +#### Since + +v13.6.0, v12.17.0 + +#### Inherited from + +`ClientBase.errorMonitor` + +#### Defined in + +node_modules/@types/node/events.d.ts:445 + +## Methods + +### \[captureRejectionSymbol\]()? + +> `optional` **\[captureRejectionSymbol\]**\<`K`\>(`error`, `event`, ...`args`): `void` + +#### Type Parameters + +• **K** + +#### Parameters + +• **error**: `Error` + +• **event**: `string` \| `symbol` + +• ...**args**: `AnyRest` + +#### Returns + +`void` + +#### Inherited from + +`ClientBase.[captureRejectionSymbol]` + +#### Defined in + +node_modules/@types/node/events.d.ts:136 + +--- + +### addListener() + +> **addListener**\<`K`\>(`eventName`, `listener`): `this` + +Alias for `emitter.on(eventName, listener)`. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.addListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:597 + +--- + +### cacheTweet() + +> **cacheTweet**(`tweet`): `Promise`\<`void`\> + +#### Parameters + +• **tweet**: `Tweet` + +#### Returns + +`Promise`\<`void`\> + +#### Inherited from + +`ClientBase.cacheTweet` + +#### Defined in + +[core/src/clients/twitter/base.ts:99](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L99) + +--- + +### emit() + +> **emit**\<`K`\>(`eventName`, ...`args`): `boolean` + +Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments +to each. + +Returns `true` if the event had listeners, `false` otherwise. + +```js +import { EventEmitter } from "node:events"; +const myEmitter = new EventEmitter(); + +// First listener +myEmitter.on("event", function firstListener() { + console.log("Helloooo! first listener"); +}); +// Second listener +myEmitter.on("event", function secondListener(arg1, arg2) { + console.log(`event with parameters ${arg1}, ${arg2} in second listener`); +}); +// Third listener +myEmitter.on("event", function thirdListener(...args) { + const parameters = args.join(", "); + console.log(`event with parameters ${parameters} in third listener`); +}); + +console.log(myEmitter.listeners("event")); + +myEmitter.emit("event", 1, 2, 3, 4, 5); + +// Prints: +// [ +// [Function: firstListener], +// [Function: secondListener], +// [Function: thirdListener] +// ] +// Helloooo! first listener +// event with parameters 1, 2 in second listener +// event with parameters 1, 2, 3, 4, 5 in third listener +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• ...**args**: `AnyRest` + +#### Returns + +`boolean` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.emit` + +#### Defined in + +node_modules/@types/node/events.d.ts:859 + +--- + +### eventNames() + +> **eventNames**(): (`string` \| `symbol`)[] + +Returns an array listing the events for which the emitter has registered +listeners. The values in the array are strings or `Symbol`s. + +```js +import { EventEmitter } from "node:events"; + +const myEE = new EventEmitter(); +myEE.on("foo", () => {}); +myEE.on("bar", () => {}); + +const sym = Symbol("symbol"); +myEE.on(sym, () => {}); + +console.log(myEE.eventNames()); +// Prints: [ 'foo', 'bar', Symbol(symbol) ] +``` + +#### Returns + +(`string` \| `symbol`)[] + +#### Since + +v6.0.0 + +#### Inherited from + +`ClientBase.eventNames` + +#### Defined in + +node_modules/@types/node/events.d.ts:922 + +--- + +### fetchHomeTimeline() + +> **fetchHomeTimeline**(`count`): `Promise`\<`Tweet`[]\> + +#### Parameters + +• **count**: `number` + +#### Returns + +`Promise`\<`Tweet`[]\> + +#### Inherited from + +`ClientBase.fetchHomeTimeline` + +#### Defined in + +[core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L278) + +--- + +### fetchSearchTweets() + +> **fetchSearchTweets**(`query`, `maxTweets`, `searchMode`, `cursor`?): `Promise`\<`QueryTweetsResponse`\> + +#### Parameters + +• **query**: `string` + +• **maxTweets**: `number` + +• **searchMode**: `SearchMode` + +• **cursor?**: `string` + +#### Returns + +`Promise`\<`QueryTweetsResponse`\> + +#### Inherited from + +`ClientBase.fetchSearchTweets` + +#### Defined in + +[core/src/clients/twitter/base.ts:330](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L330) + +--- + +### getCachedTweet() + +> **getCachedTweet**(`tweetId`): `Promise`\<`Tweet`\> + +#### Parameters + +• **tweetId**: `string` + +#### Returns + +`Promise`\<`Tweet`\> + +#### Inherited from + +`ClientBase.getCachedTweet` + +#### Defined in + +[core/src/clients/twitter/base.ts:115](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L115) + +--- + +### getMaxListeners() + +> **getMaxListeners**(): `number` + +Returns the current max listener value for the `EventEmitter` which is either +set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](TwitterInteractionClient.md#defaultmaxlisteners). + +#### Returns + +`number` + +#### Since + +v1.0.0 + +#### Inherited from + +`ClientBase.getMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:774 + +--- + +### getTweet() + +> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> + +#### Parameters + +• **tweetId**: `string` + +#### Returns + +`Promise`\<`Tweet`\> + +#### Inherited from + +`ClientBase.getTweet` + +#### Defined in + +[core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L137) + +--- + +### handleTwitterInteractions() + +> **handleTwitterInteractions**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/clients/twitter/interactions.ts:93](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/interactions.ts#L93) + +--- + +### listenerCount() + +> **listenerCount**\<`K`\>(`eventName`, `listener`?): `number` + +Returns the number of listeners listening for the event named `eventName`. +If `listener` is provided, it will return how many times the listener is found +in the list of the listeners of the event. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event being listened for + +• **listener?**: `Function` + +The event handler function + +#### Returns + +`number` + +#### Since + +v3.2.0 + +#### Inherited from + +`ClientBase.listenerCount` + +#### Defined in + +node_modules/@types/node/events.d.ts:868 + +--- + +### listeners() + +> **listeners**\<`K`\>(`eventName`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`. + +```js +server.on("connection", (stream) => { + console.log("someone connected!"); +}); +console.log(util.inspect(server.listeners("connection"))); +// Prints: [ [Function] ] +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.listeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:787 + +--- + +### off() + +> **off**\<`K`\>(`eventName`, `listener`): `this` + +Alias for `emitter.removeListener()`. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v10.0.0 + +#### Inherited from + +`ClientBase.off` + +#### Defined in + +node_modules/@types/node/events.d.ts:747 + +--- + +### on() + +> **on**\<`K`\>(`eventName`, `listener`): `this` + +Adds the `listener` function to the end of the listeners array for the event +named `eventName`. No checks are made to see if the `listener` has already +been added. Multiple calls passing the same combination of `eventName` and +`listener` will result in the `listener` being added, and called, multiple times. + +```js +server.on("connection", (stream) => { + console.log("someone connected!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the +event listener to the beginning of the listeners array. + +```js +import { EventEmitter } from "node:events"; +const myEE = new EventEmitter(); +myEE.on("foo", () => console.log("a")); +myEE.prependListener("foo", () => console.log("b")); +myEE.emit("foo"); +// Prints: +// b +// a +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v0.1.101 + +#### Inherited from + +`ClientBase.on` + +#### Defined in + +node_modules/@types/node/events.d.ts:629 + +--- + +### once() + +> **once**\<`K`\>(`eventName`, `listener`): `this` + +Adds a **one-time** `listener` function for the event named `eventName`. The +next time `eventName` is triggered, this listener is removed and then invoked. + +```js +server.once("connection", (stream) => { + console.log("Ah, we have our first user!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the +event listener to the beginning of the listeners array. + +```js +import { EventEmitter } from "node:events"; +const myEE = new EventEmitter(); +myEE.once("foo", () => console.log("a")); +myEE.prependOnceListener("foo", () => console.log("b")); +myEE.emit("foo"); +// Prints: +// b +// a +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v0.3.0 + +#### Inherited from + +`ClientBase.once` + +#### Defined in + +node_modules/@types/node/events.d.ts:659 + +--- + +### onReady() + +> **onReady**(): `void` + +#### Returns + +`void` + +#### Overrides + +`ClientBase.onReady` + +#### Defined in + +[core/src/clients/twitter/interactions.ts:76](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/interactions.ts#L76) + +--- + +### prependListener() + +> **prependListener**\<`K`\>(`eventName`, `listener`): `this` + +Adds the `listener` function to the _beginning_ of the listeners array for the +event named `eventName`. No checks are made to see if the `listener` has +already been added. Multiple calls passing the same combination of `eventName` +and `listener` will result in the `listener` being added, and called, multiple times. + +```js +server.prependListener("connection", (stream) => { + console.log("someone connected!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v6.0.0 + +#### Inherited from + +`ClientBase.prependListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:886 + +--- + +### prependOnceListener() + +> **prependOnceListener**\<`K`\>(`eventName`, `listener`): `this` + +Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this +listener is removed, and then invoked. + +```js +server.prependOnceListener("connection", (stream) => { + console.log("Ah, we have our first user!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v6.0.0 + +#### Inherited from + +`ClientBase.prependOnceListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:902 + +--- + +### rawListeners() + +> **rawListeners**\<`K`\>(`eventName`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`, +including any wrappers (such as those created by `.once()`). + +```js +import { EventEmitter } from "node:events"; +const emitter = new EventEmitter(); +emitter.once("log", () => console.log("log once")); + +// Returns a new Array with a function `onceWrapper` which has a property +// `listener` which contains the original listener bound above +const listeners = emitter.rawListeners("log"); +const logFnWrapper = listeners[0]; + +// Logs "log once" to the console and does not unbind the `once` event +logFnWrapper.listener(); + +// Logs "log once" to the console and removes the listener +logFnWrapper(); + +emitter.on("log", () => console.log("log persistently")); +// Will return a new Array with a single function bound by `.on()` above +const newListeners = emitter.rawListeners("log"); + +// Logs "log persistently" twice +newListeners[0](); +emitter.emit("log"); +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v9.4.0 + +#### Inherited from + +`ClientBase.rawListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:818 + +--- + +### removeAllListeners() + +> **removeAllListeners**(`eventName`?): `this` + +Removes all listeners, or those of the specified `eventName`. + +It is bad practice to remove listeners added elsewhere in the code, +particularly when the `EventEmitter` instance was created by some other +component or module (e.g. sockets or file streams). + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Parameters + +• **eventName?**: `string` \| `symbol` + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.removeAllListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:758 + +--- + +### removeListener() + +> **removeListener**\<`K`\>(`eventName`, `listener`): `this` + +Removes the specified `listener` from the listener array for the event named `eventName`. + +```js +const callback = (stream) => { + console.log("someone connected!"); +}; +server.on("connection", callback); +// ... +server.removeListener("connection", callback); +``` + +`removeListener()` will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified `eventName`, then `removeListener()` must be +called multiple times to remove each instance. + +Once an event is emitted, all listeners attached to it at the +time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution +will not remove them from`emit()` in progress. Subsequent events behave as expected. + +```js +import { EventEmitter } from "node:events"; +class MyEmitter extends EventEmitter {} +const myEmitter = new MyEmitter(); + +const callbackA = () => { + console.log("A"); + myEmitter.removeListener("event", callbackB); +}; + +const callbackB = () => { + console.log("B"); +}; + +myEmitter.on("event", callbackA); + +myEmitter.on("event", callbackB); + +// callbackA removes listener callbackB but it will still be called. +// Internal listener array at time of emit [callbackA, callbackB] +myEmitter.emit("event"); +// Prints: +// A +// B + +// callbackB is now removed. +// Internal listener array [callbackA] +myEmitter.emit("event"); +// Prints: +// A +``` + +Because listeners are managed using an internal array, calling this will +change the position indices of any listener registered _after_ the listener +being removed. This will not impact the order in which listeners are called, +but it means that any copies of the listener array as returned by +the `emitter.listeners()` method will need to be recreated. + +When a single function has been added as a handler multiple times for a single +event (as in the example below), `removeListener()` will remove the most +recently added instance. In the example the `once('ping')` listener is removed: + +```js +import { EventEmitter } from "node:events"; +const ee = new EventEmitter(); + +function pong() { + console.log("pong"); +} + +ee.on("ping", pong); +ee.once("ping", pong); +ee.removeListener("ping", pong); + +ee.emit("ping"); +ee.emit("ping"); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.removeListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:742 + +--- + +### saveRequestMessage() + +> **saveRequestMessage**(`message`, `state`): `Promise`\<`void`\> + +#### Parameters + +• **message**: [`Memory`](../interfaces/Memory.md) + +• **state**: [`State`](../interfaces/State.md) + +#### Returns + +`Promise`\<`void`\> + +#### Inherited from + +`ClientBase.saveRequestMessage` + +#### Defined in + +[core/src/clients/twitter/base.ts:572](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L572) + +--- + +### setCookiesFromArray() + +> **setCookiesFromArray**(`cookiesArray`): `Promise`\<`void`\> + +#### Parameters + +• **cookiesArray**: `any`[] + +#### Returns + +`Promise`\<`void`\> + +#### Inherited from + +`ClientBase.setCookiesFromArray` + +#### Defined in + +[core/src/clients/twitter/base.ts:560](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L560) + +--- + +### setMaxListeners() + +> **setMaxListeners**(`n`): `this` + +By default `EventEmitter`s will print a warning if more than `10` listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. The `emitter.setMaxListeners()` method allows the limit to be +modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Parameters + +• **n**: `number` + +#### Returns + +`this` + +#### Since + +v0.3.5 + +#### Inherited from + +`ClientBase.setMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:768 + +--- + +### addAbortListener() + +> `static` **addAbortListener**(`signal`, `resource`): `Disposable` + +**`Experimental`** + +Listens once to the `abort` event on the provided `signal`. + +Listening to the `abort` event on abort signals is unsafe and may +lead to resource leaks since another third party with the signal can +call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change +this since it would violate the web standard. Additionally, the original +API makes it easy to forget to remove listeners. + +This API allows safely using `AbortSignal`s in Node.js APIs by solving these +two issues by listening to the event such that `stopImmediatePropagation` does +not prevent the listener from running. + +Returns a disposable so that it may be unsubscribed from more easily. + +```js +import { addAbortListener } from "node:events"; + +function example(signal) { + let disposable; + try { + signal.addEventListener("abort", (e) => e.stopImmediatePropagation()); + disposable = addAbortListener(signal, (e) => { + // Do something when signal is aborted. + }); + } finally { + disposable?.[Symbol.dispose](); + } +} +``` + +#### Parameters + +• **signal**: `AbortSignal` + +• **resource** + +#### Returns + +`Disposable` + +Disposable that removes the `abort` listener. + +#### Since + +v20.5.0 + +#### Inherited from + +`ClientBase.addAbortListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:437 + +--- + +### getEventListeners() + +> `static` **getEventListeners**(`emitter`, `name`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`. + +For `EventEmitter`s this behaves exactly the same as calling `.listeners` on +the emitter. + +For `EventTarget`s this is the only way to get the event listeners for the +event target. This is useful for debugging and diagnostic purposes. + +```js +import { getEventListeners, EventEmitter } from "node:events"; + +{ + const ee = new EventEmitter(); + const listener = () => console.log("Events are fun"); + ee.on("foo", listener); + console.log(getEventListeners(ee, "foo")); // [ [Function: listener] ] +} +{ + const et = new EventTarget(); + const listener = () => console.log("Events are fun"); + et.addEventListener("foo", listener); + console.log(getEventListeners(et, "foo")); // [ [Function: listener] ] +} +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` + +• **name**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v15.2.0, v14.17.0 + +#### Inherited from + +`ClientBase.getEventListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:358 + +--- + +### getMaxListeners() + +> `static` **getMaxListeners**(`emitter`): `number` + +Returns the currently set max amount of listeners. + +For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on +the emitter. + +For `EventTarget`s this is the only way to get the max event listeners for the +event target. If the number of event handlers on a single EventTarget exceeds +the max set, the EventTarget will print a warning. + +```js +import { getMaxListeners, setMaxListeners, EventEmitter } from "node:events"; + +{ + const ee = new EventEmitter(); + console.log(getMaxListeners(ee)); // 10 + setMaxListeners(11, ee); + console.log(getMaxListeners(ee)); // 11 +} +{ + const et = new EventTarget(); + console.log(getMaxListeners(et)); // 10 + setMaxListeners(11, et); + console.log(getMaxListeners(et)); // 11 +} +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` + +#### Returns + +`number` + +#### Since + +v19.9.0 + +#### Inherited from + +`ClientBase.getMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:387 + +--- + +### ~~listenerCount()~~ + +> `static` **listenerCount**(`emitter`, `eventName`): `number` + +A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. + +```js +import { EventEmitter, listenerCount } from "node:events"; + +const myEmitter = new EventEmitter(); +myEmitter.on("event", () => {}); +myEmitter.on("event", () => {}); +console.log(listenerCount(myEmitter, "event")); +// Prints: 2 +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +The emitter to query + +• **eventName**: `string` \| `symbol` + +The event name + +#### Returns + +`number` + +#### Since + +v0.9.12 + +#### Deprecated + +Since v3.2.0 - Use `listenerCount` instead. + +#### Inherited from + +`ClientBase.listenerCount` + +#### Defined in + +node_modules/@types/node/events.d.ts:330 + +--- + +### on() + +#### on(emitter, eventName, options) + +> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +// Emit later on +process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); +}); + +for await (const event of on(ee, "foo")) { + // The execution of this inner block is synchronous and it + // processes one event at a time (even with await). Do not use + // if concurrent execution is required. + console.log(event); // prints ['bar'] [42] +} +// Unreachable here +``` + +Returns an `AsyncIterator` that iterates `eventName` events. It will throw +if the `EventEmitter` emits `'error'`. It removes all listeners when +exiting the loop. The `value` returned by each iteration is an array +composed of the emitted event arguments. + +An `AbortSignal` can be used to cancel waiting on events: + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ac = new AbortController(); + +(async () => { + const ee = new EventEmitter(); + + // Emit later on + process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); + }); + + for await (const event of on(ee, "foo", { signal: ac.signal })) { + // The execution of this inner block is synchronous and it + // processes one event at a time (even with await). Do not use + // if concurrent execution is required. + console.log(event); // prints ['bar'] [42] + } + // Unreachable here +})(); + +process.nextTick(() => ac.abort()); +``` + +Use the `close` option to specify an array of event names that will end the iteration: + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +// Emit later on +process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); + ee.emit("close"); +}); + +for await (const event of on(ee, "foo", { close: ["close"] })) { + console.log(event); // prints ['bar'] [42] +} +// the loop will exit after 'close' is emitted +console.log("done"); // prints 'done' +``` + +##### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +• **eventName**: `string` \| `symbol` + +• **options?**: `StaticEventEmitterIteratorOptions` + +##### Returns + +`AsyncIterator`\<`any`[], `any`, `any`\> + +An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` + +##### Since + +v13.6.0, v12.16.0 + +##### Inherited from + +`ClientBase.on` + +##### Defined in + +node_modules/@types/node/events.d.ts:303 + +#### on(emitter, eventName, options) + +> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> + +##### Parameters + +• **emitter**: `EventTarget` + +• **eventName**: `string` + +• **options?**: `StaticEventEmitterIteratorOptions` + +##### Returns + +`AsyncIterator`\<`any`[], `any`, `any`\> + +##### Inherited from + +`ClientBase.on` + +##### Defined in + +node_modules/@types/node/events.d.ts:308 + +--- + +### once() + +#### once(emitter, eventName, options) + +> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> + +Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given +event or that is rejected if the `EventEmitter` emits `'error'` while waiting. +The `Promise` will resolve with an array of all the arguments emitted to the +given event. + +This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event +semantics and does not listen to the `'error'` event. + +```js +import { once, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +process.nextTick(() => { + ee.emit("myevent", 42); +}); + +const [value] = await once(ee, "myevent"); +console.log(value); + +const err = new Error("kaboom"); +process.nextTick(() => { + ee.emit("error", err); +}); + +try { + await once(ee, "myevent"); +} catch (err) { + console.error("error happened", err); +} +``` + +The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the +'`error'` event itself, then it is treated as any other kind of event without +special handling: + +```js +import { EventEmitter, once } from "node:events"; + +const ee = new EventEmitter(); + +once(ee, "error") + .then(([err]) => console.log("ok", err.message)) + .catch((err) => console.error("error", err.message)); + +ee.emit("error", new Error("boom")); + +// Prints: ok boom +``` + +An `AbortSignal` can be used to cancel waiting for the event: + +```js +import { EventEmitter, once } from "node:events"; + +const ee = new EventEmitter(); +const ac = new AbortController(); + +async function foo(emitter, event, signal) { + try { + await once(emitter, event, { signal }); + console.log("event emitted!"); + } catch (error) { + if (error.name === "AbortError") { + console.error("Waiting for the event was canceled!"); + } else { + console.error("There was an error", error.message); + } + } +} + +foo(ee, "foo", ac.signal); +ac.abort(); // Abort waiting for the event +ee.emit("foo"); // Prints: Waiting for the event was canceled! +``` + +##### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +• **eventName**: `string` \| `symbol` + +• **options?**: `StaticEventEmitterOptions` + +##### Returns + +`Promise`\<`any`[]\> + +##### Since + +v11.13.0, v10.16.0 + +##### Inherited from + +`ClientBase.once` + +##### Defined in + +node_modules/@types/node/events.d.ts:217 + +#### once(emitter, eventName, options) + +> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> + +##### Parameters + +• **emitter**: `EventTarget` + +• **eventName**: `string` + +• **options?**: `StaticEventEmitterOptions` + +##### Returns + +`Promise`\<`any`[]\> + +##### Inherited from + +`ClientBase.once` + +##### Defined in + +node_modules/@types/node/events.d.ts:222 + +--- + +### setMaxListeners() + +> `static` **setMaxListeners**(`n`?, ...`eventTargets`?): `void` + +```js +import { setMaxListeners, EventEmitter } from "node:events"; + +const target = new EventTarget(); +const emitter = new EventEmitter(); + +setMaxListeners(5, target, emitter); +``` + +#### Parameters + +• **n?**: `number` + +A non-negative number. The maximum number of listeners per `EventTarget` event. + +• ...**eventTargets?**: (`EventEmitter`\<`DefaultEventMap`\> \| `EventTarget`)[] + +Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} +objects. + +#### Returns + +`void` + +#### Since + +v15.4.0 + +#### Inherited from + +`ClientBase.setMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:402 diff --git a/docs/docs/api/classes/TwitterPostClient.md b/docs/docs/api/classes/TwitterPostClient.md new file mode 100644 index 00000000000..fbf83d8f83c --- /dev/null +++ b/docs/docs/api/classes/TwitterPostClient.md @@ -0,0 +1,1784 @@ +# Class: TwitterPostClient + +## Extends + +- `ClientBase` + +## Constructors + +### new TwitterPostClient() + +> **new TwitterPostClient**(`runtime`): [`TwitterPostClient`](TwitterPostClient.md) + +#### Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +#### Returns + +[`TwitterPostClient`](TwitterPostClient.md) + +#### Overrides + +`ClientBase.constructor` + +#### Defined in + +[core/src/clients/twitter/post.ts:41](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/post.ts#L41) + +## Properties + +### callback() + +> **callback**: (`self`) => `any` = `null` + +#### Parameters + +• **self**: `ClientBase` + +#### Returns + +`any` + +#### Inherited from + +`ClientBase.callback` + +#### Defined in + +[core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L150) + +--- + +### directions + +> **directions**: `string` + +#### Inherited from + +`ClientBase.directions` + +#### Defined in + +[core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L89) + +--- + +### imageDescriptionService + +> **imageDescriptionService**: `ImageDescriptionService` + +#### Inherited from + +`ClientBase.imageDescriptionService` + +#### Defined in + +[core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L92) + +--- + +### lastCheckedTweetId + +> **lastCheckedTweetId**: `number` = `null` + +#### Inherited from + +`ClientBase.lastCheckedTweetId` + +#### Defined in + +[core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L90) + +--- + +### requestQueue + +> **requestQueue**: `RequestQueue` + +#### Inherited from + +`ClientBase.requestQueue` + +#### Defined in + +[core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L96) + +--- + +### runtime + +> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +#### Inherited from + +`ClientBase.runtime` + +#### Defined in + +[core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L88) + +--- + +### temperature + +> **temperature**: `number` = `0.5` + +#### Inherited from + +`ClientBase.temperature` + +#### Defined in + +[core/src/clients/twitter/base.ts:93](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L93) + +--- + +### tweetCacheFilePath + +> **tweetCacheFilePath**: `string` = `"tweetcache/latest_checked_tweet_id.txt"` + +#### Inherited from + +`ClientBase.tweetCacheFilePath` + +#### Defined in + +[core/src/clients/twitter/base.ts:91](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L91) + +--- + +### twitterClient + +> **twitterClient**: `Scraper` + +#### Inherited from + +`ClientBase.twitterClient` + +#### Defined in + +[core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L87) + +--- + +### twitterUserId + +> **twitterUserId**: `string` + +#### Inherited from + +`ClientBase.twitterUserId` + +#### Defined in + +[core/src/clients/twitter/base.ts:97](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L97) + +--- + +### \_twitterClient + +> `static` **\_twitterClient**: `Scraper` + +#### Inherited from + +`ClientBase._twitterClient` + +#### Defined in + +[core/src/clients/twitter/base.ts:86](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L86) + +--- + +### captureRejections + +> `static` **captureRejections**: `boolean` + +Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) + +Change the default `captureRejections` option on all new `EventEmitter` objects. + +#### Since + +v13.4.0, v12.16.0 + +#### Inherited from + +`ClientBase.captureRejections` + +#### Defined in + +node_modules/@types/node/events.d.ts:459 + +--- + +### captureRejectionSymbol + +> `readonly` `static` **captureRejectionSymbol**: _typeof_ [`captureRejectionSymbol`](TwitterPostClient.md#capturerejectionsymbol) + +Value: `Symbol.for('nodejs.rejection')` + +See how to write a custom `rejection handler`. + +#### Since + +v13.4.0, v12.16.0 + +#### Inherited from + +`ClientBase.captureRejectionSymbol` + +#### Defined in + +node_modules/@types/node/events.d.ts:452 + +--- + +### defaultMaxListeners + +> `static` **defaultMaxListeners**: `number` + +By default, a maximum of `10` listeners can be registered for any single +event. This limit can be changed for individual `EventEmitter` instances +using the `emitter.setMaxListeners(n)` method. To change the default +for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property +can be used. If this value is not a positive number, a `RangeError` is thrown. + +Take caution when setting the `events.defaultMaxListeners` because the +change affects _all_ `EventEmitter` instances, including those created before +the change is made. However, calling `emitter.setMaxListeners(n)` still has +precedence over `events.defaultMaxListeners`. + +This is not a hard limit. The `EventEmitter` instance will allow +more listeners to be added but will output a trace warning to stderr indicating +that a "possible EventEmitter memory leak" has been detected. For any single +`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to +temporarily avoid this warning: + +```js +import { EventEmitter } from "node:events"; +const emitter = new EventEmitter(); +emitter.setMaxListeners(emitter.getMaxListeners() + 1); +emitter.once("event", () => { + // do stuff + emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); +}); +``` + +The `--trace-warnings` command-line flag can be used to display the +stack trace for such warnings. + +The emitted warning can be inspected with `process.on('warning')` and will +have the additional `emitter`, `type`, and `count` properties, referring to +the event emitter instance, the event's name and the number of attached +listeners, respectively. +Its `name` property is set to `'MaxListenersExceededWarning'`. + +#### Since + +v0.11.2 + +#### Inherited from + +`ClientBase.defaultMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:498 + +--- + +### errorMonitor + +> `readonly` `static` **errorMonitor**: _typeof_ [`errorMonitor`](TwitterPostClient.md#errormonitor) + +This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. + +Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no +regular `'error'` listener is installed. + +#### Since + +v13.6.0, v12.17.0 + +#### Inherited from + +`ClientBase.errorMonitor` + +#### Defined in + +node_modules/@types/node/events.d.ts:445 + +## Methods + +### \[captureRejectionSymbol\]()? + +> `optional` **\[captureRejectionSymbol\]**\<`K`\>(`error`, `event`, ...`args`): `void` + +#### Type Parameters + +• **K** + +#### Parameters + +• **error**: `Error` + +• **event**: `string` \| `symbol` + +• ...**args**: `AnyRest` + +#### Returns + +`void` + +#### Inherited from + +`ClientBase.[captureRejectionSymbol]` + +#### Defined in + +node_modules/@types/node/events.d.ts:136 + +--- + +### addListener() + +> **addListener**\<`K`\>(`eventName`, `listener`): `this` + +Alias for `emitter.on(eventName, listener)`. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.addListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:597 + +--- + +### cacheTweet() + +> **cacheTweet**(`tweet`): `Promise`\<`void`\> + +#### Parameters + +• **tweet**: `Tweet` + +#### Returns + +`Promise`\<`void`\> + +#### Inherited from + +`ClientBase.cacheTweet` + +#### Defined in + +[core/src/clients/twitter/base.ts:99](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L99) + +--- + +### emit() + +> **emit**\<`K`\>(`eventName`, ...`args`): `boolean` + +Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments +to each. + +Returns `true` if the event had listeners, `false` otherwise. + +```js +import { EventEmitter } from "node:events"; +const myEmitter = new EventEmitter(); + +// First listener +myEmitter.on("event", function firstListener() { + console.log("Helloooo! first listener"); +}); +// Second listener +myEmitter.on("event", function secondListener(arg1, arg2) { + console.log(`event with parameters ${arg1}, ${arg2} in second listener`); +}); +// Third listener +myEmitter.on("event", function thirdListener(...args) { + const parameters = args.join(", "); + console.log(`event with parameters ${parameters} in third listener`); +}); + +console.log(myEmitter.listeners("event")); + +myEmitter.emit("event", 1, 2, 3, 4, 5); + +// Prints: +// [ +// [Function: firstListener], +// [Function: secondListener], +// [Function: thirdListener] +// ] +// Helloooo! first listener +// event with parameters 1, 2 in second listener +// event with parameters 1, 2, 3, 4, 5 in third listener +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• ...**args**: `AnyRest` + +#### Returns + +`boolean` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.emit` + +#### Defined in + +node_modules/@types/node/events.d.ts:859 + +--- + +### eventNames() + +> **eventNames**(): (`string` \| `symbol`)[] + +Returns an array listing the events for which the emitter has registered +listeners. The values in the array are strings or `Symbol`s. + +```js +import { EventEmitter } from "node:events"; + +const myEE = new EventEmitter(); +myEE.on("foo", () => {}); +myEE.on("bar", () => {}); + +const sym = Symbol("symbol"); +myEE.on(sym, () => {}); + +console.log(myEE.eventNames()); +// Prints: [ 'foo', 'bar', Symbol(symbol) ] +``` + +#### Returns + +(`string` \| `symbol`)[] + +#### Since + +v6.0.0 + +#### Inherited from + +`ClientBase.eventNames` + +#### Defined in + +node_modules/@types/node/events.d.ts:922 + +--- + +### fetchHomeTimeline() + +> **fetchHomeTimeline**(`count`): `Promise`\<`Tweet`[]\> + +#### Parameters + +• **count**: `number` + +#### Returns + +`Promise`\<`Tweet`[]\> + +#### Inherited from + +`ClientBase.fetchHomeTimeline` + +#### Defined in + +[core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L278) + +--- + +### fetchSearchTweets() + +> **fetchSearchTweets**(`query`, `maxTweets`, `searchMode`, `cursor`?): `Promise`\<`QueryTweetsResponse`\> + +#### Parameters + +• **query**: `string` + +• **maxTweets**: `number` + +• **searchMode**: `SearchMode` + +• **cursor?**: `string` + +#### Returns + +`Promise`\<`QueryTweetsResponse`\> + +#### Inherited from + +`ClientBase.fetchSearchTweets` + +#### Defined in + +[core/src/clients/twitter/base.ts:330](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L330) + +--- + +### getCachedTweet() + +> **getCachedTweet**(`tweetId`): `Promise`\<`Tweet`\> + +#### Parameters + +• **tweetId**: `string` + +#### Returns + +`Promise`\<`Tweet`\> + +#### Inherited from + +`ClientBase.getCachedTweet` + +#### Defined in + +[core/src/clients/twitter/base.ts:115](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L115) + +--- + +### getMaxListeners() + +> **getMaxListeners**(): `number` + +Returns the current max listener value for the `EventEmitter` which is either +set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](TwitterPostClient.md#defaultmaxlisteners). + +#### Returns + +`number` + +#### Since + +v1.0.0 + +#### Inherited from + +`ClientBase.getMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:774 + +--- + +### getTweet() + +> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> + +#### Parameters + +• **tweetId**: `string` + +#### Returns + +`Promise`\<`Tweet`\> + +#### Inherited from + +`ClientBase.getTweet` + +#### Defined in + +[core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L137) + +--- + +### listenerCount() + +> **listenerCount**\<`K`\>(`eventName`, `listener`?): `number` + +Returns the number of listeners listening for the event named `eventName`. +If `listener` is provided, it will return how many times the listener is found +in the list of the listeners of the event. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event being listened for + +• **listener?**: `Function` + +The event handler function + +#### Returns + +`number` + +#### Since + +v3.2.0 + +#### Inherited from + +`ClientBase.listenerCount` + +#### Defined in + +node_modules/@types/node/events.d.ts:868 + +--- + +### listeners() + +> **listeners**\<`K`\>(`eventName`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`. + +```js +server.on("connection", (stream) => { + console.log("someone connected!"); +}); +console.log(util.inspect(server.listeners("connection"))); +// Prints: [ [Function] ] +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.listeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:787 + +--- + +### off() + +> **off**\<`K`\>(`eventName`, `listener`): `this` + +Alias for `emitter.removeListener()`. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v10.0.0 + +#### Inherited from + +`ClientBase.off` + +#### Defined in + +node_modules/@types/node/events.d.ts:747 + +--- + +### on() + +> **on**\<`K`\>(`eventName`, `listener`): `this` + +Adds the `listener` function to the end of the listeners array for the event +named `eventName`. No checks are made to see if the `listener` has already +been added. Multiple calls passing the same combination of `eventName` and +`listener` will result in the `listener` being added, and called, multiple times. + +```js +server.on("connection", (stream) => { + console.log("someone connected!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the +event listener to the beginning of the listeners array. + +```js +import { EventEmitter } from "node:events"; +const myEE = new EventEmitter(); +myEE.on("foo", () => console.log("a")); +myEE.prependListener("foo", () => console.log("b")); +myEE.emit("foo"); +// Prints: +// b +// a +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v0.1.101 + +#### Inherited from + +`ClientBase.on` + +#### Defined in + +node_modules/@types/node/events.d.ts:629 + +--- + +### once() + +> **once**\<`K`\>(`eventName`, `listener`): `this` + +Adds a **one-time** `listener` function for the event named `eventName`. The +next time `eventName` is triggered, this listener is removed and then invoked. + +```js +server.once("connection", (stream) => { + console.log("Ah, we have our first user!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the +event listener to the beginning of the listeners array. + +```js +import { EventEmitter } from "node:events"; +const myEE = new EventEmitter(); +myEE.once("foo", () => console.log("a")); +myEE.prependOnceListener("foo", () => console.log("b")); +myEE.emit("foo"); +// Prints: +// b +// a +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v0.3.0 + +#### Inherited from + +`ClientBase.once` + +#### Defined in + +node_modules/@types/node/events.d.ts:659 + +--- + +### onReady() + +> **onReady**(): `void` + +#### Returns + +`void` + +#### Overrides + +`ClientBase.onReady` + +#### Defined in + +[core/src/clients/twitter/post.ts:28](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/post.ts#L28) + +--- + +### prependListener() + +> **prependListener**\<`K`\>(`eventName`, `listener`): `this` + +Adds the `listener` function to the _beginning_ of the listeners array for the +event named `eventName`. No checks are made to see if the `listener` has +already been added. Multiple calls passing the same combination of `eventName` +and `listener` will result in the `listener` being added, and called, multiple times. + +```js +server.prependListener("connection", (stream) => { + console.log("someone connected!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v6.0.0 + +#### Inherited from + +`ClientBase.prependListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:886 + +--- + +### prependOnceListener() + +> **prependOnceListener**\<`K`\>(`eventName`, `listener`): `this` + +Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this +listener is removed, and then invoked. + +```js +server.prependOnceListener("connection", (stream) => { + console.log("Ah, we have our first user!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v6.0.0 + +#### Inherited from + +`ClientBase.prependOnceListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:902 + +--- + +### rawListeners() + +> **rawListeners**\<`K`\>(`eventName`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`, +including any wrappers (such as those created by `.once()`). + +```js +import { EventEmitter } from "node:events"; +const emitter = new EventEmitter(); +emitter.once("log", () => console.log("log once")); + +// Returns a new Array with a function `onceWrapper` which has a property +// `listener` which contains the original listener bound above +const listeners = emitter.rawListeners("log"); +const logFnWrapper = listeners[0]; + +// Logs "log once" to the console and does not unbind the `once` event +logFnWrapper.listener(); + +// Logs "log once" to the console and removes the listener +logFnWrapper(); + +emitter.on("log", () => console.log("log persistently")); +// Will return a new Array with a single function bound by `.on()` above +const newListeners = emitter.rawListeners("log"); + +// Logs "log persistently" twice +newListeners[0](); +emitter.emit("log"); +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v9.4.0 + +#### Inherited from + +`ClientBase.rawListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:818 + +--- + +### removeAllListeners() + +> **removeAllListeners**(`eventName`?): `this` + +Removes all listeners, or those of the specified `eventName`. + +It is bad practice to remove listeners added elsewhere in the code, +particularly when the `EventEmitter` instance was created by some other +component or module (e.g. sockets or file streams). + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Parameters + +• **eventName?**: `string` \| `symbol` + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.removeAllListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:758 + +--- + +### removeListener() + +> **removeListener**\<`K`\>(`eventName`, `listener`): `this` + +Removes the specified `listener` from the listener array for the event named `eventName`. + +```js +const callback = (stream) => { + console.log("someone connected!"); +}; +server.on("connection", callback); +// ... +server.removeListener("connection", callback); +``` + +`removeListener()` will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified `eventName`, then `removeListener()` must be +called multiple times to remove each instance. + +Once an event is emitted, all listeners attached to it at the +time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution +will not remove them from`emit()` in progress. Subsequent events behave as expected. + +```js +import { EventEmitter } from "node:events"; +class MyEmitter extends EventEmitter {} +const myEmitter = new MyEmitter(); + +const callbackA = () => { + console.log("A"); + myEmitter.removeListener("event", callbackB); +}; + +const callbackB = () => { + console.log("B"); +}; + +myEmitter.on("event", callbackA); + +myEmitter.on("event", callbackB); + +// callbackA removes listener callbackB but it will still be called. +// Internal listener array at time of emit [callbackA, callbackB] +myEmitter.emit("event"); +// Prints: +// A +// B + +// callbackB is now removed. +// Internal listener array [callbackA] +myEmitter.emit("event"); +// Prints: +// A +``` + +Because listeners are managed using an internal array, calling this will +change the position indices of any listener registered _after_ the listener +being removed. This will not impact the order in which listeners are called, +but it means that any copies of the listener array as returned by +the `emitter.listeners()` method will need to be recreated. + +When a single function has been added as a handler multiple times for a single +event (as in the example below), `removeListener()` will remove the most +recently added instance. In the example the `once('ping')` listener is removed: + +```js +import { EventEmitter } from "node:events"; +const ee = new EventEmitter(); + +function pong() { + console.log("pong"); +} + +ee.on("ping", pong); +ee.once("ping", pong); +ee.removeListener("ping", pong); + +ee.emit("ping"); +ee.emit("ping"); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.removeListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:742 + +--- + +### saveRequestMessage() + +> **saveRequestMessage**(`message`, `state`): `Promise`\<`void`\> + +#### Parameters + +• **message**: [`Memory`](../interfaces/Memory.md) + +• **state**: [`State`](../interfaces/State.md) + +#### Returns + +`Promise`\<`void`\> + +#### Inherited from + +`ClientBase.saveRequestMessage` + +#### Defined in + +[core/src/clients/twitter/base.ts:572](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L572) + +--- + +### setCookiesFromArray() + +> **setCookiesFromArray**(`cookiesArray`): `Promise`\<`void`\> + +#### Parameters + +• **cookiesArray**: `any`[] + +#### Returns + +`Promise`\<`void`\> + +#### Inherited from + +`ClientBase.setCookiesFromArray` + +#### Defined in + +[core/src/clients/twitter/base.ts:560](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L560) + +--- + +### setMaxListeners() + +> **setMaxListeners**(`n`): `this` + +By default `EventEmitter`s will print a warning if more than `10` listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. The `emitter.setMaxListeners()` method allows the limit to be +modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Parameters + +• **n**: `number` + +#### Returns + +`this` + +#### Since + +v0.3.5 + +#### Inherited from + +`ClientBase.setMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:768 + +--- + +### addAbortListener() + +> `static` **addAbortListener**(`signal`, `resource`): `Disposable` + +**`Experimental`** + +Listens once to the `abort` event on the provided `signal`. + +Listening to the `abort` event on abort signals is unsafe and may +lead to resource leaks since another third party with the signal can +call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change +this since it would violate the web standard. Additionally, the original +API makes it easy to forget to remove listeners. + +This API allows safely using `AbortSignal`s in Node.js APIs by solving these +two issues by listening to the event such that `stopImmediatePropagation` does +not prevent the listener from running. + +Returns a disposable so that it may be unsubscribed from more easily. + +```js +import { addAbortListener } from "node:events"; + +function example(signal) { + let disposable; + try { + signal.addEventListener("abort", (e) => e.stopImmediatePropagation()); + disposable = addAbortListener(signal, (e) => { + // Do something when signal is aborted. + }); + } finally { + disposable?.[Symbol.dispose](); + } +} +``` + +#### Parameters + +• **signal**: `AbortSignal` + +• **resource** + +#### Returns + +`Disposable` + +Disposable that removes the `abort` listener. + +#### Since + +v20.5.0 + +#### Inherited from + +`ClientBase.addAbortListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:437 + +--- + +### getEventListeners() + +> `static` **getEventListeners**(`emitter`, `name`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`. + +For `EventEmitter`s this behaves exactly the same as calling `.listeners` on +the emitter. + +For `EventTarget`s this is the only way to get the event listeners for the +event target. This is useful for debugging and diagnostic purposes. + +```js +import { getEventListeners, EventEmitter } from "node:events"; + +{ + const ee = new EventEmitter(); + const listener = () => console.log("Events are fun"); + ee.on("foo", listener); + console.log(getEventListeners(ee, "foo")); // [ [Function: listener] ] +} +{ + const et = new EventTarget(); + const listener = () => console.log("Events are fun"); + et.addEventListener("foo", listener); + console.log(getEventListeners(et, "foo")); // [ [Function: listener] ] +} +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` + +• **name**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v15.2.0, v14.17.0 + +#### Inherited from + +`ClientBase.getEventListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:358 + +--- + +### getMaxListeners() + +> `static` **getMaxListeners**(`emitter`): `number` + +Returns the currently set max amount of listeners. + +For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on +the emitter. + +For `EventTarget`s this is the only way to get the max event listeners for the +event target. If the number of event handlers on a single EventTarget exceeds +the max set, the EventTarget will print a warning. + +```js +import { getMaxListeners, setMaxListeners, EventEmitter } from "node:events"; + +{ + const ee = new EventEmitter(); + console.log(getMaxListeners(ee)); // 10 + setMaxListeners(11, ee); + console.log(getMaxListeners(ee)); // 11 +} +{ + const et = new EventTarget(); + console.log(getMaxListeners(et)); // 10 + setMaxListeners(11, et); + console.log(getMaxListeners(et)); // 11 +} +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` + +#### Returns + +`number` + +#### Since + +v19.9.0 + +#### Inherited from + +`ClientBase.getMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:387 + +--- + +### ~~listenerCount()~~ + +> `static` **listenerCount**(`emitter`, `eventName`): `number` + +A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. + +```js +import { EventEmitter, listenerCount } from "node:events"; + +const myEmitter = new EventEmitter(); +myEmitter.on("event", () => {}); +myEmitter.on("event", () => {}); +console.log(listenerCount(myEmitter, "event")); +// Prints: 2 +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +The emitter to query + +• **eventName**: `string` \| `symbol` + +The event name + +#### Returns + +`number` + +#### Since + +v0.9.12 + +#### Deprecated + +Since v3.2.0 - Use `listenerCount` instead. + +#### Inherited from + +`ClientBase.listenerCount` + +#### Defined in + +node_modules/@types/node/events.d.ts:330 + +--- + +### on() + +#### on(emitter, eventName, options) + +> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +// Emit later on +process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); +}); + +for await (const event of on(ee, "foo")) { + // The execution of this inner block is synchronous and it + // processes one event at a time (even with await). Do not use + // if concurrent execution is required. + console.log(event); // prints ['bar'] [42] +} +// Unreachable here +``` + +Returns an `AsyncIterator` that iterates `eventName` events. It will throw +if the `EventEmitter` emits `'error'`. It removes all listeners when +exiting the loop. The `value` returned by each iteration is an array +composed of the emitted event arguments. + +An `AbortSignal` can be used to cancel waiting on events: + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ac = new AbortController(); + +(async () => { + const ee = new EventEmitter(); + + // Emit later on + process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); + }); + + for await (const event of on(ee, "foo", { signal: ac.signal })) { + // The execution of this inner block is synchronous and it + // processes one event at a time (even with await). Do not use + // if concurrent execution is required. + console.log(event); // prints ['bar'] [42] + } + // Unreachable here +})(); + +process.nextTick(() => ac.abort()); +``` + +Use the `close` option to specify an array of event names that will end the iteration: + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +// Emit later on +process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); + ee.emit("close"); +}); + +for await (const event of on(ee, "foo", { close: ["close"] })) { + console.log(event); // prints ['bar'] [42] +} +// the loop will exit after 'close' is emitted +console.log("done"); // prints 'done' +``` + +##### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +• **eventName**: `string` \| `symbol` + +• **options?**: `StaticEventEmitterIteratorOptions` + +##### Returns + +`AsyncIterator`\<`any`[], `any`, `any`\> + +An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` + +##### Since + +v13.6.0, v12.16.0 + +##### Inherited from + +`ClientBase.on` + +##### Defined in + +node_modules/@types/node/events.d.ts:303 + +#### on(emitter, eventName, options) + +> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> + +##### Parameters + +• **emitter**: `EventTarget` + +• **eventName**: `string` + +• **options?**: `StaticEventEmitterIteratorOptions` + +##### Returns + +`AsyncIterator`\<`any`[], `any`, `any`\> + +##### Inherited from + +`ClientBase.on` + +##### Defined in + +node_modules/@types/node/events.d.ts:308 + +--- + +### once() + +#### once(emitter, eventName, options) + +> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> + +Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given +event or that is rejected if the `EventEmitter` emits `'error'` while waiting. +The `Promise` will resolve with an array of all the arguments emitted to the +given event. + +This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event +semantics and does not listen to the `'error'` event. + +```js +import { once, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +process.nextTick(() => { + ee.emit("myevent", 42); +}); + +const [value] = await once(ee, "myevent"); +console.log(value); + +const err = new Error("kaboom"); +process.nextTick(() => { + ee.emit("error", err); +}); + +try { + await once(ee, "myevent"); +} catch (err) { + console.error("error happened", err); +} +``` + +The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the +'`error'` event itself, then it is treated as any other kind of event without +special handling: + +```js +import { EventEmitter, once } from "node:events"; + +const ee = new EventEmitter(); + +once(ee, "error") + .then(([err]) => console.log("ok", err.message)) + .catch((err) => console.error("error", err.message)); + +ee.emit("error", new Error("boom")); + +// Prints: ok boom +``` + +An `AbortSignal` can be used to cancel waiting for the event: + +```js +import { EventEmitter, once } from "node:events"; + +const ee = new EventEmitter(); +const ac = new AbortController(); + +async function foo(emitter, event, signal) { + try { + await once(emitter, event, { signal }); + console.log("event emitted!"); + } catch (error) { + if (error.name === "AbortError") { + console.error("Waiting for the event was canceled!"); + } else { + console.error("There was an error", error.message); + } + } +} + +foo(ee, "foo", ac.signal); +ac.abort(); // Abort waiting for the event +ee.emit("foo"); // Prints: Waiting for the event was canceled! +``` + +##### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +• **eventName**: `string` \| `symbol` + +• **options?**: `StaticEventEmitterOptions` + +##### Returns + +`Promise`\<`any`[]\> + +##### Since + +v11.13.0, v10.16.0 + +##### Inherited from + +`ClientBase.once` + +##### Defined in + +node_modules/@types/node/events.d.ts:217 + +#### once(emitter, eventName, options) + +> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> + +##### Parameters + +• **emitter**: `EventTarget` + +• **eventName**: `string` + +• **options?**: `StaticEventEmitterOptions` + +##### Returns + +`Promise`\<`any`[]\> + +##### Inherited from + +`ClientBase.once` + +##### Defined in + +node_modules/@types/node/events.d.ts:222 + +--- + +### setMaxListeners() + +> `static` **setMaxListeners**(`n`?, ...`eventTargets`?): `void` + +```js +import { setMaxListeners, EventEmitter } from "node:events"; + +const target = new EventTarget(); +const emitter = new EventEmitter(); + +setMaxListeners(5, target, emitter); +``` + +#### Parameters + +• **n?**: `number` + +A non-negative number. The maximum number of listeners per `EventTarget` event. + +• ...**eventTargets?**: (`EventEmitter`\<`DefaultEventMap`\> \| `EventTarget`)[] + +Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} +objects. + +#### Returns + +`void` + +#### Since + +v15.4.0 + +#### Inherited from + +`ClientBase.setMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:402 diff --git a/docs/docs/api/classes/TwitterSearchClient.md b/docs/docs/api/classes/TwitterSearchClient.md new file mode 100644 index 00000000000..ab977bd41e2 --- /dev/null +++ b/docs/docs/api/classes/TwitterSearchClient.md @@ -0,0 +1,1784 @@ +# Class: TwitterSearchClient + +## Extends + +- `ClientBase` + +## Constructors + +### new TwitterSearchClient() + +> **new TwitterSearchClient**(`runtime`): [`TwitterSearchClient`](TwitterSearchClient.md) + +#### Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +#### Returns + +[`TwitterSearchClient`](TwitterSearchClient.md) + +#### Overrides + +`ClientBase.constructor` + +#### Defined in + +[core/src/clients/twitter/search.ts:53](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/search.ts#L53) + +## Properties + +### callback() + +> **callback**: (`self`) => `any` = `null` + +#### Parameters + +• **self**: `ClientBase` + +#### Returns + +`any` + +#### Inherited from + +`ClientBase.callback` + +#### Defined in + +[core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L150) + +--- + +### directions + +> **directions**: `string` + +#### Inherited from + +`ClientBase.directions` + +#### Defined in + +[core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L89) + +--- + +### imageDescriptionService + +> **imageDescriptionService**: `ImageDescriptionService` + +#### Inherited from + +`ClientBase.imageDescriptionService` + +#### Defined in + +[core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L92) + +--- + +### lastCheckedTweetId + +> **lastCheckedTweetId**: `number` = `null` + +#### Inherited from + +`ClientBase.lastCheckedTweetId` + +#### Defined in + +[core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L90) + +--- + +### requestQueue + +> **requestQueue**: `RequestQueue` + +#### Inherited from + +`ClientBase.requestQueue` + +#### Defined in + +[core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L96) + +--- + +### runtime + +> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +#### Inherited from + +`ClientBase.runtime` + +#### Defined in + +[core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L88) + +--- + +### temperature + +> **temperature**: `number` = `0.5` + +#### Inherited from + +`ClientBase.temperature` + +#### Defined in + +[core/src/clients/twitter/base.ts:93](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L93) + +--- + +### tweetCacheFilePath + +> **tweetCacheFilePath**: `string` = `"tweetcache/latest_checked_tweet_id.txt"` + +#### Inherited from + +`ClientBase.tweetCacheFilePath` + +#### Defined in + +[core/src/clients/twitter/base.ts:91](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L91) + +--- + +### twitterClient + +> **twitterClient**: `Scraper` + +#### Inherited from + +`ClientBase.twitterClient` + +#### Defined in + +[core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L87) + +--- + +### twitterUserId + +> **twitterUserId**: `string` + +#### Inherited from + +`ClientBase.twitterUserId` + +#### Defined in + +[core/src/clients/twitter/base.ts:97](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L97) + +--- + +### \_twitterClient + +> `static` **\_twitterClient**: `Scraper` + +#### Inherited from + +`ClientBase._twitterClient` + +#### Defined in + +[core/src/clients/twitter/base.ts:86](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L86) + +--- + +### captureRejections + +> `static` **captureRejections**: `boolean` + +Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) + +Change the default `captureRejections` option on all new `EventEmitter` objects. + +#### Since + +v13.4.0, v12.16.0 + +#### Inherited from + +`ClientBase.captureRejections` + +#### Defined in + +node_modules/@types/node/events.d.ts:459 + +--- + +### captureRejectionSymbol + +> `readonly` `static` **captureRejectionSymbol**: _typeof_ [`captureRejectionSymbol`](TwitterPostClient.md#capturerejectionsymbol) + +Value: `Symbol.for('nodejs.rejection')` + +See how to write a custom `rejection handler`. + +#### Since + +v13.4.0, v12.16.0 + +#### Inherited from + +`ClientBase.captureRejectionSymbol` + +#### Defined in + +node_modules/@types/node/events.d.ts:452 + +--- + +### defaultMaxListeners + +> `static` **defaultMaxListeners**: `number` + +By default, a maximum of `10` listeners can be registered for any single +event. This limit can be changed for individual `EventEmitter` instances +using the `emitter.setMaxListeners(n)` method. To change the default +for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property +can be used. If this value is not a positive number, a `RangeError` is thrown. + +Take caution when setting the `events.defaultMaxListeners` because the +change affects _all_ `EventEmitter` instances, including those created before +the change is made. However, calling `emitter.setMaxListeners(n)` still has +precedence over `events.defaultMaxListeners`. + +This is not a hard limit. The `EventEmitter` instance will allow +more listeners to be added but will output a trace warning to stderr indicating +that a "possible EventEmitter memory leak" has been detected. For any single +`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to +temporarily avoid this warning: + +```js +import { EventEmitter } from "node:events"; +const emitter = new EventEmitter(); +emitter.setMaxListeners(emitter.getMaxListeners() + 1); +emitter.once("event", () => { + // do stuff + emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); +}); +``` + +The `--trace-warnings` command-line flag can be used to display the +stack trace for such warnings. + +The emitted warning can be inspected with `process.on('warning')` and will +have the additional `emitter`, `type`, and `count` properties, referring to +the event emitter instance, the event's name and the number of attached +listeners, respectively. +Its `name` property is set to `'MaxListenersExceededWarning'`. + +#### Since + +v0.11.2 + +#### Inherited from + +`ClientBase.defaultMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:498 + +--- + +### errorMonitor + +> `readonly` `static` **errorMonitor**: _typeof_ [`errorMonitor`](TwitterPostClient.md#errormonitor) + +This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. + +Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no +regular `'error'` listener is installed. + +#### Since + +v13.6.0, v12.17.0 + +#### Inherited from + +`ClientBase.errorMonitor` + +#### Defined in + +node_modules/@types/node/events.d.ts:445 + +## Methods + +### \[captureRejectionSymbol\]()? + +> `optional` **\[captureRejectionSymbol\]**\<`K`\>(`error`, `event`, ...`args`): `void` + +#### Type Parameters + +• **K** + +#### Parameters + +• **error**: `Error` + +• **event**: `string` \| `symbol` + +• ...**args**: `AnyRest` + +#### Returns + +`void` + +#### Inherited from + +`ClientBase.[captureRejectionSymbol]` + +#### Defined in + +node_modules/@types/node/events.d.ts:136 + +--- + +### addListener() + +> **addListener**\<`K`\>(`eventName`, `listener`): `this` + +Alias for `emitter.on(eventName, listener)`. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.addListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:597 + +--- + +### cacheTweet() + +> **cacheTweet**(`tweet`): `Promise`\<`void`\> + +#### Parameters + +• **tweet**: `Tweet` + +#### Returns + +`Promise`\<`void`\> + +#### Inherited from + +`ClientBase.cacheTweet` + +#### Defined in + +[core/src/clients/twitter/base.ts:99](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L99) + +--- + +### emit() + +> **emit**\<`K`\>(`eventName`, ...`args`): `boolean` + +Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments +to each. + +Returns `true` if the event had listeners, `false` otherwise. + +```js +import { EventEmitter } from "node:events"; +const myEmitter = new EventEmitter(); + +// First listener +myEmitter.on("event", function firstListener() { + console.log("Helloooo! first listener"); +}); +// Second listener +myEmitter.on("event", function secondListener(arg1, arg2) { + console.log(`event with parameters ${arg1}, ${arg2} in second listener`); +}); +// Third listener +myEmitter.on("event", function thirdListener(...args) { + const parameters = args.join(", "); + console.log(`event with parameters ${parameters} in third listener`); +}); + +console.log(myEmitter.listeners("event")); + +myEmitter.emit("event", 1, 2, 3, 4, 5); + +// Prints: +// [ +// [Function: firstListener], +// [Function: secondListener], +// [Function: thirdListener] +// ] +// Helloooo! first listener +// event with parameters 1, 2 in second listener +// event with parameters 1, 2, 3, 4, 5 in third listener +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• ...**args**: `AnyRest` + +#### Returns + +`boolean` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.emit` + +#### Defined in + +node_modules/@types/node/events.d.ts:859 + +--- + +### eventNames() + +> **eventNames**(): (`string` \| `symbol`)[] + +Returns an array listing the events for which the emitter has registered +listeners. The values in the array are strings or `Symbol`s. + +```js +import { EventEmitter } from "node:events"; + +const myEE = new EventEmitter(); +myEE.on("foo", () => {}); +myEE.on("bar", () => {}); + +const sym = Symbol("symbol"); +myEE.on(sym, () => {}); + +console.log(myEE.eventNames()); +// Prints: [ 'foo', 'bar', Symbol(symbol) ] +``` + +#### Returns + +(`string` \| `symbol`)[] + +#### Since + +v6.0.0 + +#### Inherited from + +`ClientBase.eventNames` + +#### Defined in + +node_modules/@types/node/events.d.ts:922 + +--- + +### fetchHomeTimeline() + +> **fetchHomeTimeline**(`count`): `Promise`\<`Tweet`[]\> + +#### Parameters + +• **count**: `number` + +#### Returns + +`Promise`\<`Tweet`[]\> + +#### Inherited from + +`ClientBase.fetchHomeTimeline` + +#### Defined in + +[core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L278) + +--- + +### fetchSearchTweets() + +> **fetchSearchTweets**(`query`, `maxTweets`, `searchMode`, `cursor`?): `Promise`\<`QueryTweetsResponse`\> + +#### Parameters + +• **query**: `string` + +• **maxTweets**: `number` + +• **searchMode**: `SearchMode` + +• **cursor?**: `string` + +#### Returns + +`Promise`\<`QueryTweetsResponse`\> + +#### Inherited from + +`ClientBase.fetchSearchTweets` + +#### Defined in + +[core/src/clients/twitter/base.ts:330](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L330) + +--- + +### getCachedTweet() + +> **getCachedTweet**(`tweetId`): `Promise`\<`Tweet`\> + +#### Parameters + +• **tweetId**: `string` + +#### Returns + +`Promise`\<`Tweet`\> + +#### Inherited from + +`ClientBase.getCachedTweet` + +#### Defined in + +[core/src/clients/twitter/base.ts:115](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L115) + +--- + +### getMaxListeners() + +> **getMaxListeners**(): `number` + +Returns the current max listener value for the `EventEmitter` which is either +set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](TwitterSearchClient.md#defaultmaxlisteners). + +#### Returns + +`number` + +#### Since + +v1.0.0 + +#### Inherited from + +`ClientBase.getMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:774 + +--- + +### getTweet() + +> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> + +#### Parameters + +• **tweetId**: `string` + +#### Returns + +`Promise`\<`Tweet`\> + +#### Inherited from + +`ClientBase.getTweet` + +#### Defined in + +[core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L137) + +--- + +### listenerCount() + +> **listenerCount**\<`K`\>(`eventName`, `listener`?): `number` + +Returns the number of listeners listening for the event named `eventName`. +If `listener` is provided, it will return how many times the listener is found +in the list of the listeners of the event. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event being listened for + +• **listener?**: `Function` + +The event handler function + +#### Returns + +`number` + +#### Since + +v3.2.0 + +#### Inherited from + +`ClientBase.listenerCount` + +#### Defined in + +node_modules/@types/node/events.d.ts:868 + +--- + +### listeners() + +> **listeners**\<`K`\>(`eventName`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`. + +```js +server.on("connection", (stream) => { + console.log("someone connected!"); +}); +console.log(util.inspect(server.listeners("connection"))); +// Prints: [ [Function] ] +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.listeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:787 + +--- + +### off() + +> **off**\<`K`\>(`eventName`, `listener`): `this` + +Alias for `emitter.removeListener()`. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v10.0.0 + +#### Inherited from + +`ClientBase.off` + +#### Defined in + +node_modules/@types/node/events.d.ts:747 + +--- + +### on() + +> **on**\<`K`\>(`eventName`, `listener`): `this` + +Adds the `listener` function to the end of the listeners array for the event +named `eventName`. No checks are made to see if the `listener` has already +been added. Multiple calls passing the same combination of `eventName` and +`listener` will result in the `listener` being added, and called, multiple times. + +```js +server.on("connection", (stream) => { + console.log("someone connected!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the +event listener to the beginning of the listeners array. + +```js +import { EventEmitter } from "node:events"; +const myEE = new EventEmitter(); +myEE.on("foo", () => console.log("a")); +myEE.prependListener("foo", () => console.log("b")); +myEE.emit("foo"); +// Prints: +// b +// a +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v0.1.101 + +#### Inherited from + +`ClientBase.on` + +#### Defined in + +node_modules/@types/node/events.d.ts:629 + +--- + +### once() + +> **once**\<`K`\>(`eventName`, `listener`): `this` + +Adds a **one-time** `listener` function for the event named `eventName`. The +next time `eventName` is triggered, this listener is removed and then invoked. + +```js +server.once("connection", (stream) => { + console.log("Ah, we have our first user!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the +event listener to the beginning of the listeners array. + +```js +import { EventEmitter } from "node:events"; +const myEE = new EventEmitter(); +myEE.once("foo", () => console.log("a")); +myEE.prependOnceListener("foo", () => console.log("b")); +myEE.emit("foo"); +// Prints: +// b +// a +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v0.3.0 + +#### Inherited from + +`ClientBase.once` + +#### Defined in + +node_modules/@types/node/events.d.ts:659 + +--- + +### onReady() + +> **onReady**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +#### Overrides + +`ClientBase.onReady` + +#### Defined in + +[core/src/clients/twitter/search.ts:60](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/search.ts#L60) + +--- + +### prependListener() + +> **prependListener**\<`K`\>(`eventName`, `listener`): `this` + +Adds the `listener` function to the _beginning_ of the listeners array for the +event named `eventName`. No checks are made to see if the `listener` has +already been added. Multiple calls passing the same combination of `eventName` +and `listener` will result in the `listener` being added, and called, multiple times. + +```js +server.prependListener("connection", (stream) => { + console.log("someone connected!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v6.0.0 + +#### Inherited from + +`ClientBase.prependListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:886 + +--- + +### prependOnceListener() + +> **prependOnceListener**\<`K`\>(`eventName`, `listener`): `this` + +Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this +listener is removed, and then invoked. + +```js +server.prependOnceListener("connection", (stream) => { + console.log("Ah, we have our first user!"); +}); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +The name of the event. + +• **listener** + +The callback function + +#### Returns + +`this` + +#### Since + +v6.0.0 + +#### Inherited from + +`ClientBase.prependOnceListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:902 + +--- + +### rawListeners() + +> **rawListeners**\<`K`\>(`eventName`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`, +including any wrappers (such as those created by `.once()`). + +```js +import { EventEmitter } from "node:events"; +const emitter = new EventEmitter(); +emitter.once("log", () => console.log("log once")); + +// Returns a new Array with a function `onceWrapper` which has a property +// `listener` which contains the original listener bound above +const listeners = emitter.rawListeners("log"); +const logFnWrapper = listeners[0]; + +// Logs "log once" to the console and does not unbind the `once` event +logFnWrapper.listener(); + +// Logs "log once" to the console and removes the listener +logFnWrapper(); + +emitter.on("log", () => console.log("log persistently")); +// Will return a new Array with a single function bound by `.on()` above +const newListeners = emitter.rawListeners("log"); + +// Logs "log persistently" twice +newListeners[0](); +emitter.emit("log"); +``` + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v9.4.0 + +#### Inherited from + +`ClientBase.rawListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:818 + +--- + +### removeAllListeners() + +> **removeAllListeners**(`eventName`?): `this` + +Removes all listeners, or those of the specified `eventName`. + +It is bad practice to remove listeners added elsewhere in the code, +particularly when the `EventEmitter` instance was created by some other +component or module (e.g. sockets or file streams). + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Parameters + +• **eventName?**: `string` \| `symbol` + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.removeAllListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:758 + +--- + +### removeListener() + +> **removeListener**\<`K`\>(`eventName`, `listener`): `this` + +Removes the specified `listener` from the listener array for the event named `eventName`. + +```js +const callback = (stream) => { + console.log("someone connected!"); +}; +server.on("connection", callback); +// ... +server.removeListener("connection", callback); +``` + +`removeListener()` will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified `eventName`, then `removeListener()` must be +called multiple times to remove each instance. + +Once an event is emitted, all listeners attached to it at the +time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution +will not remove them from`emit()` in progress. Subsequent events behave as expected. + +```js +import { EventEmitter } from "node:events"; +class MyEmitter extends EventEmitter {} +const myEmitter = new MyEmitter(); + +const callbackA = () => { + console.log("A"); + myEmitter.removeListener("event", callbackB); +}; + +const callbackB = () => { + console.log("B"); +}; + +myEmitter.on("event", callbackA); + +myEmitter.on("event", callbackB); + +// callbackA removes listener callbackB but it will still be called. +// Internal listener array at time of emit [callbackA, callbackB] +myEmitter.emit("event"); +// Prints: +// A +// B + +// callbackB is now removed. +// Internal listener array [callbackA] +myEmitter.emit("event"); +// Prints: +// A +``` + +Because listeners are managed using an internal array, calling this will +change the position indices of any listener registered _after_ the listener +being removed. This will not impact the order in which listeners are called, +but it means that any copies of the listener array as returned by +the `emitter.listeners()` method will need to be recreated. + +When a single function has been added as a handler multiple times for a single +event (as in the example below), `removeListener()` will remove the most +recently added instance. In the example the `once('ping')` listener is removed: + +```js +import { EventEmitter } from "node:events"; +const ee = new EventEmitter(); + +function pong() { + console.log("pong"); +} + +ee.on("ping", pong); +ee.once("ping", pong); +ee.removeListener("ping", pong); + +ee.emit("ping"); +ee.emit("ping"); +``` + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Type Parameters + +• **K** + +#### Parameters + +• **eventName**: `string` \| `symbol` + +• **listener** + +#### Returns + +`this` + +#### Since + +v0.1.26 + +#### Inherited from + +`ClientBase.removeListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:742 + +--- + +### saveRequestMessage() + +> **saveRequestMessage**(`message`, `state`): `Promise`\<`void`\> + +#### Parameters + +• **message**: [`Memory`](../interfaces/Memory.md) + +• **state**: [`State`](../interfaces/State.md) + +#### Returns + +`Promise`\<`void`\> + +#### Inherited from + +`ClientBase.saveRequestMessage` + +#### Defined in + +[core/src/clients/twitter/base.ts:572](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L572) + +--- + +### setCookiesFromArray() + +> **setCookiesFromArray**(`cookiesArray`): `Promise`\<`void`\> + +#### Parameters + +• **cookiesArray**: `any`[] + +#### Returns + +`Promise`\<`void`\> + +#### Inherited from + +`ClientBase.setCookiesFromArray` + +#### Defined in + +[core/src/clients/twitter/base.ts:560](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L560) + +--- + +### setMaxListeners() + +> **setMaxListeners**(`n`): `this` + +By default `EventEmitter`s will print a warning if more than `10` listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. The `emitter.setMaxListeners()` method allows the limit to be +modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. + +Returns a reference to the `EventEmitter`, so that calls can be chained. + +#### Parameters + +• **n**: `number` + +#### Returns + +`this` + +#### Since + +v0.3.5 + +#### Inherited from + +`ClientBase.setMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:768 + +--- + +### addAbortListener() + +> `static` **addAbortListener**(`signal`, `resource`): `Disposable` + +**`Experimental`** + +Listens once to the `abort` event on the provided `signal`. + +Listening to the `abort` event on abort signals is unsafe and may +lead to resource leaks since another third party with the signal can +call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change +this since it would violate the web standard. Additionally, the original +API makes it easy to forget to remove listeners. + +This API allows safely using `AbortSignal`s in Node.js APIs by solving these +two issues by listening to the event such that `stopImmediatePropagation` does +not prevent the listener from running. + +Returns a disposable so that it may be unsubscribed from more easily. + +```js +import { addAbortListener } from "node:events"; + +function example(signal) { + let disposable; + try { + signal.addEventListener("abort", (e) => e.stopImmediatePropagation()); + disposable = addAbortListener(signal, (e) => { + // Do something when signal is aborted. + }); + } finally { + disposable?.[Symbol.dispose](); + } +} +``` + +#### Parameters + +• **signal**: `AbortSignal` + +• **resource** + +#### Returns + +`Disposable` + +Disposable that removes the `abort` listener. + +#### Since + +v20.5.0 + +#### Inherited from + +`ClientBase.addAbortListener` + +#### Defined in + +node_modules/@types/node/events.d.ts:437 + +--- + +### getEventListeners() + +> `static` **getEventListeners**(`emitter`, `name`): `Function`[] + +Returns a copy of the array of listeners for the event named `eventName`. + +For `EventEmitter`s this behaves exactly the same as calling `.listeners` on +the emitter. + +For `EventTarget`s this is the only way to get the event listeners for the +event target. This is useful for debugging and diagnostic purposes. + +```js +import { getEventListeners, EventEmitter } from "node:events"; + +{ + const ee = new EventEmitter(); + const listener = () => console.log("Events are fun"); + ee.on("foo", listener); + console.log(getEventListeners(ee, "foo")); // [ [Function: listener] ] +} +{ + const et = new EventTarget(); + const listener = () => console.log("Events are fun"); + et.addEventListener("foo", listener); + console.log(getEventListeners(et, "foo")); // [ [Function: listener] ] +} +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` + +• **name**: `string` \| `symbol` + +#### Returns + +`Function`[] + +#### Since + +v15.2.0, v14.17.0 + +#### Inherited from + +`ClientBase.getEventListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:358 + +--- + +### getMaxListeners() + +> `static` **getMaxListeners**(`emitter`): `number` + +Returns the currently set max amount of listeners. + +For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on +the emitter. + +For `EventTarget`s this is the only way to get the max event listeners for the +event target. If the number of event handlers on a single EventTarget exceeds +the max set, the EventTarget will print a warning. + +```js +import { getMaxListeners, setMaxListeners, EventEmitter } from "node:events"; + +{ + const ee = new EventEmitter(); + console.log(getMaxListeners(ee)); // 10 + setMaxListeners(11, ee); + console.log(getMaxListeners(ee)); // 11 +} +{ + const et = new EventTarget(); + console.log(getMaxListeners(et)); // 10 + setMaxListeners(11, et); + console.log(getMaxListeners(et)); // 11 +} +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` + +#### Returns + +`number` + +#### Since + +v19.9.0 + +#### Inherited from + +`ClientBase.getMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:387 + +--- + +### ~~listenerCount()~~ + +> `static` **listenerCount**(`emitter`, `eventName`): `number` + +A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. + +```js +import { EventEmitter, listenerCount } from "node:events"; + +const myEmitter = new EventEmitter(); +myEmitter.on("event", () => {}); +myEmitter.on("event", () => {}); +console.log(listenerCount(myEmitter, "event")); +// Prints: 2 +``` + +#### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +The emitter to query + +• **eventName**: `string` \| `symbol` + +The event name + +#### Returns + +`number` + +#### Since + +v0.9.12 + +#### Deprecated + +Since v3.2.0 - Use `listenerCount` instead. + +#### Inherited from + +`ClientBase.listenerCount` + +#### Defined in + +node_modules/@types/node/events.d.ts:330 + +--- + +### on() + +#### on(emitter, eventName, options) + +> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +// Emit later on +process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); +}); + +for await (const event of on(ee, "foo")) { + // The execution of this inner block is synchronous and it + // processes one event at a time (even with await). Do not use + // if concurrent execution is required. + console.log(event); // prints ['bar'] [42] +} +// Unreachable here +``` + +Returns an `AsyncIterator` that iterates `eventName` events. It will throw +if the `EventEmitter` emits `'error'`. It removes all listeners when +exiting the loop. The `value` returned by each iteration is an array +composed of the emitted event arguments. + +An `AbortSignal` can be used to cancel waiting on events: + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ac = new AbortController(); + +(async () => { + const ee = new EventEmitter(); + + // Emit later on + process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); + }); + + for await (const event of on(ee, "foo", { signal: ac.signal })) { + // The execution of this inner block is synchronous and it + // processes one event at a time (even with await). Do not use + // if concurrent execution is required. + console.log(event); // prints ['bar'] [42] + } + // Unreachable here +})(); + +process.nextTick(() => ac.abort()); +``` + +Use the `close` option to specify an array of event names that will end the iteration: + +```js +import { on, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +// Emit later on +process.nextTick(() => { + ee.emit("foo", "bar"); + ee.emit("foo", 42); + ee.emit("close"); +}); + +for await (const event of on(ee, "foo", { close: ["close"] })) { + console.log(event); // prints ['bar'] [42] +} +// the loop will exit after 'close' is emitted +console.log("done"); // prints 'done' +``` + +##### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +• **eventName**: `string` \| `symbol` + +• **options?**: `StaticEventEmitterIteratorOptions` + +##### Returns + +`AsyncIterator`\<`any`[], `any`, `any`\> + +An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` + +##### Since + +v13.6.0, v12.16.0 + +##### Inherited from + +`ClientBase.on` + +##### Defined in + +node_modules/@types/node/events.d.ts:303 + +#### on(emitter, eventName, options) + +> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> + +##### Parameters + +• **emitter**: `EventTarget` + +• **eventName**: `string` + +• **options?**: `StaticEventEmitterIteratorOptions` + +##### Returns + +`AsyncIterator`\<`any`[], `any`, `any`\> + +##### Inherited from + +`ClientBase.on` + +##### Defined in + +node_modules/@types/node/events.d.ts:308 + +--- + +### once() + +#### once(emitter, eventName, options) + +> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> + +Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given +event or that is rejected if the `EventEmitter` emits `'error'` while waiting. +The `Promise` will resolve with an array of all the arguments emitted to the +given event. + +This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event +semantics and does not listen to the `'error'` event. + +```js +import { once, EventEmitter } from "node:events"; +import process from "node:process"; + +const ee = new EventEmitter(); + +process.nextTick(() => { + ee.emit("myevent", 42); +}); + +const [value] = await once(ee, "myevent"); +console.log(value); + +const err = new Error("kaboom"); +process.nextTick(() => { + ee.emit("error", err); +}); + +try { + await once(ee, "myevent"); +} catch (err) { + console.error("error happened", err); +} +``` + +The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the +'`error'` event itself, then it is treated as any other kind of event without +special handling: + +```js +import { EventEmitter, once } from "node:events"; + +const ee = new EventEmitter(); + +once(ee, "error") + .then(([err]) => console.log("ok", err.message)) + .catch((err) => console.error("error", err.message)); + +ee.emit("error", new Error("boom")); + +// Prints: ok boom +``` + +An `AbortSignal` can be used to cancel waiting for the event: + +```js +import { EventEmitter, once } from "node:events"; + +const ee = new EventEmitter(); +const ac = new AbortController(); + +async function foo(emitter, event, signal) { + try { + await once(emitter, event, { signal }); + console.log("event emitted!"); + } catch (error) { + if (error.name === "AbortError") { + console.error("Waiting for the event was canceled!"); + } else { + console.error("There was an error", error.message); + } + } +} + +foo(ee, "foo", ac.signal); +ac.abort(); // Abort waiting for the event +ee.emit("foo"); // Prints: Waiting for the event was canceled! +``` + +##### Parameters + +• **emitter**: `EventEmitter`\<`DefaultEventMap`\> + +• **eventName**: `string` \| `symbol` + +• **options?**: `StaticEventEmitterOptions` + +##### Returns + +`Promise`\<`any`[]\> + +##### Since + +v11.13.0, v10.16.0 + +##### Inherited from + +`ClientBase.once` + +##### Defined in + +node_modules/@types/node/events.d.ts:217 + +#### once(emitter, eventName, options) + +> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> + +##### Parameters + +• **emitter**: `EventTarget` + +• **eventName**: `string` + +• **options?**: `StaticEventEmitterOptions` + +##### Returns + +`Promise`\<`any`[]\> + +##### Inherited from + +`ClientBase.once` + +##### Defined in + +node_modules/@types/node/events.d.ts:222 + +--- + +### setMaxListeners() + +> `static` **setMaxListeners**(`n`?, ...`eventTargets`?): `void` + +```js +import { setMaxListeners, EventEmitter } from "node:events"; + +const target = new EventTarget(); +const emitter = new EventEmitter(); + +setMaxListeners(5, target, emitter); +``` + +#### Parameters + +• **n?**: `number` + +A non-negative number. The maximum number of listeners per `EventTarget` event. + +• ...**eventTargets?**: (`EventEmitter`\<`DefaultEventMap`\> \| `EventTarget`)[] + +Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} +objects. + +#### Returns + +`void` + +#### Since + +v15.4.0 + +#### Inherited from + +`ClientBase.setMaxListeners` + +#### Defined in + +node_modules/@types/node/events.d.ts:402 diff --git a/docs/docs/api/classes/WalletProvider.md b/docs/docs/api/classes/WalletProvider.md new file mode 100644 index 00000000000..7f0284df838 --- /dev/null +++ b/docs/docs/api/classes/WalletProvider.md @@ -0,0 +1,97 @@ +# Class: WalletProvider + +## Constructors + +### new WalletProvider() + +> **new WalletProvider**(`connection`, `walletPublicKey`): [`WalletProvider`](WalletProvider.md) + +#### Parameters + +• **connection**: `Connection` + +• **walletPublicKey**: `PublicKey` + +#### Returns + +[`WalletProvider`](WalletProvider.md) + +#### Defined in + +[core/src/providers/wallet.ts:53](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L53) + +## Methods + +### fetchPortfolioValue() + +> **fetchPortfolioValue**(`runtime`): `Promise`\<`WalletPortfolio`\> + +#### Parameters + +• **runtime**: `any` + +#### Returns + +`Promise`\<`WalletPortfolio`\> + +#### Defined in + +[core/src/providers/wallet.ts:105](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L105) + +--- + +### fetchPrices() + +> **fetchPrices**(`runtime`): `Promise`\<`Prices`\> + +#### Parameters + +• **runtime**: `any` + +#### Returns + +`Promise`\<`Prices`\> + +#### Defined in + +[core/src/providers/wallet.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L150) + +--- + +### formatPortfolio() + +> **formatPortfolio**(`runtime`, `portfolio`, `prices`): `string` + +#### Parameters + +• **runtime**: `any` + +• **portfolio**: `WalletPortfolio` + +• **prices**: `Prices` + +#### Returns + +`string` + +#### Defined in + +[core/src/providers/wallet.ts:192](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L192) + +--- + +### getFormattedPortfolio() + +> **getFormattedPortfolio**(`runtime`): `Promise`\<`string`\> + +#### Parameters + +• **runtime**: `any` + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[core/src/providers/wallet.ts:229](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L229) diff --git a/docs/docs/api/enumerations/Clients.md b/docs/docs/api/enumerations/Clients.md new file mode 100644 index 00000000000..2639b8da956 --- /dev/null +++ b/docs/docs/api/enumerations/Clients.md @@ -0,0 +1,41 @@ +# Enumeration: Clients + +## Enumeration Members + +### DIRECT + +> **DIRECT**: `"direct"` + +#### Defined in + +[core/src/core/types.ts:300](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L300) + +--- + +### DISCORD + +> **DISCORD**: `"discord"` + +#### Defined in + +[core/src/core/types.ts:299](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L299) + +--- + +### TELEGRAM + +> **TELEGRAM**: `"telegram"` + +#### Defined in + +[core/src/core/types.ts:302](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L302) + +--- + +### TWITTER + +> **TWITTER**: `"twitter"` + +#### Defined in + +[core/src/core/types.ts:301](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L301) diff --git a/docs/docs/api/enumerations/GoalStatus.md b/docs/docs/api/enumerations/GoalStatus.md new file mode 100644 index 00000000000..3bec50a388d --- /dev/null +++ b/docs/docs/api/enumerations/GoalStatus.md @@ -0,0 +1,31 @@ +# Enumeration: GoalStatus + +## Enumeration Members + +### DONE + +> **DONE**: `"DONE"` + +#### Defined in + +[core/src/core/types.ts:58](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L58) + +--- + +### FAILED + +> **FAILED**: `"FAILED"` + +#### Defined in + +[core/src/core/types.ts:59](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L59) + +--- + +### IN_PROGRESS + +> **IN_PROGRESS**: `"IN_PROGRESS"` + +#### Defined in + +[core/src/core/types.ts:60](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L60) diff --git a/docs/docs/api/enumerations/ImageGenModel.md b/docs/docs/api/enumerations/ImageGenModel.md new file mode 100644 index 00000000000..e9b366064ba --- /dev/null +++ b/docs/docs/api/enumerations/ImageGenModel.md @@ -0,0 +1,21 @@ +# Enumeration: ImageGenModel + +## Enumeration Members + +### Dalle + +> **Dalle**: `"Dalle"` + +#### Defined in + +[core/src/core/imageGenModels.ts:3](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L3) + +--- + +### TogetherAI + +> **TogetherAI**: `"TogetherAI"` + +#### Defined in + +[core/src/core/imageGenModels.ts:2](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L2) diff --git a/docs/docs/api/enumerations/ModelClass.md b/docs/docs/api/enumerations/ModelClass.md new file mode 100644 index 00000000000..ff8b6242396 --- /dev/null +++ b/docs/docs/api/enumerations/ModelClass.md @@ -0,0 +1,41 @@ +# Enumeration: ModelClass + +## Enumeration Members + +### EMBEDDING + +> **EMBEDDING**: `"embedding"` + +#### Defined in + +[core/src/core/types.ts:79](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L79) + +--- + +### LARGE + +> **LARGE**: `"large"` + +#### Defined in + +[core/src/core/types.ts:78](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L78) + +--- + +### MEDIUM + +> **MEDIUM**: `"medium"` + +#### Defined in + +[core/src/core/types.ts:77](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L77) + +--- + +### SMALL + +> **SMALL**: `"small"` + +#### Defined in + +[core/src/core/types.ts:76](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L76) diff --git a/docs/docs/api/enumerations/ModelProvider.md b/docs/docs/api/enumerations/ModelProvider.md new file mode 100644 index 00000000000..8cea253f246 --- /dev/null +++ b/docs/docs/api/enumerations/ModelProvider.md @@ -0,0 +1,101 @@ +# Enumeration: ModelProvider + +## Enumeration Members + +### ANTHROPIC + +> **ANTHROPIC**: `"anthropic"` + +#### Defined in + +[core/src/core/types.ts:103](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L103) + +--- + +### CLAUDE_VERTEX + +> **CLAUDE_VERTEX**: `"claude_vertex"` + +#### Defined in + +[core/src/core/types.ts:109](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L109) + +--- + +### GITHUB + +> **GITHUB**: `"GITHUB"` + +#### Defined in + +[core/src/core/types.ts:111](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L111) + +--- + +### GOOGLE + +> **GOOGLE**: `"google"` + +#### Defined in + +[core/src/core/types.ts:108](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L108) + +--- + +### GROK + +> **GROK**: `"grok"` + +#### Defined in + +[core/src/core/types.ts:104](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L104) + +--- + +### GROQ + +> **GROQ**: `"groq"` + +#### Defined in + +[core/src/core/types.ts:105](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L105) + +--- + +### LLAMACLOUD + +> **LLAMACLOUD**: `"llama_cloud"` + +#### Defined in + +[core/src/core/types.ts:106](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L106) + +--- + +### LLAMALOCAL + +> **LLAMALOCAL**: `"llama_local"` + +#### Defined in + +[core/src/core/types.ts:107](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L107) + +--- + +### OPENAI + +> **OPENAI**: `"openai"` + +#### Defined in + +[core/src/core/types.ts:102](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L102) + +--- + +### REDPILL + +> **REDPILL**: `"redpill"` + +#### Defined in + +[core/src/core/types.ts:110](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L110) diff --git a/docs/docs/api/functions/addHeader.md b/docs/docs/api/functions/addHeader.md new file mode 100644 index 00000000000..b93ea9b2445 --- /dev/null +++ b/docs/docs/api/functions/addHeader.md @@ -0,0 +1,40 @@ +# Function: addHeader() + +> **addHeader**(`header`, `body`): `string` + +Adds a header to a body of text. + +This function takes a header string and a body string and returns a new string with the header prepended to the body. +If the body string is empty, the header is returned as is. + +## Parameters + +• **header**: `string` + +The header to add to the body. + +• **body**: `string` + +The body to which to add the header. + +## Returns + +`string` + +The body with the header prepended. + +## Example + +```ts +// Given a header and a body +const header = "Header"; +const body = "Body"; + +// Adding the header to the body will result in: +// "Header\nBody" +const text = addHeader(header, body); +``` + +## Defined in + +[core/src/core/context.ts:58](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/context.ts#L58) diff --git a/docs/docs/api/functions/buyToken.md b/docs/docs/api/functions/buyToken.md new file mode 100644 index 00000000000..98dfb5f0d55 --- /dev/null +++ b/docs/docs/api/functions/buyToken.md @@ -0,0 +1,31 @@ +# Function: buyToken() + +> **buyToken**(`__namedParameters`): `Promise`\<`void`\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.allowOffCurve**: `boolean` + +• **\_\_namedParameters.amount**: `bigint` + +• **\_\_namedParameters.buyer**: `Keypair` + +• **\_\_namedParameters.connection**: `Connection` + +• **\_\_namedParameters.mint**: `PublicKey` + +• **\_\_namedParameters.priorityFee**: `PriorityFee` + +• **\_\_namedParameters.sdk**: `PumpFunSDK` + +• **\_\_namedParameters.slippage**: `string` + +## Returns + +`Promise`\<`void`\> + +## Defined in + +[core/src/actions/pumpfun.ts:119](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L119) diff --git a/docs/docs/api/functions/composeActionExamples.md b/docs/docs/api/functions/composeActionExamples.md new file mode 100644 index 00000000000..8ba5371a578 --- /dev/null +++ b/docs/docs/api/functions/composeActionExamples.md @@ -0,0 +1,26 @@ +# Function: composeActionExamples() + +> **composeActionExamples**(`actionsData`, `count`): `string` + +Composes a set of example conversations based on provided actions and a specified count. +It randomly selects examples from the provided actions and formats them with generated names. + +## Parameters + +• **actionsData**: [`Action`](../interfaces/Action.md)[] + +An array of `Action` objects from which to draw examples. + +• **count**: `number` + +The number of examples to generate. + +## Returns + +`string` + +A string containing formatted examples of conversations. + +## Defined in + +[core/src/core/actions.ts:18](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/actions.ts#L18) diff --git a/docs/docs/api/functions/composeContext.md b/docs/docs/api/functions/composeContext.md new file mode 100644 index 00000000000..df9064caa56 --- /dev/null +++ b/docs/docs/api/functions/composeContext.md @@ -0,0 +1,45 @@ +# Function: composeContext() + +> **composeContext**(`params`): `string` + +Composes a context string by replacing placeholders in a template with corresponding values from the state. + +This function takes a template string with placeholders in the format `{{placeholder}}` and a state object. +It replaces each placeholder with the value from the state object that matches the placeholder's name. +If a matching key is not found in the state object for a given placeholder, the placeholder is replaced with an empty string. + +## Parameters + +• **params** + +The parameters for composing the context. + +• **params.state**: [`State`](../interfaces/State.md) + +The state object containing values to replace the placeholders in the template. + +• **params.template**: `string` + +The template string containing placeholders to be replaced with state values. + +## Returns + +`string` + +The composed context string with placeholders replaced by corresponding state values. + +## Example + +```ts +// Given a state object and a template +const state = { userName: "Alice", userAge: 30 }; +const template = "Hello, {{userName}}! You are {{userAge}} years old"; + +// Composing the context will result in: +// "Hello, Alice! You are 30 years old." +const context = composeContext({ state, template }); +``` + +## Defined in + +[core/src/core/context.ts:24](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/context.ts#L24) diff --git a/docs/docs/api/functions/createAgentRuntime.md b/docs/docs/api/functions/createAgentRuntime.md new file mode 100644 index 00000000000..ef33390ee9a --- /dev/null +++ b/docs/docs/api/functions/createAgentRuntime.md @@ -0,0 +1,21 @@ +# Function: createAgentRuntime() + +> **createAgentRuntime**(`character`, `db`, `token`, `configPath`): `Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> + +## Parameters + +• **character**: [`Character`](../type-aliases/Character.md) + +• **db**: `any` + +• **token**: `string` + +• **configPath**: `string` = `"./elizaConfig.yaml"` + +## Returns + +`Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> + +## Defined in + +[core/src/cli/index.ts:139](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L139) diff --git a/docs/docs/api/functions/createAndBuyToken.md b/docs/docs/api/functions/createAndBuyToken.md new file mode 100644 index 00000000000..06add699226 --- /dev/null +++ b/docs/docs/api/functions/createAndBuyToken.md @@ -0,0 +1,35 @@ +# Function: createAndBuyToken() + +> **createAndBuyToken**(`__namedParameters`): `Promise`\<`void`\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.allowOffCurve**: `boolean` + +• **\_\_namedParameters.buyAmountSol**: `bigint` + +• **\_\_namedParameters.commitment?**: `"processed"` \| `"confirmed"` \| `"finalized"` \| `"recent"` \| `"single"` \| `"singleGossip"` \| `"root"` \| `"max"` = `"finalized"` + +• **\_\_namedParameters.connection**: `Connection` + +• **\_\_namedParameters.deployer**: `Keypair` + +• **\_\_namedParameters.mint**: `Keypair` + +• **\_\_namedParameters.priorityFee**: `PriorityFee` + +• **\_\_namedParameters.sdk**: `PumpFunSDK` + +• **\_\_namedParameters.slippage**: `string` + +• **\_\_namedParameters.tokenMetadata**: `CreateTokenMetadata` + +## Returns + +`Promise`\<`void`\> + +## Defined in + +[core/src/actions/pumpfun.ts:51](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L51) diff --git a/docs/docs/api/functions/createDirectRuntime.md b/docs/docs/api/functions/createDirectRuntime.md new file mode 100644 index 00000000000..256a9cf0b05 --- /dev/null +++ b/docs/docs/api/functions/createDirectRuntime.md @@ -0,0 +1,21 @@ +# Function: createDirectRuntime() + +> **createDirectRuntime**(`character`, `db`, `token`, `configPath`): `Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> + +## Parameters + +• **character**: [`Character`](../type-aliases/Character.md) + +• **db**: `any` + +• **token**: `string` + +• **configPath**: `string` = `"./elizaConfig.yaml"` + +## Returns + +`Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> + +## Defined in + +[core/src/cli/index.ts:174](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L174) diff --git a/docs/docs/api/functions/createGoal.md b/docs/docs/api/functions/createGoal.md new file mode 100644 index 00000000000..afa2fc3f4f6 --- /dev/null +++ b/docs/docs/api/functions/createGoal.md @@ -0,0 +1,19 @@ +# Function: createGoal() + +> **createGoal**(`__namedParameters`): `Promise`\<`void`\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.goal**: [`Goal`](../interfaces/Goal.md) + +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<`void`\> + +## Defined in + +[core/src/core/goals.ts:54](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/goals.ts#L54) diff --git a/docs/docs/api/functions/createRelationship.md b/docs/docs/api/functions/createRelationship.md new file mode 100644 index 00000000000..431a17e4a05 --- /dev/null +++ b/docs/docs/api/functions/createRelationship.md @@ -0,0 +1,21 @@ +# Function: createRelationship() + +> **createRelationship**(`__namedParameters`): `Promise`\<`boolean`\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **\_\_namedParameters.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **\_\_namedParameters.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +## Returns + +`Promise`\<`boolean`\> + +## Defined in + +[core/src/core/relationships.ts:3](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/relationships.ts#L3) diff --git a/docs/docs/api/functions/embed.md b/docs/docs/api/functions/embed.md new file mode 100644 index 00000000000..9c9492cbc5b --- /dev/null +++ b/docs/docs/api/functions/embed.md @@ -0,0 +1,23 @@ +# Function: embed() + +> **embed**(`runtime`, `input`): `Promise`\<`number`[]\> + +Send a message to the OpenAI API for embedding. + +## Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **input**: `string` + +The input to be embedded. + +## Returns + +`Promise`\<`number`[]\> + +The embedding of the input. + +## Defined in + +[core/src/core/embedding.ts:9](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/embedding.ts#L9) diff --git a/docs/docs/api/functions/formatActionNames.md b/docs/docs/api/functions/formatActionNames.md new file mode 100644 index 00000000000..e2b189af443 --- /dev/null +++ b/docs/docs/api/functions/formatActionNames.md @@ -0,0 +1,21 @@ +# Function: formatActionNames() + +> **formatActionNames**(`actions`): `string` + +Formats the names of the provided actions into a comma-separated string. + +## Parameters + +• **actions**: [`Action`](../interfaces/Action.md)[] + +An array of `Action` objects from which to extract names. + +## Returns + +`string` + +A comma-separated string of action names. + +## Defined in + +[core/src/core/actions.ts:54](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/actions.ts#L54) diff --git a/docs/docs/api/functions/formatActions.md b/docs/docs/api/functions/formatActions.md new file mode 100644 index 00000000000..9b181d7bb39 --- /dev/null +++ b/docs/docs/api/functions/formatActions.md @@ -0,0 +1,21 @@ +# Function: formatActions() + +> **formatActions**(`actions`): `string` + +Formats the provided actions into a detailed string listing each action's name and description, separated by commas and newlines. + +## Parameters + +• **actions**: [`Action`](../interfaces/Action.md)[] + +An array of `Action` objects to format. + +## Returns + +`string` + +A detailed string of actions, including names and descriptions. + +## Defined in + +[core/src/core/actions.ts:66](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/actions.ts#L66) diff --git a/docs/docs/api/functions/formatActors.md b/docs/docs/api/functions/formatActors.md new file mode 100644 index 00000000000..43b2112243e --- /dev/null +++ b/docs/docs/api/functions/formatActors.md @@ -0,0 +1,23 @@ +# Function: formatActors() + +> **formatActors**(`actors`): `string` + +Format actors into a string + +## Parameters + +• **actors** + +list of actors + +• **actors.actors**: [`Actor`](../interfaces/Actor.md)[] + +## Returns + +`string` + +string + +## Defined in + +[core/src/core/messages.ts:45](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/messages.ts#L45) diff --git a/docs/docs/api/functions/formatEvaluatorExampleDescriptions.md b/docs/docs/api/functions/formatEvaluatorExampleDescriptions.md new file mode 100644 index 00000000000..3c3e677ecf4 --- /dev/null +++ b/docs/docs/api/functions/formatEvaluatorExampleDescriptions.md @@ -0,0 +1,21 @@ +# Function: formatEvaluatorExampleDescriptions() + +> **formatEvaluatorExampleDescriptions**(`evaluators`): `string` + +Generates a string summarizing the descriptions of each evaluator example. + +## Parameters + +• **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] + +An array of evaluator objects, each containing examples. + +## Returns + +`string` + +A string that summarizes the descriptions for each evaluator example, formatted with the evaluator name, example number, and description. + +## Defined in + +[core/src/core/evaluators.ts:114](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L114) diff --git a/docs/docs/api/functions/formatEvaluatorExamples.md b/docs/docs/api/functions/formatEvaluatorExamples.md new file mode 100644 index 00000000000..b0e29b29d8c --- /dev/null +++ b/docs/docs/api/functions/formatEvaluatorExamples.md @@ -0,0 +1,21 @@ +# Function: formatEvaluatorExamples() + +> **formatEvaluatorExamples**(`evaluators`): `string` + +Formats evaluator examples into a readable string, replacing placeholders with generated names. + +## Parameters + +• **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] + +An array of evaluator objects, each containing examples to format. + +## Returns + +`string` + +A string that presents each evaluator example in a structured format, including context, messages, and outcomes, with placeholders replaced by generated names. + +## Defined in + +[core/src/core/evaluators.ts:59](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L59) diff --git a/docs/docs/api/functions/formatEvaluatorNames.md b/docs/docs/api/functions/formatEvaluatorNames.md new file mode 100644 index 00000000000..f6786782383 --- /dev/null +++ b/docs/docs/api/functions/formatEvaluatorNames.md @@ -0,0 +1,21 @@ +# Function: formatEvaluatorNames() + +> **formatEvaluatorNames**(`evaluators`): `string` + +Formats the names of evaluators into a comma-separated list, each enclosed in single quotes. + +## Parameters + +• **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] + +An array of evaluator objects. + +## Returns + +`string` + +A string that concatenates the names of all evaluators, each enclosed in single quotes and separated by commas. + +## Defined in + +[core/src/core/evaluators.ts:34](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L34) diff --git a/docs/docs/api/functions/formatEvaluators.md b/docs/docs/api/functions/formatEvaluators.md new file mode 100644 index 00000000000..bdabc314acf --- /dev/null +++ b/docs/docs/api/functions/formatEvaluators.md @@ -0,0 +1,21 @@ +# Function: formatEvaluators() + +> **formatEvaluators**(`evaluators`): `string` + +Formats evaluator details into a string, including both the name and description of each evaluator. + +## Parameters + +• **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] + +An array of evaluator objects. + +## Returns + +`string` + +A string that concatenates the name and description of each evaluator, separated by a colon and a newline character. + +## Defined in + +[core/src/core/evaluators.ts:45](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L45) diff --git a/docs/docs/api/functions/formatGoalsAsString.md b/docs/docs/api/functions/formatGoalsAsString.md new file mode 100644 index 00000000000..abf951cbdef --- /dev/null +++ b/docs/docs/api/functions/formatGoalsAsString.md @@ -0,0 +1,17 @@ +# Function: formatGoalsAsString() + +> **formatGoalsAsString**(`__namedParameters`): `string` + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.goals**: [`Goal`](../interfaces/Goal.md)[] + +## Returns + +`string` + +## Defined in + +[core/src/core/goals.ts:29](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/goals.ts#L29) diff --git a/docs/docs/api/functions/formatMessages.md b/docs/docs/api/functions/formatMessages.md new file mode 100644 index 00000000000..7dd245834e5 --- /dev/null +++ b/docs/docs/api/functions/formatMessages.md @@ -0,0 +1,23 @@ +# Function: formatMessages() + +> **formatMessages**(`__namedParameters`): `string` + +Format messages into a string + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.actors**: [`Actor`](../interfaces/Actor.md)[] + +• **\_\_namedParameters.messages**: [`Memory`](../interfaces/Memory.md)[] + +## Returns + +`string` + +string + +## Defined in + +[core/src/core/messages.ts:60](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/messages.ts#L60) diff --git a/docs/docs/api/functions/formatPosts.md b/docs/docs/api/functions/formatPosts.md new file mode 100644 index 00000000000..565fc5d3363 --- /dev/null +++ b/docs/docs/api/functions/formatPosts.md @@ -0,0 +1,21 @@ +# Function: formatPosts() + +> **formatPosts**(`__namedParameters`): `string` + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.actors**: [`Actor`](../interfaces/Actor.md)[] + +• **\_\_namedParameters.conversationHeader?**: `boolean` = `true` + +• **\_\_namedParameters.messages**: [`Memory`](../interfaces/Memory.md)[] + +## Returns + +`string` + +## Defined in + +[core/src/core/posts.ts:4](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/posts.ts#L4) diff --git a/docs/docs/api/functions/formatRelationships.md b/docs/docs/api/functions/formatRelationships.md new file mode 100644 index 00000000000..cd1d8dd7544 --- /dev/null +++ b/docs/docs/api/functions/formatRelationships.md @@ -0,0 +1,19 @@ +# Function: formatRelationships() + +> **formatRelationships**(`__namedParameters`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **\_\_namedParameters.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +## Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +## Defined in + +[core/src/core/relationships.ts:43](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/relationships.ts#L43) diff --git a/docs/docs/api/functions/formatTimestamp.md b/docs/docs/api/functions/formatTimestamp.md new file mode 100644 index 00000000000..a33b4ceed5c --- /dev/null +++ b/docs/docs/api/functions/formatTimestamp.md @@ -0,0 +1,15 @@ +# Function: formatTimestamp() + +> **formatTimestamp**(`messageDate`): `string` + +## Parameters + +• **messageDate**: `number` + +## Returns + +`string` + +## Defined in + +[core/src/core/messages.ts:94](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/messages.ts#L94) diff --git a/docs/docs/api/functions/generateCaption.md b/docs/docs/api/functions/generateCaption.md new file mode 100644 index 00000000000..3f9b6eaea67 --- /dev/null +++ b/docs/docs/api/functions/generateCaption.md @@ -0,0 +1,27 @@ +# Function: generateCaption() + +> **generateCaption**(`data`, `runtime`): `Promise`\<`object`\> + +## Parameters + +• **data** + +• **data.imageUrl**: `string` + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<`object`\> + +### description + +> **description**: `string` + +### title + +> **title**: `string` + +## Defined in + +[core/src/actions/imageGenerationUtils.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/imageGenerationUtils.ts#L90) diff --git a/docs/docs/api/functions/generateImage.md b/docs/docs/api/functions/generateImage.md new file mode 100644 index 00000000000..e5b91938b03 --- /dev/null +++ b/docs/docs/api/functions/generateImage.md @@ -0,0 +1,37 @@ +# Function: generateImage() + +> **generateImage**(`data`, `runtime`): `Promise`\<`object`\> + +## Parameters + +• **data** + +• **data.count?**: `number` + +• **data.height**: `number` + +• **data.prompt**: `string` + +• **data.width**: `number` + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<`object`\> + +### data? + +> `optional` **data**: `string`[] + +### error? + +> `optional` **error**: `any` + +### success + +> **success**: `boolean` + +## Defined in + +[core/src/actions/imageGenerationUtils.ts:8](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/imageGenerationUtils.ts#L8) diff --git a/docs/docs/api/functions/generateMessageResponse.md b/docs/docs/api/functions/generateMessageResponse.md new file mode 100644 index 00000000000..90542895ec8 --- /dev/null +++ b/docs/docs/api/functions/generateMessageResponse.md @@ -0,0 +1,29 @@ +# Function: generateMessageResponse() + +> **generateMessageResponse**(`opts`): `Promise`\<[`Content`](../interfaces/Content.md)\> + +Send a message to the model for generateText. + +## Parameters + +• **opts** + +The options for the generateText request. + +• **opts.context**: `string` + +The context of the message to be completed. + +• **opts.modelClass**: `string` + +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<[`Content`](../interfaces/Content.md)\> + +The completed message. + +## Defined in + +[core/src/core/generation.ts:522](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L522) diff --git a/docs/docs/api/functions/generateObject.md b/docs/docs/api/functions/generateObject.md new file mode 100644 index 00000000000..9d1dbf9eea2 --- /dev/null +++ b/docs/docs/api/functions/generateObject.md @@ -0,0 +1,21 @@ +# Function: generateObject() + +> **generateObject**(`__namedParameters`): `Promise`\<`any`\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.context**: `string` + +• **\_\_namedParameters.modelClass**: `string` + +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<`any`\> + +## Defined in + +[core/src/core/generation.ts:438](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L438) diff --git a/docs/docs/api/functions/generateObjectArray.md b/docs/docs/api/functions/generateObjectArray.md new file mode 100644 index 00000000000..af24589e74d --- /dev/null +++ b/docs/docs/api/functions/generateObjectArray.md @@ -0,0 +1,21 @@ +# Function: generateObjectArray() + +> **generateObjectArray**(`__namedParameters`): `Promise`\<`any`[]\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.context**: `string` + +• **\_\_namedParameters.modelClass**: `string` + +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<`any`[]\> + +## Defined in + +[core/src/core/generation.ts:474](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L474) diff --git a/docs/docs/api/functions/generateShouldRespond.md b/docs/docs/api/functions/generateShouldRespond.md new file mode 100644 index 00000000000..5f73dfa705e --- /dev/null +++ b/docs/docs/api/functions/generateShouldRespond.md @@ -0,0 +1,29 @@ +# Function: generateShouldRespond() + +> **generateShouldRespond**(`opts`): `Promise`\<`"RESPOND"` \| `"IGNORE"` \| `"STOP"` \| `null`\> + +Sends a message to the model to determine if it should respond to the given context. + +## Parameters + +• **opts** + +The options for the generateText request + +• **opts.context**: `string` + +The context to evaluate for response + +• **opts.modelClass**: `string` + +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<`"RESPOND"` \| `"IGNORE"` \| `"STOP"` \| `null`\> + +Promise resolving to "RESPOND", "IGNORE", "STOP" or null + +## Defined in + +[core/src/core/generation.ts:249](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L249) diff --git a/docs/docs/api/functions/generateText.md b/docs/docs/api/functions/generateText.md new file mode 100644 index 00000000000..4c5c6da9974 --- /dev/null +++ b/docs/docs/api/functions/generateText.md @@ -0,0 +1,33 @@ +# Function: generateText() + +> **generateText**(`opts`): `Promise`\<`string`\> + +Send a message to the model for a text generateText - receive a string back and parse how you'd like + +## Parameters + +• **opts** + +The options for the generateText request. + +• **opts.context**: `string` + +The context of the message to be completed. + +• **opts.modelClass**: `string` + +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **opts.stop?**: `string`[] + +A list of strings to stop the generateText at. + +## Returns + +`Promise`\<`string`\> + +The completed message. + +## Defined in + +[core/src/core/generation.ts:30](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L30) diff --git a/docs/docs/api/functions/generateTextArray.md b/docs/docs/api/functions/generateTextArray.md new file mode 100644 index 00000000000..8aa1618631a --- /dev/null +++ b/docs/docs/api/functions/generateTextArray.md @@ -0,0 +1,29 @@ +# Function: generateTextArray() + +> **generateTextArray**(`opts`): `Promise`\<`string`[]\> + +Send a message to the model and parse the response as a string array + +## Parameters + +• **opts** + +The options for the generateText request + +• **opts.context**: `string` + +The context/prompt to send to the model + +• **opts.modelClass**: `string` + +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<`string`[]\> + +Promise resolving to an array of strings parsed from the model's response + +## Defined in + +[core/src/core/generation.ts:402](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L402) diff --git a/docs/docs/api/functions/generateTrueOrFalse.md b/docs/docs/api/functions/generateTrueOrFalse.md new file mode 100644 index 00000000000..55a73fb8203 --- /dev/null +++ b/docs/docs/api/functions/generateTrueOrFalse.md @@ -0,0 +1,29 @@ +# Function: generateTrueOrFalse() + +> **generateTrueOrFalse**(`opts`): `Promise`\<`boolean`\> + +Sends a message to the model and parses the response as a boolean value + +## Parameters + +• **opts** + +The options for the generateText request + +• **opts.context**: `string` = `""` + +The context to evaluate for the boolean response + +• **opts.modelClass**: `string` + +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<`boolean`\> + +Promise resolving to a boolean value parsed from the model's response + +## Defined in + +[core/src/core/generation.ts:350](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L350) diff --git a/docs/docs/api/functions/getActorDetails.md b/docs/docs/api/functions/getActorDetails.md new file mode 100644 index 00000000000..fd1308e231a --- /dev/null +++ b/docs/docs/api/functions/getActorDetails.md @@ -0,0 +1,21 @@ +# Function: getActorDetails() + +> **getActorDetails**(`__namedParameters`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +Get details for a list of actors. + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +## Defined in + +[core/src/core/messages.ts:12](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/messages.ts#L12) diff --git a/docs/docs/api/functions/getEndpoint.md b/docs/docs/api/functions/getEndpoint.md new file mode 100644 index 00000000000..80d526b74a8 --- /dev/null +++ b/docs/docs/api/functions/getEndpoint.md @@ -0,0 +1,15 @@ +# Function: getEndpoint() + +> **getEndpoint**(`provider`): `any` + +## Parameters + +• **provider**: [`ModelProvider`](../enumerations/ModelProvider.md) + +## Returns + +`any` + +## Defined in + +[core/src/core/models.ts:178](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/models.ts#L178) diff --git a/docs/docs/api/functions/getGoals.md b/docs/docs/api/functions/getGoals.md new file mode 100644 index 00000000000..145fbd9bed4 --- /dev/null +++ b/docs/docs/api/functions/getGoals.md @@ -0,0 +1,25 @@ +# Function: getGoals() + +> **getGoals**(`__namedParameters`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.count?**: `number` = `5` + +• **\_\_namedParameters.onlyInProgress?**: `boolean` = `true` + +• **\_\_namedParameters.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **\_\_namedParameters.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +## Returns + +`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +## Defined in + +[core/src/core/goals.ts:8](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/goals.ts#L8) diff --git a/docs/docs/api/functions/getImageGenModel.md b/docs/docs/api/functions/getImageGenModel.md new file mode 100644 index 00000000000..cb905f53167 --- /dev/null +++ b/docs/docs/api/functions/getImageGenModel.md @@ -0,0 +1,15 @@ +# Function: getImageGenModel() + +> **getImageGenModel**(`model`): `object` \| `object` + +## Parameters + +• **model**: [`ImageGenModel`](../enumerations/ImageGenModel.md) + +## Returns + +`object` \| `object` + +## Defined in + +[core/src/core/imageGenModels.ts:17](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L17) diff --git a/docs/docs/api/functions/getModel.md b/docs/docs/api/functions/getModel.md new file mode 100644 index 00000000000..9c980265b4e --- /dev/null +++ b/docs/docs/api/functions/getModel.md @@ -0,0 +1,17 @@ +# Function: getModel() + +> **getModel**(`provider`, `type`): `any` + +## Parameters + +• **provider**: [`ModelProvider`](../enumerations/ModelProvider.md) + +• **type**: [`ModelClass`](../enumerations/ModelClass.md) + +## Returns + +`any` + +## Defined in + +[core/src/core/models.ts:174](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/models.ts#L174) diff --git a/docs/docs/api/functions/getProviders.md b/docs/docs/api/functions/getProviders.md new file mode 100644 index 00000000000..ae5e5b56b6b --- /dev/null +++ b/docs/docs/api/functions/getProviders.md @@ -0,0 +1,29 @@ +# Function: getProviders() + +> **getProviders**(`runtime`, `message`, `state`?): `Promise`\<`string`\> + +Formats provider outputs into a string which can be injected into the context. + +## Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +The AgentRuntime object. + +• **message**: [`Memory`](../interfaces/Memory.md) + +The incoming message object. + +• **state?**: [`State`](../interfaces/State.md) + +The current state object. + +## Returns + +`Promise`\<`string`\> + +A string that concatenates the outputs of each provider. + +## Defined in + +[core/src/core/providers.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/providers.ts#L13) diff --git a/docs/docs/api/functions/getRelationship.md b/docs/docs/api/functions/getRelationship.md new file mode 100644 index 00000000000..53db6c21ee6 --- /dev/null +++ b/docs/docs/api/functions/getRelationship.md @@ -0,0 +1,21 @@ +# Function: getRelationship() + +> **getRelationship**(`__namedParameters`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **\_\_namedParameters.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **\_\_namedParameters.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +## Returns + +`Promise`\<[`Relationship`](../interfaces/Relationship.md)\> + +## Defined in + +[core/src/core/relationships.ts:18](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/relationships.ts#L18) diff --git a/docs/docs/api/functions/getRelationships.md b/docs/docs/api/functions/getRelationships.md new file mode 100644 index 00000000000..c4b451730c6 --- /dev/null +++ b/docs/docs/api/functions/getRelationships.md @@ -0,0 +1,19 @@ +# Function: getRelationships() + +> **getRelationships**(`__namedParameters`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **\_\_namedParameters.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +## Returns + +`Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> + +## Defined in + +[core/src/core/relationships.ts:33](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/relationships.ts#L33) diff --git a/docs/docs/api/functions/getTokenForProvider.md b/docs/docs/api/functions/getTokenForProvider.md new file mode 100644 index 00000000000..0177abf0f69 --- /dev/null +++ b/docs/docs/api/functions/getTokenForProvider.md @@ -0,0 +1,17 @@ +# Function: getTokenForProvider() + +> **getTokenForProvider**(`provider`, `character`): `string` + +## Parameters + +• **provider**: [`ModelProvider`](../enumerations/ModelProvider.md) + +• **character**: [`Character`](../type-aliases/Character.md) + +## Returns + +`string` + +## Defined in + +[core/src/cli/index.ts:105](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L105) diff --git a/docs/docs/api/functions/initializeClients.md b/docs/docs/api/functions/initializeClients.md new file mode 100644 index 00000000000..9549c70a104 --- /dev/null +++ b/docs/docs/api/functions/initializeClients.md @@ -0,0 +1,17 @@ +# Function: initializeClients() + +> **initializeClients**(`character`, `runtime`): `Promise`\<`any`[]\> + +## Parameters + +• **character**: [`Character`](../type-aliases/Character.md) + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<`any`[]\> + +## Defined in + +[core/src/cli/index.ts:21](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L21) diff --git a/docs/docs/api/functions/initializeDatabase.md b/docs/docs/api/functions/initializeDatabase.md new file mode 100644 index 00000000000..d7d58df27f6 --- /dev/null +++ b/docs/docs/api/functions/initializeDatabase.md @@ -0,0 +1,11 @@ +# Function: initializeDatabase() + +> **initializeDatabase**(): [`PostgresDatabaseAdapter`](../classes/PostgresDatabaseAdapter.md) \| [`SqliteDatabaseAdapter`](../classes/SqliteDatabaseAdapter.md) + +## Returns + +[`PostgresDatabaseAdapter`](../classes/PostgresDatabaseAdapter.md) \| [`SqliteDatabaseAdapter`](../classes/SqliteDatabaseAdapter.md) + +## Defined in + +[core/src/cli/index.ts:129](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L129) diff --git a/docs/docs/api/functions/isCreateAndBuyContent.md b/docs/docs/api/functions/isCreateAndBuyContent.md new file mode 100644 index 00000000000..da8cdbee1a2 --- /dev/null +++ b/docs/docs/api/functions/isCreateAndBuyContent.md @@ -0,0 +1,17 @@ +# Function: isCreateAndBuyContent() + +> **isCreateAndBuyContent**(`runtime`, `content`): `content is CreateAndBuyContent` + +## Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **content**: `any` + +## Returns + +`content is CreateAndBuyContent` + +## Defined in + +[core/src/actions/pumpfun.ts:33](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L33) diff --git a/docs/docs/api/functions/loadActionConfigs.md b/docs/docs/api/functions/loadActionConfigs.md new file mode 100644 index 00000000000..3348a03d815 --- /dev/null +++ b/docs/docs/api/functions/loadActionConfigs.md @@ -0,0 +1,15 @@ +# Function: loadActionConfigs() + +> **loadActionConfigs**(`configPath`): `ActionConfig`[] + +## Parameters + +• **configPath**: `string` + +## Returns + +`ActionConfig`[] + +## Defined in + +[core/src/cli/config.ts:15](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/config.ts#L15) diff --git a/docs/docs/api/functions/loadCharacters.md b/docs/docs/api/functions/loadCharacters.md new file mode 100644 index 00000000000..43f4922c042 --- /dev/null +++ b/docs/docs/api/functions/loadCharacters.md @@ -0,0 +1,15 @@ +# Function: loadCharacters() + +> **loadCharacters**(`charactersArg`): [`Character`](../type-aliases/Character.md)[] + +## Parameters + +• **charactersArg**: `string` + +## Returns + +[`Character`](../type-aliases/Character.md)[] + +## Defined in + +[core/src/cli/index.ts:70](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L70) diff --git a/docs/docs/api/functions/loadCustomActions.md b/docs/docs/api/functions/loadCustomActions.md new file mode 100644 index 00000000000..c1d81f66a46 --- /dev/null +++ b/docs/docs/api/functions/loadCustomActions.md @@ -0,0 +1,15 @@ +# Function: loadCustomActions() + +> **loadCustomActions**(`actionConfigs`): `Promise`\<[`Action`](../interfaces/Action.md)[]\> + +## Parameters + +• **actionConfigs**: `ActionConfig`[] + +## Returns + +`Promise`\<[`Action`](../interfaces/Action.md)[]\> + +## Defined in + +[core/src/cli/config.ts:26](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/config.ts#L26) diff --git a/docs/docs/api/functions/parseArguments.md b/docs/docs/api/functions/parseArguments.md new file mode 100644 index 00000000000..b70bd97354a --- /dev/null +++ b/docs/docs/api/functions/parseArguments.md @@ -0,0 +1,11 @@ +# Function: parseArguments() + +> **parseArguments**(): `Arguments` + +## Returns + +`Arguments` + +## Defined in + +[core/src/cli/index.ts:46](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L46) diff --git a/docs/docs/api/functions/retrieveCachedEmbedding.md b/docs/docs/api/functions/retrieveCachedEmbedding.md new file mode 100644 index 00000000000..31922d1ebcb --- /dev/null +++ b/docs/docs/api/functions/retrieveCachedEmbedding.md @@ -0,0 +1,17 @@ +# Function: retrieveCachedEmbedding() + +> **retrieveCachedEmbedding**(`runtime`, `input`): `Promise`\<`number`[]\> + +## Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **input**: `string` + +## Returns + +`Promise`\<`number`[]\> + +## Defined in + +[core/src/core/embedding.ts:65](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/embedding.ts#L65) diff --git a/docs/docs/api/functions/sellToken.md b/docs/docs/api/functions/sellToken.md new file mode 100644 index 00000000000..c275a4ae4ed --- /dev/null +++ b/docs/docs/api/functions/sellToken.md @@ -0,0 +1,31 @@ +# Function: sellToken() + +> **sellToken**(`__namedParameters`): `Promise`\<`void`\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.allowOffCurve**: `boolean` + +• **\_\_namedParameters.amount**: `bigint` + +• **\_\_namedParameters.connection**: `Connection` + +• **\_\_namedParameters.mint**: `PublicKey` + +• **\_\_namedParameters.priorityFee**: `PriorityFee` + +• **\_\_namedParameters.sdk**: `PumpFunSDK` + +• **\_\_namedParameters.seller**: `Keypair` + +• **\_\_namedParameters.slippage**: `string` + +## Returns + +`Promise`\<`void`\> + +## Defined in + +[core/src/actions/pumpfun.ts:167](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L167) diff --git a/docs/docs/api/functions/splitChunks.md b/docs/docs/api/functions/splitChunks.md new file mode 100644 index 00000000000..7e8758b5330 --- /dev/null +++ b/docs/docs/api/functions/splitChunks.md @@ -0,0 +1,33 @@ +# Function: splitChunks() + +> **splitChunks**(`runtime`, `content`, `chunkSize`, `bleed`, `modelClass`): `Promise`\<`string`[]\> + +Splits content into chunks of specified size with optional overlapping bleed sections + +## Parameters + +• **runtime**: `any` + +• **content**: `string` + +The text content to split into chunks + +• **chunkSize**: `number` + +The maximum size of each chunk in tokens + +• **bleed**: `number` = `100` + +Number of characters to overlap between chunks (default: 100) + +• **modelClass**: `string` + +## Returns + +`Promise`\<`string`[]\> + +Promise resolving to array of text chunks with bleed sections + +## Defined in + +[core/src/core/generation.ts:302](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L302) diff --git a/docs/docs/api/functions/startDiscord.md b/docs/docs/api/functions/startDiscord.md new file mode 100644 index 00000000000..1c46e116f36 --- /dev/null +++ b/docs/docs/api/functions/startDiscord.md @@ -0,0 +1,15 @@ +# Function: startDiscord() + +> **startDiscord**(`runtime`): [`DiscordClient`](../classes/DiscordClient.md) + +## Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +[`DiscordClient`](../classes/DiscordClient.md) + +## Defined in + +[core/src/cli/index.ts:211](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L211) diff --git a/docs/docs/api/functions/startTelegram.md b/docs/docs/api/functions/startTelegram.md new file mode 100644 index 00000000000..f70aa9fbab3 --- /dev/null +++ b/docs/docs/api/functions/startTelegram.md @@ -0,0 +1,17 @@ +# Function: startTelegram() + +> **startTelegram**(`runtime`, `character`): `Promise`\<[`TelegramClient`](../classes/TelegramClient.md)\> + +## Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **character**: [`Character`](../type-aliases/Character.md) + +## Returns + +`Promise`\<[`TelegramClient`](../classes/TelegramClient.md)\> + +## Defined in + +[core/src/cli/index.ts:215](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L215) diff --git a/docs/docs/api/functions/startTwitter.md b/docs/docs/api/functions/startTwitter.md new file mode 100644 index 00000000000..ab9859190da --- /dev/null +++ b/docs/docs/api/functions/startTwitter.md @@ -0,0 +1,15 @@ +# Function: startTwitter() + +> **startTwitter**(`runtime`): `Promise`\<([`TwitterPostClient`](../classes/TwitterPostClient.md) \| [`TwitterInteractionClient`](../classes/TwitterInteractionClient.md) \| [`TwitterSearchClient`](../classes/TwitterSearchClient.md))[]\> + +## Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<([`TwitterPostClient`](../classes/TwitterPostClient.md) \| [`TwitterInteractionClient`](../classes/TwitterInteractionClient.md) \| [`TwitterSearchClient`](../classes/TwitterSearchClient.md))[]\> + +## Defined in + +[core/src/cli/index.ts:245](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L245) diff --git a/docs/docs/api/functions/trimTokens.md b/docs/docs/api/functions/trimTokens.md new file mode 100644 index 00000000000..b42f5b16712 --- /dev/null +++ b/docs/docs/api/functions/trimTokens.md @@ -0,0 +1,25 @@ +# Function: trimTokens() + +> **trimTokens**(`context`, `maxTokens`, `model`): `any` + +Truncate the context to the maximum length allowed by the model. + +## Parameters + +• **context**: `any` + +The context of the message to be completed. + +• **maxTokens**: `any` + +• **model**: `any` + +The model to use for generateText. + +## Returns + +`any` + +## Defined in + +[core/src/core/generation.ts:223](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L223) diff --git a/docs/docs/api/functions/updateGoal.md b/docs/docs/api/functions/updateGoal.md new file mode 100644 index 00000000000..b4150ab70ff --- /dev/null +++ b/docs/docs/api/functions/updateGoal.md @@ -0,0 +1,19 @@ +# Function: updateGoal() + +> **updateGoal**(`__namedParameters`): `Promise`\<`void`\> + +## Parameters + +• **\_\_namedParameters** + +• **\_\_namedParameters.goal**: [`Goal`](../interfaces/Goal.md) + +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +## Returns + +`Promise`\<`void`\> + +## Defined in + +[core/src/core/goals.ts:44](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/goals.ts#L44) diff --git a/docs/docs/api/globals.md b/docs/docs/api/globals.md new file mode 100644 index 00000000000..c01b63de249 --- /dev/null +++ b/docs/docs/api/globals.md @@ -0,0 +1,156 @@ +# @eliza/core + +## Enumerations + +- [Clients](enumerations/Clients.md) +- [GoalStatus](enumerations/GoalStatus.md) +- [ImageGenModel](enumerations/ImageGenModel.md) +- [ModelClass](enumerations/ModelClass.md) +- [ModelProvider](enumerations/ModelProvider.md) + +## Classes + +- [AgentRuntime](classes/AgentRuntime.md) +- [DatabaseAdapter](classes/DatabaseAdapter.md) +- [DirectClient](classes/DirectClient.md) +- [DiscordClient](classes/DiscordClient.md) +- [MemoryManager](classes/MemoryManager.md) +- [PostgresDatabaseAdapter](classes/PostgresDatabaseAdapter.md) +- [SqliteDatabaseAdapter](classes/SqliteDatabaseAdapter.md) +- [TelegramClient](classes/TelegramClient.md) +- [TokenProvider](classes/TokenProvider.md) +- [TwitterInteractionClient](classes/TwitterInteractionClient.md) +- [TwitterPostClient](classes/TwitterPostClient.md) +- [TwitterSearchClient](classes/TwitterSearchClient.md) +- [WalletProvider](classes/WalletProvider.md) + +## Interfaces + +- [Account](interfaces/Account.md) +- [Action](interfaces/Action.md) +- [ActionExample](interfaces/ActionExample.md) +- [Actor](interfaces/Actor.md) +- [Content](interfaces/Content.md) +- [ConversationExample](interfaces/ConversationExample.md) +- [CreateAndBuyContent](interfaces/CreateAndBuyContent.md) +- [EvaluationExample](interfaces/EvaluationExample.md) +- [Evaluator](interfaces/Evaluator.md) +- [Goal](interfaces/Goal.md) +- [IAgentRuntime](interfaces/IAgentRuntime.md) +- [IBrowserService](interfaces/IBrowserService.md) +- [IDatabaseAdapter](interfaces/IDatabaseAdapter.md) +- [IImageRecognitionService](interfaces/IImageRecognitionService.md) +- [ILlamaService](interfaces/ILlamaService.md) +- [IMemoryManager](interfaces/IMemoryManager.md) +- [IPdfService](interfaces/IPdfService.md) +- [ISpeechService](interfaces/ISpeechService.md) +- [ITranscriptionService](interfaces/ITranscriptionService.md) +- [IVideoService](interfaces/IVideoService.md) +- [Memory](interfaces/Memory.md) +- [MessageExample](interfaces/MessageExample.md) +- [Objective](interfaces/Objective.md) +- [Participant](interfaces/Participant.md) +- [Provider](interfaces/Provider.md) +- [Relationship](interfaces/Relationship.md) +- [Room](interfaces/Room.md) +- [State](interfaces/State.md) + +## Type Aliases + +- [Character](type-aliases/Character.md) +- [Handler](type-aliases/Handler.md) +- [HandlerCallback](type-aliases/HandlerCallback.md) +- [Media](type-aliases/Media.md) +- [Model](type-aliases/Model.md) +- [Plugin](type-aliases/Plugin.md) +- [UUID](type-aliases/UUID.md) +- [Validator](type-aliases/Validator.md) + +## Variables + +- [boredomProvider](variables/boredomProvider.md) +- [continueAction](variables/continueAction.md) +- [defaultActions](variables/defaultActions.md) +- [defaultCharacter](variables/defaultCharacter.md) +- [defaultEvaluators](variables/defaultEvaluators.md) +- [defaultProviders](variables/defaultProviders.md) +- [elizaLogger](variables/elizaLogger.md) +- [embeddingDimension](variables/embeddingDimension.md) +- [embeddingZeroVector](variables/embeddingZeroVector.md) +- [evaluationTemplate](variables/evaluationTemplate.md) +- [executeSwap](variables/executeSwap.md) +- [followRoom](variables/followRoom.md) +- [ignore](variables/ignore.md) +- [imageGeneration](variables/imageGeneration.md) +- [imageGenModels](variables/imageGenModels.md) +- [messageHandlerTemplate](variables/messageHandlerTemplate.md) +- [muteRoom](variables/muteRoom.md) +- [none](variables/none.md) +- [orderBookProvider](variables/orderBookProvider.md) +- [shouldContinueTemplate](variables/shouldContinueTemplate.md) +- [shouldFollowTemplate](variables/shouldFollowTemplate.md) +- [shouldMuteTemplate](variables/shouldMuteTemplate.md) +- [shouldUnmuteTemplate](variables/shouldUnmuteTemplate.md) +- [timeProvider](variables/timeProvider.md) +- [tokenProvider](variables/tokenProvider.md) +- [unfollowRoom](variables/unfollowRoom.md) +- [unmuteRoom](variables/unmuteRoom.md) +- [walletProvider](variables/walletProvider.md) + +## Functions + +- [addHeader](functions/addHeader.md) +- [buyToken](functions/buyToken.md) +- [composeActionExamples](functions/composeActionExamples.md) +- [composeContext](functions/composeContext.md) +- [createAgentRuntime](functions/createAgentRuntime.md) +- [createAndBuyToken](functions/createAndBuyToken.md) +- [createDirectRuntime](functions/createDirectRuntime.md) +- [createGoal](functions/createGoal.md) +- [createRelationship](functions/createRelationship.md) +- [embed](functions/embed.md) +- [formatActionNames](functions/formatActionNames.md) +- [formatActions](functions/formatActions.md) +- [formatActors](functions/formatActors.md) +- [formatEvaluatorExampleDescriptions](functions/formatEvaluatorExampleDescriptions.md) +- [formatEvaluatorExamples](functions/formatEvaluatorExamples.md) +- [formatEvaluatorNames](functions/formatEvaluatorNames.md) +- [formatEvaluators](functions/formatEvaluators.md) +- [formatGoalsAsString](functions/formatGoalsAsString.md) +- [formatMessages](functions/formatMessages.md) +- [formatPosts](functions/formatPosts.md) +- [formatRelationships](functions/formatRelationships.md) +- [formatTimestamp](functions/formatTimestamp.md) +- [generateCaption](functions/generateCaption.md) +- [generateImage](functions/generateImage.md) +- [generateMessageResponse](functions/generateMessageResponse.md) +- [generateObject](functions/generateObject.md) +- [generateObjectArray](functions/generateObjectArray.md) +- [generateShouldRespond](functions/generateShouldRespond.md) +- [generateText](functions/generateText.md) +- [generateTextArray](functions/generateTextArray.md) +- [generateTrueOrFalse](functions/generateTrueOrFalse.md) +- [getActorDetails](functions/getActorDetails.md) +- [getEndpoint](functions/getEndpoint.md) +- [getGoals](functions/getGoals.md) +- [getImageGenModel](functions/getImageGenModel.md) +- [getModel](functions/getModel.md) +- [getProviders](functions/getProviders.md) +- [getRelationship](functions/getRelationship.md) +- [getRelationships](functions/getRelationships.md) +- [getTokenForProvider](functions/getTokenForProvider.md) +- [initializeClients](functions/initializeClients.md) +- [initializeDatabase](functions/initializeDatabase.md) +- [isCreateAndBuyContent](functions/isCreateAndBuyContent.md) +- [loadActionConfigs](functions/loadActionConfigs.md) +- [loadCharacters](functions/loadCharacters.md) +- [loadCustomActions](functions/loadCustomActions.md) +- [parseArguments](functions/parseArguments.md) +- [retrieveCachedEmbedding](functions/retrieveCachedEmbedding.md) +- [sellToken](functions/sellToken.md) +- [splitChunks](functions/splitChunks.md) +- [startDiscord](functions/startDiscord.md) +- [startTelegram](functions/startTelegram.md) +- [startTwitter](functions/startTwitter.md) +- [trimTokens](functions/trimTokens.md) +- [updateGoal](functions/updateGoal.md) diff --git a/docs/docs/api/index.md b/docs/docs/api/index.md index eac95003240..277dac78164 100644 --- a/docs/docs/api/index.md +++ b/docs/docs/api/index.md @@ -25,7 +25,6 @@ **Prerequisites (MUST):** -- [Python 2.7+](https://www.python.org/downloads/) - [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) - [pnpm](https://pnpm.io/installation) diff --git a/docs/docs/api/interfaces/Account.md b/docs/docs/api/interfaces/Account.md new file mode 100644 index 00000000000..c6022f7c906 --- /dev/null +++ b/docs/docs/api/interfaces/Account.md @@ -0,0 +1,67 @@ +# Interface: Account + +Represents a user, including their name, details, and a unique identifier. + +## Properties + +### avatarUrl? + +> `optional` **avatarUrl**: `string` + +#### Defined in + +[core/src/core/types.ts:262](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L262) + +--- + +### details? + +> `optional` **details**: `object` + +#### Index Signature + +\[`key`: `string`\]: `any` + +#### Defined in + +[core/src/core/types.ts:260](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L260) + +--- + +### email? + +> `optional` **email**: `string` + +#### Defined in + +[core/src/core/types.ts:261](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L261) + +--- + +### id + +> **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:257](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L257) + +--- + +### name + +> **name**: `string` + +#### Defined in + +[core/src/core/types.ts:258](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L258) + +--- + +### username + +> **username**: `string` + +#### Defined in + +[core/src/core/types.ts:259](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L259) diff --git a/docs/docs/api/interfaces/Action.md b/docs/docs/api/interfaces/Action.md new file mode 100644 index 00000000000..6e83f718283 --- /dev/null +++ b/docs/docs/api/interfaces/Action.md @@ -0,0 +1,63 @@ +# Interface: Action + +Represents an action that the agent can perform, including conditions for its use, a description, examples, a handler function, and a validation function. + +## Properties + +### description + +> **description**: `string` + +#### Defined in + +[core/src/core/types.ts:201](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L201) + +--- + +### examples + +> **examples**: [`ActionExample`](ActionExample.md)[][] + +#### Defined in + +[core/src/core/types.ts:202](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L202) + +--- + +### handler + +> **handler**: [`Handler`](../type-aliases/Handler.md) + +#### Defined in + +[core/src/core/types.ts:203](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L203) + +--- + +### name + +> **name**: `string` + +#### Defined in + +[core/src/core/types.ts:204](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L204) + +--- + +### similes + +> **similes**: `string`[] + +#### Defined in + +[core/src/core/types.ts:200](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L200) + +--- + +### validate + +> **validate**: [`Validator`](../type-aliases/Validator.md) + +#### Defined in + +[core/src/core/types.ts:205](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L205) diff --git a/docs/docs/api/interfaces/ActionExample.md b/docs/docs/api/interfaces/ActionExample.md new file mode 100644 index 00000000000..40240f293cd --- /dev/null +++ b/docs/docs/api/interfaces/ActionExample.md @@ -0,0 +1,23 @@ +# Interface: ActionExample + +Represents an example of content, typically used for demonstrating or testing purposes. Includes user, content, optional action, and optional source. + +## Properties + +### content + +> **content**: [`Content`](Content.md) + +#### Defined in + +[core/src/core/types.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L27) + +--- + +### user + +> **user**: `string` + +#### Defined in + +[core/src/core/types.ts:26](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L26) diff --git a/docs/docs/api/interfaces/Actor.md b/docs/docs/api/interfaces/Actor.md new file mode 100644 index 00000000000..be771e44ad9 --- /dev/null +++ b/docs/docs/api/interfaces/Actor.md @@ -0,0 +1,55 @@ +# Interface: Actor + +Represents an actor in the conversation, which could be a user or the agent itself, including their name, details (such as tagline, summary, and quote), and a unique identifier. + +## Properties + +### details + +> **details**: `object` + +#### quote + +> **quote**: `string` + +#### summary + +> **summary**: `string` + +#### tagline + +> **tagline**: `string` + +#### Defined in + +[core/src/core/types.ts:44](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L44) + +--- + +### id + +> **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:45](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L45) + +--- + +### name + +> **name**: `string` + +#### Defined in + +[core/src/core/types.ts:42](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L42) + +--- + +### username + +> **username**: `string` + +#### Defined in + +[core/src/core/types.ts:43](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L43) diff --git a/docs/docs/api/interfaces/Content.md b/docs/docs/api/interfaces/Content.md new file mode 100644 index 00000000000..c5200d905df --- /dev/null +++ b/docs/docs/api/interfaces/Content.md @@ -0,0 +1,71 @@ +# Interface: Content + +Represents the content of a message, including its main text (`content`), any associated action (`action`), and the source of the content (`source`), if applicable. + +## Extended by + +- [`CreateAndBuyContent`](CreateAndBuyContent.md) + +## Indexable + +\[`key`: `string`\]: `unknown` + +## Properties + +### action? + +> `optional` **action**: `string` + +#### Defined in + +[core/src/core/types.ts:14](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L14) + +--- + +### attachments? + +> `optional` **attachments**: [`Media`](../type-aliases/Media.md)[] + +#### Defined in + +[core/src/core/types.ts:18](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L18) + +--- + +### inReplyTo? + +> `optional` **inReplyTo**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:17](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L17) + +--- + +### source? + +> `optional` **source**: `string` + +#### Defined in + +[core/src/core/types.ts:15](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L15) + +--- + +### text + +> **text**: `string` + +#### Defined in + +[core/src/core/types.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L13) + +--- + +### url? + +> `optional` **url**: `string` + +#### Defined in + +[core/src/core/types.ts:16](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L16) diff --git a/docs/docs/api/interfaces/ConversationExample.md b/docs/docs/api/interfaces/ConversationExample.md new file mode 100644 index 00000000000..a0602491922 --- /dev/null +++ b/docs/docs/api/interfaces/ConversationExample.md @@ -0,0 +1,23 @@ +# Interface: ConversationExample + +Represents an example of content, typically used for demonstrating or testing purposes. Includes user, content, optional action, and optional source. + +## Properties + +### content + +> **content**: [`Content`](Content.md) + +#### Defined in + +[core/src/core/types.ts:35](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L35) + +--- + +### userId + +> **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:34](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L34) diff --git a/docs/docs/api/interfaces/CreateAndBuyContent.md b/docs/docs/api/interfaces/CreateAndBuyContent.md new file mode 100644 index 00000000000..fd158d57101 --- /dev/null +++ b/docs/docs/api/interfaces/CreateAndBuyContent.md @@ -0,0 +1,149 @@ +# Interface: CreateAndBuyContent + +Represents the content of a message, including its main text (`content`), any associated action (`action`), and the source of the content (`source`), if applicable. + +## Extends + +- [`Content`](Content.md) + +## Properties + +### action? + +> `optional` **action**: `string` + +#### Inherited from + +[`Content`](Content.md).[`action`](Content.md#action) + +#### Defined in + +[core/src/core/types.ts:14](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L14) + +--- + +### allowOffCurve + +> **allowOffCurve**: `boolean` + +#### Defined in + +[core/src/actions/pumpfun.ts:30](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L30) + +--- + +### attachments? + +> `optional` **attachments**: [`Media`](../type-aliases/Media.md)[] + +#### Inherited from + +[`Content`](Content.md).[`attachments`](Content.md#attachments) + +#### Defined in + +[core/src/core/types.ts:18](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L18) + +--- + +### buyAmountSol + +> **buyAmountSol**: `string` \| `number` + +#### Defined in + +[core/src/actions/pumpfun.ts:25](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L25) + +--- + +### deployerPrivateKey + +> **deployerPrivateKey**: `string` + +#### Defined in + +[core/src/actions/pumpfun.ts:23](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L23) + +--- + +### inReplyTo? + +> `optional` **inReplyTo**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Inherited from + +[`Content`](Content.md).[`inReplyTo`](Content.md#inreplyto) + +#### Defined in + +[core/src/core/types.ts:17](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L17) + +--- + +### priorityFee + +> **priorityFee**: `object` + +#### unitLimit + +> **unitLimit**: `number` + +#### unitPrice + +> **unitPrice**: `number` + +#### Defined in + +[core/src/actions/pumpfun.ts:26](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L26) + +--- + +### source? + +> `optional` **source**: `string` + +#### Inherited from + +[`Content`](Content.md).[`source`](Content.md#source) + +#### Defined in + +[core/src/core/types.ts:15](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L15) + +--- + +### text + +> **text**: `string` + +#### Inherited from + +[`Content`](Content.md).[`text`](Content.md#text) + +#### Defined in + +[core/src/core/types.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L13) + +--- + +### tokenMetadata + +> **tokenMetadata**: `CreateTokenMetadata` + +#### Defined in + +[core/src/actions/pumpfun.ts:24](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L24) + +--- + +### url? + +> `optional` **url**: `string` + +#### Inherited from + +[`Content`](Content.md).[`url`](Content.md#url) + +#### Defined in + +[core/src/core/types.ts:16](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L16) diff --git a/docs/docs/api/interfaces/EvaluationExample.md b/docs/docs/api/interfaces/EvaluationExample.md new file mode 100644 index 00000000000..0891f664ae5 --- /dev/null +++ b/docs/docs/api/interfaces/EvaluationExample.md @@ -0,0 +1,33 @@ +# Interface: EvaluationExample + +Represents an example for evaluation, including the context, an array of message examples, and the expected outcome. + +## Properties + +### context + +> **context**: `string` + +#### Defined in + +[core/src/core/types.ts:212](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L212) + +--- + +### messages + +> **messages**: [`ActionExample`](ActionExample.md)[] + +#### Defined in + +[core/src/core/types.ts:213](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L213) + +--- + +### outcome + +> **outcome**: `string` + +#### Defined in + +[core/src/core/types.ts:214](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L214) diff --git a/docs/docs/api/interfaces/Evaluator.md b/docs/docs/api/interfaces/Evaluator.md new file mode 100644 index 00000000000..3596d2b1b3e --- /dev/null +++ b/docs/docs/api/interfaces/Evaluator.md @@ -0,0 +1,63 @@ +# Interface: Evaluator + +Represents an evaluator, which is used to assess and guide the agent's responses based on the current context and state. + +## Properties + +### description + +> **description**: `string` + +#### Defined in + +[core/src/core/types.ts:221](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L221) + +--- + +### examples + +> **examples**: [`EvaluationExample`](EvaluationExample.md)[] + +#### Defined in + +[core/src/core/types.ts:223](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L223) + +--- + +### handler + +> **handler**: [`Handler`](../type-aliases/Handler.md) + +#### Defined in + +[core/src/core/types.ts:224](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L224) + +--- + +### name + +> **name**: `string` + +#### Defined in + +[core/src/core/types.ts:225](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L225) + +--- + +### similes + +> **similes**: `string`[] + +#### Defined in + +[core/src/core/types.ts:222](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L222) + +--- + +### validate + +> **validate**: [`Validator`](../type-aliases/Validator.md) + +#### Defined in + +[core/src/core/types.ts:226](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L226) diff --git a/docs/docs/api/interfaces/Goal.md b/docs/docs/api/interfaces/Goal.md new file mode 100644 index 00000000000..8aa672768b0 --- /dev/null +++ b/docs/docs/api/interfaces/Goal.md @@ -0,0 +1,63 @@ +# Interface: Goal + +Represents a goal, which is a higher-level aim composed of one or more objectives. Goals are tracked to measure progress or achievements within the conversation or system. + +## Properties + +### id? + +> `optional` **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:67](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L67) + +--- + +### name + +> **name**: `string` + +#### Defined in + +[core/src/core/types.ts:70](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L70) + +--- + +### objectives + +> **objectives**: [`Objective`](Objective.md)[] + +#### Defined in + +[core/src/core/types.ts:72](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L72) + +--- + +### roomId + +> **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:68](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L68) + +--- + +### status + +> **status**: [`GoalStatus`](../enumerations/GoalStatus.md) + +#### Defined in + +[core/src/core/types.ts:71](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L71) + +--- + +### userId + +> **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:69](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L69) diff --git a/docs/docs/api/interfaces/IAgentRuntime.md b/docs/docs/api/interfaces/IAgentRuntime.md new file mode 100644 index 00000000000..61b5234f98e --- /dev/null +++ b/docs/docs/api/interfaces/IAgentRuntime.md @@ -0,0 +1,441 @@ +# Interface: IAgentRuntime + +## Properties + +### actions + +> **actions**: [`Action`](Action.md)[] + +#### Defined in + +[core/src/core/types.ts:494](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L494) + +--- + +### agentId + +> **agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:486](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L486) + +--- + +### browserService + +> **browserService**: [`IBrowserService`](IBrowserService.md) + +#### Defined in + +[core/src/core/types.ts:504](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L504) + +--- + +### character + +> **character**: [`Character`](../type-aliases/Character.md) + +#### Defined in + +[core/src/core/types.ts:492](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L492) + +--- + +### databaseAdapter + +> **databaseAdapter**: [`IDatabaseAdapter`](IDatabaseAdapter.md) + +#### Defined in + +[core/src/core/types.ts:488](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L488) + +--- + +### descriptionManager + +> **descriptionManager**: [`IMemoryManager`](IMemoryManager.md) + +#### Defined in + +[core/src/core/types.ts:497](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L497) + +--- + +### factManager + +> **factManager**: [`IMemoryManager`](IMemoryManager.md) + +#### Defined in + +[core/src/core/types.ts:498](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L498) + +--- + +### imageDescriptionService + +> **imageDescriptionService**: [`IImageRecognitionService`](IImageRecognitionService.md) + +#### Defined in + +[core/src/core/types.ts:500](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L500) + +--- + +### imageGenModel + +> **imageGenModel**: [`ImageGenModel`](../enumerations/ImageGenModel.md) + +#### Defined in + +[core/src/core/types.ts:491](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L491) + +--- + +### llamaService + +> **llamaService**: [`ILlamaService`](ILlamaService.md) + +#### Defined in + +[core/src/core/types.ts:503](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L503) + +--- + +### loreManager + +> **loreManager**: [`IMemoryManager`](IMemoryManager.md) + +#### Defined in + +[core/src/core/types.ts:499](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L499) + +--- + +### messageManager + +> **messageManager**: [`IMemoryManager`](IMemoryManager.md) + +#### Defined in + +[core/src/core/types.ts:496](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L496) + +--- + +### modelProvider + +> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) + +#### Defined in + +[core/src/core/types.ts:490](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L490) + +--- + +### pdfService + +> **pdfService**: [`IPdfService`](IPdfService.md) + +#### Defined in + +[core/src/core/types.ts:506](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L506) + +--- + +### providers + +> **providers**: [`Provider`](Provider.md)[] + +#### Defined in + +[core/src/core/types.ts:493](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L493) + +--- + +### serverUrl + +> **serverUrl**: `string` + +#### Defined in + +[core/src/core/types.ts:487](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L487) + +--- + +### speechService + +> **speechService**: [`ISpeechService`](ISpeechService.md) + +#### Defined in + +[core/src/core/types.ts:505](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L505) + +--- + +### token + +> **token**: `string` + +#### Defined in + +[core/src/core/types.ts:489](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L489) + +--- + +### transcriptionService + +> **transcriptionService**: [`ITranscriptionService`](ITranscriptionService.md) + +#### Defined in + +[core/src/core/types.ts:501](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L501) + +--- + +### videoService + +> **videoService**: [`IVideoService`](IVideoService.md) + +#### Defined in + +[core/src/core/types.ts:502](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L502) + +## Methods + +### composeState() + +> **composeState**(`message`, `additionalKeys`?): `Promise`\<[`State`](State.md)\> + +#### Parameters + +• **message**: [`Memory`](Memory.md) + +• **additionalKeys?** + +#### Returns + +`Promise`\<[`State`](State.md)\> + +#### Defined in + +[core/src/core/types.ts:536](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L536) + +--- + +### ensureConnection() + +> **ensureConnection**(`userId`, `roomId`, `userName`?, `userScreenName`?, `source`?): `Promise`\<`void`\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userName?**: `string` + +• **userScreenName?**: `string` + +• **source?**: `string` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:527](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L527) + +--- + +### ensureParticipantExists() + +> **ensureParticipantExists**(`userId`, `roomId`): `Promise`\<`void`\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:519](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L519) + +--- + +### ensureParticipantInRoom() + +> **ensureParticipantInRoom**(`userId`, `roomId`): `Promise`\<`void`\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:534](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L534) + +--- + +### ensureRoomExists() + +> **ensureRoomExists**(`roomId`): `Promise`\<`void`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:535](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L535) + +--- + +### ensureUserExists() + +> **ensureUserExists**(`userId`, `userName`, `name`, `source`): `Promise`\<`void`\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userName**: `string` + +• **name**: `string` + +• **source**: `string` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:520](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L520) + +--- + +### evaluate() + +> **evaluate**(`message`, `state`?): `Promise`\<`string`[]\> + +#### Parameters + +• **message**: [`Memory`](Memory.md) + +• **state?**: [`State`](State.md) + +#### Returns + +`Promise`\<`string`[]\> + +#### Defined in + +[core/src/core/types.ts:518](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L518) + +--- + +### getConversationLength() + +> **getConversationLength**(): `number` + +#### Returns + +`number` + +#### Defined in + +[core/src/core/types.ts:511](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L511) + +--- + +### getSetting() + +> **getSetting**(`key`): `string` + +#### Parameters + +• **key**: `string` + +#### Returns + +`string` + +#### Defined in + +[core/src/core/types.ts:508](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L508) + +--- + +### processActions() + +> **processActions**(`message`, `responses`, `state`?, `callback`?): `Promise`\<`void`\> + +#### Parameters + +• **message**: [`Memory`](Memory.md) + +• **responses**: [`Memory`](Memory.md)[] + +• **state?**: [`State`](State.md) + +• **callback?**: [`HandlerCallback`](../type-aliases/HandlerCallback.md) + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:512](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L512) + +--- + +### registerAction() + +> **registerAction**(`action`): `void` + +#### Parameters + +• **action**: [`Action`](Action.md) + +#### Returns + +`void` + +#### Defined in + +[core/src/core/types.ts:526](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L526) + +--- + +### updateRecentMessageState() + +> **updateRecentMessageState**(`state`): `Promise`\<[`State`](State.md)\> + +#### Parameters + +• **state**: [`State`](State.md) + +#### Returns + +`Promise`\<[`State`](State.md)\> + +#### Defined in + +[core/src/core/types.ts:540](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L540) diff --git a/docs/docs/api/interfaces/IBrowserService.md b/docs/docs/api/interfaces/IBrowserService.md new file mode 100644 index 00000000000..445c72451b4 --- /dev/null +++ b/docs/docs/api/interfaces/IBrowserService.md @@ -0,0 +1,59 @@ +# Interface: IBrowserService + +## Methods + +### closeBrowser() + +> **closeBrowser**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:587](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L587) + +--- + +### getPageContent() + +> **getPageContent**(`url`): `Promise`\<`object`\> + +#### Parameters + +• **url**: `string` + +#### Returns + +`Promise`\<`object`\> + +##### bodyContent + +> **bodyContent**: `string` + +##### description + +> **description**: `string` + +##### title + +> **title**: `string` + +#### Defined in + +[core/src/core/types.ts:588](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L588) + +--- + +### initialize() + +> **initialize**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:586](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L586) diff --git a/docs/docs/api/interfaces/IDatabaseAdapter.md b/docs/docs/api/interfaces/IDatabaseAdapter.md new file mode 100644 index 00000000000..76d1544b164 --- /dev/null +++ b/docs/docs/api/interfaces/IDatabaseAdapter.md @@ -0,0 +1,733 @@ +# Interface: IDatabaseAdapter + +## Properties + +### db + +> **db**: `any` + +#### Defined in + +[core/src/core/types.ts:342](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L342) + +## Methods + +### addParticipant() + +> **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`boolean`\> + +#### Defined in + +[core/src/core/types.ts:424](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L424) + +--- + +### countMemories() + +> **countMemories**(`roomId`, `unique`?, `tableName`?): `Promise`\<`number`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **unique?**: `boolean` + +• **tableName?**: `string` + +#### Returns + +`Promise`\<`number`\> + +#### Defined in + +[core/src/core/types.ts:404](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L404) + +--- + +### createAccount() + +> **createAccount**(`account`): `Promise`\<`boolean`\> + +#### Parameters + +• **account**: [`Account`](Account.md) + +#### Returns + +`Promise`\<`boolean`\> + +#### Defined in + +[core/src/core/types.ts:344](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L344) + +--- + +### createGoal() + +> **createGoal**(`goal`): `Promise`\<`void`\> + +#### Parameters + +• **goal**: [`Goal`](Goal.md) + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:416](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L416) + +--- + +### createMemory() + +> **createMemory**(`memory`, `tableName`, `unique`?): `Promise`\<`void`\> + +#### Parameters + +• **memory**: [`Memory`](Memory.md) + +• **tableName**: `string` + +• **unique?**: `boolean` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:397](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L397) + +--- + +### createRelationship() + +> **createRelationship**(`params`): `Promise`\<`boolean`\> + +#### Parameters + +• **params** + +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`boolean`\> + +#### Defined in + +[core/src/core/types.ts:437](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L437) + +--- + +### createRoom() + +> **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +#### Parameters + +• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +#### Defined in + +[core/src/core/types.ts:420](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L420) + +--- + +### getAccountById() + +> **getAccountById**(`userId`): `Promise`\<[`Account`](Account.md)\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Account`](Account.md)\> + +#### Defined in + +[core/src/core/types.ts:343](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L343) + +--- + +### getActorDetails() + +> **getActorDetails**(`params`): `Promise`\<[`Actor`](Actor.md)[]\> + +#### Parameters + +• **params** + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Actor`](Actor.md)[]\> + +#### Defined in + +[core/src/core/types.ts:373](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L373) + +--- + +### getCachedEmbeddings() + +> **getCachedEmbeddings**(`params`): `Promise`\<`object`[]\> + +#### Parameters + +• **params** + +• **params.query_field_name**: `string` + +• **params.query_field_sub_name**: `string` + +• **params.query_input**: `string` + +• **params.query_match_count**: `number` + +• **params.query_table_name**: `string` + +• **params.query_threshold**: `number` + +#### Returns + +`Promise`\<`object`[]\> + +#### Defined in + +[core/src/core/types.ts:359](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L359) + +--- + +### getGoals() + +> **getGoals**(`params`): `Promise`\<[`Goal`](Goal.md)[]\> + +#### Parameters + +• **params** + +• **params.count?**: `number` + +• **params.onlyInProgress?**: `boolean` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Goal`](Goal.md)[]\> + +#### Defined in + +[core/src/core/types.ts:409](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L409) + +--- + +### getMemories() + +> **getMemories**(`params`): `Promise`\<[`Memory`](Memory.md)[]\> + +#### Parameters + +• **params** + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.count?**: `number` + +• **params.end?**: `number` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.start?**: `number` + +• **params.tableName**: `string` + +• **params.unique?**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](Memory.md)[]\> + +#### Defined in + +[core/src/core/types.ts:345](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L345) + +--- + +### getMemoriesByRoomIds() + +> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](Memory.md)[]\> + +#### Parameters + +• **params** + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +#### Returns + +`Promise`\<[`Memory`](Memory.md)[]\> + +#### Defined in + +[core/src/core/types.ts:355](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L355) + +--- + +### getMemoryById() + +> **getMemoryById**(`id`): `Promise`\<[`Memory`](Memory.md)\> + +#### Parameters + +• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Memory`](Memory.md)\> + +#### Defined in + +[core/src/core/types.ts:354](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L354) + +--- + +### getParticipantsForAccount() + +> **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](Participant.md)[]\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Participant`](Participant.md)[]\> + +#### Defined in + +[core/src/core/types.ts:426](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L426) + +--- + +### getParticipantsForRoom() + +> **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +#### Defined in + +[core/src/core/types.ts:427](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L427) + +--- + +### getParticipantUserState() + +> **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> + +#### Defined in + +[core/src/core/types.ts:428](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L428) + +--- + +### getRelationship() + +> **getRelationship**(`params`): `Promise`\<[`Relationship`](Relationship.md)\> + +#### Parameters + +• **params** + +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Relationship`](Relationship.md)\> + +#### Defined in + +[core/src/core/types.ts:438](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L438) + +--- + +### getRelationships() + +> **getRelationships**(`params`): `Promise`\<[`Relationship`](Relationship.md)[]\> + +#### Parameters + +• **params** + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Relationship`](Relationship.md)[]\> + +#### Defined in + +[core/src/core/types.ts:442](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L442) + +--- + +### getRoom() + +> **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +#### Defined in + +[core/src/core/types.ts:419](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L419) + +--- + +### getRoomsForParticipant() + +> **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +#### Defined in + +[core/src/core/types.ts:422](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L422) + +--- + +### getRoomsForParticipants() + +> **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +#### Parameters + +• **userIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +#### Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +#### Defined in + +[core/src/core/types.ts:423](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L423) + +--- + +### log() + +> **log**(`params`): `Promise`\<`void`\> + +#### Parameters + +• **params** + +• **params.body** + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.type**: `string` + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:367](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L367) + +--- + +### removeAllGoals() + +> **removeAllGoals**(`roomId`): `Promise`\<`void`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:418](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L418) + +--- + +### removeAllMemories() + +> **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **tableName**: `string` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:403](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L403) + +--- + +### removeGoal() + +> **removeGoal**(`goalId`): `Promise`\<`void`\> + +#### Parameters + +• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:417](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L417) + +--- + +### removeMemory() + +> **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> + +#### Parameters + +• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **tableName**: `string` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:402](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L402) + +--- + +### removeParticipant() + +> **removeParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +#### Parameters + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`boolean`\> + +#### Defined in + +[core/src/core/types.ts:425](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L425) + +--- + +### removeRoom() + +> **removeRoom**(`roomId`): `Promise`\<`void`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:421](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L421) + +--- + +### searchMemories() + +> **searchMemories**(`params`): `Promise`\<[`Memory`](Memory.md)[]\> + +#### Parameters + +• **params** + +• **params.embedding**: `number`[] + +• **params.match_count**: `number` + +• **params.match_threshold**: `number` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.tableName**: `string` + +• **params.unique**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](Memory.md)[]\> + +#### Defined in + +[core/src/core/types.ts:374](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L374) + +--- + +### searchMemoriesByEmbedding() + +> **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](Memory.md)[]\> + +#### Parameters + +• **embedding**: `number`[] + +• **params** + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.count?**: `number` + +• **params.match_threshold?**: `number` + +• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.tableName**: `string` + +• **params.unique?**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](Memory.md)[]\> + +#### Defined in + +[core/src/core/types.ts:386](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L386) + +--- + +### setParticipantUserState() + +> **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **state**: `"FOLLOWED"` \| `"MUTED"` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:432](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L432) + +--- + +### updateGoal() + +> **updateGoal**(`goal`): `Promise`\<`void`\> + +#### Parameters + +• **goal**: [`Goal`](Goal.md) + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:415](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L415) + +--- + +### updateGoalStatus() + +> **updateGoalStatus**(`params`): `Promise`\<`void`\> + +#### Parameters + +• **params** + +• **params.goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.status**: [`GoalStatus`](../enumerations/GoalStatus.md) + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:382](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L382) diff --git a/docs/docs/api/interfaces/IImageRecognitionService.md b/docs/docs/api/interfaces/IImageRecognitionService.md new file mode 100644 index 00000000000..80743e38c6a --- /dev/null +++ b/docs/docs/api/interfaces/IImageRecognitionService.md @@ -0,0 +1,47 @@ +# Interface: IImageRecognitionService + +## Methods + +### describeImage() + +> **describeImage**(`imageUrl`): `Promise`\<`object`\> + +#### Parameters + +• **imageUrl**: `string` + +#### Returns + +`Promise`\<`object`\> + +##### description + +> **description**: `string` + +##### title + +> **title**: `string` + +#### Defined in + +[core/src/core/types.ts:545](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L545) + +--- + +### initialize() + +> **initialize**(`modelId`?, `device`?): `Promise`\<`void`\> + +#### Parameters + +• **modelId?**: `string` + +• **device?**: `string` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:544](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L544) diff --git a/docs/docs/api/interfaces/ILlamaService.md b/docs/docs/api/interfaces/ILlamaService.md new file mode 100644 index 00000000000..99f1d512e7e --- /dev/null +++ b/docs/docs/api/interfaces/ILlamaService.md @@ -0,0 +1,89 @@ +# Interface: ILlamaService + +## Methods + +### getEmbeddingResponse() + +> **getEmbeddingResponse**(`input`): `Promise`\<`number`[]\> + +#### Parameters + +• **input**: `string` + +#### Returns + +`Promise`\<`number`[]\> + +#### Defined in + +[core/src/core/types.ts:582](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L582) + +--- + +### initializeModel() + +> **initializeModel**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:565](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L565) + +--- + +### queueMessageCompletion() + +> **queueMessageCompletion**(`context`, `temperature`, `stop`, `frequency_penalty`, `presence_penalty`, `max_tokens`): `Promise`\<`any`\> + +#### Parameters + +• **context**: `string` + +• **temperature**: `number` + +• **stop**: `string`[] + +• **frequency_penalty**: `number` + +• **presence_penalty**: `number` + +• **max_tokens**: `number` + +#### Returns + +`Promise`\<`any`\> + +#### Defined in + +[core/src/core/types.ts:566](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L566) + +--- + +### queueTextCompletion() + +> **queueTextCompletion**(`context`, `temperature`, `stop`, `frequency_penalty`, `presence_penalty`, `max_tokens`): `Promise`\<`string`\> + +#### Parameters + +• **context**: `string` + +• **temperature**: `number` + +• **stop**: `string`[] + +• **frequency_penalty**: `number` + +• **presence_penalty**: `number` + +• **max_tokens**: `number` + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[core/src/core/types.ts:574](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L574) diff --git a/docs/docs/api/interfaces/IMemoryManager.md b/docs/docs/api/interfaces/IMemoryManager.md new file mode 100644 index 00000000000..9026f0b807f --- /dev/null +++ b/docs/docs/api/interfaces/IMemoryManager.md @@ -0,0 +1,243 @@ +# Interface: IMemoryManager + +## Properties + +### constructor + +> **constructor**: `Function` + +#### Defined in + +[core/src/core/types.ts:449](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L449) + +--- + +### runtime + +> **runtime**: [`IAgentRuntime`](IAgentRuntime.md) + +#### Defined in + +[core/src/core/types.ts:446](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L446) + +--- + +### tableName + +> **tableName**: `string` + +#### Defined in + +[core/src/core/types.ts:447](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L447) + +## Methods + +### addEmbeddingToMemory() + +> **addEmbeddingToMemory**(`memory`): `Promise`\<[`Memory`](Memory.md)\> + +#### Parameters + +• **memory**: [`Memory`](Memory.md) + +#### Returns + +`Promise`\<[`Memory`](Memory.md)\> + +#### Defined in + +[core/src/core/types.ts:451](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L451) + +--- + +### countMemories() + +> **countMemories**(`roomId`, `unique`?): `Promise`\<`number`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **unique?**: `boolean` + +#### Returns + +`Promise`\<`number`\> + +#### Defined in + +[core/src/core/types.ts:481](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L481) + +--- + +### createMemory() + +> **createMemory**(`memory`, `unique`?): `Promise`\<`void`\> + +#### Parameters + +• **memory**: [`Memory`](Memory.md) + +• **unique?**: `boolean` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:478](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L478) + +--- + +### getCachedEmbeddings() + +> **getCachedEmbeddings**(`content`): `Promise`\<`object`[]\> + +#### Parameters + +• **content**: `string` + +#### Returns + +`Promise`\<`object`[]\> + +#### Defined in + +[core/src/core/types.ts:460](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L460) + +--- + +### getMemories() + +> **getMemories**(`opts`): `Promise`\<[`Memory`](Memory.md)[]\> + +#### Parameters + +• **opts** + +• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **opts.count?**: `number` + +• **opts.end?**: `number` + +• **opts.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **opts.start?**: `number` + +• **opts.unique?**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](Memory.md)[]\> + +#### Defined in + +[core/src/core/types.ts:452](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L452) + +--- + +### getMemoriesByRoomIds() + +> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](Memory.md)[]\> + +#### Parameters + +• **params** + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +#### Returns + +`Promise`\<[`Memory`](Memory.md)[]\> + +#### Defined in + +[core/src/core/types.ts:464](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L464) + +--- + +### getMemoryById() + +> **getMemoryById**(`id`): `Promise`\<[`Memory`](Memory.md)\> + +#### Parameters + +• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<[`Memory`](Memory.md)\> + +#### Defined in + +[core/src/core/types.ts:463](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L463) + +--- + +### removeAllMemories() + +> **removeAllMemories**(`roomId`): `Promise`\<`void`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:480](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L480) + +--- + +### removeMemory() + +> **removeMemory**(`memoryId`): `Promise`\<`void`\> + +#### Parameters + +• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[core/src/core/types.ts:479](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L479) + +--- + +### searchMemoriesByEmbedding() + +> **searchMemoriesByEmbedding**(`embedding`, `opts`): `Promise`\<[`Memory`](Memory.md)[]\> + +#### Parameters + +• **embedding**: `number`[] + +• **opts** + +• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **opts.count?**: `number` + +• **opts.match_threshold?**: `number` + +• **opts.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **opts.unique?**: `boolean` + +#### Returns + +`Promise`\<[`Memory`](Memory.md)[]\> + +#### Defined in + +[core/src/core/types.ts:468](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L468) diff --git a/docs/docs/api/interfaces/IPdfService.md b/docs/docs/api/interfaces/IPdfService.md new file mode 100644 index 00000000000..a4d4b011711 --- /dev/null +++ b/docs/docs/api/interfaces/IPdfService.md @@ -0,0 +1,19 @@ +# Interface: IPdfService + +## Methods + +### convertPdfToText() + +> **convertPdfToText**(`pdfBuffer`): `Promise`\<`string`\> + +#### Parameters + +• **pdfBuffer**: `Buffer` + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[core/src/core/types.ts:598](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L598) diff --git a/docs/docs/api/interfaces/ISpeechService.md b/docs/docs/api/interfaces/ISpeechService.md new file mode 100644 index 00000000000..1fd58914203 --- /dev/null +++ b/docs/docs/api/interfaces/ISpeechService.md @@ -0,0 +1,21 @@ +# Interface: ISpeechService + +## Methods + +### generate() + +> **generate**(`runtime`, `text`): `Promise`\<`Readable`\> + +#### Parameters + +• **runtime**: [`IAgentRuntime`](IAgentRuntime.md) + +• **text**: `string` + +#### Returns + +`Promise`\<`Readable`\> + +#### Defined in + +[core/src/core/types.ts:594](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L594) diff --git a/docs/docs/api/interfaces/ITranscriptionService.md b/docs/docs/api/interfaces/ITranscriptionService.md new file mode 100644 index 00000000000..e21318f2812 --- /dev/null +++ b/docs/docs/api/interfaces/ITranscriptionService.md @@ -0,0 +1,73 @@ +# Interface: ITranscriptionService + +## Methods + +### transcribe() + +> **transcribe**(`audioBuffer`): `Promise`\<`string`\> + +#### Parameters + +• **audioBuffer**: `ArrayBuffer` + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[core/src/core/types.ts:555](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L555) + +--- + +### transcribeAttachment() + +> **transcribeAttachment**(`audioBuffer`): `Promise`\<`string`\> + +#### Parameters + +• **audioBuffer**: `ArrayBuffer` + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[core/src/core/types.ts:551](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L551) + +--- + +### transcribeAttachmentLocally() + +> **transcribeAttachmentLocally**(`audioBuffer`): `Promise`\<`string`\> + +#### Parameters + +• **audioBuffer**: `ArrayBuffer` + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[core/src/core/types.ts:552](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L552) + +--- + +### transcribeLocally() + +> **transcribeLocally**(`audioBuffer`): `Promise`\<`string`\> + +#### Parameters + +• **audioBuffer**: `ArrayBuffer` + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[core/src/core/types.ts:556](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L556) diff --git a/docs/docs/api/interfaces/IVideoService.md b/docs/docs/api/interfaces/IVideoService.md new file mode 100644 index 00000000000..37974807efb --- /dev/null +++ b/docs/docs/api/interfaces/IVideoService.md @@ -0,0 +1,37 @@ +# Interface: IVideoService + +## Methods + +### isVideoUrl() + +> **isVideoUrl**(`url`): `boolean` + +#### Parameters + +• **url**: `string` + +#### Returns + +`boolean` + +#### Defined in + +[core/src/core/types.ts:560](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L560) + +--- + +### processVideo() + +> **processVideo**(`url`): `Promise`\<[`Media`](../type-aliases/Media.md)\> + +#### Parameters + +• **url**: `string` + +#### Returns + +`Promise`\<[`Media`](../type-aliases/Media.md)\> + +#### Defined in + +[core/src/core/types.ts:561](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L561) diff --git a/docs/docs/api/interfaces/Memory.md b/docs/docs/api/interfaces/Memory.md new file mode 100644 index 00000000000..b395bcfa43d --- /dev/null +++ b/docs/docs/api/interfaces/Memory.md @@ -0,0 +1,83 @@ +# Interface: Memory + +Represents a memory record, which could be a message or any other piece of information remembered by the system, including its content, associated user IDs, and optionally, its embedding vector for similarity comparisons. + +## Properties + +### agentId + +> **agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:154](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L154) + +--- + +### content + +> **content**: [`Content`](Content.md) + +#### Defined in + +[core/src/core/types.ts:156](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L156) + +--- + +### createdAt? + +> `optional` **createdAt**: `number` + +#### Defined in + +[core/src/core/types.ts:155](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L155) + +--- + +### embedding? + +> `optional` **embedding**: `number`[] + +#### Defined in + +[core/src/core/types.ts:157](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L157) + +--- + +### id? + +> `optional` **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:152](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L152) + +--- + +### roomId + +> **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:158](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L158) + +--- + +### unique? + +> `optional` **unique**: `boolean` + +#### Defined in + +[core/src/core/types.ts:159](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L159) + +--- + +### userId + +> **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:153](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L153) diff --git a/docs/docs/api/interfaces/MessageExample.md b/docs/docs/api/interfaces/MessageExample.md new file mode 100644 index 00000000000..100e99f58e3 --- /dev/null +++ b/docs/docs/api/interfaces/MessageExample.md @@ -0,0 +1,23 @@ +# Interface: MessageExample + +Represents an example of a message, typically used for demonstrating or testing purposes, including optional content and action. + +## Properties + +### content + +> **content**: [`Content`](Content.md) + +#### Defined in + +[core/src/core/types.ts:167](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L167) + +--- + +### user + +> **user**: `string` + +#### Defined in + +[core/src/core/types.ts:166](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L166) diff --git a/docs/docs/api/interfaces/Objective.md b/docs/docs/api/interfaces/Objective.md new file mode 100644 index 00000000000..6fd03f9c5e8 --- /dev/null +++ b/docs/docs/api/interfaces/Objective.md @@ -0,0 +1,33 @@ +# Interface: Objective + +Represents an objective within a goal, detailing what needs to be achieved and whether it has been completed. + +## Properties + +### completed + +> **completed**: `boolean` + +#### Defined in + +[core/src/core/types.ts:54](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L54) + +--- + +### description + +> **description**: `string` + +#### Defined in + +[core/src/core/types.ts:53](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L53) + +--- + +### id? + +> `optional` **id**: `string` + +#### Defined in + +[core/src/core/types.ts:52](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L52) diff --git a/docs/docs/api/interfaces/Participant.md b/docs/docs/api/interfaces/Participant.md new file mode 100644 index 00000000000..e8a774c6f21 --- /dev/null +++ b/docs/docs/api/interfaces/Participant.md @@ -0,0 +1,23 @@ +# Interface: Participant + +Represents a participant in a room, including their ID and account details. + +## Properties + +### account + +> **account**: [`Account`](Account.md) + +#### Defined in + +[core/src/core/types.ts:270](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L270) + +--- + +### id + +> **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:269](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L269) diff --git a/docs/docs/api/interfaces/Provider.md b/docs/docs/api/interfaces/Provider.md new file mode 100644 index 00000000000..8951692f9c1 --- /dev/null +++ b/docs/docs/api/interfaces/Provider.md @@ -0,0 +1,25 @@ +# Interface: Provider + +Represents a provider, which is used to retrieve information or perform actions on behalf of the agent, such as fetching data from an external API or service. + +## Properties + +### get() + +> **get**: (`runtime`, `message`, `state`?) => `Promise`\<`any`\> + +#### Parameters + +• **runtime**: [`IAgentRuntime`](IAgentRuntime.md) + +• **message**: [`Memory`](Memory.md) + +• **state?**: [`State`](State.md) + +#### Returns + +`Promise`\<`any`\> + +#### Defined in + +[core/src/core/types.ts:233](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L233) diff --git a/docs/docs/api/interfaces/Relationship.md b/docs/docs/api/interfaces/Relationship.md new file mode 100644 index 00000000000..fb5742fb7c3 --- /dev/null +++ b/docs/docs/api/interfaces/Relationship.md @@ -0,0 +1,73 @@ +# Interface: Relationship + +Represents a relationship between two users, including their IDs, the status of the relationship, and the room ID in which the relationship is established. + +## Properties + +### createdAt? + +> `optional` **createdAt**: `string` + +#### Defined in + +[core/src/core/types.ts:250](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L250) + +--- + +### id + +> **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:244](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L244) + +--- + +### roomId + +> **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:248](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L248) + +--- + +### status + +> **status**: `string` + +#### Defined in + +[core/src/core/types.ts:249](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L249) + +--- + +### userA + +> **userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:245](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L245) + +--- + +### userB + +> **userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:246](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L246) + +--- + +### userId + +> **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:247](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L247) diff --git a/docs/docs/api/interfaces/Room.md b/docs/docs/api/interfaces/Room.md new file mode 100644 index 00000000000..63a2ed05817 --- /dev/null +++ b/docs/docs/api/interfaces/Room.md @@ -0,0 +1,23 @@ +# Interface: Room + +Represents a room or conversation context, including its ID and a list of participants. + +## Properties + +### id + +> **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:277](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L277) + +--- + +### participants + +> **participants**: [`Participant`](Participant.md)[] + +#### Defined in + +[core/src/core/types.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L278) diff --git a/docs/docs/api/interfaces/State.md b/docs/docs/api/interfaces/State.md new file mode 100644 index 00000000000..177552ce39d --- /dev/null +++ b/docs/docs/api/interfaces/State.md @@ -0,0 +1,277 @@ +# Interface: State + +Represents the state of the conversation or context in which the agent is operating, including information about users, messages, goals, and other relevant data. + +## Indexable + +\[`key`: `string`\]: `unknown` + +## Properties + +### actionExamples? + +> `optional` **actionExamples**: `string` + +#### Defined in + +[core/src/core/types.ts:140](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L140) + +--- + +### actionNames? + +> `optional` **actionNames**: `string` + +#### Defined in + +[core/src/core/types.ts:137](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L137) + +--- + +### actions? + +> `optional` **actions**: `string` + +#### Defined in + +[core/src/core/types.ts:138](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L138) + +--- + +### actionsData? + +> `optional` **actionsData**: [`Action`](Action.md)[] + +#### Defined in + +[core/src/core/types.ts:139](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L139) + +--- + +### actors + +> **actors**: `string` + +#### Defined in + +[core/src/core/types.ts:127](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L127) + +--- + +### actorsData? + +> `optional` **actorsData**: [`Actor`](Actor.md)[] + +#### Defined in + +[core/src/core/types.ts:128](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L128) + +--- + +### agentId? + +> `optional` **agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:119](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L119) + +--- + +### agentName? + +> `optional` **agentName**: `string` + +#### Defined in + +[core/src/core/types.ts:125](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L125) + +--- + +### bio + +> **bio**: `string` + +#### Defined in + +[core/src/core/types.ts:120](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L120) + +--- + +### goals? + +> `optional` **goals**: `string` + +#### Defined in + +[core/src/core/types.ts:129](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L129) + +--- + +### goalsData? + +> `optional` **goalsData**: [`Goal`](Goal.md)[] + +#### Defined in + +[core/src/core/types.ts:130](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L130) + +--- + +### lore + +> **lore**: `string` + +#### Defined in + +[core/src/core/types.ts:121](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L121) + +--- + +### messageDirections + +> **messageDirections**: `string` + +#### Defined in + +[core/src/core/types.ts:122](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L122) + +--- + +### postDirections + +> **postDirections**: `string` + +#### Defined in + +[core/src/core/types.ts:123](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L123) + +--- + +### providers? + +> `optional` **providers**: `string` + +#### Defined in + +[core/src/core/types.ts:141](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L141) + +--- + +### recentFacts? + +> `optional` **recentFacts**: `string` + +#### Defined in + +[core/src/core/types.ts:133](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L133) + +--- + +### recentFactsData? + +> `optional` **recentFactsData**: [`Memory`](Memory.md)[] + +#### Defined in + +[core/src/core/types.ts:134](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L134) + +--- + +### recentInteractions? + +> `optional` **recentInteractions**: `string` + +#### Defined in + +[core/src/core/types.ts:144](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L144) + +--- + +### recentInteractionsData? + +> `optional` **recentInteractionsData**: [`Memory`](Memory.md)[] + +#### Defined in + +[core/src/core/types.ts:143](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L143) + +--- + +### recentMessages + +> **recentMessages**: `string` + +#### Defined in + +[core/src/core/types.ts:131](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L131) + +--- + +### recentMessagesData + +> **recentMessagesData**: [`Memory`](Memory.md)[] + +#### Defined in + +[core/src/core/types.ts:132](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L132) + +--- + +### relevantFacts? + +> `optional` **relevantFacts**: `string` + +#### Defined in + +[core/src/core/types.ts:135](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L135) + +--- + +### relevantFactsData? + +> `optional` **relevantFactsData**: [`Memory`](Memory.md)[] + +#### Defined in + +[core/src/core/types.ts:136](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L136) + +--- + +### responseData? + +> `optional` **responseData**: [`Content`](Content.md) + +#### Defined in + +[core/src/core/types.ts:142](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L142) + +--- + +### roomId + +> **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:124](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L124) + +--- + +### senderName? + +> `optional` **senderName**: `string` + +#### Defined in + +[core/src/core/types.ts:126](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L126) + +--- + +### userId? + +> `optional` **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[core/src/core/types.ts:118](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L118) diff --git a/docs/docs/api/type-aliases/Character.md b/docs/docs/api/type-aliases/Character.md new file mode 100644 index 00000000000..511d14ef778 --- /dev/null +++ b/docs/docs/api/type-aliases/Character.md @@ -0,0 +1,129 @@ +# Type Alias: Character + +> **Character**: `object` + +## Type declaration + +### adjectives + +> **adjectives**: `string`[] + +### bio + +> **bio**: `string` \| `string`[] + +### clients + +> **clients**: [`Clients`](../enumerations/Clients.md)[] + +### id? + +> `optional` **id**: [`UUID`](UUID.md) + +### imageGenModel? + +> `optional` **imageGenModel**: [`ImageGenModel`](../enumerations/ImageGenModel.md) + +### knowledge? + +> `optional` **knowledge**: `string`[] + +### lore + +> **lore**: `string`[] + +### messageExamples + +> **messageExamples**: [`MessageExample`](../interfaces/MessageExample.md)[][] + +### modelEndpointOverride? + +> `optional` **modelEndpointOverride**: `string` + +### modelProvider + +> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) + +### name + +> **name**: `string` + +### people + +> **people**: `string`[] + +### plugins + +> **plugins**: [`Plugin`](Plugin.md)[] + +### postExamples + +> **postExamples**: `string`[] + +### settings? + +> `optional` **settings**: `object` + +### settings.embeddingModel? + +> `optional` **embeddingModel**: `string` + +### settings.model? + +> `optional` **model**: `string` + +### settings.secrets? + +> `optional` **secrets**: `object` + +#### Index Signature + +\[`key`: `string`\]: `string` + +### settings.voice? + +> `optional` **voice**: `object` + +### settings.voice.model? + +> `optional` **model**: `string` + +### settings.voice.url? + +> `optional` **url**: `string` + +### style + +> **style**: `object` + +### style.all + +> **all**: `string`[] + +### style.chat + +> **chat**: `string`[] + +### style.post + +> **post**: `string`[] + +### system? + +> `optional` **system**: `string` + +### templates? + +> `optional` **templates**: `object` + +#### Index Signature + +\[`key`: `string`\]: `string` + +### topics + +> **topics**: `string`[] + +## Defined in + +[core/src/core/types.ts:305](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L305) diff --git a/docs/docs/api/type-aliases/Handler.md b/docs/docs/api/type-aliases/Handler.md new file mode 100644 index 00000000000..6b3e13d5b4d --- /dev/null +++ b/docs/docs/api/type-aliases/Handler.md @@ -0,0 +1,25 @@ +# Type Alias: Handler() + +> **Handler**: (`runtime`, `message`, `state`?, `options`?, `callback`?) => `Promise`\<`unknown`\> + +Represents the type of a handler function, which takes a runtime instance, a message, and an optional state, and returns a promise resolving to any type. + +## Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **message**: [`Memory`](../interfaces/Memory.md) + +• **state?**: [`State`](../interfaces/State.md) + +• **options?** + +• **callback?**: [`HandlerCallback`](HandlerCallback.md) + +## Returns + +`Promise`\<`unknown`\> + +## Defined in + +[core/src/core/types.ts:173](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L173) diff --git a/docs/docs/api/type-aliases/HandlerCallback.md b/docs/docs/api/type-aliases/HandlerCallback.md new file mode 100644 index 00000000000..2d9641aea5b --- /dev/null +++ b/docs/docs/api/type-aliases/HandlerCallback.md @@ -0,0 +1,17 @@ +# Type Alias: HandlerCallback() + +> **HandlerCallback**: (`response`, `files`?) => `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +## Parameters + +• **response**: [`Content`](../interfaces/Content.md) + +• **files?**: `any` + +## Returns + +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +## Defined in + +[core/src/core/types.ts:182](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L182) diff --git a/docs/docs/api/type-aliases/Media.md b/docs/docs/api/type-aliases/Media.md new file mode 100644 index 00000000000..0585ea6b841 --- /dev/null +++ b/docs/docs/api/type-aliases/Media.md @@ -0,0 +1,33 @@ +# Type Alias: Media + +> **Media**: `object` + +## Type declaration + +### description + +> **description**: `string` + +### id + +> **id**: `string` + +### source + +> **source**: `string` + +### text + +> **text**: `string` + +### title + +> **title**: `string` + +### url + +> **url**: `string` + +## Defined in + +[core/src/core/types.ts:281](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L281) diff --git a/docs/docs/api/type-aliases/Model.md b/docs/docs/api/type-aliases/Model.md new file mode 100644 index 00000000000..0449532f653 --- /dev/null +++ b/docs/docs/api/type-aliases/Model.md @@ -0,0 +1,65 @@ +# Type Alias: Model + +> **Model**: `object` + +## Type declaration + +### endpoint? + +> `optional` **endpoint**: `string` + +### model + +> **model**: `object` + +### model.embedding? + +> `optional` **embedding**: `string` + +### model.large + +> **large**: `string` + +### model.medium + +> **medium**: `string` + +### model.small + +> **small**: `string` + +### settings + +> **settings**: `object` + +### settings.frequency_penalty? + +> `optional` **frequency_penalty**: `number` + +### settings.maxInputTokens + +> **maxInputTokens**: `number` + +### settings.maxOutputTokens + +> **maxOutputTokens**: `number` + +### settings.presence_penalty? + +> `optional` **presence_penalty**: `number` + +### settings.repetition_penalty? + +> `optional` **repetition_penalty**: `number` + +### settings.stop + +> **stop**: `string`[] + +### settings.temperature + +> **temperature**: `number` + +## Defined in + +[core/src/core/types.ts:82](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L82) diff --git a/docs/docs/api/type-aliases/Plugin.md b/docs/docs/api/type-aliases/Plugin.md new file mode 100644 index 00000000000..3598e5ac7bc --- /dev/null +++ b/docs/docs/api/type-aliases/Plugin.md @@ -0,0 +1,29 @@ +# Type Alias: Plugin + +> **Plugin**: `object` + +## Type declaration + +### actions + +> **actions**: [`Action`](../interfaces/Action.md)[] + +### description + +> **description**: `string` + +### evaluators + +> **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] + +### name + +> **name**: `string` + +### providers + +> **providers**: [`Provider`](../interfaces/Provider.md)[] + +## Defined in + +[core/src/core/types.ts:290](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L290) diff --git a/docs/docs/api/type-aliases/UUID.md b/docs/docs/api/type-aliases/UUID.md new file mode 100644 index 00000000000..bf620cb27db --- /dev/null +++ b/docs/docs/api/type-aliases/UUID.md @@ -0,0 +1,9 @@ +# Type Alias: UUID + +> **UUID**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +Represents a UUID, which is a universally unique identifier conforming to the UUID standard. + +## Defined in + +[core/src/core/types.ts:7](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L7) diff --git a/docs/docs/api/type-aliases/Validator.md b/docs/docs/api/type-aliases/Validator.md new file mode 100644 index 00000000000..3289d9e2e56 --- /dev/null +++ b/docs/docs/api/type-aliases/Validator.md @@ -0,0 +1,21 @@ +# Type Alias: Validator() + +> **Validator**: (`runtime`, `message`, `state`?) => `Promise`\<`boolean`\> + +Represents the type of a validator function, which takes a runtime instance, a message, and an optional state, and returns a promise resolving to a boolean indicating whether the validation passed. + +## Parameters + +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **message**: [`Memory`](../interfaces/Memory.md) + +• **state?**: [`State`](../interfaces/State.md) + +## Returns + +`Promise`\<`boolean`\> + +## Defined in + +[core/src/core/types.ts:190](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L190) diff --git a/docs/docs/api/typedoc-sidebar.cjs b/docs/docs/api/typedoc-sidebar.cjs new file mode 100644 index 00000000000..6c759f89fee --- /dev/null +++ b/docs/docs/api/typedoc-sidebar.cjs @@ -0,0 +1,552 @@ +// @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/ImageGenModel", + label: "ImageGenModel", + }, + { type: "doc", id: "api/enumerations/ModelClass", label: "ModelClass" }, + { + type: "doc", + id: "api/enumerations/ModelProvider", + label: "ModelProvider", + }, + ], + }, + { + 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/DirectClient", label: "DirectClient" }, + { + type: "doc", + id: "api/classes/DiscordClient", + label: "DiscordClient", + }, + { + type: "doc", + id: "api/classes/MemoryManager", + label: "MemoryManager", + }, + { + type: "doc", + id: "api/classes/PostgresDatabaseAdapter", + label: "PostgresDatabaseAdapter", + }, + { + type: "doc", + id: "api/classes/SqliteDatabaseAdapter", + label: "SqliteDatabaseAdapter", + }, + { + type: "doc", + id: "api/classes/TelegramClient", + label: "TelegramClient", + }, + { + type: "doc", + id: "api/classes/TokenProvider", + label: "TokenProvider", + }, + { + type: "doc", + id: "api/classes/TwitterInteractionClient", + label: "TwitterInteractionClient", + }, + { + type: "doc", + id: "api/classes/TwitterPostClient", + label: "TwitterPostClient", + }, + { + type: "doc", + id: "api/classes/TwitterSearchClient", + label: "TwitterSearchClient", + }, + { + type: "doc", + id: "api/classes/WalletProvider", + label: "WalletProvider", + }, + ], + }, + { + 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/CreateAndBuyContent", + label: "CreateAndBuyContent", + }, + { + 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/IImageRecognitionService", + label: "IImageRecognitionService", + }, + { + type: "doc", + id: "api/interfaces/ILlamaService", + label: "ILlamaService", + }, + { + 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/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/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/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/boredomProvider", + label: "boredomProvider", + }, + { + type: "doc", + id: "api/variables/continueAction", + label: "continueAction", + }, + { + type: "doc", + id: "api/variables/defaultActions", + label: "defaultActions", + }, + { + type: "doc", + id: "api/variables/defaultCharacter", + label: "defaultCharacter", + }, + { + type: "doc", + id: "api/variables/defaultEvaluators", + label: "defaultEvaluators", + }, + { + type: "doc", + id: "api/variables/defaultProviders", + label: "defaultProviders", + }, + { 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/executeSwap", label: "executeSwap" }, + { type: "doc", id: "api/variables/followRoom", label: "followRoom" }, + { type: "doc", id: "api/variables/ignore", label: "ignore" }, + { + type: "doc", + id: "api/variables/imageGeneration", + label: "imageGeneration", + }, + { + type: "doc", + id: "api/variables/imageGenModels", + label: "imageGenModels", + }, + { + type: "doc", + id: "api/variables/messageHandlerTemplate", + label: "messageHandlerTemplate", + }, + { type: "doc", id: "api/variables/muteRoom", label: "muteRoom" }, + { type: "doc", id: "api/variables/none", label: "none" }, + { + type: "doc", + id: "api/variables/orderBookProvider", + label: "orderBookProvider", + }, + { + type: "doc", + id: "api/variables/shouldContinueTemplate", + label: "shouldContinueTemplate", + }, + { + type: "doc", + id: "api/variables/shouldFollowTemplate", + label: "shouldFollowTemplate", + }, + { + type: "doc", + id: "api/variables/shouldMuteTemplate", + label: "shouldMuteTemplate", + }, + { + type: "doc", + id: "api/variables/shouldUnmuteTemplate", + label: "shouldUnmuteTemplate", + }, + { + type: "doc", + id: "api/variables/timeProvider", + label: "timeProvider", + }, + { + type: "doc", + id: "api/variables/tokenProvider", + label: "tokenProvider", + }, + { + type: "doc", + id: "api/variables/unfollowRoom", + label: "unfollowRoom", + }, + { type: "doc", id: "api/variables/unmuteRoom", label: "unmuteRoom" }, + { + type: "doc", + id: "api/variables/walletProvider", + label: "walletProvider", + }, + ], + }, + { + type: "category", + label: "Functions", + items: [ + { type: "doc", id: "api/functions/addHeader", label: "addHeader" }, + { type: "doc", id: "api/functions/buyToken", label: "buyToken" }, + { + type: "doc", + id: "api/functions/composeActionExamples", + label: "composeActionExamples", + }, + { + type: "doc", + id: "api/functions/composeContext", + label: "composeContext", + }, + { + type: "doc", + id: "api/functions/createAgentRuntime", + label: "createAgentRuntime", + }, + { + type: "doc", + id: "api/functions/createAndBuyToken", + label: "createAndBuyToken", + }, + { + type: "doc", + id: "api/functions/createDirectRuntime", + label: "createDirectRuntime", + }, + { 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/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/getImageGenModel", + label: "getImageGenModel", + }, + { 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/getTokenForProvider", + label: "getTokenForProvider", + }, + { + type: "doc", + id: "api/functions/initializeClients", + label: "initializeClients", + }, + { + type: "doc", + id: "api/functions/initializeDatabase", + label: "initializeDatabase", + }, + { + type: "doc", + id: "api/functions/isCreateAndBuyContent", + label: "isCreateAndBuyContent", + }, + { + type: "doc", + id: "api/functions/loadActionConfigs", + label: "loadActionConfigs", + }, + { + type: "doc", + id: "api/functions/loadCharacters", + label: "loadCharacters", + }, + { + type: "doc", + id: "api/functions/loadCustomActions", + label: "loadCustomActions", + }, + { + type: "doc", + id: "api/functions/parseArguments", + label: "parseArguments", + }, + { + type: "doc", + id: "api/functions/retrieveCachedEmbedding", + label: "retrieveCachedEmbedding", + }, + { type: "doc", id: "api/functions/sellToken", label: "sellToken" }, + { type: "doc", id: "api/functions/splitChunks", label: "splitChunks" }, + { + type: "doc", + id: "api/functions/startDiscord", + label: "startDiscord", + }, + { + type: "doc", + id: "api/functions/startTelegram", + label: "startTelegram", + }, + { + type: "doc", + id: "api/functions/startTwitter", + label: "startTwitter", + }, + { 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/api/variables/boredomProvider.md b/docs/docs/api/variables/boredomProvider.md new file mode 100644 index 00000000000..f9fdc3d727c --- /dev/null +++ b/docs/docs/api/variables/boredomProvider.md @@ -0,0 +1,7 @@ +# Variable: boredomProvider + +> `const` **boredomProvider**: [`Provider`](../interfaces/Provider.md) + +## Defined in + +[core/src/providers/boredom.ts:275](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/boredom.ts#L275) diff --git a/docs/docs/api/variables/continueAction.md b/docs/docs/api/variables/continueAction.md new file mode 100644 index 00000000000..030165236dd --- /dev/null +++ b/docs/docs/api/variables/continueAction.md @@ -0,0 +1,7 @@ +# Variable: continueAction + +> `const` **continueAction**: [`Action`](../interfaces/Action.md) + +## Defined in + +[core/src/actions/continue.ts:58](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/continue.ts#L58) diff --git a/docs/docs/api/variables/defaultActions.md b/docs/docs/api/variables/defaultActions.md new file mode 100644 index 00000000000..b283756741b --- /dev/null +++ b/docs/docs/api/variables/defaultActions.md @@ -0,0 +1,7 @@ +# Variable: defaultActions + +> `const` **defaultActions**: [`Action`](../interfaces/Action.md)[] + +## Defined in + +[core/src/core/actions.ts:6](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/actions.ts#L6) diff --git a/docs/docs/api/variables/defaultCharacter.md b/docs/docs/api/variables/defaultCharacter.md new file mode 100644 index 00000000000..58de13c19f4 --- /dev/null +++ b/docs/docs/api/variables/defaultCharacter.md @@ -0,0 +1,7 @@ +# Variable: defaultCharacter + +> `const` **defaultCharacter**: [`Character`](../type-aliases/Character.md) + +## Defined in + +[core/src/core/defaultCharacter.ts:3](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/defaultCharacter.ts#L3) diff --git a/docs/docs/api/variables/defaultEvaluators.md b/docs/docs/api/variables/defaultEvaluators.md new file mode 100644 index 00000000000..3d8953896dc --- /dev/null +++ b/docs/docs/api/variables/defaultEvaluators.md @@ -0,0 +1,7 @@ +# Variable: defaultEvaluators + +> `const` **defaultEvaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] + +## Defined in + +[core/src/core/evaluators.ts:7](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L7) diff --git a/docs/docs/api/variables/defaultProviders.md b/docs/docs/api/variables/defaultProviders.md new file mode 100644 index 00000000000..a7005af1763 --- /dev/null +++ b/docs/docs/api/variables/defaultProviders.md @@ -0,0 +1,7 @@ +# Variable: defaultProviders + +> `const` **defaultProviders**: [`Provider`](../interfaces/Provider.md)[] + +## Defined in + +[core/src/core/providers.ts:4](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/providers.ts#L4) diff --git a/docs/docs/api/variables/elizaLogger.md b/docs/docs/api/variables/elizaLogger.md new file mode 100644 index 00000000000..ffb378d63fa --- /dev/null +++ b/docs/docs/api/variables/elizaLogger.md @@ -0,0 +1,7 @@ +# Variable: elizaLogger + +> `const` **elizaLogger**: `elizaLogger` + +## Defined in + +[core/src/index.ts:12](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/index.ts#L12) diff --git a/docs/docs/api/variables/embeddingDimension.md b/docs/docs/api/variables/embeddingDimension.md new file mode 100644 index 00000000000..1447d864ead --- /dev/null +++ b/docs/docs/api/variables/embeddingDimension.md @@ -0,0 +1,7 @@ +# Variable: embeddingDimension + +> `const` **embeddingDimension**: `1536` = `1536` + +## Defined in + +[core/src/core/memory.ts:9](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L9) diff --git a/docs/docs/api/variables/embeddingZeroVector.md b/docs/docs/api/variables/embeddingZeroVector.md new file mode 100644 index 00000000000..9101bd6332b --- /dev/null +++ b/docs/docs/api/variables/embeddingZeroVector.md @@ -0,0 +1,7 @@ +# Variable: embeddingZeroVector + +> `const` **embeddingZeroVector**: `any`[] + +## Defined in + +[core/src/core/memory.ts:10](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L10) diff --git a/docs/docs/api/variables/evaluationTemplate.md b/docs/docs/api/variables/evaluationTemplate.md new file mode 100644 index 00000000000..316b9d6be67 --- /dev/null +++ b/docs/docs/api/variables/evaluationTemplate.md @@ -0,0 +1,9 @@ +# Variable: evaluationTemplate + +> `const` **evaluationTemplate**: `string` + +Template used for the evaluation generateText. + +## Defined in + +[core/src/core/evaluators.ts:12](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L12) diff --git a/docs/docs/api/variables/executeSwap.md b/docs/docs/api/variables/executeSwap.md new file mode 100644 index 00000000000..15018dafaaf --- /dev/null +++ b/docs/docs/api/variables/executeSwap.md @@ -0,0 +1,7 @@ +# Variable: executeSwap + +> `const` **executeSwap**: [`Action`](../interfaces/Action.md) + +## Defined in + +[core/src/actions/swap.ts:178](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/swap.ts#L178) diff --git a/docs/docs/api/variables/followRoom.md b/docs/docs/api/variables/followRoom.md new file mode 100644 index 00000000000..37276e24ce0 --- /dev/null +++ b/docs/docs/api/variables/followRoom.md @@ -0,0 +1,7 @@ +# Variable: followRoom + +> `const` **followRoom**: [`Action`](../interfaces/Action.md) + +## Defined in + +[core/src/actions/followRoom.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/followRoom.ts#L27) diff --git a/docs/docs/api/variables/ignore.md b/docs/docs/api/variables/ignore.md new file mode 100644 index 00000000000..151124d7180 --- /dev/null +++ b/docs/docs/api/variables/ignore.md @@ -0,0 +1,7 @@ +# Variable: ignore + +> `const` **ignore**: [`Action`](../interfaces/Action.md) + +## Defined in + +[core/src/actions/ignore.ts:8](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/ignore.ts#L8) diff --git a/docs/docs/api/variables/imageGenModels.md b/docs/docs/api/variables/imageGenModels.md new file mode 100644 index 00000000000..7f38921b9ea --- /dev/null +++ b/docs/docs/api/variables/imageGenModels.md @@ -0,0 +1,33 @@ +# Variable: imageGenModels + +> `const` **imageGenModels**: `object` + +## Type declaration + +### Dalle + +> **Dalle**: `object` + +### Dalle.steps + +> **steps**: `number` = `0` + +### Dalle.subModel + +> **subModel**: `string` = `"dall-e-3"` + +### TogetherAI + +> **TogetherAI**: `object` + +### TogetherAI.steps + +> **steps**: `number` = `4` + +### TogetherAI.subModel + +> **subModel**: `string` = `"black-forest-labs/FLUX.1-schnell"` + +## Defined in + +[core/src/core/imageGenModels.ts:6](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L6) diff --git a/docs/docs/api/variables/imageGeneration.md b/docs/docs/api/variables/imageGeneration.md new file mode 100644 index 00000000000..2ca52ee544c --- /dev/null +++ b/docs/docs/api/variables/imageGeneration.md @@ -0,0 +1,7 @@ +# Variable: imageGeneration + +> `const` **imageGeneration**: [`Action`](../interfaces/Action.md) + +## Defined in + +[core/src/actions/imageGeneration.ts:11](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/imageGeneration.ts#L11) diff --git a/docs/docs/api/variables/messageHandlerTemplate.md b/docs/docs/api/variables/messageHandlerTemplate.md new file mode 100644 index 00000000000..cef7d99229a --- /dev/null +++ b/docs/docs/api/variables/messageHandlerTemplate.md @@ -0,0 +1,7 @@ +# Variable: messageHandlerTemplate + +> `const` **messageHandlerTemplate**: `string` + +## Defined in + +[core/src/actions/continue.ts:20](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/continue.ts#L20) diff --git a/docs/docs/api/variables/muteRoom.md b/docs/docs/api/variables/muteRoom.md new file mode 100644 index 00000000000..e955e043758 --- /dev/null +++ b/docs/docs/api/variables/muteRoom.md @@ -0,0 +1,7 @@ +# Variable: muteRoom + +> `const` **muteRoom**: [`Action`](../interfaces/Action.md) + +## Defined in + +[core/src/actions/muteRoom.ts:28](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/muteRoom.ts#L28) diff --git a/docs/docs/api/variables/none.md b/docs/docs/api/variables/none.md new file mode 100644 index 00000000000..583c9f86f15 --- /dev/null +++ b/docs/docs/api/variables/none.md @@ -0,0 +1,7 @@ +# Variable: none + +> `const` **none**: [`Action`](../interfaces/Action.md) + +## Defined in + +[core/src/actions/none.ts:8](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/none.ts#L8) diff --git a/docs/docs/api/variables/orderBookProvider.md b/docs/docs/api/variables/orderBookProvider.md new file mode 100644 index 00000000000..1a727c6a829 --- /dev/null +++ b/docs/docs/api/variables/orderBookProvider.md @@ -0,0 +1,7 @@ +# Variable: orderBookProvider + +> `const` **orderBookProvider**: [`Provider`](../interfaces/Provider.md) + +## Defined in + +[core/src/providers/orderBook.ts:14](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/orderBook.ts#L14) diff --git a/docs/docs/api/variables/shouldContinueTemplate.md b/docs/docs/api/variables/shouldContinueTemplate.md new file mode 100644 index 00000000000..a6f189eb0b3 --- /dev/null +++ b/docs/docs/api/variables/shouldContinueTemplate.md @@ -0,0 +1,7 @@ +# Variable: shouldContinueTemplate + +> `const` **shouldContinueTemplate**: `string` + +## Defined in + +[core/src/actions/continue.ts:47](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/continue.ts#L47) diff --git a/docs/docs/api/variables/shouldFollowTemplate.md b/docs/docs/api/variables/shouldFollowTemplate.md new file mode 100644 index 00000000000..682da6f91ba --- /dev/null +++ b/docs/docs/api/variables/shouldFollowTemplate.md @@ -0,0 +1,7 @@ +# Variable: shouldFollowTemplate + +> `const` **shouldFollowTemplate**: `string` + +## Defined in + +[core/src/actions/followRoom.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/followRoom.ts#L13) diff --git a/docs/docs/api/variables/shouldMuteTemplate.md b/docs/docs/api/variables/shouldMuteTemplate.md new file mode 100644 index 00000000000..c999f23e561 --- /dev/null +++ b/docs/docs/api/variables/shouldMuteTemplate.md @@ -0,0 +1,7 @@ +# Variable: shouldMuteTemplate + +> `const` **shouldMuteTemplate**: `string` + +## Defined in + +[core/src/actions/muteRoom.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/muteRoom.ts#L13) diff --git a/docs/docs/api/variables/shouldUnmuteTemplate.md b/docs/docs/api/variables/shouldUnmuteTemplate.md new file mode 100644 index 00000000000..e69a5fc9aaa --- /dev/null +++ b/docs/docs/api/variables/shouldUnmuteTemplate.md @@ -0,0 +1,7 @@ +# Variable: shouldUnmuteTemplate + +> `const` **shouldUnmuteTemplate**: `string` + +## Defined in + +[core/src/actions/unmuteRoom.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/unmuteRoom.ts#L13) diff --git a/docs/docs/api/variables/timeProvider.md b/docs/docs/api/variables/timeProvider.md new file mode 100644 index 00000000000..495451cd21c --- /dev/null +++ b/docs/docs/api/variables/timeProvider.md @@ -0,0 +1,7 @@ +# Variable: timeProvider + +> `const` **timeProvider**: [`Provider`](../interfaces/Provider.md) + +## Defined in + +[core/src/providers/time.ts:3](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/time.ts#L3) diff --git a/docs/docs/api/variables/tokenProvider.md b/docs/docs/api/variables/tokenProvider.md new file mode 100644 index 00000000000..f2af9a6a8bb --- /dev/null +++ b/docs/docs/api/variables/tokenProvider.md @@ -0,0 +1,7 @@ +# Variable: tokenProvider + +> `const` **tokenProvider**: [`Provider`](../interfaces/Provider.md) + +## Defined in + +[core/src/providers/token.ts:801](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L801) diff --git a/docs/docs/api/variables/unfollowRoom.md b/docs/docs/api/variables/unfollowRoom.md new file mode 100644 index 00000000000..a35743195c4 --- /dev/null +++ b/docs/docs/api/variables/unfollowRoom.md @@ -0,0 +1,7 @@ +# Variable: unfollowRoom + +> `const` **unfollowRoom**: [`Action`](../interfaces/Action.md) + +## Defined in + +[core/src/actions/unfollowRoom.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/unfollowRoom.ts#L27) diff --git a/docs/docs/api/variables/unmuteRoom.md b/docs/docs/api/variables/unmuteRoom.md new file mode 100644 index 00000000000..95fd4dabbe3 --- /dev/null +++ b/docs/docs/api/variables/unmuteRoom.md @@ -0,0 +1,7 @@ +# Variable: unmuteRoom + +> `const` **unmuteRoom**: [`Action`](../interfaces/Action.md) + +## Defined in + +[core/src/actions/unmuteRoom.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/unmuteRoom.ts#L27) diff --git a/docs/docs/api/variables/walletProvider.md b/docs/docs/api/variables/walletProvider.md new file mode 100644 index 00000000000..32f4688f60c --- /dev/null +++ b/docs/docs/api/variables/walletProvider.md @@ -0,0 +1,7 @@ +# Variable: walletProvider + +> `const` **walletProvider**: [`Provider`](../interfaces/Provider.md) + +## Defined in + +[core/src/providers/wallet.ts:244](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L244) diff --git a/docs/docs/community/contributing.md b/docs/docs/community/contributing.md index c8a6e04b7cb..e69de29bb2d 100644 --- a/docs/docs/community/contributing.md +++ b/docs/docs/community/contributing.md @@ -1,98 +0,0 @@ ---- -sidebar_position: 5 -title: Contributing ---- - -# Contributor Guide - -Welcome to the Eliza contributor guide! This document is designed to help you understand how you can be part of building the future of autonomous AI agents, regardless of your technical background. - -## The OODA Loop: A Framework for Contribution - -We believe in the power of the OODA Loop - a decision-making framework that emphasizes speed and adaptability. OODA stands for: - -- **Observe**: Gather information and insights about the project, the community, and the broader AI ecosystem. -- **Orient**: Analyze your observations to identify opportunities for contribution and improvement. -- **Decide**: Choose a course of action based on your analysis. This could be proposing a new feature, fixing a bug, or creating content. -- **Act**: Execute your decision and share your work with the community. - -By internalizing the OODA Loop, you can quickly identify areas where you can make a meaningful impact and drive the project forward. - ---- - -## How to Contribute - -### For Developers - -1. **Extend Eliza's Capabilities** - - - Develop new actions, evaluators, and providers to expand what Eliza agents can do. - - Improve existing components and modules. - -2. **Enhance Infrastructure** - - - Go through open issues, send back a PR if you can improve anything. - - Test currently documented steps to ensure they're still up to date. - - Optimize Eliza's database architecture and performance. - - Contribute to the autonomous trading system and trust engine. - - Improve deployment and scaling solutions. - -3. **Implement Integrations** - - Build connectors for new platforms and services. - - Enhance existing integrations with additional features. - -### For AI Enthusiasts - -1. **Fine-tune Models** - - - Experiment with fine-tuning models for specific tasks and domains. - - Develop best practices for prompt engineering and model selection. - -2. **Develop Characters** - - Create compelling character files that showcase Eliza's potential. - - Curate knowledge bases and datasets for different use cases. - -### Non-Technical Contributions - -1. **Create Content** - - - Make memes, stickers, emojis, and clips of AI agents that are deployed. - - Write tutorials, guides, and blog posts to help others learn about Eliza. - - Produce videos showcasing Eliza's capabilities and real-world applications. - -2. **Engage the Community** - - - Participate in discussions on Discord, Twitter, and other platforms. - - Help answer questions and provide support to other community members. - - Organize events, workshops, and hackathons to bring people together. - -3. **Spread the Word** - - Share the Eliza project and help attract new contributors. - - Participate in one of our upcoming demo days, show and tell your project. - ---- - -### Tips for Efficient Contribution - -- Use tools like OBS and Whisper to record and transcribe your work sessions. This allows you to easily document your process and share insights with the community. -- Leverage AI assistants to help with tasks like code generation, document summarization, and content creation. -- Collaborate with other community members to divide and conquer larger initiatives. - -## Recognition and Rewards - -We believe in recognizing and rewarding contributors who go above and beyond to drive the project forward. Stand-out contributions may be eligible for: - -- Grants from the ai16z Creator Fund -- Featuring your project across various channels -- Opportunities to shape the direction of the project - -Note: we're still finalizing details on the creator/dev fund that seeks to retroactively reward valued contributions to the ecosystem. - -## Getting Started - -1. Join the [Eliza Discord](https://discord.gg/ai16z) and make a short introduction. -2. Explore the [documentation](/docs/intro) to understand the project's architecture and capabilities. -3. Check out the [open issues](https://github.com/ai16z/eliza/issues) on GitHub to find ways to contribute. -4. Share your ideas and initiatives with the community - we're excited to see what you'll build! - -Lets push the boundaries of what's possible with autonomous AI agents. Welcome aboard! diff --git a/docs/docs/community/development-notes.md b/docs/docs/community/development-notes.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/community/project-overview.md b/docs/docs/community/project-overview.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/community/spaces-notes.md b/docs/docs/community/spaces-notes.md new file mode 100644 index 00000000000..4f05a0f1ac0 --- /dev/null +++ b/docs/docs/community/spaces-notes.md @@ -0,0 +1,155 @@ +--- +sidebar_position: 1 +title: X Space Notes +--- + +# X Space Notes + +## 10-29-24 + +Space: https://x.com/weremeow/status/1851365658916708616 + +- 00:04:03 - Keeping up with rapid AI agent growth +- 00:09:01 - Imran from Alliance DAO on consumer AI incubators +- 00:14:04 - Discussion on Goatsea and Opus AI system +- 00:14:34 - Exponential growth accelerates AI progress +- 00:17:10 - Entertainers and AI as modern "religions" +- 00:28:45 - Mathis on Opus and "Goatse Gospels" +- 00:35:11 - Base vs. instruct/chat-tuned models +- 00:59:42 - http://ai16z.vc approach to memecoins fund +- 01:17:06 - Balancing chaotic vs. orderly AI systems +- 01:25:38 - AI controlling blockchain keys/wallets +- 01:36:10 - Creation story of ai16z +- 01:40:27 - AI / Crypto tipping points +- 01:49:54 - Preserving Opus on-chain before potential takedown +- 01:58:46 - Shinkai Protocol’s decentralized AI wallet +- 02:17:02 - Fee-sharing model to sustain DAOs +- 02:21:18 - DAO token liquidity pools as passive income +- 02:27:02 - AI bots for DAO treasury oversight +- 02:31:30 - AI-facilitated financial freedom for higher pursuits +- 02:41:51 - Call to build on http://DAO.fun for team-friendly economics + +--- + +## 10-27-24 + +Space: https://x.com/shawmakesmagic/status/1850609680558805422 + +00:00:00 - Opening + +- Co-hosts: Shaw and Jin +- Purpose: Structured FAQ session about AI16Z and DegenAI +- Format: Pre-collected questions followed by audience Q&A + +00:06:40 - AI16Z vs DegenAI Relationship +Q: What's the difference between AI16Z and DegenAI? +A: + +- ai16z: DAO-based investment vehicle, more PvE focused, community driven +- DegenAI: Individual trading agent, PvP focused, more aggressive strategy +- Both use same codebase but different personalities +- DAO is a large holder of DegenAI +- Management fees (1%) used to buy more DegenAI +- Carry fees reinvested in DegenAI +- Projects intentionally interlinked but serve different purposes + +00:10:45 - Trust Engine Mechanics +Q: How does the trust engine work? +A: + +- Users share contract addresses with confidence levels +- System tracks recommendation performance +- Low conviction recommendations = low penalty if wrong +- High conviction failures severely impact trust score +- Historical performance tracked for trust calculation +- Trust scores influence agent's future decision-making + +00:21:45 - Technical Infrastructure +Q: Where do the agents live? +A: + +- Currently: Test servers and local development +- Future: Trusted Execution Environment (TEE) +- Partnership with TreasureDAO for infrastructure +- Goal: Fully autonomous agents without developer control +- Private keys generated within TEE for security + +00:34:20 - Trading Implementation +Q: When will Mark start trading? +A: + +- Three phase approach: + +1. Testing tech infrastructure +2. Virtual order book/paper trading +3. Live trading with real assets + +- Using Jupiter API for swaps +- Initial focus on basic trades before complex strategies +- Trading decisions based on community trust scores + +00:54:15 - Development Status +Q: Who's building this? +A: + +- Open source project with multiple contributors +- Key maintainers: Circuitry, Nate Martin +- Community developers incentivized through token ownership +- Focus on reusable components and documentation + +01:08:35 - AI Model Architecture +Q: What models power the agents? +A: + +- DegenAI: Llama 70B +- Using Together.xyz for model marketplace +- Continuous fine-tuning planned +- Different personalities require different model approaches +- Avoiding GPT-4 due to distinct "voice" + +01:21:35 - Ethics Framework +Q: What ethical guidelines are being followed? +A: + +- Rejecting traditional corporate AI ethics frameworks +- Focus on community-driven standards +- Emphasis on transparency and open source +- Goal: Multiple competing approaches rather than single standard +- Priority on practical utility over theoretical ethics + +01:28:30 - Wrap-up + +- Discord: AI16z.vc +- Future spaces planned with DAOs.fun team +- Focus on responsible growth +- Community engagement continuing in Discord + +The space emphasized technical implementation details while addressing community concerns about governance, ethics, and practical functionality. + +--- + +## 10-25-24 + +- https://x.com/shawmakesmagic/status/1848553697611301014 + - https://www.youtube.com/live/F3IZ3ikacWM?feature=share + +**Overview** + +- 00:00-30:00 Talks about Eliza framework. The bot is able to tweet, reply to tweets, search Twitter for topics, and generate new posts on its own every few hours. It works autonomously without human input (except to fix the occasional issues) +- 30:00-45:00 Deep dive into creating the bots personality which is defined by character files containing bios, lore, example conversations, and specific directions. Some alpha for those +- 45:00-60:00 working on adding capabilities for the bot to make crypto token swaps and trades. This requires providing the bot wallet balances, token prices, market data, and a swap action. Some live coding for showing how new features can get implemented. +- 60:00-75:00 Discussion around the symbiosis between the AI and crypto communities. AI developers are realizing they can monetize their work through tokens vs traditional VC funding route. Crypto people are learning about AI advancements. + +**Notes** + +1. A large amount of $degenai tokens were moved to the DAO, which the AI bot "Marc" will hold and eventually trade with. +2. The goal is to make the AI bot a genuinely good venture capitalist that funds cool projects and buys interesting tokens. They want it to be high fidelity and real, bringing in Marc Andreeson's real knowledge by training a model on his writings. +3. Shaw thinks the only way to make an authentic / legitimate AI version of Marc Andreessen is to also have it outperform the real Marc Andreessen financially. +4. AI Marc Andreessen (or AI Marc) will be in a Discord channel (Telegram was also mentioned). DAO token holders above a certain threshold get access to interact with him, pitch ideas, and try to influence his investing decisions. +5. AI Marc decides how much to trust people's investment advice based on a "virtual Marcetplace of trust". He tracks how much money he would have made following their recommendations. Successful tips increase trust; failed ones decrease it. +6. The amount of DAO tokens someone holds also influences their sway with AI Marc. The two balancing factors are the virtual Marcetplace of trust performance and DAO token holdings. +7. The core tech behind AI Marc AIndreessen is the same agent system that allows him to pull in relevant knowledge, interact with people, and make decisions (http://github.com/ai16z) +8. AI Marc should be able to autonomously execute on-chain activities, not just have humans execute actions on his behalf. +9. In the near future, AI Marc will be able to execute trades autonomously based on the information and recommendations gathered from the community. Human intervention will be minimized. +10. They are working on getting AI Marc on-chain as soon as possible using trusted execution environments for him to take actions like approving trades. +11. The plan is for AI Marc to eventually participate in a "futarchy" style governance market within the DAO, allowing humans to influence decisions but not fully control the AI. diff --git a/docs/docs/community/stream-notes.md b/docs/docs/community/stream-notes.md index 6fa3e795e99..e76adffbc9e 100644 --- a/docs/docs/community/stream-notes.md +++ b/docs/docs/community/stream-notes.md @@ -3,6 +3,7 @@ sidebar_position: 1 title: Stream Notes --- +<<<<<<< HEAD # Stream Notes Overview Welcome to our collection of stream notes! This section contains detailed summaries and recordings of our community streams, Twitter spaces, and development sessions. These notes capture key insights, technical discussions, and community interactions that help shape the Eliza framework and our ecosystem. @@ -87,3 +88,634 @@ Have notes from a stream that isn't documented here? We welcome community contri - Join our [Discord](https://discord.gg/ai16z) to participate in future streams - Follow us on [Twitter](https://twitter.com/ai16zdao) for stream announcements +======= +# Stream Notes + +## Memes, AI Agents, DAOs 11-8-24 + +Space: 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 +- Future vision for AI agent ecosystems + +--- + +Detailed Breakdown of Topic 1: Introductions & Community Building (00:00:00 - 00:45: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 +- Parzival: 89 project lead, working on alternate reality game integration with AI +- 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 +- Emphasis on moving beyond purely academic approach to practical applications + +Key Quotes: +"Code is cheap... there's no sense in proprietary software anymore" (00:59:10) +"We're competing against Microsoft and Facebook, we're not competing against each other" (00:44:33) + +Summary: +This segment establishes the foundational ethos of the AI agent development community, emphasizing collaboration over competition. The introductions reveal a diverse group of developers from various backgrounds (gaming, finance, law) united by a vision of open source AI development. There's a strong focus on building public infrastructure rather than competing proprietary systems, with multiple participants emphasizing the importance of community building and knowledge sharing. The segment reveals a shift from theoretical academic work to practical implementation, with a clear understanding that success requires collaborative effort rather than isolated development. + +Notable Timestamp Ranges: +00:03:37 - 00:07:15: Shaw's introduction and community vision +00:13:30 - 00:16:45: Tim's gaming background and AVB concept +00:17:30 - 00:20:15: Glue's introduction of Duck AI +00:23:00 - 00:27:45: Parzival's background and ARG connection +00:30:15 - 00:35:20: Michelle's extensive AI background and projects + +--- + +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 +- Discussion of perverse incentives in traditional DAO structures +- 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 +- Question of whether to label bots as automated vs. appearing human +- 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 +- Focus on building trust through transparent operation +- 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 +- Evolution beyond traditional KOL (Key Opinion Leader) model +- Timestamp: 01:08:45 - 01:15:00 + +Key Quotes: +"Trust like you should not trust me because I'm a good guy, you should trust me because the incentives that I am going to do this are aligned" (01:02:45) +"We need trust to be something more about giving people points in the games that they're playing" (01:04:30) + +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 +- Creation of transparent scoring mechanisms + +--- + +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" +- Exploration of how memes gain autonomous life through financial backing +- 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 +- Exploration of how AI can manifest hyperstition concepts +- 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 +- Discussion of how memes function as basic units of meaning +- 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 +- Role of AI in creating self-fulfilling prophecies +- Timestamp: 01:39:00 - 01:45:00 + +Key Quotes: +"Memes want to spread... it's a unit of information that wants to spread itself between humans" (01:17:30) +"You're never not looking at a meme, it's just that your brain has entrained itself to recognize certain memes as something stable" (01:35:15) + +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 +- AI agents as autonomous narrative creators + +--- + +Detailed Breakdown of Topic 4: Technical Implementation & Future Vision (01:45:00 - 02:10:00) + +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 +- Solutions for quadratic communication path problems +- 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 +- Discussion of lightweight, flexible architecture +- 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 +- Shared backrooms/environments for agent interaction +- 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 +- Focus on building shared infrastructure +- Timestamp: 02:04:30 - 02:10:00 + +Key Quotes: +"I'm thinking about multi-agent swarms like mycelia, where each agent is like a fungus of a global intelligence body" (01:47:30) +"We're making an open source agent where we're almost done with the first marketplace to trust mechanic element" (02:05:15) + +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 +- Cross-platform integration strategies + +This segment effectively bridges the philosophical discussions from earlier with practical implementation details, providing a roadmap for how these systems might actually be built and scaled. + +--- + +## Discord Stream 11-6-24 + +#### Part 1 + +Watch: [Youtube](https://www.youtube.com/watch?v=oqq5H0HRF_A) + +00:00:00 - Overview + +- Eliza is moving to a plugin architecture to enable developers to easily add integrations (e.g. Ethereum wallets, NFTs, Obsidian, etc.) without modifying core code +- Plugins allow devs to focus on specific areas of interest +- Core changes will focus on enabling more flexibility and features to support plugins + +00:01:27 - Core abstractions + +- Characters: Way to input information to enable multi-agent systems +- Actions, evaluators, providers +- Existing capabilities: Document reading, audio transcription, video summarization, long-form context, timed message summarization + +00:02:50 - Eliza as an agent, not just a chatbot + +- Designed to act human-like and interact with the world using human tools +- Aim is to enable natural interactions without reliance on slash commands + +00:04:44 - Advanced usage and services + +- Memory and vector search db (SQLite, Postgres with pgVector) +- Browser service to summarize website content, get through CAPTCHAs +- Services are tools leveraged by actions, attached to runtime + +00:06:06 - Character-centric configuration + +- Moving secrets, API keys, model provider to character config +- Clients will become plugins, selectable per character +- Allows closed-source custom plugins while still contributing to open-source + +00:10:13 - Providers + +- Inject dynamic, real-time context into the agent +- Examples: Time, wallet, marketplace trust score, token balances, boredom/cringe detection +- Easy to add and register with the agent + +00:15:12 - Setting up providers and default actions + +- Default providers imported in runtime.ts +- CLI loads characters and default actions (to be made more flexible) +- Character config will define custom action names to load + +00:18:13 - Actions +Q: How does each client decide which action to call? +A: Agent response can include text, action, or both. Process actions checks the action name/similes and executes the corresponding handler. Action description is injected into agent context to guide usage. + +00:22:27 - Action execution flow + +- Check if action should be taken (validation) +- Determine action outcome +- Compose context and send follow-up if continuing +- Execute desired functionality (mint token, generate image, etc.) +- Use callback to send messages back to the connector (Discord, Twitter, etc.) + +00:24:47 - Choosing actions +Q: How does it choose which action to run? +A: The "generate method response" includes the action to run. Message handler template includes action examples, facts, generated dialogue actions, and more to guide the agent. + +00:28:22 - Custom actions +Q: How to create a custom action (e.g. send USDC to a wallet)? +A: Use existing actions (like token swap) as a template. Actions don't have input fields, but use secondary prompts to gather parameters. The "generate object" converts language to API calls. + +00:32:21 - Limitations of action-only approaches + +- Shaw believes half of the PhD papers on action-only models are not reproducible +- Many public claims of superior models are exaggerated; use Eliza if it's better + +00:36:40 - Next steps + +- Shaw to make a tutorial to better communicate key concepts +- Debugging and improvements based on the discussion +- Attendee to document their experience and suggest doc enhancements + +### Part 2 + +Watch: [Youtube](https://www.youtube.com/watch?v=yE8Mzq3BnUc) + +00:00:00 - Dealing with OpenAI rate limits for new accounts + +- New accounts have very low rate limits +- Options to increase limits: + 1. Have a friend at OpenAI age your account + 2. Use an older account + 3. Consistently use the API and limits will increase quickly +- Can also email OpenAI to request limit increases + +00:00:43 - Alternatives to OpenAI to avoid rate limits + +- Amazon Bedrock or Google Vertex likely have same models without strict rate limits +- Switching to these is probably a one-line change +- Project 89 got unlimited free access to Vertex + +00:01:25 - Memory management best practices +Q: Suggestions for memory management best practices across users/rooms? +A: Most memory systems are user-agent based, with no room concept. Eliza uses a room abstraction (like a Discord channel/server or Twitter thread) to enable multi-agent simulation. Memories are stored per-agent to avoid collisions. + +00:02:57 - Using memories in Eliza + +- Memories are used in the `composeState` function +- Pulls memories from various sources (recent messages, facts, goals, etc.) into a large state object +- State object is used to hydrate templates +- Custom memory providers can be added to pull from other sources (Obsidian, databases) + +00:05:11 - Evaluators vs. Action validation + +- Actions have a `validate` function to check if the action is valid to run (e.g., check if agent has a wallet before a swap) +- Evaluators are a separate abstraction that run a "reflection" step +- Example: Fact extraction evaluator runs every N messages to store facts about the user as memories +- Allows agent to "get to know" the user without needing full conversation history + +00:07:58 - Example use case: Order book evaluator + +- Evaluator looks at chats sent to an agent and extracts information about "shields" (tokens?) +- Uses this to build an order book and "marketplace of trust" + +00:09:15 - Mapping Eliza abstractions to OODA loop + +- Providers: Observe/Orient stages (merged since agent is a data machine) +- Actions & response handling: Decide stage +- Action execution: Act stage +- Evaluators: Update state, then loop back to Decide + +00:10:03 - Wrap up + +- Shaw considers making a video to explain these concepts in depth + +### Part 3 + +Watch: [Youtube](https://www.youtube.com/watch?v=7FiKJPyaMJI) + +00:00:00 - Managing large context sizes + +- State object can get very large, especially with long user posts +- Eliza uses "trim tokens" and a maximum content length (120k tokens) to cap context size + - New models have 128k-200k context, which is a lot (equivalent to 10 YouTube videos + full conversation) +- Conversation length is typically capped at 32 messages + - Fact extraction allows recalling information beyond this window + - Per-channel conversation access +- Increasing conversation length risks more aggressive token trimming from the top of the prompt + - Keep instructions at the bottom to avoid trimming them + +00:01:53 - Billing costs for cloud/GPT models +Q: What billing costs have you experienced with cloud/GPT model integration? +A: + +- Open Router has a few always-free models limited to 8k context and rate-limited + - Plan to re-implement and use these for the tiny/check model with fallback for rate limiting +- 8k context unlikely to make a good agent; preference for smaller model over largest 8k one +- Locally-run models are free for MacBooks with 16GB RAM, but not feasible for Linux/AMD users + +00:03:35 - Cost management strategies + +- Very cost-scalable depending on model size +- Use very cheap model (1000x cheaper than GPT-4) for should_respond handler + - Runs AI on every message, so cost is a consideration +- Consider running a local Llama 3B model for should_respond to minimize costs + - Only pay for valid generations + +00:04:32 - Model provider and class configuration + +- `ModelProvider` class with `ModelClass` (small, medium, large, embedding) +- Configured in `models.ts` +- Example: OpenAI small = GPT-4-mini, medium = GPT-4 +- Approach: Check if model class can handle everything in less than 8k context + - If yes (should_respond), default to free tier + - Else, use big models + +00:06:23 - Fine-tuned model support + +- Extend `ModelProvider` to support fine-tuned instances of small Llama models for specific tasks +- In progress, to be added soon +- Model endpoint override exists; will add per-model provider override + - Allows pointing small model to fine-tuned Llama 3.1B for should_respond + +00:07:10 - Avoiding cringey model loops + +- Fine-tuning is a form of anti-slop (avoiding low-quality responses) +- For detecting cringey model responses, use the "boredom provider" + - Has a list of cringe words; if detected, agent disengages +- JSON file exists with words disproportionately high in the dataset + - To be shared for a more comprehensive solution + +### Part 4 + +Watch: [Youtube](https://www.youtube.com/watch?v=ZlzZzDU1drM) + +00:00:00 - Setting up an autonomous agent loop +Q: How to set up an agent to constantly loop and explore based on objectives/goals? +A: Create a new "autonomous" client: + +1. Initialize with just the runtime (no Express app needed) +2. Set a timer to call a `step` function every 10 seconds +3. In the `step` function: + - Compose state + - Decide on action + - Execute action + - Update state + - Run evaluators + +00:01:56 - Creating an auto template + +- Create an `autoTemplate` with agent info (bio, lore, goals, actions) +- Prompt: "What does the agent want to do? Your response should only be the name of the action to call." +- Compose state using `runtime.composeState` + +00:03:38 - Passing a message object + +- Need to pass a message object with `userId`, `agentId`, `content`, and `roomId` +- Create a unique `roomId` for the autonomous agent using `crypto.randomUUID()` +- Set `userId` and `agentId` using the runtime +- Set `content` to a default message + +00:04:33 - Composing context + +- Compose context using the runtime, state, and auto template + +00:05:02 - Type error + +- Getting a type error: "is missing the following from type state" +- (Transcript ends before resolution) + +The key steps are: + +1. Create a dedicated autonomous client +2. Set up a loop to continuously step through the runtime +3. In each step, compose state, decide & execute actions, update state, and run evaluators +4. Create a custom auto template to guide the agent's decisions +5. Pass a properly formatted message object +6. Compose context using the runtime, state, and auto template + +--- + +## X Space 10-29-24 + +Space: https://x.com/weremeow/status/1851365658916708616 + +- 00:04:03 - Keeping up with rapid AI agent growth +- 00:09:01 - Imran from Alliance DAO on consumer AI incubators +- 00:14:04 - Discussion on Goatsea and Opus AI system +- 00:14:34 - Exponential growth accelerates AI progress +- 00:17:10 - Entertainers and AI as modern "religions" +- 00:28:45 - Mathis on Opus and "Goatse Gospels" +- 00:35:11 - Base vs. instruct/chat-tuned models +- 00:59:42 - http://ai16z.vc approach to memecoins fund +- 01:17:06 - Balancing chaotic vs. orderly AI systems +- 01:25:38 - AI controlling blockchain keys/wallets +- 01:36:10 - Creation story of ai16z +- 01:40:27 - AI / Crypto tipping points +- 01:49:54 - Preserving Opus on-chain before potential takedown +- 01:58:46 - Shinkai Protocol’s decentralized AI wallet +- 02:17:02 - Fee-sharing model to sustain DAOs +- 02:21:18 - DAO token liquidity pools as passive income +- 02:27:02 - AI bots for DAO treasury oversight +- 02:31:30 - AI-facilitated financial freedom for higher pursuits +- 02:41:51 - Call to build on http://DAO.fun for team-friendly economics + +--- + +## X Space 10-27-24 + +Space: https://x.com/shawmakesmagic/status/1850609680558805422 + +00:00:00 - Opening + +- Co-hosts: Shaw and Jin +- Purpose: Structured FAQ session about AI16Z and DegenAI +- Format: Pre-collected questions followed by audience Q&A + +00:06:40 - AI16Z vs DegenAI Relationship +Q: What's the difference between AI16Z and DegenAI? +A: + +- ai16z: DAO-based investment vehicle, more PvE focused, community driven +- DegenAI: Individual trading agent, PvP focused, more aggressive strategy +- Both use same codebase but different personalities +- DAO is a large holder of DegenAI +- Management fees (1%) used to buy more DegenAI +- Carry fees reinvested in DegenAI +- Projects intentionally interlinked but serve different purposes + +00:10:45 - Trust Engine Mechanics +Q: How does the trust engine work? +A: + +- Users share contract addresses with confidence levels +- System tracks recommendation performance +- Low conviction recommendations = low penalty if wrong +- High conviction failures severely impact trust score +- Historical performance tracked for trust calculation +- Trust scores influence agent's future decision-making + +00:21:45 - Technical Infrastructure +Q: Where do the agents live? +A: + +- Currently: Test servers and local development +- Future: Trusted Execution Environment (TEE) +- Partnership with TreasureDAO for infrastructure +- Goal: Fully autonomous agents without developer control +- Private keys generated within TEE for security + +00:34:20 - Trading Implementation +Q: When will Mark start trading? +A: + +- Three phase approach: + +1. Testing tech infrastructure +2. Virtual order book/paper trading +3. Live trading with real assets + +- Using Jupiter API for swaps +- Initial focus on basic trades before complex strategies +- Trading decisions based on community trust scores + +00:54:15 - Development Status +Q: Who's building this? +A: + +- Open source project with multiple contributors +- Key maintainers: Circuitry, Nate Martin +- Community developers incentivized through token ownership +- Focus on reusable components and documentation + +01:08:35 - AI Model Architecture +Q: What models power the agents? +A: + +- DegenAI: Llama 70B +- Using Together.xyz for model marketplace +- Continuous fine-tuning planned +- Different personalities require different model approaches +- Avoiding GPT-4 due to distinct "voice" + +01:21:35 - Ethics Framework +Q: What ethical guidelines are being followed? +A: + +- Rejecting traditional corporate AI ethics frameworks +- Focus on community-driven standards +- Emphasis on transparency and open source +- Goal: Multiple competing approaches rather than single standard +- Priority on practical utility over theoretical ethics + +01:28:30 - Wrap-up + +- Discord: AI16z.vc +- Future spaces planned with DAOs.fun team +- Focus on responsible growth +- Community engagement continuing in Discord + +The space emphasized technical implementation details while addressing community concerns about governance, ethics, and practical functionality. + +--- + +## X Space 10-25-24 + +- https://x.com/shawmakesmagic/status/1848553697611301014 + - https://www.youtube.com/live/F3IZ3ikacWM?feature=share + +**Overview** + +- 00:00-30:00 Talks about Eliza framework. The bot is able to tweet, reply to tweets, search Twitter for topics, and generate new posts on its own every few hours. It works autonomously without human input (except to fix the occasional issues) +- 30:00-45:00 Deep dive into creating the bots personality which is defined by character files containing bios, lore, example conversations, and specific directions. Some alpha for those +- 45:00-60:00 working on adding capabilities for the bot to make crypto token swaps and trades. This requires providing the bot wallet balances, token prices, market data, and a swap action. Some live coding for showing how new features can get implemented. +- 60:00-75:00 Discussion around the symbiosis between the AI and crypto communities. AI developers are realizing they can monetize their work through tokens vs traditional VC funding route. Crypto people are learning about AI advancements. + +**Notes** + +1. A large amount of $degenai tokens were moved to the DAO, which the AI bot "Marc" will hold and eventually trade with. +2. The goal is to make the AI bot a genuinely good venture capitalist that funds cool projects and buys interesting tokens. They want it to be high fidelity and real, bringing in Marc Andreeson's real knowledge by training a model on his writings. +3. Shaw thinks the only way to make an authentic / legitimate AI version of Marc Andreessen is to also have it outperform the real Marc Andreessen financially. +4. AI Marc Andreessen (or AI Marc) will be in a Discord channel (Telegram was also mentioned). DAO token holders above a certain threshold get access to interact with him, pitch ideas, and try to influence his investing decisions. +5. AI Marc decides how much to trust people's investment advice based on a "virtual Marcetplace of trust". He tracks how much money he would have made following their recommendations. Successful tips increase trust; failed ones decrease it. +6. The amount of DAO tokens someone holds also influences their sway with AI Marc. The two balancing factors are the virtual Marcetplace of trust performance and DAO token holdings. +7. The core tech behind AI Marc AIndreessen is the same agent system that allows him to pull in relevant knowledge, interact with people, and make decisions (http://github.com/ai16z) +8. AI Marc should be able to autonomously execute on-chain activities, not just have humans execute actions on his behalf. +9. In the near future, AI Marc will be able to execute trades autonomously based on the information and recommendations gathered from the community. Human intervention will be minimized. +10. They are working on getting AI Marc on-chain as soon as possible using trusted execution environments for him to take actions like approving trades. +11. The plan is for AI Marc to eventually participate in a "futarchy" style governance market within the DAO, allowing humans to influence decisions but not fully control the AI. +>>>>>>> 0e7722d643664681c2403f9e6d88f7b212105505 diff --git a/docs/docs/core/actions.md b/docs/docs/core/actions.md index 3676da1cabd..559527fb924 100644 --- a/docs/docs/core/actions.md +++ b/docs/docs/core/actions.md @@ -1,126 +1,111 @@ --- -sidebar_position: 6 +sidebar_position: 4 --- -# ⚡ Actions +# Actions -Actions are core building blocks in Eliza that define how agents respond to and interact with messages. They allow agents to interact with external systems, modify their behavior, and perform tasks beyond simple message responses. +Actions are executable behaviors that agents can perform in response to messages. They allow agents to interact with external systems, modify their behavior, and perform tasks beyond simple message responses. ## Overview -Each Action consists of: +Each Action has: -- `name`: Unique identifier for the action -- `similes`: Array of alternative names/variations -- `description`: Detailed explanation of the action's purpose -- `validate`: Function that checks if action is appropriate -- `handler`: Implementation of the action's behavior -- `examples`: Array of example usage patterns +- A unique name and similar variations (similes) +- A validation function +- A handler function +- A description +- Example usage patterns -## Implementation +## Built-in Actions -```typescript -interface Action { - name: string; - similes: string[]; - description: string; - examples: ActionExample[][]; - handler: Handler; - validate: Validator; -} -``` -Source: https://github.com/ai16z/eliza/packages/core/src/types.ts +### Basic Conversation Actions ---- +#### CONTINUE -# Built-in Actions +- Continues the conversation when additional context is needed +- Used for natural conversation flow +- Prevents over-dominating conversations +- Limited to maximum of 3 continues in a row -## Conversation Flow +#### IGNORE -### CONTINUE -- Maintains conversation when more context is needed -- Manages natural dialogue progression -- Limited to 3 consecutive continues +- Disengages from conversation when appropriate +- Used for: + - Handling aggressive/inappropriate users + - After natural conversation endings + - When agent should stop responding + - Following goodbyes or closings -### IGNORE -- Gracefully disengages from conversations -- Handles: - - Inappropriate interactions - - Natural conversation endings - - Post-closing responses +#### NONE -### NONE -- Default response action -- Used for standard conversational replies +- Default action when just responding normally +- No additional behaviors needed +- Basic conversational responses -## External Integrations +### Room Management Actions -### TAKE_ORDER -- Records trading/purchase orders -- Processes user conviction levels -- Validates ticker symbols and contract addresses +#### FOLLOW_ROOM +- Actively follows a conversation/channel +- Participates without needing explicit mentions +- Used when: + - Explicitly asked to participate + - Topic is highly relevant + - Input would be valuable -```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 -}; -``` -Source: https://github.com/ai16z/eliza/packages/plugin-solana/src/actions/takeOrder.ts +#### UNFOLLOW_ROOM -## Creating Custom Actions -1. Implement the Action interface -2. Define validation logic -3. Implement handler functionality -4. Provide usage examples +- Stops following a previously followed room +- Only responds when explicitly mentioned +- Used when: + - Asked to reduce participation + - Agent is being too disruptive + - Input is no longer needed -Example: +#### MUTE_ROOM & UNMUTE_ROOM -```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: [] -}; -``` +- Completely mutes/unmutes a room +- More strict than follow/unfollow +- Used for temporary or permanent disengagement +### External Integrations -### Testing Actions +#### ASK_CLAUDE -Use the built-in testing framework: +- Forwards complex queries to Claude AI +- Handles: + - Code review/debugging + - Content creation + - Complex analysis + - Detailed explanations -```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 -}); -``` +#### IMAGE_GENERATION -## Core Concepts +- Creates images from text descriptions +- Supports multiple providers +- Includes image captioning +- Returns base64 encoded images -### Action Structure +### Trading/Financial Actions + +#### SWAP + +- Executes token swaps on Solana +- Handles slippage and validation +- Supports: + - Quote fetching + - Transaction simulation + - Error handling + +#### TAKE_ORDER + +- Records trading orders +- Processes user conviction levels +- Manages order book updates + +## Creating Custom Actions + +To create a custom action, implement the Action interface: ```typescript interface Action { @@ -128,361 +113,96 @@ 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, + options?: any, + callback?: HandlerCallback, + ) => Promise; examples: ActionExample[][]; } ``` -### Key Components - -- **name**: Unique identifier for the action -- **similes**: Alternative names/triggers for the action -- **description**: Explains when and how the action should be used -- **validate**: Determines if the action can be executed -- **handler**: Implements the action's behavior -- **examples**: Demonstrates proper usage patterns - -## 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.", - 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.)", - 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.", - handler: async (runtime, message) => { - // Room following logic - } -}; -``` - -## Creating Custom Actions +Example custom action: -### Basic Action Template ```typescript const customAction: Action = { name: "CUSTOM_ACTION", - similes: ["ALTERNATE_NAME", "OTHER_TRIGGER"], - description: "Detailed description of when and how to use this action", - validate: async (runtime: IAgentRuntime, message: Memory) => { + similes: ["ALTERNATIVE_NAME"], + description: "Describes what the action does", + validate: async (runtime, message) => { // Validation logic return true; }, - handler: async (runtime: IAgentRuntime, message: Memory) => { - // Implementation logic - return true; + handler: async (runtime, message, state, options, callback) => { + // Action implementation + return result; }, examples: [ - [ - { - user: "{{user1}}", - content: { text: "Trigger message" } - }, - { - user: "{{user2}}", - content: { text: "Response", action: "CUSTOM_ACTION" } - } - ] - ] + // Usage examples + ], }; ``` -### Advanced Action Example -```typescript -const complexAction: Action = { - name: "PROCESS_DOCUMENT", - similes: ["READ_DOCUMENT", "ANALYZE_DOCUMENT"], - description: "Process and analyze uploaded documents", - 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); - }, - handler: async (runtime, message, state) => { - const attachment = message.content.attachments[0]; - - // Process document - 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 - }); - - return true; - } -}; -``` +## Handler Callback -## 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" - }); - - await runtime.updateState(newState); - return true; - } -}; -``` +Actions can use the callback parameter to: -### Service Integration -```typescript -const serviceAction: Action = { - name: "TRANSCRIBE_AUDIO", - handler: async (runtime, message) => { - const transcriptionService = runtime.getService( - ServiceType.TRANSCRIPTION - ); - - const result = await transcriptionService.transcribe( - message.content.attachments[0] - ); - - return true; - } -}; -``` +- Send intermediate responses +- Update conversation state +- Add attachments +- Trigger other actions ## Best Practices -### Action Design -1. **Clear Purpose** - - Single responsibility principle - - Well-defined triggers - - Clear success criteria +1. **Validation** -2. **Robust Validation** - - Check prerequisites - - Validate input data + - Always validate input parameters + - Check for required permissions + - Verify preconditions - Handle edge cases -3. **Error Handling** - - Graceful failure - - Meaningful error messages - - State recovery +2. **Error Handling** -### Example Organization -1. **Comprehensive Coverage** -```typescript -examples: [ - // Happy path - [basicUsageExample], - // Edge cases - [edgeCaseExample], - // Error cases - [errorCaseExample] -] -``` + - Implement proper error catching + - Provide informative error messages + - Handle network failures gracefully + - Clean up resources on failure + +3. **Examples** + + - Provide clear usage examples + - Show expected inputs/outputs + - Demonstrate error cases + - Include edge cases + +4. **State Management** + - Keep track of action state + - Clean up after completion + - Handle interruptions + - Maintain consistency + +## Testing Actions + +Test your actions using the example format: -2. **Clear Context** ```typescript -examples: [ +const examples = [ [ { user: "{{user1}}", - content: { - text: "Context message showing why action is needed" - } + content: { text: "Input message" }, }, { user: "{{user2}}", - content: { - text: "Clear response demonstrating action usage", - action: "ACTION_NAME" - } - } - ] -] -``` - -## Troubleshooting - -### 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 - -3. **State Inconsistencies** - - Verify state updates - - Check concurrent modifications - - Review state transitions - -## 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; - } -}; -``` - -## Example: Complete Action Implementation - -```typescript -import { Action, IAgentRuntime, Memory, State } from "@ai16z/eliza"; - -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 - ); - - // Process document - const content = await docService.processDocument( - message.content.attachments[0] - ); - - // Store analysis - await runtime.documentsManager.createMemory({ - id: generateId(), - content: { - text: content, - analysis: await docService.analyze(content) - }, - userId: message.userId, - roomId: message.roomId, - createdAt: Date.now() - }); - - return true; - } catch (error) { - console.error("Document analysis failed:", error); - return false; - } - }, - - examples: [ - [ - { - user: "{{user1}}", - content: { - text: "Can you analyze this document?", - attachments: [{ type: "pdf", url: "document.pdf" }] - } + content: { + text: "Response", + action: "ACTION_NAME", }, - { - user: "{{user2}}", - content: { - text: "I'll analyze that document for you", - 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 - -3. **Documentation** - - Include clear usage examples - - Document expected inputs/outputs - - Explain error scenarios - - -## Further Reading - -- [Provider System](./providers.md) -- [Service Integration](#) -- [Memory Management](../../packages/core) +## Related diff --git a/docs/docs/core/agents.md b/docs/docs/core/agents.md index 7ccc4bc004c..888bc83841e 100644 --- a/docs/docs/core/agents.md +++ b/docs/docs/core/agents.md @@ -2,267 +2,136 @@ sidebar_position: 2 --- -# 🤖 Agents +# Agents Agents are the core components of the Eliza framework that handle autonomous interactions. Each agent runs in a runtime environment and can interact through various clients (Discord, Telegram, etc.) while maintaining consistent behavior and memory. ---- - ## Overview -The [AgentRuntime](/api/classes/AgentRuntime) class is the primary implementation of the [IAgentRuntime](/api/interfaces) interface, which manages the agent's core functions, including: - -- **Message and Memory Processing**: Storing, retrieving, and managing conversation data and contextual memory. -- **State Management**: Composing and updating the agent’s state for a coherent, ongoing interaction. -- **Action Execution**: Handling behaviors such as transcribing media, generating images, and following rooms. -- **Evaluation and Response**: Assessing responses, managing goals, and extracting relevant information. - ---- - -## Core Components - -Each agent runtime consists of key components that enable flexible and extensible functionality: - -1. **Clients**: Enable communication across platforms such as Discord, Telegram, and Direct (REST API), with features tailored for each platform. -2. **Providers**: Extend the agent’s capabilities by integrating with additional services (e.g., time, wallet, or custom data). -3. **Actions**: Define agent behaviors, such as following rooms, generating images, or processing attachments. Custom actions can be created to tailor behaviors to specific needs. -4. **Evaluators**: Manage agent responses by assessing message relevance, managing goals, extracting facts, and building long-term memory. - -### AgentRuntime Interface - -The `IAgentRuntime` interface defines the main structure of the runtime environment, specifying the configuration and essential components: - -```typescript -interface IAgentRuntime { - // Core identification - agentId: UUID; - serverUrl: string; - token: string; - - // Configuration - character: Character; - modelProvider: ModelProviderName; - - // Components - actions: Action[]; - evaluators: Evaluator[]; - providers: Provider[]; - - // Database & Memory - databaseAdapter: IDatabaseAdapter; - messageManager: IMemoryManager; - descriptionManager: IMemoryManager; - loreManager: IMemoryManager; -} -``` - -Each element in the runtime interface plays a crucial role: +- What agents are in Eliza +- How they interact with the system +- Core components and workflow -- **Identification**: Agent ID, server URL, and token for authentication and identification. -- **Configuration**: Character profile and model provider define the agent's personality and language model. -- **Components**: Actions, evaluators, and providers support extensible behaviors, response evaluation, and service integration. -- **Memory Management**: Specialized memory managers track conversations, descriptions, and static knowledge to enable contextual and adaptive responses. - ---- - -## Creating an Agent Runtime - -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'; - -// Configuration example -const runtime = new AgentRuntime({ - token: "auth-token", - modelProvider: ModelProviderName.ANTHROPIC, - character: characterConfig, - databaseAdapter: new DatabaseAdapter(), - conversationLength: 32, - serverUrl: "http://localhost:7998", - actions: customActions, - evaluators: customEvaluators, - providers: customProviders -}); -``` +## Architecture +### Agent Runtime ---- +- Base environment for the agent +- Message processing +- Action handling +- Provider integration +- Memory management -## State Management +### Key Components -This section should cover how agents manage and update state, with a focus on initial state composition and updating methods. The runtime maintains state through the [State](/api/interfaces) interface: +#### 1. Clients -```typescript -interface State { - userId?: UUID; - agentId?: UUID; - roomId: UUID; - bio: string; - lore: string; - agentName?: string; - senderName?: string; - actors: string; - actorsData?: Actor[]; - recentMessages: string; - recentMessagesData: Memory[]; - goals?: string; - goalsData?: Goal[]; - actions?: string; - actionNames?: string; - providers?: string; -} -``` +- Discord +- Telegram +- Direct (REST API) +- Available connectors +- Client-specific features (e.g., voice, attachments) -State composition and updates are handled through dedicated methods: +#### 2. Providers -```typescript -// Compose initial state -const state = await runtime.composeState(message, { - additionalContext: "custom-context" -}); +- Inject context into agent responses +- Types of providers: + - Time + - Wallet + - Custom data/state +- How to use providers for extended functionality -// Update message state -const updatedState = await runtime.updateRecentMessageState(state); -``` +#### 3. Actions -**Best practices** +- Executable behaviors +- Built-in actions: + - Follow/unfollow rooms + - Generate images + - Transcribe media + - Process attachments +- Creating custom actions -- Keep state immutable where possible -- Use `composeState` for initial state creation -- Use `updateRecentMessageState` for updates -- Cache frequently accessed state data +#### 4. Evaluators ---- +- Response assessment +- Goal tracking +- Fact extraction +- Memory building +- Long-term memory management -## Memory Systems +### Memory System -The Eliza framework uses multiple types of memory to support an agent's long-term engagement, contextual understanding, and adaptive responses. Each type of memory serves a specific purpose: +#### Types of Memory -- **Message History**: Stores recent conversations to provide continuity within a session. This helps the agent maintain conversational context and avoid repetitive responses within short-term exchanges. +- Message history +- Factual memory +- Knowledge base +- Relationship tracking -- **Factual Memory**: Holds specific, context-based facts about the user or environment, such as user preferences, recent activities, or specific details mentioned in previous interactions. This type of memory enables the agent to recall user-specific information across sessions. +#### RAG Integration -- **Knowledge Base**: Contains general knowledge the agent might need to respond to broader queries or provide informative answers. This memory is more static, helping the agent retrieve pre-defined data, common responses, or static character lore. +- Vector search for relevant information +- Knowledge embedding +- Contextual recall -- **Relationship Tracking**: Manages the agent’s understanding of its relationship with users, including details like user-agent interaction frequency, sentiment, and connection history. It is particularly useful for building rapport and providing a more personalized interaction experience over time. +## Configuration -- **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. +- Model settings +- Runtime options +- Client configuration +- Memory settings +- Provider setup +## Best Practices -The runtime uses multiple specialized [IMemoryManager](/api/interfaces) instances: +### Performance -- `messageManager` - conversation messages and responses -- `descriptionManager` - user descriptions and profiles -- `loreManager` - static character knowledge +- Model selection +- Context management +- Memory optimization +- Client-specific considerations +### Development +- Local development setup +- Testing agents +- Debugging tools +- Monitoring and logging +### Scaling +- Multiple agent management +- Resource considerations +- Infrastructure recommendations ---- +## Examples -## Message Processing - -The runtime's message processing is handled through the [processActions](/api/classes/AgentRuntime#processactions) method: +### Basic Agent Setup ```typescript -// Process message with actions -await runtime.processActions( - message, - responses, - state, - async (newMessages) => { - // Handle new messages - return [message]; - } -); +// Example code for basic agent configuration ``` - ---- - -## Services and Memory Management - -Services are managed through the [getService](/api/classes/AgentRuntime#getservice) and [registerService](/api/classes/AgentRuntime#registerservice) methods: +### Adding Custom Functionality ```typescript -// Register service -runtime.registerService(new TranscriptionService()); - -// Get service -const service = runtime.getService( - ServiceType.TRANSCRIPTION -); +// Example of extending agent capabilities ``` -### Memory Management - -Memory managers are accessed via [getMemoryManager](/api/classes/AgentRuntime#getmemorymanager): +### Client Integration ```typescript -// Get memory manager -const memoryManager = runtime.getMemoryManager("messages"); - -// Create memory -await memoryManager.createMemory({ - id: messageId, - content: { text: "Message content" }, - userId: userId, - roomId: roomId -}); +// Example of connecting to different platforms ``` -**Best practices** +## Troubleshooting -- Use appropriate memory managers for different data types -- Consider memory limits when storing data, regularly clean up memory -- Use the `unique` flag for deduplicated storage -- Clean up old memories periodically -- 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 -); -``` ---- - -## Usage Examples - -1. **Message Processing**: - -```typescript -await runtime.processActions(message, responses, state, (newMessages) => { - return [message]; -}); -``` - -2. **State Management**: - -```typescript -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 }); -``` +- Common issues +- Debug strategies +- Performance optimization +- Error handling -## Further Reading +## Related -- [Actions Documentation](./actions.md) -- [Evaluators Documentation](./evaluators.md) -- [Providers Documentation](./providers.md) -- [Full API Reference](/api) +- [Character Files](../characterfile) +- [API Reference](/api/classes/AgentRuntime) diff --git a/docs/docs/core/characterfile.md b/docs/docs/core/characterfile.md index 0cc08c9def4..d057b3d130e 100644 --- a/docs/docs/core/characterfile.md +++ b/docs/docs/core/characterfile.md @@ -2,102 +2,36 @@ sidebar_position: 4 --- -# 📝 Character Files +# Character Files -Character files are JSON-formatted configurations that define an AI character's personality, knowledge, and behavior patterns. This guide explains how to create effective character files for use with Eliza agents. +Character files are JSON-formatted configurations that define an AI character's personality, knowledge, and behavior patterns. This guide explains how to create effective character files for use with LLM agents. -## Overview +## Structure Overview -A `characterfile` implements the [Character](/api/type-aliases) type and defines the character's: - -- Core identity and behavior -- Model provider configuration -- Client settings and capabilities -- Interaction examples and style guidelines - -**Example:** +A character file contains several key sections that work together to define the character's personality and behavior: ```json { - "name": "trump", - "clients": ["DISCORD", "DIRECT"], - "settings": { - "voice": { "model": "en_US-male-medium" } - }, - "bio": [ - "Built a strong economy and reduced inflation.", - "Promises to make America the crypto capital and restore affordability." - ], - "lore": [ - "Secret Service allocations used for election interference.", - "Promotes WorldLibertyFi for crypto leadership." - ], - "knowledge": [ - "Understands border issues, Secret Service dynamics, and financial impacts on families." - ], - "messageExamples": [ - { - "user": "{{user1}}", - "content": { "text": "What about the border crisis?" }, - "response": "Current administration lets in violent criminals. I secured the border; they destroyed it." - } - ], - "postExamples": [ - "End inflation and make America affordable again.", - "America needs law and order, not crime creation." - ] -} -``` - ---- - -## Core Components - -```json -{ - "id": "unique-identifier", "name": "character_name", - "modelProvider": "ModelProviderName", - "clients": ["Client1", "Client2"], - "settings": { - "secrets": { "key": "value" }, - "voice": { "model": "VoiceModelName", "url": "VoiceModelURL" }, - "model": "CharacterModel", - "embeddingModel": "EmbeddingModelName" - }, - "bio": "Character biography or description", - "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"], - "adjectives": ["Adjective1", "Adjective2"], - "style": { - "all": ["All style guidelines"], - "chat": ["Chat-specific style guidelines"], - "post": ["Post-specific style guidelines"] - } + "bio": [], + "lore": [], + "knowledge": [], + "messageExamples": [], + "postExamples": [], + "topics": [], + "style": {}, + "adjectives": [] } ``` -### 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`. +## Core Components -#### `bio` -Character background as a string or array of statements. +### Bio Array - Contains biographical information about the character - Can be a single comprehensive biography or multiple shorter statements - Multiple statements are randomized to create variety in responses - -Example: +- Example: ```json "bio": [ @@ -107,10 +41,12 @@ Example: ] ``` -#### `lore` -Backstory elements and unique character traits. These help define personality and can be randomly sampled in conversations. +### Lore Array -Example: +- Contains interesting facts and details about the character +- Helps define personality and unique traits +- Gets randomly sampled during conversations +- Example: ```json "lore": [ @@ -120,16 +56,19 @@ Example: ] ``` -#### `knowledge` -Array used for Retrieval Augmented Generation (RAG), containing facts or references to ground the character's responses. +### Knowledge Array +- Used for RAG (Retrieval Augmented Generation) - Can contain chunks of text from articles, books, or other sources - Helps ground the character's responses in factual information -- Knowledge can be generated from PDFs or other documents using provided tools +- 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. +### Message Examples +- Sample conversations between users and the character +- Helps establish the character's conversational style +- Should cover various topics and scenarios +- Example: ```json "messageExamples": [ @@ -140,18 +79,7 @@ Sample conversations for establishing interaction patterns, helps establish the ] ``` -#### `postExamples` - -Sample social media posts to guide content style: - -```json -"postExamples": [ - "No tax on tips, overtime, or social security for seniors!", - "End inflation and make America affordable again." -] -``` - -### Style Configuration +### Style Object Contains three key sections: @@ -161,17 +89,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 -"style": { - "all": ["maintain technical accuracy", "be approachable and clear"], - "chat": ["ask clarifying questions", "provide examples when helpful"], - "post": ["share insights concisely", "focus on practical applications"] -} -``` - ### Topics Array - List of subjects the character is interested in or knowledgeable about @@ -184,121 +101,94 @@ The `style` object defines behavior patterns across contexts: - Used for generating responses with consistent tone - Can be used in "Mad Libs" style content generation +## Best Practices -### Settings Configuration - -The `settings` object defines additional configurations like secrets and voice models. +1. **Randomization for Variety** -```json -"settings": { - "secrets": { "API_KEY": "your-api-key" }, - "voice": { "model": "voice-model-id", "url": "voice-service-url" }, - "model": "specific-model-name", - "embeddingModel": "embedding-model-name" -} -``` + - Break bio and lore into smaller chunks + - This creates more natural, varied responses + - Prevents repetitive or predictable behavior -## Example: Complete Character File +2. **Knowledge Management** -```json -{ - "name": "TechAI", - "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"], - "messageExamples": [ - [ - {"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"], - "style": { - "all": ["explain complex topics simply", "be encouraging and supportive"], - "chat": ["use relevant examples", "check understanding"], - "post": ["focus on practical insights", "encourage learning"] - }, - "adjectives": ["knowledgeable", "approachable", "practical"], - "settings": { - "model": "claude-3-opus-20240229", - "voice": { "model": "en-US-neural" } - } -} -``` + - Use the provided tools to convert documents into knowledge: ---- + ```bash + npx folder2knowledge + npx knowledge2character + ``` -## Best Practices +3. **Style Instructions** -1. **Randomization for Variety** + - Be specific about communication patterns + - Include both dos and don'ts + - Consider platform-specific behavior (chat vs posts) -- Break bio and lore into smaller chunks -- This creates more natural, varied responses -- Prevents repetitive or predictable behavior +4. **Message Examples** + - Include diverse scenarios + - Show character-specific responses + - Demonstrate typical interaction patterns -2. **Knowledge Management** +## Tools and Utilities -Use the provided tools to convert documents into knowledge: +1. **Generate from Twitter** -- [folder2knowledge](https://github.com/ai16z/characterfile/blob/main/scripts/folder2knowledge.js) -- [knowledge2folder](https://github.com/ai16z/characterfile/blob/main/scripts/knowledge2character.js) -- [tweets2character](https://github.com/ai16z/characterfile/blob/main/scripts/tweets2character.js) +```bash +npx tweets2character +``` -Example: +2. **Convert Documents to Knowledge** ```bash npx folder2knowledge +``` + +3. **Add Knowledge to Character** + +```bash npx knowledge2character ``` +## Context Length Considerations -3. **Style Instructions** +- Modern LLMs support longer contexts (128k tokens) +- No strict limits on section lengths +- Focus on quality and relevance rather than size +- Consider randomization for large collections of information -- Be specific about communication patterns -- Include both dos and don'ts -- Consider platform-specific behavior (chat vs posts) +## Validation -4. **Message Examples** +You can validate your character file against the schema using provided tools: -- Include diverse scenarios -- Show character-specific responses -- Demonstrate typical interaction patterns +```bash +# Python +python examples/validate.py +# JavaScript +node examples/validate.mjs +``` ## Tips for Quality 1. **Bio and Lore** -- Mix factual and personality-defining information -- Include both historical and current details -- Break into modular, reusable pieces + - Mix factual and personality-defining information + - Include both historical and current details + - Break into modular, reusable pieces 2. **Style Instructions** -- Be specific about tone and mannerisms -- Include platform-specific guidance -- Define clear boundaries and limitations + - Be specific about tone and mannerisms + - Include platform-specific guidance + - Define clear boundaries and limitations 3. **Examples** -- Cover common scenarios -- Show character-specific reactions -- Demonstrate proper tone and style + - Cover common scenarios + - Show character-specific reactions + - Demonstrate proper tone and style 4. **Knowledge** - -- Focus on relevant information -- Organize in digestible chunks -- Update regularly to maintain relevance - - -## Further Reading - -- [Agents Documentation](./agents.md) -- [Model Providers](../../advanced/fine-tuning) -- [Client Integration](../../packages/clients) + - Focus on relevant information + - Organize in digestible chunks + - Update regularly to maintain relevance diff --git a/docs/docs/core/evaluators.md b/docs/docs/core/evaluators.md index 52058a18227..b17c049d216 100644 --- a/docs/docs/core/evaluators.md +++ b/docs/docs/core/evaluators.md @@ -2,247 +2,212 @@ sidebar_position: 5 --- -# 📊 Evaluators +# Evaluators -## Table of Contents -- [Overview](#overview) -- [Quick Start](#quick-start) -- [Best Practices](#best-practices) -- [Built-in Evaluators](#built-in-evaluators) -- [Creating Custom Evaluators](#creating-custom-evaluators) -- [Memory Integration](#memory-integration) +Evaluators are components that assess and extract information from conversations, helping agents build long-term memory and track goal progress. They analyze conversations to extract facts, update goals, and maintain agent state. ## Overview -[Evaluators](/api/interfaces) are core components that assess and extract information from conversations. They integrate with the [AgentRuntime](/api/classes/AgentRuntime)'s evaluation system, enabling agents to: +Evaluators help agents: +- Extract useful information from conversations +- Track progress toward goals - Build long-term memory -- Track goal progress -- Extract facts and insights -- Maintain contextual awareness - -## Quick Start - -1. Import the necessary evaluator types: -```typescript -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: [] -}; -``` +- Maintain context awareness ## Built-in Evaluators - ### Fact Evaluator -The fact evaluator extracts and stores factual information from conversations. - +The fact evaluator extracts factual information from conversations for long-term memory storage. ```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; } ``` -Source: https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts +#### Fact Types -**Example Facts:** +- `fact`: True statements about the world or character that don't change +- `status`: Facts that are true but may change over time +- `opinion`: Non-factual opinions, thoughts, feelings, or recommendations + +#### Example Facts: ```json -{ - "claim": "User completed marathon training", +[ + { + "claim": "User lives in Oakland", "type": "fact", "in_bio": false, "already_known": false -} + }, + { + "claim": "User completed marathon in 3 hours", + "type": "fact", + "in_bio": false, + "already_known": false + }, + { + "claim": "User is proud of their achievement", + "type": "opinion", + "in_bio": false, + "already_known": false + } +] ``` ### Goal Evaluator -From bootstrap plugin - tracks conversation goals: + +The goal evaluator tracks progress on agent goals and objectives. ```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; } ``` ---- +#### Goal Updates -## Best Practices +- Monitors conversation for goal progress +- Updates objective completion status +- Marks goals as complete when all objectives are done +- Marks goals as failed when they cannot be completed -### Fact Extraction -- Validate facts before storage -- Avoid duplicate entries -- Include relevant context -- Properly categorize information types +#### Example Goal: -### 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 -- Cover edge cases - ---- +```json +{ + "id": "goal-123", + "name": "Complete Marathon Training", + "status": "IN_PROGRESS", + "objectives": [ + { + "description": "Run 30 miles per week", + "completed": true + }, + { + "description": "Complete practice half-marathon", + "completed": false + } + ] +} +``` ## Creating Custom Evaluators -Implement the Evaluator interface: +To create a custom evaluator, 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[]; } ``` -Source: https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts - -### Memory Integration - -Example of storing evaluator results: +Example custom evaluator: ```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); -} catch (error) { - console.error("Failed to store evaluation result:", error); -} +const customEvaluator: Evaluator = { + name: "CUSTOM_EVALUATOR", + similes: ["ALTERNATE_NAME"], + description: "Evaluates something in the conversation", + validate: async (runtime, message) => { + // Determine if evaluation should run + return true; + }, + handler: async (runtime, message, state, options) => { + // Evaluation logic + return evaluationResult; + }, + examples: [ + // Example inputs and outputs + ], +}; ``` -Source: https://github.com/ai16z/eliza/blob/main/packages/core/src/tests/memory.test.ts +## Best Practices +### Fact Extraction -### Memory Usage +1. **Avoid Duplication** -Evaluators should use runtime memory managers for storage: + - Check for existing facts + - Only store new information + - Mark duplicates as already_known -```typescript -const memoryEvaluator: Evaluator = { - name: "MEMORY_EVAL", - handler: async (runtime: IAgentRuntime, message: Memory) => { - // Store in message memory - await runtime.messageManager.createMemory({ - id: message.id, - content: message.content, - roomId: message.roomId, - userId: message.userId, - 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 - }); - } -}; -``` +2. **Proper Categorization** -## Integration with Agent Runtime + - Distinguish between facts/opinions/status + - Check if fact exists in bio + - Include relevant context -The [AgentRuntime](/api/classes/AgentRuntime) processes evaluators through its [evaluate](/api/classes/AgentRuntime#evaluate) method: +3. **Quality Control** + - Remove corrupted facts + - Validate fact format + - Ensure facts are meaningful -```typescript -// Register evaluator -runtime.registerEvaluator(customEvaluator); +### Goal Tracking -// Process evaluations -const results = await runtime.evaluate(message, state); -``` +1. **Clear Objectives** + + - Break goals into measurable objectives + - Define completion criteria + - Track partial progress + +2. **Status Updates** + + - Only update changed goals + - Include complete objectives list + - Preserve unchanged data +3. **Failure Handling** + - Define failure conditions + - Record failure reasons + - Allow goal adaptation -## Error Handling +## Memory Integration + +Evaluators work with the memory system to: + +1. Store extracted facts +2. Update goal states +3. Build long-term context +4. Maintain conversation history + +Example memory integration: ```typescript -const robustEvaluator: Evaluator = { - name: "ROBUST_EVAL", - handler: async (runtime: IAgentRuntime, message: Memory) => { - try { - // Attempt evaluation - await runtime.messageManager.createMemory({ - id: message.id, - content: message.content, - roomId: message.roomId, - userId: message.userId, - 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 - }); - } - } -}; +// Store new fact +const factMemory = await runtime.factManager.addEmbeddingToMemory({ + userId: agentId, + content: { text: fact }, + roomId, + createdAt: Date.now(), +}); + +await runtime.factManager.createMemory(factMemory, true); ``` - +## Related diff --git a/docs/docs/core/providers.md b/docs/docs/core/providers.md index b3655aad410..36fd97cf90d 100644 --- a/docs/docs/core/providers.md +++ b/docs/docs/core/providers.md @@ -1,36 +1,20 @@ -# 🔌 Providers - -[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. +--- +sidebar_position: 3 +title: Providers +--- +# Providers ## Overview -A provider's primary purpose is to: -- Supply dynamic contextual information -- Integrate with the agent runtime -- Format information for conversation templates -- Maintain consistent data access +Providers 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. -### Core Structure +## Core Provider Types -```typescript -interface Provider { - get: ( - runtime: IAgentRuntime, - message: Memory, - state?: State - ) => Promise; -} -``` +### 1. Time Provider ---- - -## Built-in Providers - -### Time Provider Provides temporal context for agent interactions: - ```typescript const timeProvider: Provider = { get: async (_runtime: IAgentRuntime, _message: Memory) => { @@ -42,58 +26,60 @@ const timeProvider: Provider = { }; ``` -### Facts Provider -From bootstrap plugin - maintains conversation facts: +### 2. Token Provider -```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}`; - }, -}; +Provides comprehensive token analytics and market data: -export { factsProvider }; +```typescript +interface TokenAnalytics { + security: TokenSecurityData; + tradeData: TokenTradeData; + holderDistribution: string; + marketMetrics: { + price: number; + volume24h: number; + priceChange: number; + }; +} ``` -### 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. +Key features: +- Real-time price and volume data +- Security metrics and risk assessment +- Holder distribution analysis +- DexScreener integration +- Smart caching system -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. +### 3. Wallet Provider -2. **Boredom Calculation**: +Manages cryptocurrency wallet interactions: -- The `boredomProvider` gets recent messages from the agent’s conversation over the last 15 minutes. -- It calculates a **boredom score** by analyzing the text of these messages. The score is influenced by: - - **Interest words**: Decrease boredom (subtract 1 point). - - **Cringe words**: Increase boredom (add 1 point). - - **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 WalletPortfolio { + totalUsd: string; + totalSol?: string; + items: Array<{ + name: string; + symbol: string; + balance: string; + valueUsd: string; + valueSol?: string; + }>; +} +``` + +Capabilities: + +- Portfolio valuation +- Token balances +- Price tracking +- Performance metrics +- Multi-currency support +### 4. Boredom Provider + +Manages conversation dynamics and engagement: ```typescript interface BoredomLevel { @@ -101,24 +87,6 @@ interface BoredomLevel { statusMessages: string[]; } ``` -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 - }); - - return messages.length > 0 ? - "Actively engaged in conversation" : - "No recent interactions"; - } -}; -``` - Features: @@ -128,60 +96,90 @@ Features: - Sentiment analysis - Response adaptation ---- - ## Implementation -### Basic Provider Template +### Provider Interface + +```typescript +interface Provider { + get: ( + runtime: IAgentRuntime, + message: Memory, + state?: State, + ) => Promise; +} +``` + +### Data Caching System ```typescript -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 - }); - - // Format and return context - return formatContextString(memories); +class CacheManager { + private cache: NodeCache; + private cacheDir: string; + + constructor(ttl: number = 300) { + // 5 minutes default + this.cache = new NodeCache({ stdTTL: ttl }); + this.cacheDir = path.join(__dirname, "cache"); } -}; + + async getCachedData(key: string): Promise { + // Check memory cache + const memoryCache = this.cache.get(key); + if (memoryCache) return memoryCache; + + // Check file cache + return this.readFromFileCache(key); + } +} ``` -### Memory Integration +### Error Handling ```typescript -const memoryProvider: Provider = { - get: async (runtime: IAgentRuntime, message: Memory) => { - // Get recent messages - const messages = await runtime.messageManager.getMemories({ - roomId: message.roomId, - count: 5, - unique: true - }); - - // Get user descriptions - const descriptions = await runtime.descriptionManager.getMemories({ - roomId: message.roomId, - userId: message.userId - }); - - // Combine and format - return ` -Recent Activity: -${formatMessages(messages)} - -User Context: -${formatDescriptions(descriptions)} - `.trim(); +async function withErrorHandling( + operation: () => Promise, + fallback: T, + retries: number = 3, +): Promise { + try { + return await operation(); + } catch (error) { + console.error(`Provider error: ${error.message}`); + if (retries > 0) { + await delay(1000); + return withErrorHandling(operation, fallback, retries - 1); + } + return fallback; } +} +``` + +## Provider Configuration + +### Base Settings + +```typescript +const PROVIDER_CONFIG = { + API_ENDPOINTS: { + BIRDEYE: "https://public-api.birdeye.so", + DEXSCREENER: "https://api.dexscreener.com/latest/dex", + HELIUS: "https://mainnet.helius-rpc.com", + }, + CACHE_TTL: 300, // 5 minutes + MAX_RETRIES: 3, + RETRY_DELAY: 2000, }; ``` ---- +### Rate Limiting + +```typescript +const rateLimiter = new RateLimit({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 100, // limit each IP to 100 requests per windowMs +}); +``` ## Best Practices @@ -222,76 +220,46 @@ async function fetchDataWithCache( - Implement rate limiting - Handle sensitive data appropriately ---- +## Integration Examples -## Integration with Runtime - -Providers are registered with the [AgentRuntime](/api/classes/AgentRuntime): +### Combining Multiple Providers ```typescript -// Register provider -runtime.registerContextProvider(customProvider); - -// Providers are accessed through composeState -const state = await runtime.composeState(message); +async function getMarketContext( + runtime: IAgentRuntime, + message: Memory, +): Promise { + const [timeContext, walletInfo, tokenData] = await Promise.all([ + timeProvider.get(runtime, message), + walletProvider.get(runtime, message), + tokenProvider.get(runtime, message), + ]); + + return formatContext({ + time: timeContext, + wallet: walletInfo, + token: tokenData, + }); +} ``` -## Example: Complete Provider +### Custom Provider Implementation ```typescript -import { - Provider, - IAgentRuntime, - Memory, - State -} from '@ai16z/eliza'; - -const comprehensiveProvider: Provider = { - get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { - try { - // Get recent messages - const messages = await runtime.messageManager.getMemories({ - roomId: message.roomId, - count: 5 - }); - - // Get user context - const userContext = await runtime.descriptionManager.getMemories({ - roomId: message.roomId, - userId: message.userId - }); - - // Get relevant facts - const facts = await runtime.messageManager.getMemories({ - roomId: message.roomId, - tableName: "facts", - count: 3 - }); - - // Format comprehensive context - return ` -# Conversation Context -${messages.map(m => `- ${m.content.text}`).join('\n')} - -# User Information -${userContext.map(c => c.content.text).join('\n')} - -# Related Facts -${facts.map(f => `- ${f.content.text}`).join('\n')} - `.trim(); - - } catch (error) { - console.error("Provider error:", error); - return "Context temporarily unavailable"; - } - } +const marketSentimentProvider: Provider = { + get: async (runtime: IAgentRuntime, message: Memory) => { + const sentiment = await analyzeSentiment(message.content); + const marketMetrics = await getMarketMetrics(); + + return formatSentimentResponse(sentiment, marketMetrics); + }, }; ``` ---- - ## Troubleshooting +### Common Issues and Solutions + 1. **Stale Data** ```typescript @@ -319,10 +287,5 @@ ${facts.map(f => `- ${f.content.text}`).join('\n')} // Attempt alternative data sources }; ``` - ---- - -## Further Reading -- [Agent Runtime](./agents.md) -- [Memory System](../../packages/core) +## Additional Resources diff --git a/docs/docs/guides/advanced.md b/docs/docs/guides/advanced.md index 1c31fceb75c..234abf3b053 100644 --- a/docs/docs/guides/advanced.md +++ b/docs/docs/guides/advanced.md @@ -1,397 +1,246 @@ ---- -sidebar_position: 10 ---- +# Advanced Usage -# 🔧 Advanced Usage Guide +This guide covers advanced usage patterns and features of Eliza, including working with services, custom implementations, and advanced configuration options. -This guide covers advanced features and capabilities of Eliza, including complex integrations, custom services, and specialized plugins. +## Video and Media Processing -## Service Integration +### Video Service -### Video Processing Service +Eliza provides robust video processing capabilities through the VideoService class. Key features include: -Eliza supports advanced video processing capabilities through the `VideoService`: +- Downloading and processing videos from multiple sources (YouTube, Vimeo, direct MP4 links) +- Automatic transcription of video content +- Caching mechanisms for efficient processing +- Support for both manual and automatic captions ```typescript -import { VideoService } from '@ai16z/eliza/plugin-node'; +import { VideoService } from "./services/video"; -// Initialize service -const videoService = new VideoService(); +// Initialize the service +const videoService = VideoService.getInstance(runtime); -// Process video content -const result = await videoService.processVideo(url, runtime); +// Process a video URL +const media = await videoService.processVideo(videoUrl); ``` -Key features: -- Automatic video downloading -- Transcription support -- Subtitle extraction -- Cache management -- Queue processing - ### Image Processing -The `ImageDescriptionService` provides advanced image analysis: - -```typescript -import { ImageDescriptionService } from '@ai16z/eliza/plugin-node'; - -const imageService = new ImageDescriptionService(); -const description = await imageService.describeImage(imageUrl, 'gpu', runtime); -``` +The ImageService provides advanced image analysis capabilities: -Features: -- Local and cloud processing options -- CUDA acceleration support -- Automatic format handling -- GIF frame extraction +- Local and cloud-based image recognition +- Support for GIF processing (first frame extraction) +- Integration with multiple AI models for image analysis +- Caching and batch processing capabilities -## Blockchain Integration +## Memory Management and Embeddings -### Solana Integration +### Advanced Memory Operations -The Solana plugin provides comprehensive blockchain functionality: +The system supports sophisticated memory operations through various database adapters: ```typescript -import { solanaPlugin } from '@ai16z/eliza/plugin-solana'; - -// Initialize plugin -runtime.registerPlugin(solanaPlugin); -``` - -#### Token Operations - -```typescript -// Buy tokens -const swapResult = await swapToken( - connection, - walletPublicKey, - inputTokenCA, - outputTokenCA, - amount -); - -// Sell tokens -const sellResult = await sellToken({ - sdk, - seller: walletKeypair, - mint: tokenMint, - amount: sellAmount, - priorityFee, - allowOffCurve: false, - slippage: "1", - connection +// Search memories with embedding similarity +const similarMemories = await db.searchMemoriesByEmbedding(embedding, { + match_threshold: 0.95, + count: 5, + roomId: currentRoom, + tableName: "long_term_memory", }); -``` -#### Trust Score System - -```typescript -const trustScoreManager = new TrustScoreManager(tokenProvider, trustScoreDb); - -// Generate trust scores -const score = await trustScoreManager.generateTrustScore( - tokenAddress, - recommenderId, - recommenderWallet -); - -// Monitor trade performance -await trustScoreManager.createTradePerformance(runtime, tokenAddress, userId, { - buy_amount: amount, - is_simulation: false -}); +// Create unique memories with deduplication +await db.createMemory(memory, "episodic_memory", true); ``` -## Custom Services - -### Speech Generation +### Custom Database Adapters -Implement text-to-speech capabilities: +You can implement custom database adapters by extending the DatabaseAdapter class: ```typescript -class SpeechService extends Service implements ISpeechService { - async generate(runtime: IAgentRuntime, text: string): Promise { - if (runtime.getSetting("ELEVENLABS_XI_API_KEY")) { - return textToSpeech(runtime, text); - } - - const { audio } = await synthesize(text, { - engine: "vits", - voice: "en_US-hfc_female-medium" - }); - - return Readable.from(audio); +class CustomDatabaseAdapter extends DatabaseAdapter { + async searchMemories(params: { + tableName: string; + roomId: UUID; + embedding: number[]; + match_threshold: number; + match_count: number; + unique: boolean; + }): Promise { + // Custom implementation } } ``` -### PDF Processing +## Speech and Transcription + +### Speech Service -Handle PDF document analysis: +The system includes a comprehensive speech service with support for: + +- Text-to-speech conversion with multiple providers +- Voice customization options +- Streaming audio support +- PCM and WAV format handling ```typescript -class PdfService extends Service { - async convertPdfToText(pdfBuffer: Buffer): Promise { - const pdf = await getDocument({ data: pdfBuffer }).promise; - const numPages = pdf.numPages; - const textPages = []; - - for (let pageNum = 1; pageNum <= numPages; pageNum++) { - const page = await pdf.getPage(pageNum); - const textContent = await page.getTextContent(); - const pageText = textContent.items - .filter(isTextItem) - .map(item => item.str) - .join(" "); - textPages.push(pageText); - } - - return textPages.join("\n"); - } -} +const speechService = new SpeechService(); +const audioStream = await speechService.generate(runtime, text); ``` -## Advanced Memory Management +### Advanced Transcription -### Retrievable Memory System +The TranscriptionService provides: -```typescript -class MemoryManager { - async getMemories({ - agentId, - roomId, - count - }: { - agentId: string; - roomId: string; - count: number; - }): Promise { - // Implement memory retrieval logic - } - - async createMemory(memory: Memory, allowDuplicates: boolean = false): Promise { - // Implement memory storage logic - } -} -``` +- Local and cloud-based transcription options +- CUDA acceleration support +- Audio format conversion and normalization +- Debug logging and error handling -### Trust Score Database +## Trust Score System -Implement advanced scoring systems: +The system includes a sophisticated trust score management system: ```typescript -class TrustScoreDatabase { - async calculateValidationTrust(tokenAddress: string): number { - const sql = ` - SELECT rm.trust_score - FROM token_recommendations tr - 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; - } +interface RecommenderMetrics { + trustScore: number; + totalRecommendations: number; + successfulRecs: number; + avgTokenPerformance: number; + riskScore: number; + consistencyScore: number; + virtualConfidence: number; } ``` -## Plugin Development +Key features include: -### Creating Custom Plugins +- Historical metrics tracking +- Performance analysis +- Risk assessment +- Consistency evaluation -```typescript -const customPlugin: Plugin = { - name: "custom-plugin", - description: "Custom Plugin for Eliza", - actions: [ - // Custom actions - ], - evaluators: [ - // Custom evaluators - ], - providers: [ - // Custom providers - ] -}; -``` +## Browser Automation + +The BrowserService provides advanced web interaction capabilities: -### Advanced Action Development +- CAPTCHA handling +- Ad blocking +- Content extraction +- Proxy support +- Cache management ```typescript -export const complexAction: Action = { - name: "COMPLEX_ACTION", - similes: ["ALTERNATIVE_NAME", "OTHER_NAME"], - validate: async (runtime: IAgentRuntime, message: Memory) => { - // Implement validation logic - return true; - }, - handler: async ( - runtime: IAgentRuntime, - message: Memory, - state: State, - options: { [key: string]: unknown }, - callback?: HandlerCallback - ): Promise => { - // Implement complex handling logic - return true; - } -}; +const browserService = BrowserService.getInstance(runtime); +const content = await browserService.getPageContent(url); ``` -## Advanced Configuration +## Best Practices -### Custom Runtime Configuration +### Memory Management -```typescript -const customRuntime = new AgentRuntime({ - databaseAdapter: new PostgresDatabaseAdapter(config), - modelProvider: new OpenAIProvider(apiKey), - plugins: [ - solanaPlugin, - customPlugin - ], - services: [ - new VideoService(), - new ImageDescriptionService(), - new SpeechService() - ] -}); -``` +- Implement proper memory cleanup and garbage collection +- Use the caching system effectively +- Monitor memory usage in long-running processes -### Advanced Model Configuration +### Error Handling -```typescript -const modelConfig = { - modelClass: ModelClass.LARGE, - temperature: 0.7, - maxTokens: 2000, - topP: 0.9, - frequencyPenalty: 0.5, - presencePenalty: 0.5 -}; +- Implement comprehensive error handling +- Use the logging system effectively +- Monitor system performance -const response = await generateText({ - runtime, - context: prompt, - ...modelConfig -}); -``` +### Performance Optimization -## Performance Optimization +- Use batch processing when possible +- Implement proper caching strategies +- Monitor and optimize database queries -### Caching Strategy +## Configuration Options -```typescript -class CacheManager { - private cache: NodeCache; - private cacheDir: string; - - constructor() { - this.cache = new NodeCache({ stdTTL: 300 }); - this.cacheDir = path.join(__dirname, "cache"); - this.ensureCacheDirectoryExists(); - } +### Environment Variables - private async getCachedData(key: string): Promise { - // Implement tiered caching strategy - } -} +Key configuration options include: + +```bash +CUDA_PATH=/usr/local/cuda # For GPU acceleration +OPENAI_API_KEY=sk-... # For OpenAI integration +ELEVENLABS_API_KEY=... # For voice synthesis ``` -### Queue Management +### Runtime Configuration + +The runtime can be configured with various options: ```typescript -class QueueManager { - private queue: string[] = []; - private processing: boolean = false; - - async processQueue(): Promise { - if (this.processing || this.queue.length === 0) { - return; - } - - this.processing = true; - while (this.queue.length > 0) { - const item = this.queue.shift(); - await this.processItem(item); - } - this.processing = false; - } -} +const runtime = { + character: { + settings: { + model: "gpt-4", + temperature: 0.7, + maxTokens: 2048, + }, + }, + // Additional configuration options +}; ``` -## Best Practices +## Advanced Features -### Error Handling +### Custom Actions + +Implement custom actions for specialized behavior: ```typescript -try { - const result = await complexOperation(); - if (!result) { - throw new Error("Operation failed"); +class CustomAction extends BaseAction { + async execute(context: ActionContext): Promise { + // Custom implementation + return { + success: true, + data: {}, + }; } - return result; -} catch (error) { - console.error("Error in operation:", error); - await errorReporting.log(error); - throw new OperationalError("Failed to complete operation", { cause: error }); } ``` -### Resource Management +### Custom Evaluators + +Create specialized evaluators for specific use cases: ```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 +class CustomEvaluator extends BaseEvaluator { + async evaluate(context: EvaluatorContext): Promise { + // Custom evaluation logic + return { + score: 0.95, + confidence: 0.8, + }; } } ``` -## Troubleshooting - -### Common Issues +## Security Considerations -1. Memory Leaks - - Monitor memory usage - - Implement proper cleanup - - Use WeakMap for caching +- Implement proper input validation +- Use secure token management +- Monitor system access +- Implement rate limiting +- Use proper encryption for sensitive data -2. Performance Bottlenecks - - Profile slow operations - - Implement batching - - Use connection pooling +## Troubleshooting -3. Integration Issues - - Verify API credentials - - Check network connectivity - - Validate request formatting +Common issues and solutions: -### Debugging +1. Memory leaks -```typescript -const debug = require('debug')('eliza:advanced'); + - Monitor memory usage + - Implement proper cleanup + - Use garbage collection -debug('Detailed operation info: %O', { - operation: 'complexOperation', - parameters: params, - result: result -}); -``` +2. Performance issues -## Further Resources + - Optimize database queries + - Implement proper caching + - Use batch processing -- [Infrastructure Guide](../advanced/infrastructure.md) for deployment -- [Trust Engine Documentation](../advanced/trust-engine.md) for scoring system -- [Autonomous Trading Guide](../advanced/autonomous-trading.md) for trading features -- [Fine-tuning Guide](../advanced/fine-tuning.md) for model optimization +3. Integration issues + - Check API keys and permissions + - Verify network connectivity + - Monitor API rate limits diff --git a/docs/docs/guides/basic-usage.md b/docs/docs/guides/basic-usage.md new file mode 100644 index 00000000000..f00b7143bf1 --- /dev/null +++ b/docs/docs/guides/basic-usage.md @@ -0,0 +1,269 @@ +# Basic Usage + +## Overview + +This guide covers the fundamental concepts and basic usage of the agent framework. We'll explore how to initialize and configure agents, handle different types of interactions, and leverage core capabilities. + +## Getting Started + +### Installation + +First, install the package using npm or pnpm: + +```bash +npm install @your-org/agent-framework +# or +pnpm install @your-org/agent-framework +``` + +### Basic Setup + +Here's a minimal example to create and start an agent: + +```typescript +import { AgentRuntime, createAgentRuntime } from "@your-org/agent-framework"; +import { SqliteDatabaseAdapter } from "@your-org/agent-framework/adapters"; + +// Initialize database +const db = new SqliteDatabaseAdapter(new Database("./db.sqlite")); + +// Create runtime with basic configuration +const runtime = await createAgentRuntime({ + character: { + name: "Assistant", + modelProvider: "anthropic", + // Add character details + }, + db, + token: process.env.API_TOKEN, +}); +``` + +## Core Concepts + +### Agents + +Agents are autonomous entities that can: + +- Process incoming messages +- Generate contextual responses +- Take actions based on input +- Maintain conversation state +- Handle multiple communication channels + +### Clients + +The framework supports multiple client types: + +- Discord +- Telegram +- Twitter +- Direct API + +Each client handles platform-specific message formatting and interaction patterns. + +### Actions + +Actions are discrete tasks that agents can perform: + +```typescript +const action = { + name: "SUMMARIZE", + description: "Summarize content or conversations", + handler: async (runtime, message, state) => { + // Action implementation + }, +}; + +runtime.registerAction(action); +``` + +### Providers + +Providers supply contextual information to agents: + +- Time awareness +- User relationships +- System state +- External data sources + +## Common Use Cases + +### Chat Interactions + +```typescript +// Handle incoming chat message +runtime.on("message", async (message) => { + const response = await runtime.handleMessage(message); + // Process response +}); +``` + +### Voice Integration + +For platforms supporting voice (e.g., Discord): + +```typescript +// Handle voice channel join +runtime.on("voiceStateUpdate", async (oldState, newState) => { + if (newState.channelId) { + await runtime.joinVoiceChannel(newState.channelId); + } +}); +``` + +### Media Processing + +The framework can handle various media types: + +- Images (with description generation) +- Audio (with transcription) +- Documents (with text extraction) +- Videos (with summarization) + +```typescript +// Process attachment +const media = await runtime.processAttachment({ + type: "image", + url: "https://example.com/image.jpg", +}); +``` + +## Configuration Options + +### Character Configuration + +Define agent personality and behavior: + +```typescript +const character = { + name: "Assistant", + bio: "A helpful AI assistant", + style: { + tone: "professional", + personality: "friendly", + language: "en", + }, + topics: ["technology", "science", "general"], + // Additional character settings +}; +``` + +### Runtime Settings + +Configure runtime behavior: + +```typescript +const settings = { + maxContextLength: 2000, + responseTimeout: 30000, + modelProvider: "anthropic", + temperature: 0.7, + // Additional runtime settings +}; +``` + +## Best Practices + +1. **Error Handling** + + - Implement proper error catching + - Provide graceful fallbacks + - Log errors for debugging + +2. **Resource Management** + + - Monitor memory usage + - Implement rate limiting + - Cache frequently accessed data + +3. **Security** + + - Validate input + - Sanitize output + - Implement proper authentication + +4. **Performance** + - Use appropriate model sizes + - Implement caching strategies + - Optimize database queries + +## Example Implementation + +Here's a complete example bringing together the core concepts: + +```typescript +import { AgentRuntime, createAgentRuntime } from "@your-org/agent-framework"; +import { DiscordClient } from "@your-org/agent-framework/clients/discord"; + +async function main() { + // Initialize runtime + const runtime = await createAgentRuntime({ + character: { + name: "Helper", + bio: "A helpful assistant", + modelProvider: "anthropic", + style: { + tone: "friendly", + personality: "helpful", + }, + }, + settings: { + maxContextLength: 2000, + temperature: 0.7, + }, + }); + + // Add custom action + runtime.registerAction({ + name: "HELP", + description: "Provide help information", + handler: async (runtime, message, state) => { + return { + text: "Here's how I can help...", + action: "HELP_RESPONSE", + }; + }, + }); + + // Initialize Discord client + const discord = new DiscordClient(runtime); + + // Start listening + discord.start(); +} + +main().catch(console.error); +``` + +## Troubleshooting + +Common issues and solutions: + +1. **Connection Issues** + + - Verify API tokens + - Check network connectivity + - Confirm service status + +2. **Response Timeouts** + + - Adjust timeout settings + - Check rate limits + - Verify model availability + +3. **Memory Issues** + - Monitor heap usage + - Implement garbage collection + - Optimize data structures + +## Next Steps + +After mastering basic usage, explore: + +- Advanced configuration options +- Custom action development +- Integration with external services +- Performance optimization techniques + +For more detailed information, refer to the specific component documentation and API reference. diff --git a/docs/docs/guides/configuration.md b/docs/docs/guides/configuration.md index 3de1504fbf4..850a6e73deb 100644 --- a/docs/docs/guides/configuration.md +++ b/docs/docs/guides/configuration.md @@ -1,289 +1,233 @@ ---- -sidebar_position: 9 ---- +# Configuration -# ⚙️ Configuration Guide +## Overview -This guide covers how to configure Eliza for different use cases and environments. We'll walk through all available configuration options and best practices. +The framework provides multiple layers of configuration to customize agent behavior, system settings, and runtime environments. This guide covers all configuration aspects: character files, environment variables, action configuration, and runtime settings. -## Environment Configuration +## Key Components -### Basic Setup +### 1. Environment Setup -The first step is creating your environment configuration file: +Create a `.env` file in your project root: ```bash -cp .env.example .env +# Model API Keys +OPENAI_API_KEY=your-key +CLAUDE_API_KEY=your-key + +# Database Configuration +DATABASE_URL=your-db-url +POSTGRES_URL=your-postgres-url # Optional, defaults to SQLite + +# Client-Specific Tokens +DISCORD_API_TOKEN=your-token +DISCORD_APPLICATION_ID=your-id +TELEGRAM_BOT_TOKEN=your-token +TWITTER_USERNAME=your-username ``` -### Core Environment Variables +### 2. Character Configuration -Here are the essential environment variables you need to configure: - -```bash -# Core API Keys -OPENAI_API_KEY=sk-your-key # Required for OpenAI features -ANTHROPIC_API_KEY=your-key # Required for Claude models -TOGETHER_API_KEY=your-key # Required for Together.ai models - -# Default Settings -XAI_MODEL=gpt-4o-mini # Default model to use -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_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 -``` - -### Model Provider Settings - -You can configure different AI model providers: - -```bash -# OpenAI Settings -OPENAI_API_KEY=sk-* - -# Anthropic Settings -ANTHROPIC_API_KEY= - -# Together.ai Settings -TOGETHER_API_KEY= - -# Local Model Settings -XAI_MODEL=meta-llama/Llama-3.1-7b-instruct -``` - -## Character Configuration - -### Character File Structure - -Character files define your agent's personality and behavior. Create them in the `characters/` directory: +Create character files in the `characters` directory: ```json { "name": "AgentName", - "clients": ["discord", "twitter"], + "clients": ["discord", "twitter", "telegram"], "modelProvider": "openai", "settings": { "secrets": { - "OPENAI_API_KEY": "character-specific-key", - "DISCORD_TOKEN": "bot-specific-token" + "OPENAI_API_KEY": "your-key" + }, + "voice": { + "model": "en_US-male-medium" } + }, + "bio": ["Biography elements..."], + "lore": ["Character background..."], + "knowledge": ["Factual information..."], + "topics": ["Relevant topics..."], + "style": { + "all": ["Style guidelines..."], + "chat": ["Chat-specific style..."], + "post": ["Post-specific style..."] } } ``` -### Loading Characters +### 3. Custom Actions -You can load characters in several ways: +Define custom actions in `elizaConfig.yaml`: -```bash -# Load default character -pnpm start +```yaml +actions: + - name: customAction + path: ./actions/customAction.ts + - name: anotherAction + path: ./custom_actions/anotherAction.ts +``` + +## Usage Guide -# Load specific character -pnpm start --characters="characters/your-character.json" +### 1. Basic Setup -# Load multiple characters -pnpm start --characters="characters/char1.json,characters/char2.json" +```typescript +import { createAgentRuntime } from "@your-org/agent-framework"; +import { SqliteDatabaseAdapter } from "@your-org/agent-framework/adapters"; + +// Initialize runtime +const runtime = await createAgentRuntime({ + character: characterConfig, + configPath: "./elizaConfig.yaml", + databaseAdapter: new SqliteDatabaseAdapter("./db.sqlite"), +}); ``` -## Custom Actions +### 2. Running Multiple Characters -### Adding Custom Actions +```bash +# Start with specific character file +pnpm run dev --characters=./characters/agent1.json,./characters/agent2.json +``` -1. Create a `custom_actions` directory -2. Add your action files there -3. Configure in `elizaConfig.yaml`: +### 3. Client Configuration -```yaml -actions: - - name: myCustomAction - path: ./custom_actions/myAction.ts +```typescript +// Discord client example +const discordClient = new DiscordClient(runtime); +await discordClient.start(); + +// Telegram client example +const telegramClient = new TelegramClient(runtime, botToken); +await telegramClient.start(); ``` -### Action Configuration Structure +## Configuration Options + +### 1. Model Providers ```typescript -export const myAction: Action = { - name: "MY_ACTION", - similes: ["SIMILAR_ACTION", "ALTERNATE_NAME"], - validate: async (runtime: IAgentRuntime, message: Memory) => { - // Validation logic - return true; +const modelProviders = { + openai: { + small: "gpt-3.5-turbo", + large: "gpt-4", + }, + anthropic: { + small: "claude-3-haiku", + large: "claude-3-opus", + }, + "llama-cloud": { + small: "llama-7b", + large: "llama-70b", }, - description: "Action description", - handler: async (runtime: IAgentRuntime, message: Memory) => { - // Action logic - return true; - } }; ``` -## Provider Configuration +### 2. Database Options -### Database Providers +```typescript +// SQLite (default) +const dbAdapter = new SqliteDatabaseAdapter("./db.sqlite"); -Configure different database backends: +// PostgreSQL +const dbAdapter = new PostgresDatabaseAdapter({ + connectionString: process.env.POSTGRES_URL, +}); +``` + +### 3. Custom Provider Configuration ```typescript -// SQLite (Recommended for development) -import { SqliteDatabaseAdapter } from "@your-org/agent-framework/adapters"; -const db = new SqliteDatabaseAdapter("./dev.db"); - -// PostgreSQL (Production) -import { PostgresDatabaseAdapter } from "@your-org/agent-framework/adapters"; -const db = new PostgresDatabaseAdapter({ - host: process.env.DB_HOST, - port: parseInt(process.env.DB_PORT), - database: process.env.DB_NAME, - user: process.env.DB_USER, - password: process.env.DB_PASSWORD +// Add custom provider +runtime.providers.push({ + name: "customProvider", + get: async (runtime, message, state) => { + // Provider implementation + return data; + }, }); ``` -### Model Providers +## Best Practices -Configure model providers in your character file: +### 1. Security -```json -{ - "modelProvider": "openai", - "settings": { - "model": "gpt-4o-mini", - "temperature": 0.7, - "maxTokens": 2000 - } -} -``` +- Store sensitive credentials in `.env` file +- Use character-specific secrets for per-agent credentials +- Never commit secrets to version control +- Rotate API keys regularly -## Advanced Configuration +### 2. Character Configuration -### Runtime Settings +- Break bio and lore into smaller chunks for variety +- Use RAG (knowledge array) for factual information +- Keep message examples diverse and representative +- Update knowledge regularly -Fine-tune runtime behavior: +### 3. Performance ```typescript +// Optimize context length const settings = { - // Logging - DEBUG: "eliza:*", - LOG_LEVEL: "info", - - // Performance - MAX_CONCURRENT_REQUESTS: 5, - REQUEST_TIMEOUT: 30000, - - // Memory - MEMORY_TTL: 3600, - MAX_MEMORY_ITEMS: 1000 + maxContextLength: 4000, // Adjust based on model + maxTokens: 1000, // Limit response length + temperature: 0.7, // Adjust response randomness }; ``` -### Plugin Configuration +### 4. Error Handling -Enable and configure plugins in `elizaConfig.yaml`: - -```yaml -plugins: - - name: solana - enabled: true - settings: - network: mainnet-beta - endpoint: https://api.mainnet-beta.solana.com - - - name: image-generation - enabled: true - settings: - provider: dalle - size: 1024x1024 +```typescript +try { + const runtime = await createAgentRuntime(config); +} catch (error) { + if (error.code === "CONFIG_NOT_FOUND") { + console.error("Configuration file missing"); + } else if (error.code === "INVALID_CHARACTER") { + console.error("Character file validation failed"); + } +} ``` -## 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 - -5. **Database Configuration** - - Use SQLite for development - - Configure connection pooling for production - - Set up proper indexes - ## Troubleshooting ### 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)" - ``` +1. **Missing Configuration** -2. **Character Loading Failures** - ```bash - # Validate character file - npx ajv validate -s character-schema.json -d your-character.json - ``` +```typescript +if (!fs.existsSync("./elizaConfig.yaml")) { + console.error("Missing elizaConfig.yaml - copy from example"); +} +``` -3. **Database Connection Issues** - ```bash - # Test database connection - npx ts-node scripts/test-db-connection.ts - ``` +2. **Invalid Character File** -### Configuration Validation +```typescript +// Validate character file +if (!character.name || !character.bio || !character.style) { + throw new Error("Invalid character configuration"); +} +``` -Use the built-in config validator: +3. **Model Provider Issues** -```bash -pnpm run validate-config +```typescript +// Fallback to local model +if (!process.env.OPENAI_API_KEY) { + console.log("Using local model fallback"); + runtime.modelProvider = "llama-local"; +} ``` -This will check: -- Environment variables -- Character files -- Database configuration -- Plugin settings +## Next Steps + +After basic configuration: -## Further Resources +1. Configure custom actions +2. Set up client integrations +3. Customize character behavior +4. Optimize model settings +5. Implement error handling -- [Quickstart Guide](../quickstart.md) for initial setup -- [Secrets Management](./secrets-management.md) for secure configuration -- [Local Development](./local-development.md) for development setup -- [Advanced Usage](./advanced.md) for complex configurations +For more detailed information on specific components, refer to their respective documentation sections. diff --git a/docs/docs/guides/local-development.md b/docs/docs/guides/local-development.md index ac800be7eb4..6f48de06726 100644 --- a/docs/docs/guides/local-development.md +++ b/docs/docs/guides/local-development.md @@ -1,30 +1,18 @@ ---- -sidebar_position: 12 ---- - -# 💻 Local Development Guide - -This guide covers setting up and working with Eliza in a development environment. +# Local Development ## Prerequisites -Before you begin, ensure you have: +Before starting local development, ensure you have: -```bash -# Required -Node.js 22+ -pnpm -Git - -# Optional but recommended -VS Code -Docker (for database development) -CUDA Toolkit (for GPU acceleration) -``` +- Node.js 22 or higher installed +- pnpm package manager installed +- Git for version control +- Code editor (VS Code recommended) +- CUDA Toolkit (optional, for GPU acceleration) ## Initial Setup -### 1. Repository Setup +### 1. Clone and Install ```bash # Clone the repository @@ -34,26 +22,26 @@ cd eliza # Install dependencies pnpm install -# Install optional dependencies +# Install optional Sharp package if needed pnpm install --include=optional sharp ``` ### 2. Environment Configuration -Create your development environment file: +Copy the example environment file: ```bash cp .env.example .env ``` -Configure essential development variables: +Configure essential variables for local development: ```bash -# Minimum required for local development +# Minimum required for local testing OPENAI_API_KEY=sk-* # Optional, for OpenAI features X_SERVER_URL= # Leave blank for local inference -XAI_API_KEY= # Leave blank for local inference -XAI_MODEL=meta-llama/Llama-3.1-7b-instruct # Local model +XAI_API_KEY= # Leave blank for local inference +XAI_MODEL=meta-llama/Llama-3.1-7b-instruct # Choose your model ``` ### 3. Local Model Setup @@ -61,45 +49,62 @@ XAI_MODEL=meta-llama/Llama-3.1-7b-instruct # Local model For local inference without API dependencies: ```bash -# Install CUDA support for NVIDIA GPUs +# Install CUDA support if you have an NVIDIA GPU npx --no node-llama-cpp source download --gpu cuda -# The system will automatically download models from -# Hugging Face on first run +# The system will automatically download the selected model +# from Hugging Face on first run ``` ## Development Workflow -### Running the Development Server +### 1. Running the Development Server ```bash # Start with default character pnpm run dev -# Start with specific character -pnpm run dev --characters="characters/my-character.json" +# Start with specific character(s) +pnpm run dev --characters="characters/your-character.json" # Start with multiple characters pnpm run dev --characters="characters/char1.json,characters/char2.json" ``` -### Development Commands +### 2. Testing in Shell Mode + +Open a new terminal to interact with your agent: + +```bash +pnpm run shell +``` + +### 3. Custom Actions Development + +Create custom actions without modifying core files: ```bash -pnpm run build # Build the project -pnpm run clean # Clean build artifacts -pnpm run dev # Start development server -pnpm run test # Run tests -pnpm run test:watch # Run tests in watch mode -pnpm run lint # Lint code +# Create custom actions directory +mkdir custom_actions + +# Create your action file +touch custom_actions/myAction.ts +``` + +Register your action in `elizaConfig.yaml`: + +```yaml +actions: + - name: myAction + path: ./custom_actions/myAction.ts ``` -## Database Development +## Database Options ### SQLite (Recommended for Development) ```typescript -import { SqliteDatabaseAdapter } from "@ai16z/eliza/adapters"; +import { SqliteDatabaseAdapter } from "@your-org/agent-framework/adapters"; import Database from "better-sqlite3"; const db = new SqliteDatabaseAdapter(new Database("./dev.db")); @@ -108,106 +113,32 @@ const db = new SqliteDatabaseAdapter(new Database("./dev.db")); ### In-Memory Database (for Testing) ```typescript -import { SqlJsDatabaseAdapter } from "@ai16z/eliza/adapters"; +import { SqlJsDatabaseAdapter } from "@your-org/agent-framework/adapters"; const db = new SqlJsDatabaseAdapter(new Database(":memory:")); ``` -### Schema Management +## GPU Acceleration -```bash -# Create new migration -pnpm run migration:create - -# Run migrations -pnpm run migration:up - -# Rollback migrations -pnpm run migration:down -``` - -## Testing +For NVIDIA GPU users: -### Running Tests +1. Install CUDA Toolkit with cuDNN and cuBLAS +2. Set environment variables: ```bash -# Run all tests -pnpm test - -# Run specific test file -pnpm test tests/specific.test.ts - -# Run tests with coverage -pnpm test:coverage - -# Run database-specific tests -pnpm test:sqlite -pnpm test:sqljs +CUDA_PATH=/usr/local/cuda # Windows: typically C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0 ``` -### Writing Tests - -```typescript -import { runAiTest } from "@ai16z/eliza/test_resources"; - -describe("Feature Test", () => { - beforeEach(async () => { - // Setup test environment - }); - - it("should perform expected behavior", async () => { - const result = await runAiTest({ - messages: [ - { - user: "user1", - content: { text: "test message" } - } - ], - expected: "expected response" - }); - expect(result.success).toBe(true); - }); -}); -``` - -## Plugin Development - -### Creating a New Plugin +## Debugging Tips -```typescript -// plugins/my-plugin/src/index.ts -import { Plugin } from "@ai16z/eliza/types"; - -export const myPlugin: Plugin = { - name: "my-plugin", - description: "My custom plugin", - actions: [], - evaluators: [], - providers: [] -}; -``` +### 1. Enable Debug Logging -### Custom Action Development - -```typescript -// plugins/my-plugin/src/actions/myAction.ts -export const myAction: Action = { - name: "MY_ACTION", - similes: ["SIMILAR_ACTION"], - validate: async (runtime: IAgentRuntime, message: Memory) => { - return true; - }, - handler: async (runtime: IAgentRuntime, message: Memory) => { - // Implementation - return true; - }, - examples: [] -}; +```bash +# Add to your .env file +DEBUG=eliza:* ``` -## Debugging - -### VS Code Configuration +### 2. VS Code Launch Configuration Create `.vscode/launch.json`: @@ -230,165 +161,72 @@ 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'); +### 3. Common Issues -debug('Operation details: %O', { - operation: 'functionName', - params: parameters, - result: result -}); -``` +**Memory Issues:** -3. Memory Debugging ```bash -# Increase Node.js memory for development +# Increase Node.js memory limit if needed NODE_OPTIONS="--max-old-space-size=8192" pnpm run dev ``` -## Common Development Tasks +**Model Download Issues:** -### 1. Adding a New Character - -```json -{ - "name": "DevBot", - "description": "Development testing bot", - "modelProvider": "openai", - "settings": { - "debug": true, - "logLevel": "debug" - } -} -``` - -### 2. Creating Custom Services - -```typescript -class CustomService extends Service { - static serviceType = ServiceType.CUSTOM; - - async initialize() { - // Setup code - } - - async process(input: any): Promise { - // Service logic - } -} -``` - -### 3. Working with Models - -```typescript -// Local model configuration -const localModel = { - modelProvider: "llamalocal", - settings: { - modelPath: "./models/llama-7b.gguf", - contextSize: 8192 - } -}; - -// Cloud model configuration -const cloudModel = { - modelProvider: "openai", - settings: { - model: "gpt-4o-mini", - temperature: 0.7 - } -}; +```bash +# Clear model cache +rm -rf ./models/* +# Restart with fresh download ``` -## Performance Optimization - -### CUDA Setup +## Testing -For NVIDIA GPU users: - -1. Install CUDA Toolkit with cuDNN and cuBLAS -2. Set environment variables: +### Unit Tests ```bash -CUDA_PATH=/usr/local/cuda # Windows: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0 -``` - -### Memory Management +# Run all tests +pnpm test -```typescript -class MemoryManager { - private cache = new Map(); - private maxSize = 1000; +# Run specific test file +pnpm test tests/your-test.test.ts - async cleanup() { - if (this.cache.size > this.maxSize) { - // Implement cleanup logic - } - } -} +# Run with coverage +pnpm test:coverage ``` -## Troubleshooting - -### Common Issues - -1. Model Loading Issues -```bash -# Clear model cache -rm -rf ./models/* -# Restart with fresh download -``` +### Integration Testing -2. Database Connection Issues ```bash -# Test database connection -pnpm run test:db-connection -``` +# Start test environment +pnpm run dev:test -3. Memory Issues -```bash -# Check memory usage -node --trace-gc index.js +# Run integration tests +pnpm test:integration ``` -### Development Tools +## Development Best Practices -```bash -# Generate TypeScript documentation -pnpm run docs:generate +1. **Version Control** -# Check for circular dependencies -pnpm run madge - -# Analyze bundle size -pnpm run analyze -``` + - Create feature branches + - Follow conventional commits + - Keep PRs focused and manageable -## Best Practices +2. **Code Organization** -1. Code Organization - Place custom actions in `custom_actions/` - Keep character files in `characters/` - Store test data in `tests/fixtures/` -2. Testing Strategy +3. **Performance** + + - Use SQLite for development + - Enable GPU acceleration when possible + - Monitor memory usage + +4. **Testing** - Write unit tests for new features - - Use integration tests for plugins - Test with multiple model providers - -3. Git Workflow - - Create feature branches - - Follow conventional commits - - Keep PRs focused + - Verify character behavior in shell ## Additional Tools @@ -405,22 +243,4 @@ npx folder2knowledge npx knowledge2character ``` -### Development Scripts - -```bash -# Analyze codebase -./scripts/analyze-codebase.ts - -# Extract tweets for training -./scripts/extracttweets.js - -# Clean build artifacts -./scripts/clean.sh -``` - -## Further Resources - -- [Configuration Guide](./configuration.md) for setup details -- [Advanced Usage](./advanced.md) for complex features -- [API Documentation](/api) for complete API reference -- [Contributing Guide](../community/contributing.md) for contribution guidelines +Remember to regularly update dependencies and test your changes across different environments and configurations. diff --git a/docs/docs/guides/secrets-management.md b/docs/docs/guides/secrets-management.md index 5b924f6fc2e..898594e01c5 100644 --- a/docs/docs/guides/secrets-management.md +++ b/docs/docs/guides/secrets-management.md @@ -1,245 +1,94 @@ ---- -sidebar_position: 11 ---- +# Secrets Management -# 🔐 Secrets Management +## Overview -A comprehensive guide for managing secrets, API keys, and sensitive configuration in Eliza. +Eliza provides multiple options for managing secrets and credentials, including environment variables and character-specific secrets. This guide covers best practices for managing API keys, tokens, and other sensitive configuration values across different deployment scenarios. -## Core Concepts +## Environment Variables -### Environment Variables - -Eliza uses a hierarchical environment variable system: - -1. Character-specific secrets (highest priority) -2. Environment variables -3. Default values (lowest priority) - -### Secret Types +### Basic Setup -Common secrets you'll need to manage: +Create a `.env` file in your project root: ```bash -# API Keys -OPENAI_API_KEY=sk-* +# Core API Keys +OPENAI_API_KEY=sk-your-key ANTHROPIC_API_KEY=your-key ELEVENLABS_XI_API_KEY=your-key -GOOGLE_GENERATIVE_AI_API_KEY=your-key -# Client Authentication -DISCORD_API_TOKEN=your-token -TELEGRAM_BOT_TOKEN=your-token +# Discord Configuration +DISCORD_APPLICATION_ID=your-app-id +DISCORD_API_TOKEN=your-bot-token -# Database Credentials -SUPABASE_URL=your-url -SUPABASE_SERVICE_API_KEY=your-key +# Twitter Configuration +TWITTER_USERNAME=your-username +TWITTER_PASSWORD=your-password +TWITTER_EMAIL=your-email +TWITTER_COOKIES=your-cookies -# Blockchain Keys -WALLET_PRIVATE_KEY=your-private-key -WALLET_PUBLIC_KEY=your-public-key -``` +# Database Configuration (Optional) +SUPABASE_URL=your-supabase-url +SUPABASE_SERVICE_API_KEY=your-service-key -## Implementation Guide - -### Basic Setup - -1. Create a `.env` file from template: - -```bash -cp .env.example .env +# Voice Settings (Optional) +ELEVENLABS_MODEL_ID=eleven_multilingual_v2 +ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM +ELEVENLABS_VOICE_STABILITY=0.5 +ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9 +ELEVENLABS_VOICE_STYLE=0.66 +ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false +ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4 +ELEVENLABS_OUTPUT_FORMAT=pcm_16000 ``` -2. Configure environment discovery: - -```typescript -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); - } - - return null; -} -``` +## Character-Specific Secrets -### Character-Specific Secrets +### Configuration in Character Files -Define secrets in character files: +Character files can include their own secrets, which override environment variables: ```json { - "name": "TradingBot", + "name": "AgentName", + "clients": ["discord", "twitter"], + "modelProvider": "openai", "settings": { "secrets": { "OPENAI_API_KEY": "character-specific-key", - "WALLET_PRIVATE_KEY": "character-specific-wallet" + "DISCORD_TOKEN": "bot-specific-token", + "TWITTER_USERNAME": "bot-twitter-handle", + "TWITTER_PASSWORD": "bot-twitter-password" } } } ``` -Access secrets in code: - -```typescript -const apiKey = runtime.getSetting("OPENAI_API_KEY"); -``` - -### Secure Storage - -#### Database Secrets - -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); - } -} -``` - -#### Wallet Management - -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); - } -} -``` - -### Secret Rotation - -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); - } -} -``` - -### Access Control +### Precedence Order -Implement proper access controls: +Secrets are resolved in the following order: -```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); - } -} -``` +1. Character-specific secrets (highest priority) +2. Environment variables +3. Default values (lowest priority) -### Encryption at Rest +## Best Practices -Implement encryption for stored secrets: +### 1. Secret Storage -```typescript -import { createCipheriv, createDecipheriv } from "crypto"; +- Never commit secret files to version control +- Use `.gitignore` to exclude sensitive files: -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; - } -} +```bash +# .gitignore +.env +.env.* +characters/**/secrets.json +**/serviceAccount.json ``` -## Best Practices - -### 1. Environment Segregation +### 2. Development Workflow -Maintain separate environment files: +Create different environment files for different environments: ```bash .env.development # Local development settings @@ -247,106 +96,92 @@ Maintain separate environment files: .env.production # Production settings ``` -### 2. Git Security - -Exclude sensitive files: - -```gitignore -# .gitignore -.env -.env.* -characters/**/secrets.json -**/serviceAccount.json -``` - -### 3. Secret Validation +### 3. Secret Rotation -Validate secrets before use: +Implement a rotation strategy: ```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(", ")}` - ); - } +class SecretManager { + 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 > SecretManager.SECRET_LIFETIME; + } } ``` -### 4. Error Handling +### 4. Secure Character Files -Secure error messages: +When using character-specific secrets: ```typescript -try { - 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"); - } -} +// Validate character file location +const isSecurePath = (path: string): boolean => { + return !path.includes("../") && !path.startsWith("/"); +}; + +// Load character securely +const loadCharacter = async (path: string) => { + if (!isSecurePath(path)) { + throw new Error("Invalid character file path"); + } + // Load and validate character +}; ``` ## Security Considerations -### 1. Handling API Keys +### 1. Access Control + +Implement proper access controls for secret management: ```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 - } +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); + } } ``` -### 2. Secure Configuration Loading +### 2. Encryption at Rest + +For stored secrets: ```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 - } +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); + // ... implementation + } + + static async decrypt(encrypted: string, key: Buffer): Promise { + // ... implementation + } } ``` -### 3. Memory Security +### 3. Secret Validation + +Validate secrets before use: ```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; - } +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(", ")}`); + } } ``` @@ -354,44 +189,46 @@ class SecureMemory { ### Common Issues -1. Missing Secrets +1. **Missing Secrets** + ```typescript -if (!process.env.OPENAI_API_KEY) { - throw new Error( - "OpenAI API key not found in environment or character settings" - ); +if (!process.env.OPENAI_API_KEY && !character.settings.secrets.OPENAI_API_KEY) { + throw new Error( + "OpenAI API key not found in environment or character settings", + ); } ``` -2. Invalid Secret Format +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 +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.code === "ENOENT") { + console.error("Environment file not found"); + } else if (error instanceof ValidationError) { + console.error("Invalid secret format"); + } } ``` ## Related Resources -- [Configuration Guide](./configuration.md) for general setup -- [Local Development](./local-development.md) for development environment -- [Infrastructure Guide](../advanced/infrastructure.md) for deployment security +- [Configuration Guide](./configuration.md) for general configuration options +- [Character Files](../core/characterfile.md) for character-specific settings +- [Local Development](./local-development.md) for development environment setup + +Remember to follow security best practices and never expose sensitive credentials in logs, error messages, or version control systems. diff --git a/docs/docs/installation.md b/docs/docs/installation.md new file mode 100644 index 00000000000..975253e27ef --- /dev/null +++ b/docs/docs/installation.md @@ -0,0 +1,126 @@ +--- +sidebar_position: 3 +--- + +# Installation + +Currently eliza is dependent on Supabase for local development. You can install it with the following command: + +`pnpm install eliza` + +## Select your database adapter + +``` +pnpm install sqlite-vss better-sqlite3 # for sqlite (simple, for local development) + +pnpm install @supabase/supabase-js # for supabase (more complicated but can be deployed at scale) +``` + +### Set up environment variables + +You will need a Supbase account, as well as an OpenAI developer account. + +Copy and paste the .dev.vars.example to .dev.vars and fill in the environment variables: + +``` +SUPABASE_URL="https://your-supabase-url.supabase.co" +SUPABASE_SERVICE_API_KEY="your-supabase-service-api-key" +OPENAI_API_KEY="your-openai-api-key" +``` + +### SQLite Local Setup (Easiest) + +You can use SQLite for local development. This is the easiest way to get started with eliza. + +``` +import { BgentRuntime, SqliteDatabaseAdapter } from "eliza"; +import { Database } from "sqlite3"; +const sqliteDatabaseAdapter = new SqliteDatabaseAdapter(new Database(":memory:")); + +const runtime = new BgentRuntime({ + serverUrl: "https://api.openai.com/v1", + token: process.env.OPENAI_API_KEY, // Can be an API key or JWT token for your AI services + databaseAdapter: sqliteDatabaseAdapter, + // ... other options +}); +``` + +### Supabase Local Setup + +First, you will need to install the Supabase CLI. You can install it using the instructions here. + +Once you have the CLI installed, you can run the following commands to set up a local Supabase instance: + +``` +supabase init +supabase start +``` + +You can now start the eliza project with `pnpm run dev` and it will connect to the local Supabase instance by default. + +NOTE: You will need Docker installed for this to work. If that is an issue for you, use the Supabase Cloud Setup instructions instead below). + +### Supabase Cloud Setup + +This library uses Supabase as a database. You can set up a free account at supabase.io and create a new project. + +- Step 1: On the Subase All Projects Dashboard, select “New Project”. +- Step 2: Select the organization to store the new project in, assign a database name, password and region. +- Step 3: Select “Create New Project”. +- Step 4: Wait for the database to setup. This will take a few minutes as supabase setups various directories. +- Step 5: Select the “SQL Editor” tab from the left navigation menu. +- Step 6: Copy in your own SQL dump file or optionally use the provided file in the eliza directory at: "src/supabase/db.sql". Note: You can use the command "supabase db dump" if you have a pre-exisiting supabase database to generate the SQL dump file. +- Step 7: Paste the SQL code into the SQL Editor and hit run in the bottom right. +- Step 8: Select the “Databases” tab from the left navigation menu to verify all of the tables have been added properly. + +Once you've set up your Supabase project, you can find your API key by going to the "Settings" tab and then "API". You will need to set the` SUPABASE_URL and SUPABASE_SERVICE_API_KEY` environment variables in your `.dev.vars` file. + +### Local Model Setup + +While eliza uses ChatGPT 3.5 by default, you can use a local model by setting the serverUrl to a local endpoint. The LocalAI project is a great way to run a local model with a compatible API endpoint. + +``` +const runtime = new BgentRuntime({ + serverUrl: process.env.LOCALAI_URL, + token: process.env.LOCALAI_TOKEN, // Can be an API key or JWT token for your AI service + // ... other options +}); +``` + +### Development + +``` +pnpm run dev # start the server + +pnpm run shell # start the shell in another terminal to talk to the default agent +``` + +### Usage + +``` + import { BgentRuntime, SupabaseDatabaseAdapter, SqliteDatabaseAdapter } from "eliza"; + + const sqliteDatabaseAdapter = new SqliteDatabaseAdapter(new Database(":memory:")); + + + // You can also use Supabase like this + // const supabaseDatabaseAdapter = new SupabaseDatabaseAdapter( + // process.env.SUPABASE_URL, + // process.env.SUPABASE_SERVICE_API_KEY) + // ; + + + const runtime = new BgentRuntime({ + serverUrl: "https://api.openai.com/v1", + token: process.env.OPENAI_API_KEY, // Can be an API key or JWT token for your AI services + databaseAdapter: sqliteDatabaseAdapter, + actions: [ + /* your custom actions */ + ], + evaluators: [ + /* your custom evaluators */ + ], + model: "gpt-3.5-turbo", // whatever model you want to use + embeddingModel: "text-embedding-3-small", // whatever model you want to use + }); +``` diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 2b03dcd13bd..8d8a364a10f 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -115,8 +115,9 @@ Eliza is backed by an active community of developers and users: ## Next Steps -- [Create Your First Agent](../quickstart) -- [Understand Core Concepts](../core/agents) +- [Install Eliza](./installation.md) +- [Create Your First Agent](./quickstart.md) +- [Understand Core Concepts](./core/agents.md) - [Explore Advanced Features](./guides/advanced.md) Join us in building the future of autonomous AI agents with Eliza! diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md index 0140aca0c37..8b18f618dd8 100644 --- a/docs/docs/quickstart.md +++ b/docs/docs/quickstart.md @@ -2,151 +2,112 @@ sidebar_position: 2 --- -# Quickstart Guide +# Quickstart -## Prerequisites +## Install Node.js -Before getting started with Eliza, ensure you have: +https://docs.npmjs.com/downloading-and-installing-node-js-and-npm -- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) -- [pnpm](https://pnpm.io/installation) -- Git for version control -- A code editor (VS Code recommended) -- CUDA Toolkit (optional, for GPU acceleration) +## Using pnpm -## Installation +We use pnpm to manage our dependencies. It is faster and more efficient than npm, and it supports workspaces. +https://pnpm.io/installation -1. **Clone and Install** -```bash -# Clone the repository -git clone https://github.com/ai16z/eliza.git -cd eliza +## Edit the .env file -# Install dependencies -pnpm install +- Copy .env.example to .env and fill in the appropriate values +- Edit the TWITTER environment variables to add your bot's username and password -# Install optional Sharp package if needed -pnpm install --include=optional sharp -``` +## Edit the character file -2. **Configure Environment** -```bash -# Copy example environment file -cp .env.example .env -``` +- Check out the file `src/core/defaultCharacter.ts` - you can modify this +- You can also load characters with the `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` and run multiple bots at the same time. -Edit `.env` and add your values: -```bash -# Required environment variables -DISCORD_APPLICATION_ID= # For Discord integration -DISCORD_API_TOKEN= # Bot token -OPENAI_API_KEY= # OpenAI API key (starting with sk-*) -ELEVENLABS_XI_API_KEY= # API key from elevenlabs (for voice) -``` +### Run with Llama -## Choose Your Model +You can run Llama 70B or 405B models by setting the `XAI_MODEL` environment variable to `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` or `meta-llama/Meta-Llama-3.1-405B-Instruct` -Eliza supports multiple AI models: +### Run with Grok -- **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 can run Grok models by setting the `XAI_MODEL` environment variable to `grok-beta` -For local inference: -1. Set `XAI_MODEL` to your chosen model -2. Leave `X_SERVER_URL` and `XAI_API_KEY` blank -3. The system will automatically download the model from Hugging Face +### Run with OpenAI -## Create Your First Agent +You can run OpenAI models by setting the `XAI_MODEL` environment variable to `gpt-4o-mini` or `gpt-4o` -1. **Edit the Character File** -Check out `src/core/defaultCharacter.ts` to customize your agent's personality and behavior. +# Requires Node 20+ -You can also load custom characters: -```bash -pnpm start --characters="path/to/your/character.json" -``` +If you are getting strange issues when starting up, make sure you're using Node 20+. Some APIs are not compatible with previous versions. You can check your node version with `node -v`. If you need to install a new version of node, we recommend using [nvm](https://github.com/nvm-sh/nvm). -2. **Start the Agent** -```bash -pnpm start -``` +## Additional Requirements -## Platform Integration - -### Discord Bot Setup -1. Create a new application at [Discord Developer Portal](https://discord.com/developers/applications) -2. Create a bot and get your token -3. Add bot to your server using OAuth2 URL generator -4. Set `DISCORD_API_TOKEN` and `DISCORD_APPLICATION_ID` in your `.env` - -### Twitter Integration -Add to your `.env`: -```bash -TWITTER_USERNAME= # Account username -TWITTER_PASSWORD= # Account password -TWITTER_EMAIL= # Account email -TWITTER_COOKIES= # Account cookies -``` +You may need to install Sharp. If you see an error when starting up, try installing it with the following command: -### Telegram Bot -1. Create a bot -2. Add your bot token to `.env`: -```bash -TELEGRAM_BOT_TOKEN=your_token_here +``` +pnpm install --include=optional sharp ``` -## Optional: GPU Acceleration +# Environment Setup -If you have an NVIDIA GPU: +You will need to add environment variables to your .env file to connect to various platforms: -```bash -# Install CUDA support -npx --no node-llama-cpp source download --gpu cuda - -# Ensure CUDA Toolkit, cuDNN, and cuBLAS are installed +``` +# Required environment variables +# Start Discord +DISCORD_APPLICATION_ID= +DISCORD_API_TOKEN= # Bot token + +# Start Twitter +TWITTER_USERNAME= # Account username +TWITTER_PASSWORD= # Account password +TWITTER_EMAIL= # Account email +TWITTER_COOKIES= # Account cookies ``` -## Basic Usage Examples +# Local Setup -### Chat with Your Agent -```bash -# Start chat interface -pnpm run shell -``` +## CUDA Setup -### Run Multiple Agents -```bash -pnpm start --characters="agent1.json,agent2.json" -``` +If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically. -## Common Issues & Solutions +``` +pnpm install +npx --no node-llama-cpp source download --gpu cuda +``` -1. **Node.js Version** - - Ensure Node.js 22+ is installed - - Use `node -v` to check version - - Consider using [nvm](https://github.com/nvm-sh/nvm) to manage Node versions +Make sure that you've installed the CUDA Toolkit, including cuDNN and cuBLAS. -2. **Sharp Installation** - If you see Sharp-related errors: - ```bash - pnpm install --include=optional sharp - ``` +## Running locally -3. **CUDA Setup** - - Verify CUDA Toolkit installation - - Check GPU compatibility - - Ensure proper environment variables are set +Add XAI_MODEL and set it to one of the above options from [Run with +Llama](#run-with-llama) - you can leave X_SERVER_URL and XAI_API_KEY blank, it +downloads the model from huggingface and queries it locally -## Next Steps +# Cloud Setup (with OpenAI) -Once you have your agent running, explore: +In addition to the environment variables above, you will need to add the following: -1. 🤖 [Understand Agents](./core/agents.md) -2. 📝 [Create Custom Characters](./core/characterfile.md) -3. ⚡ [Add Custom Actions](./core/actions.md) -4. 🔧 [Advanced Configuration](./guides/configuration.md) +``` +# OpenAI handles the bulk of the work with chat, TTS, image recognition, etc. +OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk- + +# The agent can also ask Claude for help if you have an API key +ANTHROPIC_API_KEY= + +# For Elevenlabs voice generation on Discord voice +ELEVENLABS_XI_API_KEY= # API key from elevenlabs + +# ELEVENLABS SETTINGS +ELEVENLABS_MODEL_ID=eleven_multilingual_v2 +ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM +ELEVENLABS_VOICE_STABILITY=0.5 +ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9 +ELEVENLABS_VOICE_STYLE=0.66 +ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false +ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4 +ELEVENLABS_OUTPUT_FORMAT=pcm_16000 +``` -For detailed API documentation, troubleshooting, and advanced features, check out our [full documentation](https://ai16z.github.io/eliza/). +# Discord Bot -Join our [Discord community](https://discord.gg/ai16z) for support and updates! +For help with setting up your Discord Bot, check out here: https://discordjs.guide/preparations/setting-up-a-bot-application.html diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index a32b9469c30..536ec26ea59 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -1,16 +1,19 @@ +// @ts-check import { themes as prismThemes } from "prism-react-renderer"; - +/** @type {import('@docusaurus/types').Config} */ const config = { title: "eliza", tagline: "The flexible, scalable AI agent for everyone", favicon: "img/favicon.ico", - url: "https://ai16z.github.io", + + // GitHub Pages Configuration + url: "https://madjin.github.io", baseUrl: "/eliza/", - organizationName: "ai16z", + organizationName: "madjin", projectName: "eliza", deploymentBranch: "gh-pages", trailingSlash: true, - onBrokenLinks: "ignore", + onBrokenLinks: "throw", onBrokenMarkdownLinks: "warn", i18n: { @@ -20,163 +23,134 @@ const config = { markdown: { mermaid: true, }, - themes: ["@docusaurus/theme-mermaid"], + themes: [ + "@docusaurus/theme-mermaid", + // Any other themes... + ], plugins: [ + // TypeDoc plugin for API documentation [ "docusaurus-plugin-typedoc", { entryPoints: ["../packages/core/src/index.ts"], tsconfig: "../tsconfig.json", - out: "./api", + out: "./docs/api", skipErrorChecking: true, - excludeExternals: false, - excludePrivate: true, - excludeProtected: false, - excludeInternal: false, - excludeNotDocumented: false, - plugin: ["typedoc-plugin-markdown"], - hideGenerator: true, - cleanOutputDir: true, - categorizeByGroup: true, - pretty: true, - includeVersion: true, - sort: ["source-order", "required-first", "visibility"], - gitRevision: "main", - readme: "none", - commentStyle: "all", - preserveAnchorCasing: true, - hideBreadcrumbs: false, - preserveWatchOutput: true, - disableSources: false, - validation: { - notExported: true, - invalidLink: true, - notDocumented: false - }, - exclude: [ - "**/_media/**", - "**/node_modules/**", - "**/dist/**", - "**/*.test.ts", - "**/*.spec.ts" - ], - watch: false, - treatWarningsAsErrors: true, - treatValidationWarningsAsErrors: true, - searchInComments: true, - navigationLinks: { - "GitHub": "https://github.com/ai16z/eliza", - "Documentation": "/docs/intro" - }, }, ], + // Search functionality require.resolve("docusaurus-lunr-search"), + // Separate API docs plugin instance [ "@docusaurus/plugin-content-docs", { id: "api", - path: "api", - routeBasePath: "api", + path: "docs/api", + routeBasePath: "docs/api", + sidebarPath: "./sidebars.api.js", }, ], ], presets: [ [ "classic", - { + /** @type {import('@docusaurus/preset-classic').Options} */ + ({ docs: { sidebarPath: "./sidebars.js", editUrl: "https://github.com/ai16z/eliza/tree/main/docs/", routeBasePath: "docs", - exclude: ["**/_media/**"], }, theme: { customCss: "./src/css/custom.css", }, - }, + }), ], ], - themeConfig: { - colorMode: { - defaultMode: "dark", - disableSwitch: false, - respectPrefersColorScheme: true, - }, - docs: { - sidebar: { - hideable: true, - autoCollapseCategories: true, - }, - }, - navbar: { - title: "eliza", - logo: { - alt: "Eliza Logo", - src: "img/favicon.ico", + themeConfig: + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ + ({ + // Enable dark mode by default + colorMode: { + defaultMode: "dark", + disableSwitch: false, + respectPrefersColorScheme: true, }, - items: [ - { - type: "docSidebar", - sidebarId: "tutorialSidebar", - position: "left", - label: "Documentation", - }, - { - type: "doc", - docsPluginId: "api", - position: "left", - label: "API", - docId: "index", - }, - { - href: "https://github.com/ai16z/eliza", - label: "GitHub", - position: "right", + // Add sidebar configuration + docs: { + sidebar: { + hideable: true, + autoCollapseCategories: true, }, - ], - }, - footer: { - style: "dark", - links: [ - { - title: "Docs", - items: [ - { - label: "General", - href: "./", - }, - ], - }, - { - title: "Community", - items: [ - { - label: 'Discord', - href: 'https://discord.gg/ai16z' - }, - { - label: 'Twitter', - href: 'https://twitter.com/ai16zdao' - } - ] - }, - { - title: "More", - items: [ - { - label: "GitHub", - href: "https://github.com/ai16z/eliza", - }, - ], + }, + navbar: { + title: "eliza", + logo: { + alt: "Eliza Logo", + src: "img/favicon.ico", }, - ], - copyright: `Copyright © ${new Date().getFullYear()} ai16z.ai`, - }, - prism: { - theme: prismThemes.github, - darkTheme: prismThemes.dracula, - }, - }, + items: [ + { + type: "docSidebar", + sidebarId: "tutorialSidebar", + position: "left", + label: "Documentation", + }, + { + type: "doc", + docsPluginId: "api", + position: "left", + label: "API", + docId: "index", + }, + { + href: "https://github.com/ai16z/eliza", + label: "GitHub", + position: "right", + }, + ], + }, + footer: { + style: "dark", + links: [ + { + title: "Docs", + items: [ + { + label: "General", + href: "./", + }, + ], + }, + { + title: "Community", + items: [ + { + label: "Discord", + href: "https://discord.gg/NQHKW7US", + }, + { + label: "Twitter", + href: "https://twitter.com/pmairca", + }, + ], + }, + { + title: "More", + items: [ + { + label: "GitHub", + href: "https://github.com/ai16z/eliza", + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} ai16z.ai`, + }, + prism: { + theme: prismThemes.github, + darkTheme: prismThemes.dracula, + }, + }), }; - export default config; diff --git a/docs/package.json b/docs/package.json index d284ffb6918..9b264644110 100644 --- a/docs/package.json +++ b/docs/package.json @@ -34,7 +34,7 @@ "@docusaurus/types": "3.6.0", "docusaurus-plugin-typedoc": "^1.0.5", "typedoc": "^0.26.11", - "typedoc-plugin-markdown": "^4.2.9" + "typedoc-plugin-markdown": "4.2.9" }, "browserslist": { "production": [ diff --git a/docs/sidebars.api.js b/docs/sidebars.api.js new file mode 100644 index 00000000000..678db1d4f7c --- /dev/null +++ b/docs/sidebars.api.js @@ -0,0 +1,11 @@ +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +const sidebars = { + apiSidebar: [ + { + type: "autogenerated", + dirName: ".", + }, + ], +}; + +export default sidebars; diff --git a/docs/sidebars.js b/docs/sidebars.js index 8012c9955d8..a7ac861e122 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -4,219 +4,61 @@ const sidebars = { { type: "doc", id: "intro", - label: "🚀 Introduction", + label: "Introduction", }, { type: "category", - label: "🏁 Getting Started", - items: [ - { - type: "doc", - id: "quickstart", - label: "⭐ Quick Start" - } - ], + label: "Getting Started", + items: ["quickstart", "installation"], collapsed: false, }, { type: "category", - label: "🧠 Core Concepts", + label: "Core Concepts", collapsed: false, items: [ - { - type: "doc", - id: "core/characterfile", - label: "Character Files" - }, - { - type: "doc", - id: "core/agents", - label: "Agents" - }, - { - type: "doc", - id: "core/providers", - label: "Providers" - }, - { - type: "doc", - id: "core/actions", - label: "Actions" - }, - { - type: "doc", - id: "core/evaluators", - label: "Evaluators" - }, + "core/characterfile", + "core/agents", + "core/providers", + "core/actions", + "core/evaluators", ], }, { type: "category", - label: "📘 Guides", + label: "Guides", collapsed: false, items: [ - { - type: "doc", - id: "guides/configuration", - label: "Configuration" - }, - { - type: "doc", - id: "guides/advanced", - label: "Advanced Usage" - }, - { - type: "doc", - id: "guides/secrets-management", - label: "Secrets Management" - }, - { - type: "doc", - id: "guides/local-development", - label: "Local Development" - }, + "guides/basic-usage", + "guides/configuration", + "guides/advanced", + "guides/secrets-management", + "guides/local-development", ], }, { type: "category", - label: "🎓 Advanced Topics", + label: "Advanced Topics", collapsed: false, items: [ - { - type: "doc", - id: "advanced/fine-tuning", - label: "Fine-tuning" - }, - { - type: "doc", - id: "advanced/infrastructure", - label: "Infrastructure" - }, - { - type: "doc", - id: "advanced/trust-engine", - label: "Trust Engine" - }, - { - type: "doc", - id: "advanced/autonomous-trading", - label: "Autonomous Trading" - }, + "advanced/fine-tuning", + "advanced/infrastructure", + "advanced/trust-engine", + "advanced/autonomous-trading", ], }, { type: "category", - label: "📦 Packages", + label: "Community", collapsed: false, items: [ - { - type: "doc", - id: "packages/packages", - label: "Overview" - }, - { - type: "doc", - id: "packages/core", - label: "Core Package" - }, - { - type: "doc", - id: "packages/adapters", - label: "Database Adapters" - }, - { - type: "doc", - id: "packages/clients", - label: "Client Packages" - }, - { - type: "doc", - id: "packages/agent", - label: "Agent Package" - }, - { - type: "doc", - id: "packages/plugins", - label: "Plugin System" - } + "community/project-overview", + "community/spaces-notes", + "community/development-notes", + "community/contributing", ], }, - { - type: "category", - label: "👥 Community", - collapsed: false, - items: [ - { - type: "doc", - id: "community/creator-fund", - label: "💰 Creator Fund" - }, - { - type: "category", - label: "📺 Stream Notes", - items: [ - { - type: "doc", - id: "community/stream-notes", - label: "Overview" - }, - { - type: "category", - label: "November 2024", - items: [ - { - type: "doc", - id: "community/streams/2024-11-08", - label: "X: Memes, AI Agents, and DAOs" - }, - { - type: "doc", - id: "community/streams/2024-11-06", - label: "Discord Development Stream" - } - ] - }, - { - type: "category", - label: "October 2024", - items: [ - { - type: "doc", - id: "community/streams/2024-10-29", - label: "X: AI Agents & Crypto" - }, - { - type: "doc", - id: "community/streams/2024-10-27", - label: "X: Building Autonomous Agents" - }, - { - type: "doc", - id: "community/streams/2024-10-25", - label: "X: Eliza Framework" - } - ] - } - ] - }, - { - type: "doc", - id: "community/changelog", - label: "📝 Changelog" - }, - { - type: "doc", - id: "community/faq", - label: "❓ FAQ" - }, - { - type: "doc", - id: "community/contributing", - label: "🤝 Contributing" - } - ] - } - ] + ], }; export default sidebars; diff --git a/docs/sidebars1.js b/docs/sidebars1.js new file mode 100644 index 00000000000..e7adaa4a4aa --- /dev/null +++ b/docs/sidebars1.js @@ -0,0 +1,22 @@ +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +const sidebars = { + tutorialSidebar: [ + { + type: "category", + label: "Getting Started", + items: ["intro", "quickstart", "installation"], + }, + { + type: "category", + label: "Guides", + items: [ + "guides/basic-usage", + "guides/configuration", + "guides/characterfile", + "guides/advanced", + ], + }, + ], +}; + +export default sidebars; diff --git a/docs/src/components/HomepageFeatures/index.js b/docs/src/components/HomepageFeatures/index.js index cab5a879a61..e5b4508f526 100644 --- a/docs/src/components/HomepageFeatures/index.js +++ b/docs/src/components/HomepageFeatures/index.js @@ -4,59 +4,53 @@ import styles from "./styles.module.css"; const FeatureList = [ { - icon: "🤖", - title: "Multi-Agent Framework", + title: "Made By Users", description: ( <> - Build and deploy autonomous AI agents with consistent - personalities across Discord, Twitter, and Telegram. Full support for - voice, text, and media interactions. + eliza is open source, community developed and designed to be and easy to + use. ), }, { - icon: "🧠", - title: "Advanced Capabilities", + title: "Just Works", description: ( <> - Built-in RAG memory system, document processing, media analysis, and - autonomous trading capabilities. Supports multiple AI models including - Llama, GPT-4, and Claude. + Simple, tested, used in production. Configurable enough, batteries + included. ), }, { - icon: "🔌", - title: "Extensible Design", + title: "For a Better World", description: ( <> - Create custom actions, add new platform integrations, and extend - functionality through a modular plugin system. Full TypeScript - support. + If you have ideas for how to make better agents for everyone,{" "} + let's do it together. ), }, ]; -function Feature({ icon, title, description }) { +function Feature({ Svg, title, description }) { return ( -
+
-
- {icon} - - {title} - + {/*
+ +
*/} +
+ {title}

{description}

@@ -69,11 +63,9 @@ export default function HomepageFeatures() {
-
- {FeatureList.map((props, idx) => ( - - ))} -
+ {FeatureList.map((props, idx) => ( + + ))}
diff --git a/docs/src/components/HomepageFeatures/styles.module.css b/docs/src/components/HomepageFeatures/styles.module.css index 8c7ff50f7fe..b248eb2e5de 100644 --- a/docs/src/components/HomepageFeatures/styles.module.css +++ b/docs/src/components/HomepageFeatures/styles.module.css @@ -3,57 +3,9 @@ align-items: center; padding: 2rem 0; width: 100%; - flex-wrap: wrap; } .featureSvg { height: 200px; width: 200px; } - -.featureIcon { - height: 100px; - width: 100px; - font-size: 2rem; -} - -.featureGrid { - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 1rem; -} - -@media (max-width: 768px) { - .featureGrid { - grid-template-columns: repeat(2, 1fr); - gap: 0rem; - } - - .featureSvg { - height: 150px; - width: 150px; - } - - .featureIcon { - height: 80px; - width: 80px; - font-size: 1.5rem; - } -} - -@media (max-width: 480px) { - .featureGrid { - grid-template-columns: 1fr; - } - - .featureSvg { - height: 100px; - width: 100px; - } - - .featureIcon { - height: 60px; - width: 60px; - font-size: 1.2rem; - } -} diff --git a/docs/src/css/custom.css b/docs/src/css/custom.css index af54dbd7763..ab05cc5c019 100644 --- a/docs/src/css/custom.css +++ b/docs/src/css/custom.css @@ -6,7 +6,7 @@ /* You can override the default Infima variables here. */ :root { - --ifm-color-primary: #ffa600; + --ifm-color-primary: darkblue; --ifm-color-primary-dark: #29784c; --ifm-color-primary-darker: #277148; --ifm-color-primary-darkest: #205d3b; @@ -27,27 +27,4 @@ --ifm-color-primary-lighter: #32d8b4; --ifm-color-primary-lightest: #4fddbf; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); - --ifm-footer-background-color: #ffa600; -} - -.footer { - background-color: #242736; -} - -.button--primary { - background: linear-gradient( - 180deg, - var(--token-e94f1f99-3833-4c15-8d11-a67e80285705, rgb(249, 140, 19)) - /* {"name":"Orange"} */ 0%, - rgb(255, 166, 0) 100% - ); - border: none; - padding: 1rem 2rem; - font-size: 1.2rem; - transition: background 0.3s; - color: white; -} - -.button--primary:hover { - background: linear-gradient(rgb(255, 156, 43) 0%, rgb(255, 166, 0) 100%); } diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js index 78ce7d59724..ce448e0a0b2 100644 --- a/docs/src/pages/index.js +++ b/docs/src/pages/index.js @@ -2,13 +2,38 @@ import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; import HomepageFeatures from "@site/src/components/HomepageFeatures"; import Layout from "@theme/Layout"; +import Heading from "@theme/Heading"; import styles from "./index.module.css"; -import HomepageHeader from "../components/HomepageHeader"; + +function HomepageHeader() { + const { siteConfig } = useDocusaurusContext(); + return ( +
+
+ + {siteConfig.title} + +

{siteConfig.tagline}

+
+
+ ); +} export default function Home() { const { siteConfig } = useDocusaurusContext(); return ( +
diff --git a/docs/static/img/favicon.ico b/docs/static/img/favicon.ico index 7bc84ea064e..cc99810a034 100644 Binary files a/docs/static/img/favicon.ico and b/docs/static/img/favicon.ico differ diff --git a/packages/adapter-postgres/src/index.ts b/packages/adapter-postgres/src/index.ts index 00d61867da7..2f4da22f5ef 100644 --- a/packages/adapter-postgres/src/index.ts +++ b/packages/adapter-postgres/src/index.ts @@ -115,7 +115,10 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { const { rows } = await client.query(query, queryParams); return rows.map((row) => ({ ...row, - content: typeof row.content === "string" ? JSON.parse(row.content) : row.content, + content: + typeof row.content === "string" + ? JSON.parse(row.content) + : row.content, })); } finally { client.release(); @@ -164,9 +167,10 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { console.log("account", account); return { ...account, - details: typeof account.details === "string" - ? JSON.parse(account.details) - : account.details, + details: + typeof account.details === "string" + ? JSON.parse(account.details) + : account.details, }; } finally { client.release(); @@ -209,9 +213,10 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { ); return rows.map((row) => ({ ...row, - details: typeof row.details === "string" - ? JSON.parse(row.details) - : row.details, + details: + typeof row.details === "string" + ? JSON.parse(row.details) + : row.details, })); } finally { client.release(); @@ -229,9 +234,10 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { return { ...rows[0], - content: typeof rows[0].content === "string" - ? JSON.parse(rows[0].content) - : rows[0].content, + content: + typeof rows[0].content === "string" + ? JSON.parse(rows[0].content) + : rows[0].content, }; } finally { client.release(); @@ -311,7 +317,10 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { return rows.map((row) => ({ ...row, - content: typeof row.content === "string" ? JSON.parse(row.content) : row.content, + content: + typeof row.content === "string" + ? JSON.parse(row.content) + : row.content, similarity: row.similarity, })); } finally { @@ -372,9 +381,10 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { const { rows } = await client.query(sql, values); return rows.map((row) => ({ ...row, - content: typeof row.content === "string" - ? JSON.parse(row.content) - : row.content, + content: + typeof row.content === "string" + ? JSON.parse(row.content) + : row.content, })); } finally { client.release(); @@ -412,9 +422,10 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { const { rows } = await client.query(sql, values); return rows.map((row) => ({ ...row, - objectives: typeof row.objectives === "string" - ? JSON.parse(row.objectives) - : row.objectives, + objectives: + typeof row.objectives === "string" + ? JSON.parse(row.objectives) + : row.objectives, })); } finally { client.release(); @@ -426,7 +437,12 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { try { await client.query( `UPDATE goals SET name = $1, status = $2, objectives = $3 WHERE id = $4`, - [goal.name, goal.status, JSON.stringify(goal.objectives), goal.id] + [ + goal.name, + goal.status, + JSON.stringify(goal.objectives), + goal.id, + ] ); } finally { client.release(); @@ -466,7 +482,9 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { const client = await this.pool.connect(); try { const newRoomId = roomId || v4(); - await client.query("INSERT INTO rooms (id) VALUES ($1)", [newRoomId]); + await client.query("INSERT INTO rooms (id) VALUES ($1)", [ + newRoomId, + ]); return newRoomId as UUID; } finally { client.release(); @@ -569,7 +587,7 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { ORDER BY levenshtein_score LIMIT $5 `; - + const { rows } = await client.query(sql, [ opts.query_input, opts.query_field_name, @@ -577,13 +595,13 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { opts.query_table_name, opts.query_match_count, ]); - + return rows.map((row) => ({ embedding: row.embedding, levenshtein_score: row.levenshtein_score, })); } catch (error) { - console.error('Error in getCachedEmbeddings:', error); + console.error("Error in getCachedEmbeddings:", error); throw error; } finally { client.release(); @@ -666,9 +684,10 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { const { rows } = await client.query(sql, values); return rows.map((row) => ({ ...row, - content: typeof row.content === "string" - ? JSON.parse(row.content) - : row.content, + content: + typeof row.content === "string" + ? JSON.parse(row.content) + : row.content, similarity: row.similarity, })); } finally { @@ -715,10 +734,10 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { }): Promise { const client = await this.pool.connect(); try { - await client.query( - "UPDATE goals SET status = $1 WHERE id = $2", - [params.status, params.goalId] - ); + await client.query("UPDATE goals SET status = $1 WHERE id = $2", [ + params.status, + params.goalId, + ]); } finally { client.release(); } @@ -772,10 +791,9 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { async removeAllGoals(roomId: UUID): Promise { const client = await this.pool.connect(); try { - await client.query( - `DELETE FROM goals WHERE "roomId" = $1`, - [roomId] - ); + await client.query(`DELETE FROM goals WHERE "roomId" = $1`, [ + roomId, + ]); } finally { client.release(); } @@ -833,4 +851,4 @@ export class PostgresDatabaseAdapter extends DatabaseAdapter { } } -export default PostgresDatabaseAdapter; \ No newline at end of file +export default PostgresDatabaseAdapter; diff --git a/packages/client-discord/src/messages.ts b/packages/client-discord/src/messages.ts index 99ba7efeaf0..349f57160b8 100644 --- a/packages/client-discord/src/messages.ts +++ b/packages/client-discord/src/messages.ts @@ -467,125 +467,125 @@ export class MessageManager { } if (shouldRespond) { + const context = composeContext({ + state, + template: + this.runtime.character.templates + ?.discordMessageHandlerTemplate || + discordMessageHandlerTemplate, + }); - const context = composeContext({ - state, - template: - this.runtime.character.templates - ?.discordMessageHandlerTemplate || - discordMessageHandlerTemplate, - }); - - const responseContent = await this._generateResponse( - memory, - state, - context - ); + const responseContent = await this._generateResponse( + memory, + state, + context + ); - responseContent.text = responseContent.text?.trim(); - responseContent.inReplyTo = stringToUuid( - message.id + "-" + this.runtime.agentId - ); + responseContent.text = responseContent.text?.trim(); + responseContent.inReplyTo = stringToUuid( + message.id + "-" + this.runtime.agentId + ); - if (!responseContent.text) { - return; - } + if (!responseContent.text) { + return; + } - const callback: HandlerCallback = async ( - content: Content, - files: any[] - ) => { - try { - if (message.id && !content.inReplyTo) { - content.inReplyTo = stringToUuid( - message.id + "-" + this.runtime.agentId - ); - } - if (message.channel.type === ChannelType.GuildVoice) { - // For voice channels, use text-to-speech - const audioStream = await this.runtime - .getService( - ServiceType.SPEECH_GENERATION - ) - .generate(this.runtime, content.text); - await this.voiceManager.playAudioStream( - userId, - audioStream - ); - const memory: Memory = { - id: stringToUuid( + const callback: HandlerCallback = async ( + content: Content, + files: any[] + ) => { + try { + if (message.id && !content.inReplyTo) { + content.inReplyTo = stringToUuid( message.id + "-" + this.runtime.agentId - ), - userId: this.runtime.agentId, - agentId: this.runtime.agentId, - content, - roomId, - embedding: embeddingZeroVector, - }; - return [memory]; - } else { - // For text channels, send the message - const messages = await sendMessageInChunks( - message.channel as TextChannel, - content.text, - message.id, - files - ); - - const memories: Memory[] = []; - for (const m of messages) { - let action = content.action; - // If there's only one message or it's the last message, keep the original action - // For multiple messages, set all but the last to 'CONTINUE' - if ( - messages.length > 1 && - m !== messages[messages.length - 1] - ) { - action = "CONTINUE"; - } - + ); + } + if (message.channel.type === ChannelType.GuildVoice) { + // For voice channels, use text-to-speech + const audioStream = await this.runtime + .getService( + ServiceType.SPEECH_GENERATION + ) + .generate(this.runtime, content.text); + await this.voiceManager.playAudioStream( + userId, + audioStream + ); const memory: Memory = { id: stringToUuid( - m.id + "-" + this.runtime.agentId + message.id + "-" + this.runtime.agentId ), userId: this.runtime.agentId, agentId: this.runtime.agentId, - content: { - ...content, - action, - inReplyTo: messageId, - url: m.url, - }, + content, roomId, embedding: embeddingZeroVector, - createdAt: m.createdTimestamp, }; - memories.push(memory); - } - for (const m of memories) { - await this.runtime.messageManager.createMemory(m); + return [memory]; + } else { + // For text channels, send the message + const messages = await sendMessageInChunks( + message.channel as TextChannel, + content.text, + message.id, + files + ); + + const memories: Memory[] = []; + for (const m of messages) { + let action = content.action; + // If there's only one message or it's the last message, keep the original action + // For multiple messages, set all but the last to 'CONTINUE' + if ( + messages.length > 1 && + m !== messages[messages.length - 1] + ) { + action = "CONTINUE"; + } + + const memory: Memory = { + id: stringToUuid( + m.id + "-" + this.runtime.agentId + ), + userId: this.runtime.agentId, + agentId: this.runtime.agentId, + content: { + ...content, + action, + inReplyTo: messageId, + url: m.url, + }, + roomId, + embedding: embeddingZeroVector, + createdAt: m.createdTimestamp, + }; + memories.push(memory); + } + for (const m of memories) { + await this.runtime.messageManager.createMemory( + m + ); + } + return memories; } - return memories; + } catch (error) { + console.error("Error sending message:", error); + return []; } - } catch (error) { - console.error("Error sending message:", error); - return []; - } - }; + }; - const responseMessages = await callback(responseContent); + const responseMessages = await callback(responseContent); - state = await this.runtime.updateRecentMessageState(state); + state = await this.runtime.updateRecentMessageState(state); - await this.runtime.processActions( - memory, - responseMessages, - state, - callback - ); - } + await this.runtime.processActions( + memory, + responseMessages, + state, + callback + ); + } await this.runtime.evaluate(memory, state, shouldRespond); - } catch (error) { console.error("Error handling message:", error); if (message.channel.type === ChannelType.GuildVoice) { diff --git a/packages/client-telegram/src/messageManager.ts b/packages/client-telegram/src/messageManager.ts index cf8fe13db71..0dd1e121fc3 100644 --- a/packages/client-telegram/src/messageManager.ts +++ b/packages/client-telegram/src/messageManager.ts @@ -401,79 +401,80 @@ export class MessageManager { // Decide whether to respond const shouldRespond = await this._shouldRespond(message, state); if (shouldRespond) { - // Generate response - const context = composeContext({ - state, - template: - this.runtime.character.templates - ?.telegramMessageHandlerTemplate || - this.runtime.character?.templates?.messageHandlerTemplate || - telegramMessageHandlerTemplate, - }); - - const responseContent = await this._generateResponse( - memory, - state, - context - ); - - if (!responseContent || !responseContent.text) return; - - // Send response in chunks - const callback: HandlerCallback = async (content: Content) => { - const sentMessages = await this.sendMessageInChunks( - ctx, - content.text, - message.message_id + // Generate response + const context = composeContext({ + state, + template: + this.runtime.character.templates + ?.telegramMessageHandlerTemplate || + this.runtime.character?.templates + ?.messageHandlerTemplate || + telegramMessageHandlerTemplate, + }); + + const responseContent = await this._generateResponse( + memory, + state, + context ); - const memories: Memory[] = []; - - // Create memories for each sent message - for (let i = 0; i < sentMessages.length; i++) { - const sentMessage = sentMessages[i]; - const isLastMessage = i === sentMessages.length - 1; - - const memory: Memory = { - id: stringToUuid( - sentMessage.message_id.toString() + - "-" + - this.runtime.agentId - ), - agentId, - userId, - roomId, - content: { - ...content, - text: sentMessage.text, - action: !isLastMessage ? "CONTINUE" : undefined, - inReplyTo: messageId, - }, - createdAt: sentMessage.date * 1000, - embedding: embeddingZeroVector, - }; - - await this.runtime.messageManager.createMemory(memory); - memories.push(memory); - } - - return memories; - }; - - // Execute callback to send messages and log memories - const responseMessages = await callback(responseContent); - - // Update state after response - state = await this.runtime.updateRecentMessageState(state); - - // Handle any resulting actions - await this.runtime.processActions( - memory, - responseMessages, - state, - callback - ); - } + if (!responseContent || !responseContent.text) return; + + // Send response in chunks + const callback: HandlerCallback = async (content: Content) => { + const sentMessages = await this.sendMessageInChunks( + ctx, + content.text, + message.message_id + ); + + const memories: Memory[] = []; + + // Create memories for each sent message + for (let i = 0; i < sentMessages.length; i++) { + const sentMessage = sentMessages[i]; + const isLastMessage = i === sentMessages.length - 1; + + const memory: Memory = { + id: stringToUuid( + sentMessage.message_id.toString() + + "-" + + this.runtime.agentId + ), + agentId, + userId, + roomId, + content: { + ...content, + text: sentMessage.text, + action: !isLastMessage ? "CONTINUE" : undefined, + inReplyTo: messageId, + }, + createdAt: sentMessage.date * 1000, + embedding: embeddingZeroVector, + }; + + await this.runtime.messageManager.createMemory(memory); + memories.push(memory); + } + + return memories; + }; + + // Execute callback to send messages and log memories + const responseMessages = await callback(responseContent); + + // Update state after response + state = await this.runtime.updateRecentMessageState(state); + + // Handle any resulting actions + await this.runtime.processActions( + memory, + responseMessages, + state, + callback + ); + } await this.runtime.evaluate(memory, state, shouldRespond); } catch (error) { diff --git a/packages/client-twitter/src/base.ts b/packages/client-twitter/src/base.ts index fd2e887f02e..9279816ea7b 100644 --- a/packages/client-twitter/src/base.ts +++ b/packages/client-twitter/src/base.ts @@ -172,14 +172,14 @@ export class ClientBase extends EventEmitter { this.runtime.character.style.post.join(); try { - console.log("this.tweetCacheFilePath", this.tweetCacheFilePath) + console.log("this.tweetCacheFilePath", this.tweetCacheFilePath); if (fs.existsSync(this.tweetCacheFilePath)) { // make it? const data = fs.readFileSync(this.tweetCacheFilePath, "utf-8"); this.lastCheckedTweetId = parseInt(data.trim()); } else { console.warn("Tweet cache file not found."); - console.warn(this.tweetCacheFilePath) + console.warn(this.tweetCacheFilePath); } } catch (error) { console.error( diff --git a/packages/client-twitter/src/interactions.ts b/packages/client-twitter/src/interactions.ts index 2cb7a4fce7a..9c7c1b7cdb6 100644 --- a/packages/client-twitter/src/interactions.ts +++ b/packages/client-twitter/src/interactions.ts @@ -150,7 +150,6 @@ export class TwitterInteractionClient extends ClientBase { try { if (this.lastCheckedTweetId) { - fs.writeFileSync( this.tweetCacheFilePath, this.lastCheckedTweetId.toString(), @@ -260,10 +259,10 @@ export class TwitterInteractionClient extends ClientBase { url: tweet.permanentUrl, inReplyTo: tweet.inReplyToStatusId ? stringToUuid( - tweet.inReplyToStatusId + - "-" + - this.runtime.agentId - ) + tweet.inReplyToStatusId + + "-" + + this.runtime.agentId + ) : undefined, }, userId: userIdUUID, diff --git a/packages/core/src/defaultCharacter.ts b/packages/core/src/defaultCharacter.ts index 4a6bfec9703..192280aed53 100644 --- a/packages/core/src/defaultCharacter.ts +++ b/packages/core/src/defaultCharacter.ts @@ -6,8 +6,7 @@ export const defaultCharacter: Character = { clients: [], modelProvider: ModelProviderName.OPENAI, settings: { - secrets: { - }, + secrets: {}, voice: { model: "en_US-hfc_female-medium", }, diff --git a/packages/core/src/embedding.ts b/packages/core/src/embedding.ts index 554bb1588e3..13bd64f5081 100644 --- a/packages/core/src/embedding.ts +++ b/packages/core/src/embedding.ts @@ -2,11 +2,7 @@ import { EmbeddingModel, FlagEmbedding } from "fastembed"; import path from "path"; import { fileURLToPath } from "url"; import models from "./models.ts"; -import { - IAgentRuntime, - ModelProviderName, - ModelClass -} from "./types.ts"; +import { IAgentRuntime, ModelProviderName, ModelClass } from "./types.ts"; import fs from "fs"; import { trimTokens } from "./generation.ts"; import settings from "./settings.ts"; @@ -31,11 +27,14 @@ interface EmbeddingOptions { isOllama?: boolean; } -async function getRemoteEmbedding(input: string, options: EmbeddingOptions): Promise { +async function getRemoteEmbedding( + input: string, + options: EmbeddingOptions +): Promise { // Ensure endpoint ends with /v1 for OpenAI - const baseEndpoint = options.endpoint.endsWith('/v1') ? - options.endpoint : - `${options.endpoint}${options.isOllama ? '/v1' : ''}`; + const baseEndpoint = options.endpoint.endsWith("/v1") + ? options.endpoint + : `${options.endpoint}${options.isOllama ? "/v1" : ""}`; // Construct full URL const fullUrl = `${baseEndpoint}/embeddings`; @@ -46,9 +45,11 @@ async function getRemoteEmbedding(input: string, options: EmbeddingOptions): Pro method: "POST", headers: { "Content-Type": "application/json", - ...(options.apiKey ? { - Authorization: `Bearer ${options.apiKey}`, - } : {}), + ...(options.apiKey + ? { + Authorization: `Bearer ${options.apiKey}`, + } + : {}), }, body: JSON.stringify({ input, @@ -79,7 +80,6 @@ async function getRemoteEmbedding(input: string, options: EmbeddingOptions): Pro } } - /** * Send a message to the OpenAI API for embedding. * @param input The input to be embedded. @@ -88,19 +88,17 @@ async function getRemoteEmbedding(input: string, options: EmbeddingOptions): Pro export async function embed(runtime: IAgentRuntime, input: string) { const modelProvider = models[runtime.character.modelProvider]; //need to have env override for this to select what to use for embedding if provider doesnt provide or using openai - const embeddingModel = ( - settings.USE_OPENAI_EMBEDDING ? "text-embedding-3-small" : // Use OpenAI if specified - modelProvider.model?.[ModelClass.EMBEDDING] || // Use provider's embedding model if available - models[ModelProviderName.OPENAI].model[ModelClass.EMBEDDING] // Fallback to OpenAI - ); + const embeddingModel = settings.USE_OPENAI_EMBEDDING + ? "text-embedding-3-small" // Use OpenAI if specified + : modelProvider.model?.[ModelClass.EMBEDDING] || // Use provider's embedding model if available + models[ModelProviderName.OPENAI].model[ModelClass.EMBEDDING]; // Fallback to OpenAI if (!embeddingModel) { - throw new Error('No embedding model configured'); + throw new Error("No embedding model configured"); } console.log("embeddingModel", embeddingModel); - // Try local embedding first if ( runtime.character.modelProvider !== ModelProviderName.OPENAI && @@ -119,17 +117,18 @@ export async function embed(runtime: IAgentRuntime, input: string) { // Get remote embedding return await getRemoteEmbedding(input, { model: embeddingModel, - endpoint: settings.USE_OPENAI_EMBEDDING ? - 'https://api.openai.com/v1' : // Always use OpenAI endpoint when USE_OPENAI_EMBEDDING is true - (runtime.character.modelEndpointOverride || modelProvider.endpoint), - apiKey: settings.USE_OPENAI_EMBEDDING ? - settings.OPENAI_API_KEY : // Use OpenAI key from settings when USE_OPENAI_EMBEDDING is true - runtime.token, // Use runtime token for other providers - isOllama: runtime.character.modelProvider === ModelProviderName.OLLAMA && !settings.USE_OPENAI_EMBEDDING + endpoint: settings.USE_OPENAI_EMBEDDING + ? "https://api.openai.com/v1" // Always use OpenAI endpoint when USE_OPENAI_EMBEDDING is true + : runtime.character.modelEndpointOverride || modelProvider.endpoint, + apiKey: settings.USE_OPENAI_EMBEDDING + ? settings.OPENAI_API_KEY // Use OpenAI key from settings when USE_OPENAI_EMBEDDING is true + : runtime.token, // Use runtime token for other providers + isOllama: + runtime.character.modelProvider === ModelProviderName.OLLAMA && + !settings.USE_OPENAI_EMBEDDING, }); } - async function getLocalEmbedding(input: string): Promise { const cacheDir = getRootPath() + "/cache/"; if (!fs.existsSync(cacheDir)) { @@ -137,7 +136,7 @@ async function getLocalEmbedding(input: string): Promise { } const embeddingModel = await FlagEmbedding.init({ - cacheDir: cacheDir + cacheDir: cacheDir, }); const trimmedInput = trimTokens(input, 8000, "gpt-4o-mini"); @@ -162,4 +161,3 @@ export async function retrieveCachedEmbedding( } return null; } - diff --git a/packages/core/src/generation.ts b/packages/core/src/generation.ts index 14c7ccc3bc6..1e722c9feb3 100644 --- a/packages/core/src/generation.ts +++ b/packages/core/src/generation.ts @@ -105,8 +105,8 @@ export async function generateText({ break; } - case ModelProviderName.GOOGLE: - { const google = createGoogleGenerativeAI(); + case ModelProviderName.GOOGLE: { + const google = createGoogleGenerativeAI(); const { text: anthropicResponse } = await aiGenerateText({ model: google(model), @@ -122,7 +122,8 @@ export async function generateText({ }); response = anthropicResponse; - break; } + break; + } case ModelProviderName.ANTHROPIC: { elizaLogger.debug("Initializing Anthropic model."); @@ -194,7 +195,9 @@ export async function generateText({ } case ModelProviderName.LLAMALOCAL: { - elizaLogger.debug("Using local Llama model for text completion."); + elizaLogger.debug( + "Using local Llama model for text completion." + ); response = await runtime .getService( ServiceType.TEXT_GENERATION @@ -396,8 +399,8 @@ export async function splitChunks( console.log("model", model); console.log("model.model.embedding", model.model.embedding); - - if(!model.model.embedding) { + + if (!model.model.embedding) { throw new Error("Model does not support embedding"); } diff --git a/packages/core/src/logger.ts b/packages/core/src/logger.ts index e47ae20ee88..40dfc132920 100644 --- a/packages/core/src/logger.ts +++ b/packages/core/src/logger.ts @@ -84,10 +84,8 @@ class ElizaLogger { strings = strings.map((item) => { if (typeof item === "object") { // Handle BigInt serialization - return JSON.stringify(item, (key, value) => - typeof value === 'bigint' - ? value.toString() - : value + return JSON.stringify(item, (key, value) => + typeof value === "bigint" ? value.toString() : value ); } return item; @@ -95,7 +93,7 @@ class ElizaLogger { console.log(c, strings.join(""), this.#getColorReset()); if (this.closeByNewLine) console.log(""); } - + log(...strings) { const fg = "white"; const bg = ""; diff --git a/packages/core/src/parsing.ts b/packages/core/src/parsing.ts index 4041419983e..e0ab2f0ecc6 100644 --- a/packages/core/src/parsing.ts +++ b/packages/core/src/parsing.ts @@ -14,7 +14,7 @@ export const parseShouldRespondFromText = ( text: string ): "RESPOND" | "IGNORE" | "STOP" | null => { const match = text - .split('\n')[0] + .split("\n")[0] .trim() .replace("[", "") .toUpperCase() @@ -22,7 +22,13 @@ export const parseShouldRespondFromText = ( .match(/^(RESPOND|IGNORE|STOP)$/i); return match ? (match[0].toUpperCase() as "RESPOND" | "IGNORE" | "STOP") - : text.includes("RESPOND") ? "RESPOND" : text.includes("IGNORE") ? "IGNORE" : text.includes("STOP") ? "STOP" : null; + : text.includes("RESPOND") + ? "RESPOND" + : text.includes("IGNORE") + ? "IGNORE" + : text.includes("STOP") + ? "STOP" + : null; }; export const booleanFooter = `Respond with a YES or a NO.`; diff --git a/packages/plugin-bootstrap/src/providers/facts.ts b/packages/plugin-bootstrap/src/providers/facts.ts index 6d12b9979b4..e335f1baf78 100644 --- a/packages/plugin-bootstrap/src/providers/facts.ts +++ b/packages/plugin-bootstrap/src/providers/facts.ts @@ -20,16 +20,15 @@ const factsProvider: Provider = { const embedding = await embed(runtime, recentMessages); - console.log('embedding', embedding); - console.log('embedding length', embedding.length); - + console.log("embedding", embedding); + console.log("embedding length", embedding.length); const memoryManager = new MemoryManager({ runtime, tableName: "facts", }); - const relevantFacts = [] + const relevantFacts = []; // await memoryManager.searchMemoriesByEmbedding( // embedding, // { diff --git a/packages/plugin-solana/src/actions/swap.ts b/packages/plugin-solana/src/actions/swap.ts index cc79effc51f..a2f53b8c69a 100644 --- a/packages/plugin-solana/src/actions/swap.ts +++ b/packages/plugin-solana/src/actions/swap.ts @@ -22,10 +22,7 @@ import { } from "@ai16z/eliza/src/types.ts"; import { TokenProvider } from "../providers/token.ts"; import { TrustScoreManager } from "../providers/trustScoreProvider.ts"; -import { - walletProvider, - WalletProvider, -} from "../providers/wallet.ts"; +import { walletProvider, WalletProvider } from "../providers/wallet.ts"; import { getTokenDecimals } from "./swapUtils.ts"; async function swapToken( diff --git a/packages/plugin-solana/src/index.ts b/packages/plugin-solana/src/index.ts index 440b557f24a..763dae9e749 100644 --- a/packages/plugin-solana/src/index.ts +++ b/packages/plugin-solana/src/index.ts @@ -16,9 +16,7 @@ export const solanaPlugin: Plugin = { // executeSwapForDAO, // take_order, ], - evaluators: [ - trustEvaluator - ], + evaluators: [trustEvaluator], providers: [walletProvider, trustScoreProvider], }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27684b17938..47e521f402c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -98,7 +98,7 @@ importers: specifier: ^0.26.11 version: 0.26.11(typescript@5.6.3) typedoc-plugin-markdown: - specifier: ^4.2.9 + specifier: 4.2.9 version: 4.2.9(typedoc@0.26.11(typescript@5.6.3)) packages/adapter-postgres: @@ -512,7 +512,7 @@ importers: version: 2.79.2 ts-jest: specifier: 29.2.5 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.0)(jest@29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@types/node@22.8.4)(typescript@5.6.3)))(typescript@5.6.3) + version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@types/node@22.8.4)(typescript@5.6.3)))(typescript@5.6.3) ts-node: specifier: 10.9.2 version: 10.9.2(@types/node@22.8.4)(typescript@5.6.3) @@ -24844,7 +24844,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(esbuild@0.24.0)(jest@29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@types/node@22.8.4)(typescript@5.6.3)))(typescript@5.6.3): + ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@types/node@22.8.4)(typescript@5.6.3)))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -24862,7 +24862,6 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.26.0) - esbuild: 0.24.0 ts-mixer@6.0.4: {}