diff --git a/docs/api/_media/README_CN.md b/docs/README_CN.md similarity index 98% rename from docs/api/_media/README_CN.md rename to docs/README_CN.md index 5a4bfe5c0d..6ef2ffb2e0 100644 --- a/docs/api/_media/README_CN.md +++ b/docs/README_CN.md @@ -30,7 +30,7 @@ ### 编辑.env文件 -- - 将 .env.example 复制为 .env 并填写适当的值 +- - 将 .env.example 复制为 .env 并填写适当的值 - 编辑推特环境并输入你的推特账号和密码 ### 编辑角色文件 diff --git a/docs/api/_category_.yml b/docs/api/_category_.yml deleted file mode 100644 index c5d5974f55..0000000000 --- a/docs/api/_category_.yml +++ /dev/null @@ -1 +0,0 @@ -label: "API" diff --git a/docs/api/_media/eliza_banner.jpg b/docs/api/_media/eliza_banner.jpg deleted file mode 100644 index 8364b209c8..0000000000 Binary files a/docs/api/_media/eliza_banner.jpg and /dev/null differ diff --git a/docs/api/classes/AgentRuntime.md b/docs/api/classes/AgentRuntime.md index 35607e9370..d9350777fe 100644 --- a/docs/api/classes/AgentRuntime.md +++ b/docs/api/classes/AgentRuntime.md @@ -1,345 +1,620 @@ ---- -id: "AgentRuntime" -title: "Class: AgentRuntime" -sidebar_label: "AgentRuntime" -sidebar_position: 0 -custom_edit_url: null ---- +# 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 -### constructor +### new AgentRuntime() -• **new AgentRuntime**(`opts`): [`AgentRuntime`](AgentRuntime.md) +> **new AgentRuntime**(`opts`): [`AgentRuntime`](AgentRuntime.md) Creates an instance of AgentRuntime. #### Parameters -| Name | Type | Description | -| :------------------------- | :--------------------------------------------------------- | :---------------------------------------------------------------------------------------- | -| `opts` | `Object` | 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.conversationLength?` | `number` | The number of messages to hold in the recent message cache. | -| `opts.databaseAdapter` | [`DatabaseAdapter`](DatabaseAdapter.md) | The database adapter used for interacting with the database. | -| `opts.debugMode?` | `boolean` | If true, debug messages will be logged. | -| `opts.embeddingModel?` | `string` | The model to use for embedding. | -| `opts.evaluators?` | [`Evaluator`](../interfaces/Evaluator.md)[] | Optional custom evaluators. | -| `opts.fetch?` | `unknown` | Custom fetch function to use for making requests. | -| `opts.model?` | `string` | The model to use for completion. | -| `opts.providers?` | [`Provider`](../interfaces/Provider.md)[] | Optional context providers. | -| `opts.serverUrl?` | `string` | The URL of the worker. | -| `opts.token` | `string` | The JWT token, can be a JWT token if outside worker, or an OpenAI token if inside worker. | +• **opts** + +The options for configuring the AgentRuntime. + +• **opts.conversationLength?**: `number` + +The number of messages to hold in the recent message cache. + +• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +Optional ID of the agent. + +• **opts.character?**: [`Character`](../type-aliases/Character.md) + +• **opts.token**: `string` + +The JWT token, can be a JWT token if outside worker, or an OpenAI token if inside worker. + +• **opts.serverUrl?**: `string` + +The URL of the worker. + +• **opts.actions?**: [`Action`](../interfaces/Action.md)[] + +Optional custom actions. + +• **opts.evaluators?**: [`Evaluator`](../interfaces/Evaluator.md)[] + +Optional custom evaluators. + +• **opts.providers?**: [`Provider`](../interfaces/Provider.md)[] + +Optional context providers. + +• **opts.imageGenModel?**: [`ImageGenModel`](../enumerations/ImageGenModel.md) + +• **opts.modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) + +• **opts.databaseAdapter**: [`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md) + +The database adapter used for interacting with the database. + +• **opts.fetch?**: `unknown` + +Custom fetch function to use for making requests. + +• **opts.speechModelPath?**: `string` #### Returns [`AgentRuntime`](AgentRuntime.md) +#### Defined in + +[packages/core/src/core/runtime.ts:189](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L189) + ## Properties -### actions +### agentId -• **actions**: [`Action`](../interfaces/Action.md)[] = `[]` +> **agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -Custom actions that the agent can perform. +The ID of the agent ---- +#### Implementation of -### agentId +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`agentId`](../interfaces/IAgentRuntime.md#agentid) -• **agentId**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` = `zeroUuid` +#### Defined in -The ID of the agent +[packages/core/src/core/runtime.ts:73](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L73) + +*** + +### 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 + +[packages/core/src/core/runtime.ts:77](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L77) + +*** ### databaseAdapter -• **databaseAdapter**: [`DatabaseAdapter`](DatabaseAdapter.md) +> **databaseAdapter**: [`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md) The database adapter used for interacting with the database. ---- +#### Implementation of -### debugMode +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`databaseAdapter`](../interfaces/IAgentRuntime.md#databaseadapter) -• **debugMode**: `boolean` +#### Defined in -Indicates if debug messages should be logged. +[packages/core/src/core/runtime.ts:82](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L82) ---- +*** -### descriptionManager +### token -• **descriptionManager**: [`MemoryManager`](MemoryManager.md) +> **token**: `string` -Store and recall descriptions of users based on conversations. +Authentication token used for securing requests. + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`token`](../interfaces/IAgentRuntime.md#token) + +#### Defined in ---- +[packages/core/src/core/runtime.ts:87](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L87) -### embeddingModel +*** -• **embeddingModel**: `string` = `"text-embedding-3-small"` +### actions + +> **actions**: [`Action`](../interfaces/Action.md)[] = `[]` + +Custom actions that the agent can perform. + +#### Implementation of -The model to use for embedding. +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`actions`](../interfaces/IAgentRuntime.md#actions) ---- +#### Defined in + +[packages/core/src/core/runtime.ts:92](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L92) + +*** ### evaluators -• **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] = `[]` +> **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] = `[]` Evaluators used to assess and guide the agent's responses. ---- +#### Defined in -### factManager +[packages/core/src/core/runtime.ts:97](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L97) -• **factManager**: [`MemoryManager`](MemoryManager.md) +*** -Manage the fact and recall of facts. +### providers ---- +> **providers**: [`Provider`](../interfaces/Provider.md)[] = `[]` -### fetch +Context providers used to provide context for message generation. -• **fetch**: (`input`: `RequestInfo` \| `URL`, `init?`: `RequestInit`\<`CfProperties`\<`unknown`\>\>) => `Promise`\<`Response`\>(`input`: `RequestInfo`, `init?`: `RequestInit`\<`CfProperties`\<`unknown`\>\>) => `Promise`\<`Response`\>(`input`: `RequestInfo`, `init?`: `RequestInit`\<`RequestInitCfProperties`\>) => `Promise`\<`Response`\> = `fetch` +#### Implementation of -Fetch function to use -Some environments may not have access to the global fetch function and need a custom fetch override. +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`providers`](../interfaces/IAgentRuntime.md#providers) -#### Type declaration +#### Defined in -▸ (`input`, `init?`): `Promise`\<`Response`\> +[packages/core/src/core/runtime.ts:102](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L102) -Fetch function to use -Some environments may not have access to the global fetch function and need a custom fetch override. +*** -##### Parameters +### modelProvider -| Name | Type | -| :------ | :------------------------------------------- | -| `input` | `RequestInfo` \| `URL` | -| `init?` | `RequestInit`\<`CfProperties`\<`unknown`\>\> | +> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) = `ModelProvider.LLAMALOCAL` -##### Returns +The model to use for generateText. -`Promise`\<`Response`\> +#### Implementation of -▸ (`input`, `init?`): `Promise`\<`Response`\> +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`modelProvider`](../interfaces/IAgentRuntime.md#modelprovider) -Fetch function to use -Some environments may not have access to the global fetch function and need a custom fetch override. +#### Defined in -##### Parameters +[packages/core/src/core/runtime.ts:107](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L107) -| Name | Type | -| :------ | :------------------------------------------- | -| `input` | `RequestInfo` | -| `init?` | `RequestInit`\<`CfProperties`\<`unknown`\>\> | +*** -##### Returns +### imageGenModel -`Promise`\<`Response`\> +> **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 + +[packages/core/src/core/runtime.ts:112](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L112) + +*** + +### llamaService + +> **llamaService**: `LlamaService` = `null` + +Local Llama if no OpenAI key is present + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`llamaService`](../interfaces/IAgentRuntime.md#llamaservice) -▸ (`input`, `init?`): `Promise`\<`Response`\> +#### Defined in + +[packages/core/src/core/runtime.ts:117](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L117) + +*** + +### speechService + +> **speechService**: [`ISpeechService`](../interfaces/ISpeechService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`speechService`](../interfaces/IAgentRuntime.md#speechservice) + +#### Defined in + +[packages/core/src/core/runtime.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L120) + +*** + +### transcriptionService + +> **transcriptionService**: [`ITranscriptionService`](../interfaces/ITranscriptionService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`transcriptionService`](../interfaces/IAgentRuntime.md#transcriptionservice) + +#### Defined in + +[packages/core/src/core/runtime.ts:122](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L122) + +*** + +### imageDescriptionService + +> **imageDescriptionService**: [`IImageRecognitionService`](../interfaces/IImageRecognitionService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`imageDescriptionService`](../interfaces/IAgentRuntime.md#imagedescriptionservice) + +#### Defined in + +[packages/core/src/core/runtime.ts:124](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L124) + +*** + +### browserService + +> **browserService**: [`IBrowserService`](../interfaces/IBrowserService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`browserService`](../interfaces/IAgentRuntime.md#browserservice) + +#### Defined in + +[packages/core/src/core/runtime.ts:126](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L126) + +*** + +### videoService + +> **videoService**: [`IVideoService`](../interfaces/IVideoService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`videoService`](../interfaces/IAgentRuntime.md#videoservice) + +#### Defined in + +[packages/core/src/core/runtime.ts:128](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L128) + +*** + +### pdfService + +> **pdfService**: [`IPdfService`](../interfaces/IPdfService.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`pdfService`](../interfaces/IAgentRuntime.md#pdfservice) + +#### Defined in + +[packages/core/src/core/runtime.ts:130](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L130) + +*** + +### 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. -##### Parameters +[MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) + +#### Parameters + +• **input**: `RequestInfo` \| `URL` + +• **init?**: `RequestInit` -| Name | Type | -| :------ | :----------------------------------------- | -| `input` | `RequestInfo` | -| `init?` | `RequestInit`\<`RequestInitCfProperties`\> | +#### Returns + +`Promise`\<`Response`\> + +#### Parameters -##### Returns +• **input**: `string` \| `Request` \| `URL` + +• **init?**: `RequestInit` + +#### Returns `Promise`\<`Response`\> ---- +#### Defined in -### loreManager +[packages/core/src/core/runtime.ts:136](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L136) -• **loreManager**: [`MemoryManager`](MemoryManager.md) +*** -Manage the creation and recall of static information (documents, historical game lore, etc) +### 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 + +[packages/core/src/core/runtime.ts:141](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L141) + +*** ### messageManager -• **messageManager**: [`MemoryManager`](MemoryManager.md) +> **messageManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) Store messages that are sent and received by the agent. ---- +#### Implementation of -### model +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`messageManager`](../interfaces/IAgentRuntime.md#messagemanager) -• **model**: `string` = `"gpt-3.5-turbo-0125"` +#### Defined in -The model to use for completion. +[packages/core/src/core/runtime.ts:146](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L146) ---- +*** -### providers +### descriptionManager -• **providers**: [`Provider`](../interfaces/Provider.md)[] = `[]` +> **descriptionManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) -Context providers used to provide context for message generation. +Store and recall descriptions of users based on conversations. ---- +#### Implementation of -### serverUrl +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`descriptionManager`](../interfaces/IAgentRuntime.md#descriptionmanager) -• **serverUrl**: `string` = `"http://localhost:7998"` +#### Defined in -The base URL of the server where the agent's requests are processed. +[packages/core/src/core/runtime.ts:151](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L151) ---- +*** -### token +### factManager -• **token**: `null` \| `string` +> **factManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) -Authentication token used for securing requests. +Manage the fact and recall of facts. -## Methods +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`factManager`](../interfaces/IAgentRuntime.md#factmanager) -### completion +#### Defined in -▸ **completion**(`opts`): `Promise`\<`string`\> +[packages/core/src/core/runtime.ts:156](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L156) -Send a message to the OpenAI API for completion. +*** + +### 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 + +[packages/core/src/core/runtime.ts:161](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L161) + +*** + +### documentsManager + +> **documentsManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) + +Hold large documents that can be referenced + +#### Defined in + +[packages/core/src/core/runtime.ts:166](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L166) + +*** + +### fragmentsManager + +> **fragmentsManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) + +Searchable document fragments + +#### Defined in + +[packages/core/src/core/runtime.ts:171](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L171) + +## Methods + +### getSetting() + +> **getSetting**(`key`): `any` #### Parameters -| Name | Type | Default value | Description | -| :----------------------- | :----------------------- | :------------ | :------------------------------------------------ | -| `opts` | `Object` | `undefined` | The options for the completion request. | -| `opts.context` | `undefined` \| `string` | `""` | The context of the message to be completed. | -| `opts.frequency_penalty` | `undefined` \| `number` | `0.0` | The frequency penalty to apply to the completion. | -| `opts.model` | `undefined` \| `string` | `undefined` | The model to use for completion. | -| `opts.presence_penalty` | `undefined` \| `number` | `0.0` | The presence penalty to apply to the completion. | -| `opts.stop` | `undefined` \| `never`[] | `[]` | A list of strings to stop the completion at. | -| `opts.temperature` | `undefined` \| `number` | `0.7` | The temperature to apply to the completion. | +• **key**: `string` #### Returns -`Promise`\<`string`\> +`any` -The completed message. +#### Implementation of ---- +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`getSetting`](../interfaces/IAgentRuntime.md#getsetting) -### composeState +#### Defined in -▸ **composeState**(`message`, `additionalKeys?`): `Promise`\<\{ `actionConditions`: `string` ; `actionExamples`: `string` ; `actionNames`: `string` ; `actions`: `string` ; `actors`: `string` ; `actorsData`: [`Actor`](../interfaces/Actor.md)[] ; `agentId`: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` ; `agentName`: `undefined` \| `string` ; `evaluatorConditions`: `string` ; `evaluatorExamples`: `string` ; `evaluatorNames`: `string` ; `evaluators`: `string` ; `evaluatorsData`: [`Evaluator`](../interfaces/Evaluator.md)[] ; `goals`: `string` ; `goalsData`: [`Goal`](../interfaces/Goal.md)[] ; `lore`: `string` ; `loreData`: [`Memory`](../interfaces/Memory.md)[] ; `providers`: `string` ; `recentFacts`: `string` ; `recentFactsData`: [`Memory`](../interfaces/Memory.md)[] ; `recentMessages`: `string` ; `recentMessagesData`: [`Memory`](../interfaces/Memory.md)[] ; `relevantFacts`: `string` ; `relevantFactsData`: [`Memory`](../interfaces/Memory.md)[] ; `room_id`: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` ; `senderName`: `undefined` \| `string` }\> +[packages/core/src/core/runtime.ts:392](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L392) -Compose the state of the agent into an object that can be passed or used for response generation. +*** + +### 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 + +[packages/core/src/core/runtime.ts:414](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L414) + +*** + +### registerAction() + +> **registerAction**(`action`): `void` + +Register an action for the agent to perform. #### Parameters -| Name | Type | Description | -| :--------------- | :------------------------------------ | :------------------------------------- | -| `message` | [`Message`](../interfaces/Message.md) | The message to compose the state from. | -| `additionalKeys` | `Object` | - | +• **action**: [`Action`](../interfaces/Action.md) + +The action to register. #### Returns -`Promise`\<\{ `actionConditions`: `string` ; `actionExamples`: `string` ; `actionNames`: `string` ; `actions`: `string` ; `actors`: `string` ; `actorsData`: [`Actor`](../interfaces/Actor.md)[] ; `agentId`: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` ; `agentName`: `undefined` \| `string` ; `evaluatorConditions`: `string` ; `evaluatorExamples`: `string` ; `evaluatorNames`: `string` ; `evaluators`: `string` ; `evaluatorsData`: [`Evaluator`](../interfaces/Evaluator.md)[] ; `goals`: `string` ; `goalsData`: [`Goal`](../interfaces/Goal.md)[] ; `lore`: `string` ; `loreData`: [`Memory`](../interfaces/Memory.md)[] ; `providers`: `string` ; `recentFacts`: `string` ; `recentFactsData`: [`Memory`](../interfaces/Memory.md)[] ; `recentMessages`: `string` ; `recentMessagesData`: [`Memory`](../interfaces/Memory.md)[] ; `relevantFacts`: `string` ; `relevantFactsData`: [`Memory`](../interfaces/Memory.md)[] ; `room_id`: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` ; `senderName`: `undefined` \| `string` }\> +`void` + +#### Implementation of -The state of the agent. +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`registerAction`](../interfaces/IAgentRuntime.md#registeraction) + +#### Defined in ---- +[packages/core/src/core/runtime.ts:422](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L422) -### embed +*** -▸ **embed**(`input`): `Promise`\<`number`[]\> +### registerEvaluator() -Send a message to the OpenAI API for embedding. +> **registerEvaluator**(`evaluator`): `void` + +Register an evaluator to assess and guide the agent's responses. #### Parameters -| Name | Type | Description | -| :------ | :------- | :------------------------ | -| `input` | `string` | The input to be embedded. | +• **evaluator**: [`Evaluator`](../interfaces/Evaluator.md) + +The evaluator to register. #### Returns -`Promise`\<`number`[]\> +`void` -The embedding of the input. +#### Defined in ---- +[packages/core/src/core/runtime.ts:431](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L431) -### ensureParticipantExists +*** -▸ **ensureParticipantExists**(`user_id`, `room_id`): `Promise`\<`void`\> +### registerContextProvider() -Ensure the existence of a participant in the room. If the participant does not exist, they are added to the room. +> **registerContextProvider**(`provider`): `void` + +Register a context provider to provide context for message generation. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The user ID to ensure the existence of. | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | +• **provider**: [`Provider`](../interfaces/Provider.md) + +The context provider to register. #### Returns -`Promise`\<`void`\> +`void` -**`Throws`** +#### Defined in -An error if the participant cannot be added. +[packages/core/src/core/runtime.ts:439](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L439) ---- +*** -### ensureRoomExists +### processActions() -▸ **ensureRoomExists**(`user_id`, `room_id?`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> +> **processActions**(`message`, `responses`, `state`?, `callback`?): `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. +Process the actions of a message. #### Parameters -| Name | Type | Description | -| :--------- | :--------------------------------------------------------- | :--------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The user ID to create a room with. | -| `room_id?` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | +• **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`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> +`Promise`\<`void`\> -The room ID of the room between the agent and the user. +#### Implementation of -**`Throws`** +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`processActions`](../interfaces/IAgentRuntime.md#processactions) -An error if the room cannot be created. +#### Defined in + +[packages/core/src/core/runtime.ts:448](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L448) ---- +*** -### evaluate +### evaluate() -▸ **evaluate**(`message`, `state?`): `Promise`\<`string`[]\> +> **evaluate**(`message`, `state`?): `Promise`\<`string`[]\> Evaluate the message and state using the registered evaluators. #### Parameters -| Name | Type | Description | -| :-------- | :------------------------------------ | :----------------------- | -| `message` | [`Message`](../interfaces/Message.md) | The message to evaluate. | -| `state?` | [`State`](../interfaces/State.md) | The state of the agent. | +• **message**: [`Memory`](../interfaces/Memory.md) + +The message to evaluate. + +• **state?**: [`State`](../interfaces/State.md) + +The state of the agent. #### Returns @@ -347,106 +622,215 @@ Evaluate the message and state using the registered evaluators. The results of the evaluation. ---- +#### Implementation of -### getConversationLength +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`evaluate`](../interfaces/IAgentRuntime.md#evaluate) -▸ **getConversationLength**(): `number` +#### Defined in -Get the number of messages that are kept in the conversation buffer. +[packages/core/src/core/runtime.ts:520](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L520) + +*** + +### 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 -`number` +`Promise`\<`void`\> -The number of recent messages to be kept in memory. +#### Throws ---- +An error if the participant cannot be added. -### processActions +#### Implementation of -▸ **processActions**(`message`, `content`, `state?`): `Promise`\<`unknown`\> +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`ensureParticipantExists`](../interfaces/IAgentRuntime.md#ensureparticipantexists) -Process the actions of a message. +#### Defined in + +[packages/core/src/core/runtime.ts:586](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L586) + +*** + +### 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 -| Name | Type | Description | -| :-------- | :------------------------------------ | :-------------------------------------------------- | -| `message` | [`Message`](../interfaces/Message.md) | The message to process. | -| `content` | [`Content`](../interfaces/Content.md) | The content of the message to process actions from. | -| `state?` | [`State`](../interfaces/State.md) | - | +• **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`\<`unknown`\> +`Promise`\<`void`\> ---- +#### Implementation of -### registerAction +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`ensureUserExists`](../interfaces/IAgentRuntime.md#ensureuserexists) -▸ **registerAction**(`action`): `void` +#### Defined in -Register an action for the agent to perform. +[packages/core/src/core/runtime.ts:602](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L602) + +*** + +### ensureParticipantInRoom() + +> **ensureParticipantInRoom**(`userId`, `roomId`): `Promise`\<`void`\> #### Parameters -| Name | Type | Description | -| :------- | :---------------------------------- | :---------------------- | -| `action` | [`Action`](../interfaces/Action.md) | The action to register. | +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`void` +`Promise`\<`void`\> ---- +#### Implementation of -### registerContextProvider +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`ensureParticipantInRoom`](../interfaces/IAgentRuntime.md#ensureparticipantinroom) -▸ **registerContextProvider**(`provider`): `void` +#### Defined in -Register a context provider to provide context for message generation. +[packages/core/src/core/runtime.ts:622](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L622) + +*** + +### ensureConnection() + +> **ensureConnection**(`userId`, `roomId`, `userName`?, `userScreenName`?, `source`?): `Promise`\<`void`\> #### Parameters -| Name | Type | Description | -| :--------- | :-------------------------------------- | :-------------------------------- | -| `provider` | [`Provider`](../interfaces/Provider.md) | The context provider to register. | +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userName?**: `string` + +• **userScreenName?**: `string` + +• **source?**: `string` #### Returns -`void` +`Promise`\<`void`\> ---- +#### Implementation of -### registerEvaluator +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`ensureConnection`](../interfaces/IAgentRuntime.md#ensureconnection) -▸ **registerEvaluator**(`evaluator`): `void` +#### Defined in -Register an evaluator to assess and guide the agent's responses. +[packages/core/src/core/runtime.ts:633](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L633) + +*** + +### 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 -| Name | Type | Description | -| :---------- | :---------------------------------------- | :------------------------- | -| `evaluator` | [`Evaluator`](../interfaces/Evaluator.md) | The evaluator to register. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`void` +`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 + +[packages/core/src/core/runtime.ts:669](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L669) + +*** + +### 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 + +[packages/core/src/core/runtime.ts:682](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L682) -### retrieveCachedEmbedding +*** -▸ **retrieveCachedEmbedding**(`input`): `Promise`\<`null` \| `number`[]\> +### updateRecentMessageState() + +> **updateRecentMessageState**(`state`): `Promise`\<[`State`](../interfaces/State.md)\> #### Parameters -| Name | Type | -| :------ | :------- | -| `input` | `string` | +• **state**: [`State`](../interfaces/State.md) #### Returns -`Promise`\<`null` \| `number`[]\> +`Promise`\<[`State`](../interfaces/State.md)\> + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`updateRecentMessageState`](../interfaces/IAgentRuntime.md#updaterecentmessagestate) + +#### Defined in + +[packages/core/src/core/runtime.ts:1155](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/runtime.ts#L1155) diff --git a/docs/api/classes/DatabaseAdapter.md b/docs/api/classes/DatabaseAdapter.md index 8ff285f7fa..660744fc16 100644 --- a/docs/api/classes/DatabaseAdapter.md +++ b/docs/api/classes/DatabaseAdapter.md @@ -1,90 +1,84 @@ ---- -id: "DatabaseAdapter" -title: "Class: DatabaseAdapter" -sidebar_label: "DatabaseAdapter" -sidebar_position: 0 -custom_edit_url: null ---- +# Class: `abstract` DatabaseAdapter An abstract class representing a database adapter for managing various entities like accounts, memories, actors, goals, and rooms. -## Hierarchy +## Extended by -- **`DatabaseAdapter`** +- [`PostgresDatabaseAdapter`](PostgresDatabaseAdapter.md) +- [`SqliteDatabaseAdapter`](SqliteDatabaseAdapter.md) - ↳ [`SupabaseDatabaseAdapter`](SupabaseDatabaseAdapter.md) +## Implements - ↳ [`SqliteDatabaseAdapter`](SqliteDatabaseAdapter.md) - - ↳ [`SqlJsDatabaseAdapter`](SqlJsDatabaseAdapter.md) +- [`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md) ## Constructors -### constructor +### new DatabaseAdapter() -• **new DatabaseAdapter**(): [`DatabaseAdapter`](DatabaseAdapter.md) +> **new DatabaseAdapter**(): [`DatabaseAdapter`](DatabaseAdapter.md) #### Returns [`DatabaseAdapter`](DatabaseAdapter.md) -## Methods +## Properties -### addParticipant +### db -▸ **addParticipant**(`user_id`, `room_id`): `Promise`\<`boolean`\> +> **db**: `any` -Adds a user as a participant to a specific room. +The database instance. -#### Parameters +#### Implementation of -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :---------------------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user to add as a participant. | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room to which the user will be added. | +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`db`](../interfaces/IDatabaseAdapter.md#db) -#### Returns - -`Promise`\<`boolean`\> +#### Defined in -A Promise that resolves to a boolean indicating success or failure. +[packages/core/src/core/database.ts:21](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L21) ---- +## Methods -### countMemories +### getAccountById() -▸ **countMemories**(`room_id`, `unique?`, `tableName?`): `Promise`\<`number`\> +> `abstract` **getAccountById**(`userId`): `Promise`\<[`Account`](../interfaces/Account.md)\> -Counts the number of memories in a specific room. +Retrieves an account by its ID. #### Parameters -| Name | Type | Description | -| :----------- | :--------------------------------------------------------- | :------------------------------------------------ | -| `room_id` | \`$\{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. | +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user account to retrieve. #### Returns -`Promise`\<`number`\> +`Promise`\<[`Account`](../interfaces/Account.md)\> -A Promise that resolves to the number of memories. +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 ---- +[packages/core/src/core/database.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L27) -### createAccount +*** -▸ **createAccount**(`account`): `Promise`\<`boolean`\> +### createAccount() + +> `abstract` **createAccount**(`account`): `Promise`\<`boolean`\> Creates a new account in the database. #### Parameters -| Name | Type | Description | -| :-------- | :------------------------------------ | :---------------------------- | -| `account` | [`Account`](../interfaces/Account.md) | The account object to create. | +• **account**: [`Account`](../interfaces/Account.md) + +The account object to create. #### Returns @@ -92,124 +86,191 @@ Creates a new account in the database. A Promise that resolves when the account creation is complete. ---- +#### Implementation of -### createGoal +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`createAccount`](../interfaces/IDatabaseAdapter.md#createaccount) -▸ **createGoal**(`goal`): `Promise`\<`void`\> +#### Defined in -Creates a new goal in the database. +[packages/core/src/core/database.ts:34](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L34) + +*** + +### getMemories() + +> `abstract` **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Retrieves memories based on the specified parameters. #### Parameters -| Name | Type | Description | -| :----- | :------------------------------ | :------------------------- | -| `goal` | [`Goal`](../interfaces/Goal.md) | The goal object to create. | +• **params** + +An object containing parameters for the memory retrieval. + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.count?**: `number` + +• **params.unique?**: `boolean` + +• **params.tableName**: `string` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -A Promise that resolves when the goal has been created. +A Promise that resolves to an array of Memory objects. ---- +#### Implementation of -### createMemory +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getMemories`](../interfaces/IDatabaseAdapter.md#getmemories) -▸ **createMemory**(`memory`, `tableName`, `unique?`): `Promise`\<`void`\> +#### Defined in -Creates a new memory in the database. +[packages/core/src/core/database.ts:41](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L41) + +*** + +### getMemoriesByRoomIds() + +> `abstract` **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> #### Parameters -| Name | Type | Description | -| :---------- | :---------------------------------- | :------------------------------------------- | -| `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. | +• **params** + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +• **params.tableName**: `string` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -A Promise that resolves when the memory has been created. +#### Implementation of ---- +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getMemoriesByRoomIds`](../interfaces/IDatabaseAdapter.md#getmemoriesbyroomids) -### createRelationship +#### Defined in -▸ **createRelationship**(`params`): `Promise`\<`boolean`\> +[packages/core/src/core/database.ts:48](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L48) -Creates a new relationship between two users. +*** + +### getMemoryById() + +> `abstract` **getMemoryById**(`id`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> #### Parameters -| Name | Type | Description | -| :------------- | :--------------------------------------------------------- | :----------------------------------------------------------------- | -| `params` | `Object` | 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}\` | - | +• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`boolean`\> +`Promise`\<[`Memory`](../interfaces/Memory.md)\> -A Promise that resolves to a boolean indicating success or failure of the creation. +#### Implementation of ---- +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getMemoryById`](../interfaces/IDatabaseAdapter.md#getmemorybyid) -### createRoom +#### Defined in -▸ **createRoom**(`room_id?`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> +[packages/core/src/core/database.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L54) -Creates a new room with an optional specified ID. +*** + +### getCachedEmbeddings() + +> `abstract` **getCachedEmbeddings**(`params`): `Promise`\<`object`[]\> + +Retrieves cached embeddings based on the specified query parameters. #### Parameters -| Name | Type | Description | -| :--------- | :--------------------------------------------------------- | :--------------------------------------- | -| `room_id?` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | Optional UUID to assign to the new room. | +• **params** + +An object containing parameters for the embedding retrieval. + +• **params.query\_table\_name**: `string` + +• **params.query\_threshold**: `number` + +• **params.query\_input**: `string` + +• **params.query\_field\_name**: `string` + +• **params.query\_field\_sub\_name**: `string` + +• **params.query\_match\_count**: `number` #### Returns -`Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> +`Promise`\<`object`[]\> -A Promise that resolves to the UUID of the created room. +A Promise that resolves to an array of objects containing embeddings and levenshtein scores. ---- +#### Implementation of -### getAccountById +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getCachedEmbeddings`](../interfaces/IDatabaseAdapter.md#getcachedembeddings) -▸ **getAccountById**(`user_id`): `Promise`\<`null` \| [`Account`](../interfaces/Account.md)\> +#### Defined in -Retrieves an account by its ID. +[packages/core/src/core/database.ts:61](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L61) + +*** + +### log() + +> `abstract` **log**(`params`): `Promise`\<`void`\> + +Logs an event or action with the specified details. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :---------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user account to retrieve. | +• **params** + +An object containing parameters for the log entry. + +• **params.body** + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.type**: `string` #### Returns -`Promise`\<`null` \| [`Account`](../interfaces/Account.md)\> +`Promise`\<`void`\> -A Promise that resolves to the Account object or null if not found. +A Promise that resolves when the log entry has been saved. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`log`](../interfaces/IDatabaseAdapter.md#log) + +#### Defined in ---- +[packages/core/src/core/database.ts:87](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L87) -### getActorDetails +*** -▸ **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> +### getActorDetails() + +> `abstract` **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> Retrieves details of actors in a given room. #### Parameters -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `params` | `Object` | An object containing the room_id to search for actors. | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | +• **params** + +An object containing the roomId to search for actors. + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns @@ -217,73 +278,115 @@ Retrieves details of actors in a given room. A Promise that resolves to an array of Actor objects. ---- +#### Implementation of -### getCachedEmbeddings +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getActorDetails`](../interfaces/IDatabaseAdapter.md#getactordetails) -▸ **getCachedEmbeddings**(`params`): `Promise`\<\{ `embedding`: `number`[] ; `levenshtein_score`: `number` }[]\> +#### Defined in -Retrieves cached embeddings based on the specified query parameters. +[packages/core/src/core/database.ts:99](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L99) + +*** + +### searchMemories() + +> `abstract` **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories based on embeddings and other specified parameters. #### Parameters -| Name | Type | Description | -| :---------------------------- | :------- | :----------------------------------------------------------- | -| `params` | `Object` | 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` | - | +• **params** + +An object containing parameters for the memory search. + +• **params.tableName**: `string` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.embedding**: `number`[] + +• **params.match\_threshold**: `number` + +• **params.match\_count**: `number` + +• **params.unique**: `boolean` #### Returns -`Promise`\<\{ `embedding`: `number`[] ; `levenshtein_score`: `number` }[]\> +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -A Promise that resolves to an array of objects containing embeddings and levenshtein scores. +A Promise that resolves to an array of Memory objects. ---- +#### Implementation of -### getGoals +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`searchMemories`](../interfaces/IDatabaseAdapter.md#searchmemories) -▸ **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> +#### Defined in -Retrieves goals based on specified parameters. +[packages/core/src/core/database.ts:106](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L106) + +*** + +### updateGoalStatus() + +> `abstract` **updateGoalStatus**(`params`): `Promise`\<`void`\> + +Updates the status of a specific goal. #### Parameters -| Name | Type | Description | -| :----------------------- | :------------------------------------------------------------------- | :-------------------------------------------------- | -| `params` | `Object` | An object containing parameters for goal retrieval. | -| `params.count?` | `number` | - | -| `params.onlyInProgress?` | `boolean` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.user_id?` | `null` \| \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | +• **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`\<[`Goal`](../interfaces/Goal.md)[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of Goal objects. +A Promise that resolves when the goal status has been updated. ---- +#### Implementation of -### getMemories +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`updateGoalStatus`](../interfaces/IDatabaseAdapter.md#updategoalstatus) -▸ **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +#### Defined in -Retrieves memories based on the specified parameters. +[packages/core/src/core/database.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L120) + +*** + +### searchMemoriesByEmbedding() + +> `abstract` **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories by embedding and other specified parameters. #### Parameters -| Name | Type | Description | -| :----------------- | :--------------------------------------------------------- | :-------------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the memory retrieval. | -| `params.count?` | `number` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.tableName` | `string` | - | -| `params.unique?` | `boolean` | - | +• **embedding**: `number`[] + +The embedding vector to search with. + +• **params** + +Additional parameters for the search. + +• **params.match\_threshold?**: `number` + +• **params.count?**: `number` + +• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.unique?**: `boolean` + +• **params.tableName**: `string` #### Returns @@ -291,202 +394,283 @@ Retrieves memories based on the specified parameters. A Promise that resolves to an array of Memory objects. ---- +#### Implementation of -### getParticipantsForAccount +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`searchMemoriesByEmbedding`](../interfaces/IDatabaseAdapter.md#searchmemoriesbyembedding) -▸ **getParticipantsForAccount**(`user_id`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> +#### Defined in -Retrieves participants associated with a specific account. +[packages/core/src/core/database.ts:131](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L131) -#### Parameters +*** -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :----------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the account. | +### createMemory() -#### Returns +> `abstract` **createMemory**(`memory`, `tableName`, `unique`?): `Promise`\<`void`\> -`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> +Creates a new memory in the database. -A Promise that resolves to an array of Participant objects. +#### Parameters -▸ **getParticipantsForAccount**(`user_id`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> +• **memory**: [`Memory`](../interfaces/Memory.md) -Retrieves participants associated with a specific account. +The memory object to create. -#### Parameters +• **tableName**: `string` + +The table where the memory should be stored. + +• **unique?**: `boolean` -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :----------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the account. | +Indicates if the memory should be unique. #### Returns -`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of Participant objects. +A Promise that resolves when the memory has been created. ---- +#### Implementation of -### getParticipantsForRoom +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`createMemory`](../interfaces/IDatabaseAdapter.md#creatememory) -▸ **getParticipantsForRoom**(`room_id`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +#### Defined in -Retrieves participants for a specific room. +[packages/core/src/core/database.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L150) + +*** + +### removeMemory() + +> `abstract` **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> + +Removes a specific memory from the database. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :------------------------------------------------------- | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room for which to retrieve participants. | +• **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`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of UUIDs representing the participants. +A Promise that resolves when the memory has been removed. ---- +#### Implementation of -### getRelationship +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeMemory`](../interfaces/IDatabaseAdapter.md#removememory) -▸ **getRelationship**(`params`): `Promise`\<`null` \| [`Relationship`](../interfaces/Relationship.md)\> +#### Defined in -Retrieves a relationship between two users if it exists. +[packages/core/src/core/database.ts:162](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L162) + +*** + +### removeAllMemories() + +> `abstract` **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> + +Removes all memories associated with a specific room. #### Parameters -| Name | Type | Description | -| :------------- | :--------------------------------------------------------- | :----------------------------------------------------------------- | -| `params` | `Object` | 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}\` | - | +• **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`\<`null` \| [`Relationship`](../interfaces/Relationship.md)\> +`Promise`\<`void`\> -A Promise that resolves to the Relationship object or null if not found. +A Promise that resolves when all memories have been removed. ---- +#### Implementation of -### getRelationships +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeAllMemories`](../interfaces/IDatabaseAdapter.md#removeallmemories) -▸ **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> +#### Defined in -Retrieves all relationships for a specific user. +[packages/core/src/core/database.ts:170](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L170) + +*** + +### countMemories() + +> `abstract` **countMemories**(`roomId`, `unique`?, `tableName`?): `Promise`\<`number`\> + +Counts the number of memories in a specific room. #### Parameters -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :----------------------------------------- | -| `params` | `Object` | An object containing the UUID of the user. | -| `params.user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | +• **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`\<[`Relationship`](../interfaces/Relationship.md)[]\> +`Promise`\<`number`\> -A Promise that resolves to an array of Relationship objects. +A Promise that resolves to the number of memories. ---- +#### Implementation of -### getRoom +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`countMemories`](../interfaces/IDatabaseAdapter.md#countmemories) -▸ **getRoom**(`room_id`): `Promise`\<`null` \| \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> +#### Defined in -Retrieves the room ID for a given room, if it exists. +[packages/core/src/core/database.ts:179](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L179) + +*** + +### getGoals() + +> `abstract` **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +Retrieves goals based on specified parameters. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------- | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room to retrieve. | +• **params** + +An object containing parameters for goal retrieval. + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.onlyInProgress?**: `boolean` + +• **params.count?**: `number` #### Returns -`Promise`\<`null` \| \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> +`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> -A Promise that resolves to the room ID or null if not found. +A Promise that resolves to an array of Goal objects. ---- +#### Implementation of -### getRoomsForParticipant +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getGoals`](../interfaces/IDatabaseAdapter.md#getgoals) -▸ **getRoomsForParticipant**(`user_id`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +#### Defined in -Retrieves room IDs for which a specific user is a participant. +[packages/core/src/core/database.ts:190](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L190) + +*** + +### updateGoal() + +> `abstract` **updateGoal**(`goal`): `Promise`\<`void`\> + +Updates a specific goal in the database. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user. | +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object with updated properties. #### Returns -`Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of room IDs. +A Promise that resolves when the goal has been updated. ---- +#### Implementation of -### getRoomsForParticipants +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`updateGoal`](../interfaces/IDatabaseAdapter.md#updategoal) -▸ **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +#### Defined in -Retrieves room IDs for which specific users are participants. +[packages/core/src/core/database.ts:202](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L202) + +*** + +### createGoal() + +> `abstract` **createGoal**(`goal`): `Promise`\<`void`\> + +Creates a new goal in the database. #### Parameters -| Name | Type | Description | -| :-------- | :----------------------------------------------------------- | :------------------------------ | -| `userIds` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[] | An array of UUIDs of the users. | +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object to create. #### Returns -`Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of room IDs. +A Promise that resolves when the goal has been created. ---- +#### Implementation of -### log +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`createGoal`](../interfaces/IDatabaseAdapter.md#creategoal) -▸ **log**(`params`): `Promise`\<`void`\> +#### Defined in -Logs an event or action with the specified details. +[packages/core/src/core/database.ts:209](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L209) + +*** + +### removeGoal() + +> `abstract` **removeGoal**(`goalId`): `Promise`\<`void`\> + +Removes a specific goal from the database. #### Parameters -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the log entry. | -| `params.body` | `Object` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.type` | `string` | - | -| `params.user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | +• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the goal to remove. #### Returns `Promise`\<`void`\> -A Promise that resolves when the log entry has been saved. +A Promise that resolves when the goal has been removed. + +#### Implementation of + +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeGoal`](../interfaces/IDatabaseAdapter.md#removegoal) + +#### Defined in + +[packages/core/src/core/database.ts:216](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L216) ---- +*** -### removeAllGoals +### removeAllGoals() -▸ **removeAllGoals**(`room_id`): `Promise`\<`void`\> +> `abstract` **removeAllGoals**(`roomId`): `Promise`\<`void`\> Removes all goals associated with a specific room. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------------------------- | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room whose goals should be removed. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room whose goals should be removed. #### Returns @@ -494,82 +678,171 @@ Removes all goals associated with a specific room. A Promise that resolves when all goals have been removed. ---- +#### Implementation of -### removeAllMemories +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeAllGoals`](../interfaces/IDatabaseAdapter.md#removeallgoals) -▸ **removeAllMemories**(`room_id`, `tableName`): `Promise`\<`void`\> +#### Defined in -Removes all memories associated with a specific room. +[packages/core/src/core/database.ts:223](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L223) + +*** + +### getRoom() + +> `abstract` **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +Retrieves the room ID for a given room, if it exists. #### Parameters -| Name | Type | Description | -| :---------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `room_id` | \`$\{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. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to retrieve. #### Returns -`Promise`\<`void`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> -A Promise that resolves when all memories have been removed. +A Promise that resolves to the room ID or null if not found. ---- +#### Implementation of -### removeGoal +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getRoom`](../interfaces/IDatabaseAdapter.md#getroom) -▸ **removeGoal**(`goalId`): `Promise`\<`void`\> +#### Defined in -Removes a specific goal from the database. +[packages/core/src/core/database.ts:230](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L230) + +*** + +### createRoom() + +> `abstract` **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +Creates a new room with an optional specified ID. #### Parameters -| Name | Type | Description | -| :------- | :--------------------------------------------------------- | :------------------------------ | -| `goalId` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the goal to remove. | +• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +Optional UUID to assign to the new room. #### Returns -`Promise`\<`void`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> -A Promise that resolves when the goal has been removed. +A Promise that resolves to the UUID of the created room. ---- +#### Implementation of -### removeMemory +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`createRoom`](../interfaces/IDatabaseAdapter.md#createroom) -▸ **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> +#### Defined in -Removes a specific memory from the database. +[packages/core/src/core/database.ts:237](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L237) + +*** + +### removeRoom() + +> `abstract` **removeRoom**(`roomId`): `Promise`\<`void`\> + +Removes a specific room from the database. #### Parameters -| Name | Type | Description | -| :---------- | :--------------------------------------------------------- | :------------------------------------------------- | -| `memoryId` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the memory to remove. | -| `tableName` | `string` | The table from which the memory should be removed. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to remove. #### Returns `Promise`\<`void`\> -A Promise that resolves when the memory has been removed. +A Promise that resolves when the room has been removed. ---- +#### Implementation of -### removeParticipant +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeRoom`](../interfaces/IDatabaseAdapter.md#removeroom) -▸ **removeParticipant**(`user_id`, `room_id`): `Promise`\<`boolean`\> +#### Defined in -Removes a user as a participant from a specific room. +[packages/core/src/core/database.ts:244](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L244) + +*** + +### 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 + +[packages/core/src/core/database.ts:251](https://github.com/ai16z/eliza/blob/main/packages/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 + +[packages/core/src/core/database.ts:258](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L258) + +*** + +### addParticipant() + +> `abstract` **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +Adds a user as a participant to a specific room. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user to remove as a participant. | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room from which the user will be removed. | +• **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 @@ -577,116 +850,270 @@ Removes a user as a participant from a specific room. A Promise that resolves to a boolean indicating success or failure. ---- +#### Implementation of -### removeRoom +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`addParticipant`](../interfaces/IDatabaseAdapter.md#addparticipant) -▸ **removeRoom**(`room_id`): `Promise`\<`void`\> +#### Defined in -Removes a specific room from the database. +[packages/core/src/core/database.ts:266](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L266) + +*** + +### removeParticipant() + +> `abstract` **removeParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +Removes a user as a participant from a specific room. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :------------------------------ | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room to remove. | +• **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`\<`void`\> +`Promise`\<`boolean`\> -A Promise that resolves when the room has been removed. +A Promise that resolves to a boolean indicating success or failure. ---- +#### Implementation of -### searchMemories +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`removeParticipant`](../interfaces/IDatabaseAdapter.md#removeparticipant) -▸ **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +#### Defined in -Searches for memories based on embeddings and other specified parameters. +[packages/core/src/core/database.ts:274](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L274) + +*** + +### 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 + +[packages/core/src/core/database.ts:281](https://github.com/ai16z/eliza/blob/main/packages/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 + +[packages/core/src/core/database.ts:288](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L288) + +*** + +### getParticipantsForRoom() + +> `abstract` **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves participants for a specific room. #### Parameters -| Name | Type | Description | -| :----------------------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the memory search. | -| `params.embedding` | `number`[] | - | -| `params.match_count` | `number` | - | -| `params.match_threshold` | `number` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.tableName` | `string` | - | -| `params.unique` | `boolean` | - | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room for which to retrieve participants. #### Returns -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -A Promise that resolves to an array of Memory objects. +A Promise that resolves to an array of UUIDs representing the participants. ---- +#### Implementation of -### searchMemoriesByEmbedding +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getParticipantsForRoom`](../interfaces/IDatabaseAdapter.md#getparticipantsforroom) -▸ **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +#### Defined in -Searches for memories by embedding and other specified parameters. +[packages/core/src/core/database.ts:295](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L295) + +*** + +### getParticipantUserState() + +> `abstract` **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> #### Parameters -| Name | Type | Description | -| :------------------------ | :--------------------------------------------------------- | :------------------------------------ | -| `embedding` | `number`[] | The embedding vector to search with. | -| `params` | `Object` | Additional parameters for the search. | -| `params.count?` | `number` | - | -| `params.match_threshold?` | `number` | - | -| `params.room_id?` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.tableName` | `string` | - | -| `params.unique?` | `boolean` | - | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> -A Promise that resolves to an array of Memory objects. +#### Implementation of ---- +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`getParticipantUserState`](../interfaces/IDatabaseAdapter.md#getparticipantuserstate) -### updateGoal +#### Defined in -▸ **updateGoal**(`goal`): `Promise`\<`void`\> +[packages/core/src/core/database.ts:297](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L297) -Updates a specific goal in the database. +*** + +### setParticipantUserState() + +> `abstract` **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> #### Parameters -| Name | Type | Description | -| :----- | :------------------------------ | :--------------------------------------- | -| `goal` | [`Goal`](../interfaces/Goal.md) | The goal object with updated properties. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **state**: `"FOLLOWED"` \| `"MUTED"` #### Returns `Promise`\<`void`\> -A Promise that resolves when the goal has been updated. +#### Implementation of ---- +[`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md).[`setParticipantUserState`](../interfaces/IDatabaseAdapter.md#setparticipantuserstate) -### updateGoalStatus +#### Defined in -▸ **updateGoalStatus**(`params`): `Promise`\<`void`\> +[packages/core/src/core/database.ts:301](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L301) -Updates the status of a specific goal. +*** + +### createRelationship() + +> `abstract` **createRelationship**(`params`): `Promise`\<`boolean`\> + +Creates a new relationship between two users. #### Parameters -| Name | Type | Description | -| :-------------- | :--------------------------------------------------------- | :-------------------------------------------------- | -| `params` | `Object` | An object containing the goalId and the new status. | -| `params.goalId` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.status` | [`GoalStatus`](../enums/GoalStatus.md) | - | +• **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`\<`void`\> +`Promise`\<`boolean`\> -A Promise that resolves when the goal status has been updated. +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 + +[packages/core/src/core/database.ts:312](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L312) + +*** + +### 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 + +[packages/core/src/core/database.ts:322](https://github.com/ai16z/eliza/blob/main/packages/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 + +[packages/core/src/core/database.ts:332](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L332) diff --git a/docs/api/classes/DirectClient.md b/docs/api/classes/DirectClient.md index 5b0662da0c..a16ddab6c6 100644 --- a/docs/api/classes/DirectClient.md +++ b/docs/api/classes/DirectClient.md @@ -12,7 +12,7 @@ #### Defined in -[core/src/clients/direct/index.ts:57](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L57) +[packages/core/src/clients/direct/index.ts:56](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/direct/index.ts#L56) ## Methods @@ -30,17 +30,17 @@ #### Defined in -[core/src/clients/direct/index.ts:263](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L263) +[packages/core/src/clients/direct/index.ts:264](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/direct/index.ts#L264) ---- +*** -### start() +### unregisterAgent() -> **start**(`port`): `void` +> **unregisterAgent**(`runtime`): `void` #### Parameters -• **port**: `number` +• **runtime**: [`AgentRuntime`](AgentRuntime.md) #### Returns @@ -48,17 +48,17 @@ #### Defined in -[core/src/clients/direct/index.ts:271](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L271) +[packages/core/src/clients/direct/index.ts:268](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/direct/index.ts#L268) ---- +*** -### unregisterAgent() +### start() -> **unregisterAgent**(`runtime`): `void` +> **start**(`port`): `void` #### Parameters -• **runtime**: [`AgentRuntime`](AgentRuntime.md) +• **port**: `number` #### Returns @@ -66,4 +66,4 @@ #### Defined in -[core/src/clients/direct/index.ts:267](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L267) +[packages/core/src/clients/direct/index.ts:272](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/direct/index.ts#L272) diff --git a/docs/api/classes/DiscordClient.md b/docs/api/classes/DiscordClient.md index 66dd101ca5..be946a7247 100644 --- a/docs/api/classes/DiscordClient.md +++ b/docs/api/classes/DiscordClient.md @@ -24,7 +24,7 @@ #### Defined in -[core/src/clients/discord/index.ts:34](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L34) +[packages/core/src/clients/discord/index.ts:34](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/discord/index.ts#L34) ## Properties @@ -34,9 +34,9 @@ #### Defined in -[core/src/clients/discord/index.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L27) +[packages/core/src/clients/discord/index.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/discord/index.ts#L27) ---- +*** ### character @@ -44,329 +44,10 @@ #### 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 +[packages/core/src/clients/discord/index.ts:30](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/discord/index.ts#L30) ## 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`\> @@ -383,9 +64,9 @@ node_modules/@types/node/events.d.ts:774 #### Defined in -[core/src/clients/discord/index.ts:121](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L121) +[packages/core/src/clients/discord/index.ts:121](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/discord/index.ts#L121) ---- +*** ### handleReactionRemove() @@ -403,1100 +84,4 @@ node_modules/@types/node/events.d.ts:774 #### 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 +[packages/core/src/clients/discord/index.ts:195](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/discord/index.ts#L195) diff --git a/docs/api/classes/MemoryManager.md b/docs/api/classes/MemoryManager.md index 6df9297964..c0f64789bc 100644 --- a/docs/api/classes/MemoryManager.md +++ b/docs/api/classes/MemoryManager.md @@ -1,62 +1,86 @@ ---- -id: "MemoryManager" -title: "Class: MemoryManager" -sidebar_label: "MemoryManager" -sidebar_position: 0 -custom_edit_url: null ---- +# Class: MemoryManager Manage memories in the database. +## Implements + +- [`IMemoryManager`](../interfaces/IMemoryManager.md) + ## Constructors -### constructor +### new MemoryManager() -• **new MemoryManager**(`opts`): [`MemoryManager`](MemoryManager.md) +> **new MemoryManager**(`opts`): [`MemoryManager`](MemoryManager.md) Constructs a new MemoryManager instance. #### Parameters -| Name | Type | Description | -| :--------------- | :-------------------------------- | :------------------------------------------------------ | -| `opts` | `Object` | Options for the manager. | -| `opts.runtime` | [`AgentRuntime`](AgentRuntime.md) | The AgentRuntime instance associated with this manager. | -| `opts.tableName` | `string` | The name of the table this manager will operate on. | +• **opts** + +Options for the manager. + +• **opts.tableName**: `string` + +The name of the table this manager will operate on. + +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +The AgentRuntime instance associated with this manager. #### Returns [`MemoryManager`](MemoryManager.md) +#### Defined in + +[packages/core/src/core/memory.ts:35](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L35) + ## Properties ### runtime -• **runtime**: [`AgentRuntime`](AgentRuntime.md) +> **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 + +[packages/core/src/core/memory.ts:22](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L22) + +*** ### tableName -• **tableName**: `string` +> **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 + +[packages/core/src/core/memory.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L27) + ## Methods -### addEmbeddingToMemory +### addEmbeddingToMemory() -▸ **addEmbeddingToMemory**(`memory`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> +> **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 -| Name | Type | Description | -| :------- | :---------------------------------- | :---------------------------------------- | -| `memory` | [`Memory`](../interfaces/Memory.md) | The memory object to add an embedding to. | +• **memory**: [`Memory`](../interfaces/Memory.md) + +The memory object to add an embedding to. #### Returns @@ -64,41 +88,149 @@ Adds an embedding vector to a memory object. If the memory already has an embedd A Promise resolving to the memory object, potentially updated with an embedding vector. ---- +#### Implementation of -### countMemories +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`addEmbeddingToMemory`](../interfaces/IMemoryManager.md#addembeddingtomemory) -▸ **countMemories**(`room_id`, `unique?`): `Promise`\<`number`\> +#### Defined in -Counts the number of memories associated with a set of user IDs, with an option for uniqueness. +[packages/core/src/core/memory.ts:45](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L45) + +*** + +### getMemories() + +> **getMemories**(`opts`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Retrieves a list of memories by user IDs, with optional deduplication. #### Parameters -| Name | Type | Default value | Description | -| :-------- | :--------------------------------------------------------- | :------------ | :------------------------------------- | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | `undefined` | The room ID to count memories for. | -| `unique` | `boolean` | `true` | Whether to count unique memories only. | +• **opts** + +Options including user IDs, count, and uniqueness. + +• **opts.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The room ID to retrieve memories for. + +• **opts.count?**: `number` = `10` + +The number of memories to retrieve. + +• **opts.unique?**: `boolean` = `true` + +Whether to retrieve unique memories only. + +• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **opts.start?**: `number` + +• **opts.end?**: `number` #### Returns -`Promise`\<`number`\> +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -A Promise resolving to the count of memories. +A Promise resolving to an array of Memory objects. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`getMemories`](../interfaces/IMemoryManager.md#getmemories) + +#### Defined in + +[packages/core/src/core/memory.ts:66](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L66) + +*** + +### getCachedEmbeddings() + +> **getCachedEmbeddings**(`content`): `Promise`\<`object`[]\> + +#### Parameters + +• **content**: `string` + +#### Returns + +`Promise`\<`object`[]\> + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`getCachedEmbeddings`](../interfaces/IMemoryManager.md#getcachedembeddings) + +#### Defined in + +[packages/core/src/core/memory.ts:93](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L93) + +*** + +### 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.match\_threshold?**: `number` -### createMemory +The similarity threshold for matching memories. -▸ **createMemory**(`memory`, `unique?`): `Promise`\<`void`\> +• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **opts.count?**: `number` + +The maximum number of memories to retrieve. + +• **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 + +[packages/core/src/core/memory.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L120) + +*** + +### createMemory() + +> **createMemory**(`memory`, `unique`): `Promise`\<`void`\> Creates a new memory in the database, with an option to check for similarity before insertion. #### Parameters -| Name | Type | Default value | Description | -| :------- | :---------------------------------- | :------------ | :------------------------------------------------ | -| `memory` | [`Memory`](../interfaces/Memory.md) | `undefined` | The memory object to create. | -| `unique` | `boolean` | `false` | Whether to check for similarity before insertion. | +• **memory**: [`Memory`](../interfaces/Memory.md) + +The memory object to create. + +• **unique**: `boolean` = `false` + +Whether to check for similarity before insertion. #### Returns @@ -106,58 +238,75 @@ Creates a new memory in the database, with an option to check for similarity bef A Promise that resolves when the operation completes. ---- +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`createMemory`](../interfaces/IMemoryManager.md#creatememory) + +#### Defined in + +[packages/core/src/core/memory.ts:158](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L158) -### getCachedEmbeddings +*** -▸ **getCachedEmbeddings**(`content`): `Promise`\<\{ `embedding`: `number`[] ; `levenshtein_score`: `number` }[]\> +### getMemoriesByRoomIds() + +> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> #### Parameters -| Name | Type | -| :-------- | :------- | -| `content` | `string` | +• **params** + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] #### Returns -`Promise`\<\{ `embedding`: `number`[] ; `levenshtein_score`: `number` }[]\> +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +#### Implementation of ---- +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`getMemoriesByRoomIds`](../interfaces/IMemoryManager.md#getmemoriesbyroomids) -### getMemories +#### Defined in -▸ **getMemories**(`opts`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +[packages/core/src/core/memory.ts:172](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L172) -Retrieves a list of memories by user IDs, with optional deduplication. +*** + +### getMemoryById() + +> **getMemoryById**(`id`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> #### Parameters -| Name | Type | Default value | Description | -| :------------- | :--------------------------------------------------------- | :------------ | :------------------------------------------------- | -| `opts` | `Object` | `undefined` | Options including user IDs, count, and uniqueness. | -| `opts.count?` | `number` | `10` | The number of memories to retrieve. | -| `opts.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | `undefined` | The room ID to retrieve memories for. | -| `opts.unique?` | `boolean` | `true` | Whether to retrieve unique memories only. | +• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +`Promise`\<[`Memory`](../interfaces/Memory.md)\> -A Promise resolving to an array of Memory objects. +#### Implementation of ---- +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`getMemoryById`](../interfaces/IMemoryManager.md#getmemorybyid) -### removeAllMemories +#### Defined in -▸ **removeAllMemories**(`room_id`): `Promise`\<`void`\> +[packages/core/src/core/memory.ts:183](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L183) -Removes all memories associated with a set of user IDs. +*** + +### removeMemory() + +> **removeMemory**(`memoryId`): `Promise`\<`void`\> + +Removes a memory from the database by its ID. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :---------------------------------- | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The room ID to remove memories for. | +• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The ID of the memory to remove. #### Returns @@ -165,19 +314,27 @@ Removes all memories associated with a set of user IDs. A Promise that resolves when the operation completes. ---- +#### Implementation of -### removeMemory +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`removeMemory`](../interfaces/IMemoryManager.md#removememory) -▸ **removeMemory**(`memoryId`): `Promise`\<`void`\> +#### Defined in -Removes a memory from the database by its ID. +[packages/core/src/core/memory.ts:193](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L193) + +*** + +### removeAllMemories() + +> **removeAllMemories**(`roomId`): `Promise`\<`void`\> + +Removes all memories associated with a set of user IDs. #### Parameters -| Name | Type | Description | -| :--------- | :--------------------------------------------------------- | :------------------------------ | -| `memoryId` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The ID of the memory to remove. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The room ID to remove memories for. #### Returns @@ -185,27 +342,42 @@ Removes a memory from the database by its ID. A Promise that resolves when the operation completes. ---- +#### Implementation of -### searchMemoriesByEmbedding +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`removeAllMemories`](../interfaces/IMemoryManager.md#removeallmemories) -▸ **searchMemoriesByEmbedding**(`embedding`, `opts`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +#### Defined in -Searches for memories similar to a given embedding vector. +[packages/core/src/core/memory.ts:205](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L205) + +*** + +### countMemories() + +> **countMemories**(`roomId`, `unique`): `Promise`\<`number`\> + +Counts the number of memories associated with a set of user IDs, with an option for uniqueness. #### Parameters -| Name | Type | Description | -| :---------------------- | :--------------------------------------------------------- | :------------------------------------------------------------------ | -| `embedding` | `number`[] | The embedding vector to search with. | -| `opts` | `Object` | Options including match threshold, count, user IDs, and uniqueness. | -| `opts.count?` | `number` | The maximum number of memories to retrieve. | -| `opts.match_threshold?` | `number` | The similarity threshold for matching memories. | -| `opts.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The room ID to retrieve memories for. | -| `opts.unique?` | `boolean` | Whether to retrieve unique memories only. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The room ID to count memories for. + +• **unique**: `boolean` = `true` + +Whether to count unique memories only. #### Returns -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +`Promise`\<`number`\> -A Promise resolving to an array of Memory objects that match the embedding. +A Promise resolving to the count of memories. + +#### Implementation of + +[`IMemoryManager`](../interfaces/IMemoryManager.md).[`countMemories`](../interfaces/IMemoryManager.md#countmemories) + +#### Defined in + +[packages/core/src/core/memory.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L218) diff --git a/docs/api/classes/PostgresDatabaseAdapter.md b/docs/api/classes/PostgresDatabaseAdapter.md index 23da6fff34..f528213f2a 100644 --- a/docs/api/classes/PostgresDatabaseAdapter.md +++ b/docs/api/classes/PostgresDatabaseAdapter.md @@ -27,7 +27,7 @@ like accounts, memories, actors, goals, and rooms. #### Defined in -[core/src/adapters/postgres.ts:19](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L19) +[packages/core/src/adapters/postgres.ts:19](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L19) ## Properties @@ -43,225 +43,185 @@ The database instance. #### Defined in -[core/src/core/database.ts:21](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L21) +[packages/core/src/core/database.ts:21](https://github.com/ai16z/eliza/blob/main/packages/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\}\` +### testConnection() -The UUID of the room to which the user will be added. +> **testConnection**(): `Promise`\<`boolean`\> #### 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) +[packages/core/src/adapters/postgres.ts:37](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L37) ---- +*** -### countMemories() +### getRoom() -> **countMemories**(`roomId`, `unique`, `tableName`): `Promise`\<`number`\> +> **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> -Counts the number of memories in a specific room. +Retrieves the room ID for a given room, if it exists. #### 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. +The UUID of the room to retrieve. #### Returns -`Promise`\<`number`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> -A Promise that resolves to the number of memories. +A Promise that resolves to the room ID or null if not found. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`countMemories`](DatabaseAdapter.md#countmemories) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoom`](DatabaseAdapter.md#getroom) #### Defined in -[core/src/adapters/postgres.ts:752](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L752) +[packages/core/src/adapters/postgres.ts:59](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L59) ---- +*** -### createAccount() +### getParticipantsForAccount() -> **createAccount**(`account`): `Promise`\<`boolean`\> +> **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> -Creates a new account in the database. +Retrieves participants associated with a specific account. #### Parameters -• **account**: [`Account`](../interfaces/Account.md) +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -The account object to create. +The UUID of the account. #### Returns -`Promise`\<`boolean`\> +`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> -A Promise that resolves when the account creation is complete. +A Promise that resolves to an array of Participant objects. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`createAccount`](DatabaseAdapter.md#createaccount) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForAccount`](DatabaseAdapter.md#getparticipantsforaccount) #### Defined in -[core/src/adapters/postgres.ts:186](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L186) +[packages/core/src/adapters/postgres.ts:72](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L72) ---- +*** -### createGoal() - -> **createGoal**(`goal`): `Promise`\<`void`\> +### getParticipantUserState() -Creates a new goal in the database. +> **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> #### Parameters -• **goal**: [`Goal`](../interfaces/Goal.md) +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -The goal object to create. +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`void`\> - -A Promise that resolves when the goal has been created. +`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`createGoal`](DatabaseAdapter.md#creategoal) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantUserState`](DatabaseAdapter.md#getparticipantuserstate) #### Defined in -[core/src/adapters/postgres.ts:454](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L454) +[packages/core/src/adapters/postgres.ts:87](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L87) ---- +*** -### createMemory() - -> **createMemory**(`memory`, `tableName`): `Promise`\<`void`\> +### getMemoriesByRoomIds() -Creates a new memory in the database. +> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> #### Parameters -• **memory**: [`Memory`](../interfaces/Memory.md) +• **params** -The memory object to create. +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] -• **tableName**: `string` +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -The table where the memory should be stored. +• **params.tableName**: `string` #### Returns -`Promise`\<`void`\> - -A Promise that resolves when the memory has been created. +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`createMemory`](DatabaseAdapter.md#creatememory) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoriesByRoomIds`](DatabaseAdapter.md#getmemoriesbyroomids) #### Defined in -[core/src/adapters/postgres.ts:253](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L253) +[packages/core/src/adapters/postgres.ts:103](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L103) ---- +*** -### createRelationship() - -> **createRelationship**(`params`): `Promise`\<`boolean`\> +### setParticipantUserState() -Creates a new relationship between two users. +> **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> #### Parameters -• **params** - -An object containing the UUIDs of the two users (userA and userB). +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **state**: `"FOLLOWED"` \| `"MUTED"` #### Returns -`Promise`\<`boolean`\> - -A Promise that resolves to a boolean indicating success or failure of the creation. +`Promise`\<`void`\> #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`createRelationship`](DatabaseAdapter.md#createrelationship) +[`DatabaseAdapter`](DatabaseAdapter.md).[`setParticipantUserState`](DatabaseAdapter.md#setparticipantuserstate) #### Defined in -[core/src/adapters/postgres.ts:505](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L505) +[packages/core/src/adapters/postgres.ts:133](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L133) ---- +*** -### createRoom() +### getParticipantsForRoom() -> **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> +> **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -Creates a new room with an optional specified ID. +Retrieves participants for a specific room. #### Parameters -• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -Optional UUID to assign to the new room. +The UUID of the room for which to retrieve participants. #### Returns -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -A Promise that resolves to the UUID of the created room. +A Promise that resolves to an array of UUIDs representing the participants. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`createRoom`](DatabaseAdapter.md#createroom) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForRoom`](DatabaseAdapter.md#getparticipantsforroom) #### Defined in -[core/src/adapters/postgres.ts:483](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L483) +[packages/core/src/adapters/postgres.ts:149](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L149) ---- +*** ### getAccountById() @@ -287,9 +247,37 @@ A Promise that resolves to the Account object or null if not found. #### Defined in -[core/src/adapters/postgres.ts:162](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L162) +[packages/core/src/adapters/postgres.ts:162](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L162) + +*** + +### 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 + +[packages/core/src/adapters/postgres.ts:186](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L186) ---- +*** ### getActorById() @@ -307,113 +295,103 @@ A Promise that resolves to the Account object or null if not found. #### Defined in -[core/src/adapters/postgres.ts:210](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L210) +[packages/core/src/adapters/postgres.ts:210](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L210) ---- - -### getActorDetails() +*** -> **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> +### getMemoryById() -Retrieves details of actors in a given room. +> **getMemoryById**(`id`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> #### Parameters -• **params** - -An object containing the roomId to search for actors. - -• **params.roomId**: `string` +• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> - -A Promise that resolves to an array of Actor objects. +`Promise`\<[`Memory`](../interfaces/Memory.md)\> #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getActorDetails`](DatabaseAdapter.md#getactordetails) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoryById`](DatabaseAdapter.md#getmemorybyid) #### Defined in -[core/src/adapters/postgres.ts:810](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L810) +[packages/core/src/adapters/postgres.ts:232](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L232) ---- +*** -### getCachedEmbeddings() +### createMemory() -> **getCachedEmbeddings**(`opts`): `Promise`\<`object`[]\> +> **createMemory**(`memory`, `tableName`): `Promise`\<`void`\> -Retrieves cached embeddings based on the specified query parameters. +Creates a new memory in the database. #### Parameters -• **opts** - -• **opts.query_field_name**: `string` - -• **opts.query_field_sub_name**: `string` - -• **opts.query_input**: `string` +• **memory**: [`Memory`](../interfaces/Memory.md) -• **opts.query_match_count**: `number` +The memory object to create. -• **opts.query_table_name**: `string` +• **tableName**: `string` -• **opts.query_threshold**: `number` +The table where the memory should be stored. #### Returns -`Promise`\<`object`[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of objects containing embeddings and levenshtein scores. +A Promise that resolves when the memory has been created. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getCachedEmbeddings`](DatabaseAdapter.md#getcachedembeddings) +[`DatabaseAdapter`](DatabaseAdapter.md).[`createMemory`](DatabaseAdapter.md#creatememory) #### Defined in -[core/src/adapters/postgres.ts:559](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L559) +[packages/core/src/adapters/postgres.ts:253](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L253) ---- +*** -### getGoals() +### searchMemories() -> **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> +> **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -Retrieves goals based on specified parameters. +Searches for memories based on embeddings and other specified parameters. #### Parameters • **params** -An object containing parameters for goal retrieval. - -• **params.count?**: `number` +An object containing parameters for the memory search. -• **params.onlyInProgress?**: `boolean` +• **params.tableName**: `string` • **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.embedding**: `number`[] + +• **params.match\_threshold**: `number` + +• **params.match\_count**: `number` + +• **params.unique**: `boolean` #### Returns -`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -A Promise that resolves to an array of Goal objects. +A Promise that resolves to an array of Memory objects. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getGoals`](DatabaseAdapter.md#getgoals) +[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemories`](DatabaseAdapter.md#searchmemories) #### Defined in -[core/src/adapters/postgres.ts:396](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L396) +[packages/core/src/adapters/postgres.ts:291](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L291) ---- +*** ### getMemories() @@ -427,19 +405,19 @@ Retrieves memories based on the specified parameters. An object containing parameters for the memory retrieval. -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` • **params.count?**: `number` -• **params.end?**: `number` +• **params.unique?**: `boolean` -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.tableName**: `string` -• **params.start?**: `number` +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.tableName**: `string` +• **params.start?**: `number` -• **params.unique?**: `boolean` +• **params.end?**: `number` #### Returns @@ -453,285 +431,317 @@ A Promise that resolves to an array of Memory objects. #### Defined in -[core/src/adapters/postgres.ts:334](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L334) +[packages/core/src/adapters/postgres.ts:334](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L334) ---- +*** -### getMemoriesByRoomIds() +### getGoals() -> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +> **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +Retrieves goals based on specified parameters. #### Parameters • **params** -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +An object containing parameters for goal retrieval. -• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.tableName**: `string` +• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.onlyInProgress?**: `boolean` + +• **params.count?**: `number` #### Returns -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +A Promise that resolves to an array of Goal objects. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoriesByRoomIds`](DatabaseAdapter.md#getmemoriesbyroomids) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getGoals`](DatabaseAdapter.md#getgoals) #### Defined in -[core/src/adapters/postgres.ts:103](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L103) +[packages/core/src/adapters/postgres.ts:396](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L396) ---- +*** -### getMemoryById() +### updateGoal() -> **getMemoryById**(`id`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> +> **updateGoal**(`goal`): `Promise`\<`void`\> + +Updates a specific goal in the database. #### Parameters -• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object with updated properties. #### Returns -`Promise`\<[`Memory`](../interfaces/Memory.md)\> +`Promise`\<`void`\> + +A Promise that resolves when the goal has been updated. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoryById`](DatabaseAdapter.md#getmemorybyid) +[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoal`](DatabaseAdapter.md#updategoal) #### Defined in -[core/src/adapters/postgres.ts:232](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L232) +[packages/core/src/adapters/postgres.ts:437](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L437) ---- +*** -### getParticipantsForAccount() +### createGoal() -> **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> +> **createGoal**(`goal`): `Promise`\<`void`\> -Retrieves participants associated with a specific account. +Creates a new goal in the database. #### Parameters -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **goal**: [`Goal`](../interfaces/Goal.md) -The UUID of the account. +The goal object to create. #### Returns -`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of Participant objects. +A Promise that resolves when the goal has been created. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForAccount`](DatabaseAdapter.md#getparticipantsforaccount) +[`DatabaseAdapter`](DatabaseAdapter.md).[`createGoal`](DatabaseAdapter.md#creategoal) #### Defined in -[core/src/adapters/postgres.ts:72](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L72) +[packages/core/src/adapters/postgres.ts:454](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L454) ---- +*** -### getParticipantsForRoom() +### removeGoal() -> **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +> **removeGoal**(`goalId`): `Promise`\<`void`\> -Retrieves participants for a specific room. +Removes a specific goal from the database. #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -The UUID of the room for which to retrieve participants. +The UUID of the goal to remove. #### Returns -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of UUIDs representing the participants. +A Promise that resolves when the goal has been removed. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForRoom`](DatabaseAdapter.md#getparticipantsforroom) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeGoal`](DatabaseAdapter.md#removegoal) #### Defined in -[core/src/adapters/postgres.ts:149](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L149) +[packages/core/src/adapters/postgres.ts:474](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L474) ---- +*** -### getParticipantUserState() +### createRoom() -> **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> +> **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +Creates a new room with an optional specified ID. #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +Optional UUID to assign to the new room. #### Returns -`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +A Promise that resolves to the UUID of the created room. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantUserState`](DatabaseAdapter.md#getparticipantuserstate) +[`DatabaseAdapter`](DatabaseAdapter.md).[`createRoom`](DatabaseAdapter.md#createroom) #### Defined in -[core/src/adapters/postgres.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L87) +[packages/core/src/adapters/postgres.ts:483](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L483) ---- +*** -### getRelationship() +### removeRoom() -> **getRelationship**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> +> **removeRoom**(`roomId`): `Promise`\<`void`\> -Retrieves a relationship between two users if it exists. +Removes a specific room from the database. #### Parameters -• **params** - -An object containing the UUIDs of the two users (userA and userB). - -• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +The UUID of the room to remove. #### Returns -`Promise`\<[`Relationship`](../interfaces/Relationship.md)\> +`Promise`\<`void`\> -A Promise that resolves to the Relationship object or null if not found. +A Promise that resolves when the room has been removed. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationship`](DatabaseAdapter.md#getrelationship) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeRoom`](DatabaseAdapter.md#removeroom) #### Defined in -[core/src/adapters/postgres.ts:529](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L529) +[packages/core/src/adapters/postgres.ts:496](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L496) ---- +*** -### getRelationships() +### createRelationship() -> **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> +> **createRelationship**(`params`): `Promise`\<`boolean`\> -Retrieves all relationships for a specific user. +Creates a new relationship between two users. #### Parameters • **params** -An object containing the UUID of the user. +An object containing the UUIDs of the two users (userA and userB). -• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> +`Promise`\<`boolean`\> -A Promise that resolves to an array of Relationship objects. +A Promise that resolves to a boolean indicating success or failure of the creation. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationships`](DatabaseAdapter.md#getrelationships) +[`DatabaseAdapter`](DatabaseAdapter.md).[`createRelationship`](DatabaseAdapter.md#createrelationship) #### Defined in -[core/src/adapters/postgres.ts:546](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L546) +[packages/core/src/adapters/postgres.ts:505](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L505) ---- +*** -### getRoom() +### getRelationship() -> **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> +> **getRelationship**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> -Retrieves the room ID for a given room, if it exists. +Retrieves a relationship between two users if it exists. #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params** -The UUID of the room to retrieve. +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`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> +`Promise`\<[`Relationship`](../interfaces/Relationship.md)\> -A Promise that resolves to the room ID or null if not found. +A Promise that resolves to the Relationship object or null if not found. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoom`](DatabaseAdapter.md#getroom) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationship`](DatabaseAdapter.md#getrelationship) #### Defined in -[core/src/adapters/postgres.ts:59](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L59) +[packages/core/src/adapters/postgres.ts:529](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L529) ---- +*** -### getRoomsForParticipant() +### getRelationships() -> **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +> **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> -Retrieves room IDs for which a specific user is a participant. +Retrieves all relationships for a specific user. #### Parameters -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params** -The UUID of the user. +An object containing the UUID of the user. + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +`Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> -A Promise that resolves to an array of room IDs. +A Promise that resolves to an array of Relationship objects. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipant`](DatabaseAdapter.md#getroomsforparticipant) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationships`](DatabaseAdapter.md#getrelationships) #### Defined in -[core/src/adapters/postgres.ts:784](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L784) +[packages/core/src/adapters/postgres.ts:546](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L546) ---- +*** -### getRoomsForParticipants() +### getCachedEmbeddings() -> **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +> **getCachedEmbeddings**(`opts`): `Promise`\<`object`[]\> -Retrieves room IDs for which specific users are participants. +Retrieves cached embeddings based on the specified query parameters. #### Parameters -• **userIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] +• **opts** -An array of UUIDs of the users. +• **opts.query\_table\_name**: `string` + +• **opts.query\_threshold**: `number` + +• **opts.query\_input**: `string` + +• **opts.query\_field\_name**: `string` + +• **opts.query\_field\_sub\_name**: `string` + +• **opts.query\_match\_count**: `number` #### Returns -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +`Promise`\<`object`[]\> -A Promise that resolves to an array of room IDs. +A Promise that resolves to an array of objects containing embeddings and levenshtein scores. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipants`](DatabaseAdapter.md#getroomsforparticipants) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getCachedEmbeddings`](DatabaseAdapter.md#getcachedembeddings) #### Defined in -[core/src/adapters/postgres.ts:797](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L797) +[packages/core/src/adapters/postgres.ts:559](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L559) ---- +*** ### log() @@ -747,12 +757,12 @@ An object containing parameters for the log entry. • **params.body** +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + • **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` • **params.type**: `string` -• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - #### Returns `Promise`\<`void`\> @@ -765,368 +775,358 @@ A Promise that resolves when the log entry has been saved. #### Defined in -[core/src/adapters/postgres.ts:595](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L595) +[packages/core/src/adapters/postgres.ts:595](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L595) ---- +*** -### removeAllGoals() +### searchMemoriesByEmbedding() -> **removeAllGoals**(`roomId`): `Promise`\<`void`\> +> **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -Removes all goals associated with a specific room. +Searches for memories by embedding and other specified parameters. #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **embedding**: `number`[] -The UUID of the room whose goals should be removed. +The embedding vector to search with. + +• **params** + +Additional parameters for the search. + +• **params.match\_threshold?**: `number` + +• **params.count?**: `number` + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.unique?**: `boolean` + +• **params.tableName**: `string` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -A Promise that resolves when all goals have been removed. +A Promise that resolves to an array of Memory objects. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllGoals`](DatabaseAdapter.md#removeallgoals) +[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemoriesByEmbedding`](DatabaseAdapter.md#searchmemoriesbyembedding) #### Defined in -[core/src/adapters/postgres.ts:773](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L773) +[packages/core/src/adapters/postgres.ts:612](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L612) ---- +*** -### removeAllMemories() +### addParticipant() -> **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> +> **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> -Removes all memories associated with a specific room. +Adds a user as a participant to a specific room. #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -The UUID of the room whose memories should be removed. +The UUID of the user to add as a participant. -• **tableName**: `string` +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -The table from which the memories should be removed. +The UUID of the room to which the user will be added. #### Returns -`Promise`\<`void`\> +`Promise`\<`boolean`\> -A Promise that resolves when all memories have been removed. +A Promise that resolves to a boolean indicating success or failure. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllMemories`](DatabaseAdapter.md#removeallmemories) +[`DatabaseAdapter`](DatabaseAdapter.md).[`addParticipant`](DatabaseAdapter.md#addparticipant) #### Defined in -[core/src/adapters/postgres.ts:740](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L740) +[packages/core/src/adapters/postgres.ts:681](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L681) ---- +*** -### removeGoal() +### removeParticipant() -> **removeGoal**(`goalId`): `Promise`\<`void`\> +> **removeParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> -Removes a specific goal from the database. +Removes a user as a participant from a specific room. #### Parameters -• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -The UUID of the goal to remove. +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`\<`void`\> +`Promise`\<`boolean`\> -A Promise that resolves when the goal has been removed. +A Promise that resolves to a boolean indicating success or failure. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeGoal`](DatabaseAdapter.md#removegoal) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeParticipant`](DatabaseAdapter.md#removeparticipant) #### Defined in -[core/src/adapters/postgres.ts:474](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L474) +[packages/core/src/adapters/postgres.ts:697](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L697) ---- +*** -### removeMemory() +### updateGoalStatus() -> **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> +> **updateGoalStatus**(`params`): `Promise`\<`void`\> -Removes a specific memory from the database. +Updates the status of a specific goal. #### Parameters -• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params** -The UUID of the memory to remove. +An object containing the goalId and the new status. -• **tableName**: `string` +• **params.goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -The table from which the memory should be removed. +• **params.status**: [`GoalStatus`](../enumerations/GoalStatus.md) #### Returns `Promise`\<`void`\> -A Promise that resolves when the memory has been removed. +A Promise that resolves when the goal status has been updated. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeMemory`](DatabaseAdapter.md#removememory) +[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoalStatus`](DatabaseAdapter.md#updategoalstatus) #### Defined in -[core/src/adapters/postgres.ts:728](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L728) +[packages/core/src/adapters/postgres.ts:713](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L713) ---- +*** -### removeParticipant() +### removeMemory() -> **removeParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> +> **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> -Removes a user as a participant from a specific room. +Removes a specific memory from the database. #### Parameters -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -The UUID of the user to remove as a participant. +The UUID of the memory to remove. -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **tableName**: `string` -The UUID of the room from which the user will be removed. +The table from which the memory should be removed. #### Returns -`Promise`\<`boolean`\> +`Promise`\<`void`\> -A Promise that resolves to a boolean indicating success or failure. +A Promise that resolves when the memory has been removed. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeParticipant`](DatabaseAdapter.md#removeparticipant) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeMemory`](DatabaseAdapter.md#removememory) #### Defined in -[core/src/adapters/postgres.ts:697](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L697) +[packages/core/src/adapters/postgres.ts:728](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L728) ---- +*** -### removeRoom() +### removeAllMemories() -> **removeRoom**(`roomId`): `Promise`\<`void`\> +> **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> -Removes a specific room from the database. +Removes all memories associated with a specific room. #### Parameters • **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -The UUID of the room to remove. +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 the room has been removed. +A Promise that resolves when all memories have been removed. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeRoom`](DatabaseAdapter.md#removeroom) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllMemories`](DatabaseAdapter.md#removeallmemories) #### Defined in -[core/src/adapters/postgres.ts:496](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L496) +[packages/core/src/adapters/postgres.ts:740](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L740) ---- +*** -### searchMemories() +### countMemories() -> **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +> **countMemories**(`roomId`, `unique`, `tableName`): `Promise`\<`number`\> -Searches for memories based on embeddings and other specified parameters. +Counts the number of memories in a specific room. #### Parameters -• **params** - -An object containing parameters for the memory search. - -• **params.embedding**: `number`[] +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.match_count**: `number` +The UUID of the room for which to count memories. -• **params.match_threshold**: `number` +• **unique**: `boolean` = `true` -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +Specifies whether to count only unique memories. -• **params.tableName**: `string` +• **tableName**: `string` = `""` -• **params.unique**: `boolean` +Optional table name to count memories from. #### Returns -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +`Promise`\<`number`\> -A Promise that resolves to an array of Memory objects. +A Promise that resolves to the number of memories. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemories`](DatabaseAdapter.md#searchmemories) +[`DatabaseAdapter`](DatabaseAdapter.md).[`countMemories`](DatabaseAdapter.md#countmemories) #### Defined in -[core/src/adapters/postgres.ts:291](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L291) +[packages/core/src/adapters/postgres.ts:752](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L752) ---- +*** -### searchMemoriesByEmbedding() +### removeAllGoals() -> **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +> **removeAllGoals**(`roomId`): `Promise`\<`void`\> -Searches for memories by embedding and other specified parameters. +Removes all goals associated with a specific room. #### 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` +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.unique?**: `boolean` +The UUID of the room whose goals should be removed. #### Returns -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of Memory objects. +A Promise that resolves when all goals have been removed. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemoriesByEmbedding`](DatabaseAdapter.md#searchmemoriesbyembedding) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllGoals`](DatabaseAdapter.md#removeallgoals) #### Defined in -[core/src/adapters/postgres.ts:612](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L612) +[packages/core/src/adapters/postgres.ts:773](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L773) ---- +*** -### setParticipantUserState() +### getRoomsForParticipant() -> **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> +> **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -#### Parameters +Retrieves room IDs for which a specific user is a participant. -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +#### Parameters • **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **state**: `"FOLLOWED"` \| `"MUTED"` +The UUID of the user. #### 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() +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -> **testConnection**(): `Promise`\<`boolean`\> +A Promise that resolves to an array of room IDs. -#### Returns +#### Overrides -`Promise`\<`boolean`\> +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipant`](DatabaseAdapter.md#getroomsforparticipant) #### Defined in -[core/src/adapters/postgres.ts:37](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L37) +[packages/core/src/adapters/postgres.ts:784](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L784) ---- +*** -### updateGoal() +### getRoomsForParticipants() -> **updateGoal**(`goal`): `Promise`\<`void`\> +> **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -Updates a specific goal in the database. +Retrieves room IDs for which specific users are participants. #### Parameters -• **goal**: [`Goal`](../interfaces/Goal.md) +• **userIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] -The goal object with updated properties. +An array of UUIDs of the users. #### Returns -`Promise`\<`void`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -A Promise that resolves when the goal has been updated. +A Promise that resolves to an array of room IDs. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoal`](DatabaseAdapter.md#updategoal) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipants`](DatabaseAdapter.md#getroomsforparticipants) #### Defined in -[core/src/adapters/postgres.ts:437](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L437) +[packages/core/src/adapters/postgres.ts:797](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L797) ---- +*** -### updateGoalStatus() +### getActorDetails() -> **updateGoalStatus**(`params`): `Promise`\<`void`\> +> **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> -Updates the status of a specific goal. +Retrieves details of actors in a given room. #### Parameters • **params** -An object containing the goalId and the new status. - -• **params.goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +An object containing the roomId to search for actors. -• **params.status**: [`GoalStatus`](../enumerations/GoalStatus.md) +• **params.roomId**: `string` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> -A Promise that resolves when the goal status has been updated. +A Promise that resolves to an array of Actor objects. #### Overrides -[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoalStatus`](DatabaseAdapter.md#updategoalstatus) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getActorDetails`](DatabaseAdapter.md#getactordetails) #### Defined in -[core/src/adapters/postgres.ts:713](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L713) +[packages/core/src/adapters/postgres.ts:810](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/postgres.ts#L810) diff --git a/docs/api/classes/SqlJsDatabaseAdapter.md b/docs/api/classes/SqlJsDatabaseAdapter.md deleted file mode 100644 index 01aab900bf..0000000000 --- a/docs/api/classes/SqlJsDatabaseAdapter.md +++ /dev/null @@ -1,807 +0,0 @@ ---- -id: "SqlJsDatabaseAdapter" -title: "Class: SqlJsDatabaseAdapter" -sidebar_label: "SqlJsDatabaseAdapter" -sidebar_position: 0 -custom_edit_url: null ---- - -An abstract class representing a database adapter for managing various entities -like accounts, memories, actors, goals, and rooms. - -## Hierarchy - -- [`DatabaseAdapter`](DatabaseAdapter.md) - - ↳ **`SqlJsDatabaseAdapter`** - -## Constructors - -### constructor - -• **new SqlJsDatabaseAdapter**(`db`): [`SqlJsDatabaseAdapter`](SqlJsDatabaseAdapter.md) - -#### Parameters - -| Name | Type | -| :--- | :--------- | -| `db` | `Database` | - -#### Returns - -[`SqlJsDatabaseAdapter`](SqlJsDatabaseAdapter.md) - -#### Overrides - -[DatabaseAdapter](DatabaseAdapter.md).[constructor](DatabaseAdapter.md#constructor) - -## Properties - -### db - -• **db**: `Database` - -## Methods - -### addParticipant - -▸ **addParticipant**(`user_id`, `room_id`): `Promise`\<`boolean`\> - -Adds a user as a participant to a specific room. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :---------------------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user to add as a participant. | -| `room_id` | \`$\{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) - ---- - -### countMemories - -▸ **countMemories**(`room_id`, `unique?`, `tableName?`): `Promise`\<`number`\> - -Counts the number of memories in a specific room. - -#### Parameters - -| Name | Type | Default value | Description | -| :---------- | :--------------------------------------------------------- | :------------ | :------------------------------------------------ | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | `undefined` | 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) - ---- - -### createAccount - -▸ **createAccount**(`account`): `Promise`\<`boolean`\> - -Creates a new account in the database. - -#### Parameters - -| Name | Type | Description | -| :-------- | :------------------------------------ | :---------------------------- | -| `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) - ---- - -### createGoal - -▸ **createGoal**(`goal`): `Promise`\<`void`\> - -Creates a new goal in the database. - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------ | :------------------------- | -| `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) - ---- - -### createMemory - -▸ **createMemory**(`memory`, `tableName`): `Promise`\<`void`\> - -Creates a new memory in the database. - -#### Parameters - -| Name | Type | Description | -| :---------- | :---------------------------------- | :------------------------------------------- | -| `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) - ---- - -### createRelationship - -▸ **createRelationship**(`params`): `Promise`\<`boolean`\> - -Creates a new relationship between two users. - -#### Parameters - -| Name | Type | Description | -| :------------- | :--------------------------------------------------------- | :----------------------------------------------------------------- | -| `params` | `Object` | 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) - ---- - -### createRoom - -▸ **createRoom**(`room_id?`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> - -Creates a new room with an optional specified ID. - -#### Parameters - -| Name | Type | Description | -| :--------- | :--------------------------------------------------------- | :--------------------------------------- | -| `room_id?` | \`$\{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) - ---- - -### getAccountById - -▸ **getAccountById**(`user_id`): `Promise`\<`null` \| [`Account`](../interfaces/Account.md)\> - -Retrieves an account by its ID. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :---------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user account to retrieve. | - -#### Returns - -`Promise`\<`null` \| [`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) - ---- - -### getActorDetails - -▸ **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> - -Retrieves details of actors in a given room. - -#### Parameters - -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `params` | `Object` | An object containing the room_id to search for actors. | -| `params.room_id` | \`$\{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) - ---- - -### getCachedEmbeddings - -▸ **getCachedEmbeddings**(`opts`): `Promise`\<\{ `embedding`: `number`[] ; `levenshtein_score`: `number` }[]\> - -Retrieves cached embeddings based on the specified query parameters. - -#### Parameters - -| Name | Type | Description | -| :-------------------------- | :------- | :----------------------------------------------------------- | -| `opts` | `Object` | An object containing parameters for the embedding retrieval. | -| `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`\<\{ `embedding`: `number`[] ; `levenshtein_score`: `number` }[]\> - -A Promise that resolves to an array of objects containing embeddings and levenshtein scores. - -#### Overrides - -[DatabaseAdapter](DatabaseAdapter.md).[getCachedEmbeddings](DatabaseAdapter.md#getcachedembeddings) - ---- - -### getGoals - -▸ **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> - -Retrieves goals based on specified parameters. - -#### Parameters - -| Name | Type | Description | -| :----------------------- | :------------------------------------------------------------------- | :-------------------------------------------------- | -| `params` | `Object` | An object containing parameters for goal retrieval. | -| `params.count?` | `number` | - | -| `params.onlyInProgress?` | `boolean` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.user_id?` | `null` \| \`$\{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) - ---- - -### getMemories - -▸ **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Retrieves memories based on the specified parameters. - -#### Parameters - -| Name | Type | Description | -| :----------------- | :--------------------------------------------------------- | :-------------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the memory retrieval. | -| `params.count?` | `number` | - | -| `params.room_id` | \`$\{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).[getMemories](DatabaseAdapter.md#getmemories) - ---- - -### getParticipantsForAccount - -▸ **getParticipantsForAccount**(`user_id`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> - -Retrieves participants associated with a specific account. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :----------------------- | -| `user_id` | \`$\{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) - ---- - -### getParticipantsForRoom - -▸ **getParticipantsForRoom**(`room_id`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> - -Retrieves participants for a specific room. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :------------------------------------------------------- | -| `room_id` | \`$\{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) - ---- - -### getRelationship - -▸ **getRelationship**(`params`): `Promise`\<`null` \| [`Relationship`](../interfaces/Relationship.md)\> - -Retrieves a relationship between two users if it exists. - -#### Parameters - -| Name | Type | Description | -| :------------- | :--------------------------------------------------------- | :----------------------------------------------------------------- | -| `params` | `Object` | 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`\<`null` \| [`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) - ---- - -### getRelationships - -▸ **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> - -Retrieves all relationships for a specific user. - -#### Parameters - -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :----------------------------------------- | -| `params` | `Object` | An object containing the UUID of the user. | -| `params.user_id` | \`$\{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) - ---- - -### getRoom - -▸ **getRoom**(`room_id`): `Promise`\<`null` \| \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> - -Retrieves the room ID for a given room, if it exists. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------- | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room to retrieve. | - -#### Returns - -`Promise`\<`null` \| \`$\{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) - ---- - -### getRoomsForParticipant - -▸ **getRoomsForParticipant**(`user_id`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> - -Retrieves room IDs for which a specific user is a participant. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------- | -| `user_id` | \`$\{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) - ---- - -### getRoomsForParticipants - -▸ **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> - -Retrieves room IDs for which specific users are participants. - -#### Parameters - -| Name | Type | Description | -| :-------- | :----------------------------------------------------------- | :------------------------------ | -| `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) - ---- - -### log - -▸ **log**(`params`): `Promise`\<`void`\> - -Logs an event or action with the specified details. - -#### Parameters - -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the log entry. | -| `params.body` | `Object` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.type` | `string` | - | -| `params.user_id` | \`$\{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) - ---- - -### removeAllGoals - -▸ **removeAllGoals**(`room_id`): `Promise`\<`void`\> - -Removes all goals associated with a specific room. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------------------------- | -| `room_id` | \`$\{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) - ---- - -### removeAllMemories - -▸ **removeAllMemories**(`room_id`, `tableName`): `Promise`\<`void`\> - -Removes all memories associated with a specific room. - -#### Parameters - -| Name | Type | Description | -| :---------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `room_id` | \`$\{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) - ---- - -### removeGoal - -▸ **removeGoal**(`goalId`): `Promise`\<`void`\> - -Removes a specific goal from the database. - -#### Parameters - -| Name | Type | Description | -| :------- | :--------------------------------------------------------- | :------------------------------ | -| `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) - ---- - -### removeMemory - -▸ **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> - -Removes a specific memory from the database. - -#### Parameters - -| Name | Type | Description | -| :---------- | :--------------------------------------------------------- | :------------------------------------------------- | -| `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) - ---- - -### removeParticipant - -▸ **removeParticipant**(`user_id`, `room_id`): `Promise`\<`boolean`\> - -Removes a user as a participant from a specific room. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user to remove as a participant. | -| `room_id` | \`$\{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) - ---- - -### removeRoom - -▸ **removeRoom**(`room_id`): `Promise`\<`void`\> - -Removes a specific room from the database. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :------------------------------ | -| `room_id` | \`$\{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) - ---- - -### searchMemories - -▸ **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Searches for memories based on embeddings and other specified parameters. - -#### Parameters - -| Name | Type | Description | -| :----------------------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the memory search. | -| `params.embedding` | `number`[] | - | -| `params.match_count` | `number` | - | -| `params.match_threshold` | `number` | - | -| `params.room_id` | \`$\{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) - ---- - -### searchMemoriesByEmbedding - -▸ **searchMemoriesByEmbedding**(`_embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Searches for memories by embedding and other specified parameters. - -#### Parameters - -| Name | Type | Description | -| :------------------------ | :--------------------------------------------------------- | :------------------------------------ | -| `_embedding` | `number`[] | The embedding vector to search with. | -| `params` | `Object` | Additional parameters for the search. | -| `params.count?` | `number` | - | -| `params.match_threshold?` | `number` | - | -| `params.room_id?` | \`$\{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) - ---- - -### updateGoal - -▸ **updateGoal**(`goal`): `Promise`\<`void`\> - -Updates a specific goal in the database. - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------ | :--------------------------------------- | -| `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) - ---- - -### updateGoalStatus - -▸ **updateGoalStatus**(`params`): `Promise`\<`void`\> - -Updates the status of a specific goal. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :--------------------------------------------------------- | :-------------------------------------------------- | -| `params` | `Object` | An object containing the goalId and the new status. | -| `params.goalId` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.status` | [`GoalStatus`](../enums/GoalStatus.md) | - | - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the goal status has been updated. - -#### Overrides - -[DatabaseAdapter](DatabaseAdapter.md).[updateGoalStatus](DatabaseAdapter.md#updategoalstatus) diff --git a/docs/api/classes/SqliteDatabaseAdapter.md b/docs/api/classes/SqliteDatabaseAdapter.md index 2b6db4d44e..7ea4cc162c 100644 --- a/docs/api/classes/SqliteDatabaseAdapter.md +++ b/docs/api/classes/SqliteDatabaseAdapter.md @@ -1,31 +1,21 @@ ---- -id: "SqliteDatabaseAdapter" -title: "Class: SqliteDatabaseAdapter" -sidebar_label: "SqliteDatabaseAdapter" -sidebar_position: 0 -custom_edit_url: null ---- +# Class: SqliteDatabaseAdapter An abstract class representing a database adapter for managing various entities like accounts, memories, actors, goals, and rooms. -## Hierarchy +## Extends - [`DatabaseAdapter`](DatabaseAdapter.md) - ↳ **`SqliteDatabaseAdapter`** - ## Constructors -### constructor +### new SqliteDatabaseAdapter() -• **new SqliteDatabaseAdapter**(`db`): [`SqliteDatabaseAdapter`](SqliteDatabaseAdapter.md) +> **new SqliteDatabaseAdapter**(`db`): [`SqliteDatabaseAdapter`](SqliteDatabaseAdapter.md) #### Parameters -| Name | Type | -| :--- | :--------- | -| `db` | `Database` | +• **db**: `Database` #### Returns @@ -33,312 +23,401 @@ like accounts, memories, actors, goals, and rooms. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[constructor](DatabaseAdapter.md#constructor) +[`DatabaseAdapter`](DatabaseAdapter.md).[`constructor`](DatabaseAdapter.md#constructors) + +#### Defined in + +[packages/core/src/adapters/sqlite.ts:70](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L70) ## Properties ### db -• **db**: `Database` +> **db**: `any` + +The database instance. + +#### Inherited from + +[`DatabaseAdapter`](DatabaseAdapter.md).[`db`](DatabaseAdapter.md#db) + +#### Defined in + +[packages/core/src/core/database.ts:21](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/database.ts#L21) ## Methods -### addParticipant +### getRoom() -▸ **addParticipant**(`user_id`, `room_id`): `Promise`\<`boolean`\> +> **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> -Adds a user as a participant to a specific room. +Retrieves the room ID for a given room, if it exists. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :---------------------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user to add as a participant. | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room to which the user will be added. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to retrieve. #### Returns -`Promise`\<`boolean`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> -A Promise that resolves to a boolean indicating success or failure. +A Promise that resolves to the room ID or null if not found. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[addParticipant](DatabaseAdapter.md#addparticipant) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoom`](DatabaseAdapter.md#getroom) ---- +#### Defined in -### countMemories +[packages/core/src/adapters/sqlite.ts:22](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L22) -▸ **countMemories**(`room_id`, `unique?`, `tableName?`): `Promise`\<`number`\> +*** -Counts the number of memories in a specific room. +### getParticipantsForAccount() + +> **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> + +Retrieves participants associated with a specific account. #### Parameters -| Name | Type | Default value | Description | -| :---------- | :--------------------------------------------------------- | :------------ | :------------------------------------------------ | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | `undefined` | 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. | +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the account. #### Returns -`Promise`\<`number`\> +`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> -A Promise that resolves to the number of memories. +A Promise that resolves to an array of Participant objects. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[countMemories](DatabaseAdapter.md#countmemories) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForAccount`](DatabaseAdapter.md#getparticipantsforaccount) ---- +#### Defined in -### createAccount +[packages/core/src/adapters/sqlite.ts:30](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L30) -▸ **createAccount**(`account`): `Promise`\<`boolean`\> +*** -Creates a new account in the database. +### getParticipantsForRoom() + +> **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves participants for a specific room. #### Parameters -| Name | Type | Description | -| :-------- | :------------------------------------ | :---------------------------- | -| `account` | [`Account`](../interfaces/Account.md) | The account object to create. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room for which to retrieve participants. #### Returns -`Promise`\<`boolean`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -A Promise that resolves when the account creation is complete. +A Promise that resolves to an array of UUIDs representing the participants. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[createAccount](DatabaseAdapter.md#createaccount) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForRoom`](DatabaseAdapter.md#getparticipantsforroom) ---- +#### Defined in -### createGoal +[packages/core/src/adapters/sqlite.ts:40](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L40) -▸ **createGoal**(`goal`): `Promise`\<`void`\> +*** -Creates a new goal in the database. +### getParticipantUserState() + +> **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> #### Parameters -| Name | Type | Description | -| :----- | :------------------------------ | :------------------------- | -| `goal` | [`Goal`](../interfaces/Goal.md) | The goal object to create. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -#### Returns +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -`Promise`\<`void`\> +#### Returns -A Promise that resolves when the goal has been created. +`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[createGoal](DatabaseAdapter.md#creategoal) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantUserState`](DatabaseAdapter.md#getparticipantuserstate) ---- +#### Defined in -### createMemory +[packages/core/src/adapters/sqlite.ts:46](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L46) -▸ **createMemory**(`memory`, `tableName`): `Promise`\<`void`\> +*** -Creates a new memory in the database. +### setParticipantUserState() + +> **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> #### Parameters -| Name | Type | Description | -| :---------- | :---------------------------------- | :------------------------------------------- | -| `memory` | [`Memory`](../interfaces/Memory.md) | The memory object to create. | -| `tableName` | `string` | The table where the memory should be stored. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **state**: `"FOLLOWED"` \| `"MUTED"` #### Returns `Promise`\<`void`\> -A Promise that resolves when the memory has been created. - #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[createMemory](DatabaseAdapter.md#creatememory) +[`DatabaseAdapter`](DatabaseAdapter.md).[`setParticipantUserState`](DatabaseAdapter.md#setparticipantuserstate) ---- +#### Defined in -### createRelationship +[packages/core/src/adapters/sqlite.ts:59](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L59) -▸ **createRelationship**(`params`): `Promise`\<`boolean`\> +*** -Creates a new relationship between two users. +### getAccountById() + +> **getAccountById**(`userId`): `Promise`\<[`Account`](../interfaces/Account.md)\> + +Retrieves an account by its ID. #### Parameters -| Name | Type | Description | -| :------------- | :--------------------------------------------------------- | :----------------------------------------------------------------- | -| `params` | `Object` | 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}\` | - | +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user account to retrieve. #### Returns -`Promise`\<`boolean`\> +`Promise`\<[`Account`](../interfaces/Account.md)\> -A Promise that resolves to a boolean indicating success or failure of the creation. +A Promise that resolves to the Account object or null if not found. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[createRelationship](DatabaseAdapter.md#createrelationship) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getAccountById`](DatabaseAdapter.md#getaccountbyid) ---- +#### Defined in -### createRoom +[packages/core/src/adapters/sqlite.ts:88](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L88) -▸ **createRoom**(`room_id?`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> +*** -Creates a new room with an optional specified ID. +### createAccount() + +> **createAccount**(`account`): `Promise`\<`boolean`\> + +Creates a new account in the database. #### Parameters -| Name | Type | Description | -| :--------- | :--------------------------------------------------------- | :--------------------------------------- | -| `room_id?` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | Optional UUID to assign to the new room. | +• **account**: [`Account`](../interfaces/Account.md) + +The account object to create. #### Returns -`Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> +`Promise`\<`boolean`\> -A Promise that resolves to the UUID of the created room. +A Promise that resolves when the account creation is complete. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[createRoom](DatabaseAdapter.md#createroom) +[`DatabaseAdapter`](DatabaseAdapter.md).[`createAccount`](DatabaseAdapter.md#createaccount) ---- +#### Defined in -### getAccountById +[packages/core/src/adapters/sqlite.ts:102](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L102) -▸ **getAccountById**(`user_id`): `Promise`\<`null` \| [`Account`](../interfaces/Account.md)\> +*** -Retrieves an account by its ID. +### getActorDetails() + +> **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +Retrieves details of actors in a given room. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :---------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user account to retrieve. | +• **params** + +An object containing the roomId to search for actors. + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`null` \| [`Account`](../interfaces/Account.md)\> +`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> -A Promise that resolves to the Account object or null if not found. +A Promise that resolves to an array of Actor objects. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getAccountById](DatabaseAdapter.md#getaccountbyid) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getActorDetails`](DatabaseAdapter.md#getactordetails) ---- +#### Defined in -### getActorDetails +[packages/core/src/adapters/sqlite.ts:123](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L123) -▸ **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> +*** -Retrieves details of actors in a given room. +### getMemoriesByRoomIds() + +> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> #### Parameters -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `params` | `Object` | An object containing the room_id to search for actors. | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | +• **params** + +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] + +• **params.tableName**: `string` + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -A Promise that resolves to an array of Actor objects. +#### Overrides + +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoriesByRoomIds`](DatabaseAdapter.md#getmemoriesbyroomids) + +#### Defined in + +[packages/core/src/adapters/sqlite.ts:150](https://github.com/ai16z/eliza/blob/main/packages/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).[getActorDetails](DatabaseAdapter.md#getactordetails) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoryById`](DatabaseAdapter.md#getmemorybyid) ---- +#### Defined in -### getCachedEmbeddings +[packages/core/src/adapters/sqlite.ts:179](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L179) -▸ **getCachedEmbeddings**(`opts`): `Promise`\<\{ `embedding`: `number`[] ; `levenshtein_score`: `number` }[]\> +*** -Retrieves cached embeddings based on the specified query parameters. +### createMemory() + +> **createMemory**(`memory`, `tableName`): `Promise`\<`void`\> + +Creates a new memory in the database. #### Parameters -| Name | Type | Description | -| :-------------------------- | :------- | :----------------------------------------------------------- | -| `opts` | `Object` | An object containing parameters for the embedding retrieval. | -| `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` | - | +• **memory**: [`Memory`](../interfaces/Memory.md) + +The memory object to create. + +• **tableName**: `string` + +The table where the memory should be stored. #### Returns -`Promise`\<\{ `embedding`: `number`[] ; `levenshtein_score`: `number` }[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of objects containing embeddings and levenshtein scores. +A Promise that resolves when the memory has been created. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getCachedEmbeddings](DatabaseAdapter.md#getcachedembeddings) +[`DatabaseAdapter`](DatabaseAdapter.md).[`createMemory`](DatabaseAdapter.md#creatememory) ---- +#### Defined in -### getGoals +[packages/core/src/adapters/sqlite.ts:195](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L195) -▸ **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> +*** -Retrieves goals based on specified parameters. +### searchMemories() + +> **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories based on embeddings and other specified parameters. #### Parameters -| Name | Type | Description | -| :----------------------- | :------------------------------------------------------------------- | :-------------------------------------------------- | -| `params` | `Object` | An object containing parameters for goal retrieval. | -| `params.count?` | `number` | - | -| `params.onlyInProgress?` | `boolean` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.user_id?` | `null` \| \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | +• **params** + +An object containing parameters for the memory search. + +• **params.tableName**: `string` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.embedding**: `number`[] + +• **params.match\_threshold**: `number` + +• **params.match\_count**: `number` + +• **params.unique**: `boolean` #### Returns -`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -A Promise that resolves to an array of Goal objects. +A Promise that resolves to an array of Memory objects. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getGoals](DatabaseAdapter.md#getgoals) +[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemories`](DatabaseAdapter.md#searchmemories) ---- +#### Defined in -### getMemories +[packages/core/src/adapters/sqlite.ts:235](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L235) -▸ **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +*** -Retrieves memories based on the specified parameters. +### searchMemoriesByEmbedding() + +> **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Searches for memories by embedding and other specified parameters. #### Parameters -| Name | Type | Description | -| :----------------- | :--------------------------------------------------------- | :-------------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the memory retrieval. | -| `params.count?` | `number` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.tableName` | `string` | - | -| `params.unique?` | `boolean` | - | +• **embedding**: `number`[] + +The embedding vector to search with. + +• **params** + +Additional parameters for the search. + +• **params.match\_threshold?**: `number` + +• **params.count?**: `number` + +• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.unique?**: `boolean` + +• **params.tableName**: `string` #### Returns @@ -348,269 +427,365 @@ A Promise that resolves to an array of Memory objects. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getMemories](DatabaseAdapter.md#getmemories) +[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemoriesByEmbedding`](DatabaseAdapter.md#searchmemoriesbyembedding) ---- +#### Defined in -### getParticipantsForAccount +[packages/core/src/adapters/sqlite.ts:281](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L281) -▸ **getParticipantsForAccount**(`user_id`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> +*** -Retrieves participants associated with a specific account. +### getCachedEmbeddings() + +> **getCachedEmbeddings**(`opts`): `Promise`\<`object`[]\> + +Retrieves cached embeddings based on the specified query parameters. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :----------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the account. | +• **opts** + +• **opts.query\_table\_name**: `string` + +• **opts.query\_threshold**: `number` + +• **opts.query\_input**: `string` + +• **opts.query\_field\_name**: `string` + +• **opts.query\_field\_sub\_name**: `string` + +• **opts.query\_match\_count**: `number` #### Returns -`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> +`Promise`\<`object`[]\> -A Promise that resolves to an array of Participant objects. +A Promise that resolves to an array of objects containing embeddings and levenshtein scores. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getParticipantsForAccount](DatabaseAdapter.md#getparticipantsforaccount) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getCachedEmbeddings`](DatabaseAdapter.md#getcachedembeddings) ---- +#### Defined in -### getParticipantsForRoom +[packages/core/src/adapters/sqlite.ts:335](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L335) -▸ **getParticipantsForRoom**(`room_id`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +*** -Retrieves participants for a specific room. +### updateGoalStatus() + +> **updateGoalStatus**(`params`): `Promise`\<`void`\> + +Updates the status of a specific goal. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :------------------------------------------------------- | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room for which to retrieve participants. | +• **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`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of UUIDs representing the participants. +A Promise that resolves when the goal status has been updated. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getParticipantsForRoom](DatabaseAdapter.md#getparticipantsforroom) +[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoalStatus`](DatabaseAdapter.md#updategoalstatus) ---- +#### Defined in -### getRelationship +[packages/core/src/adapters/sqlite.ts:371](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L371) -▸ **getRelationship**(`params`): `Promise`\<`null` \| [`Relationship`](../interfaces/Relationship.md)\> +*** -Retrieves a relationship between two users if it exists. +### log() + +> **log**(`params`): `Promise`\<`void`\> + +Logs an event or action with the specified details. #### Parameters -| Name | Type | Description | -| :------------- | :--------------------------------------------------------- | :----------------------------------------------------------------- | -| `params` | `Object` | 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}\` | - | +• **params** + +An object containing parameters for the log entry. + +• **params.body** + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.type**: `string` #### Returns -`Promise`\<`null` \| [`Relationship`](../interfaces/Relationship.md)\> +`Promise`\<`void`\> -A Promise that resolves to the Relationship object or null if not found. +A Promise that resolves when the log entry has been saved. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getRelationship](DatabaseAdapter.md#getrelationship) +[`DatabaseAdapter`](DatabaseAdapter.md).[`log`](DatabaseAdapter.md#log) ---- +#### Defined in -### getRelationships +[packages/core/src/adapters/sqlite.ts:379](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L379) -▸ **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> +*** -Retrieves all relationships for a specific user. +### getMemories() + +> **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> + +Retrieves memories based on the specified parameters. #### Parameters -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :----------------------------------------- | -| `params` | `Object` | An object containing the UUID of the user. | -| `params.user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | +• **params** + +An object containing parameters for the memory retrieval. + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.count?**: `number` + +• **params.unique?**: `boolean` + +• **params.tableName**: `string` + +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.start?**: `number` + +• **params.end?**: `number` #### Returns -`Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> +`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> -A Promise that resolves to an array of Relationship objects. +A Promise that resolves to an array of Memory objects. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getRelationships](DatabaseAdapter.md#getrelationships) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemories`](DatabaseAdapter.md#getmemories) ---- +#### Defined in -### getRoom +[packages/core/src/adapters/sqlite.ts:397](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L397) -▸ **getRoom**(`room_id`): `Promise`\<`null` \| \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> +*** -Retrieves the room ID for a given room, if it exists. +### removeMemory() + +> **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> + +Removes a specific memory from the database. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------- | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room to retrieve. | +• **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`\<`null` \| \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> +`Promise`\<`void`\> -A Promise that resolves to the room ID or null if not found. +A Promise that resolves when the memory has been removed. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getRoom](DatabaseAdapter.md#getroom) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeMemory`](DatabaseAdapter.md#removememory) ---- +#### Defined in -### getRoomsForParticipant +[packages/core/src/adapters/sqlite.ts:454](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L454) -▸ **getRoomsForParticipant**(`user_id`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +*** -Retrieves room IDs for which a specific user is a participant. +### removeAllMemories() + +> **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> + +Removes all memories associated with a specific room. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user. | +• **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`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +`Promise`\<`void`\> -A Promise that resolves to an array of room IDs. +A Promise that resolves when all memories have been removed. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getRoomsForParticipant](DatabaseAdapter.md#getroomsforparticipant) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllMemories`](DatabaseAdapter.md#removeallmemories) ---- +#### Defined in -### getRoomsForParticipants +[packages/core/src/adapters/sqlite.ts:459](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L459) -▸ **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +*** -Retrieves room IDs for which specific users are participants. +### countMemories() + +> **countMemories**(`roomId`, `unique`, `tableName`): `Promise`\<`number`\> + +Counts the number of memories in a specific room. #### Parameters -| Name | Type | Description | -| :-------- | :----------------------------------------------------------- | :------------------------------ | -| `userIds` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[] | An array of UUIDs of the users. | +• **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`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +`Promise`\<`number`\> -A Promise that resolves to an array of room IDs. +A Promise that resolves to the number of memories. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[getRoomsForParticipants](DatabaseAdapter.md#getroomsforparticipants) +[`DatabaseAdapter`](DatabaseAdapter.md).[`countMemories`](DatabaseAdapter.md#countmemories) ---- +#### Defined in -### log +[packages/core/src/adapters/sqlite.ts:464](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L464) -▸ **log**(`params`): `Promise`\<`void`\> +*** -Logs an event or action with the specified details. +### getGoals() + +> **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +Retrieves goals based on specified parameters. #### Parameters -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the log entry. | -| `params.body` | `Object` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.type` | `string` | - | -| `params.user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | +• **params** + +An object containing parameters for goal retrieval. + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.onlyInProgress?**: `boolean` + +• **params.count?**: `number` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> -A Promise that resolves when the log entry has been saved. +A Promise that resolves to an array of Goal objects. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[log](DatabaseAdapter.md#log) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getGoals`](DatabaseAdapter.md#getgoals) ---- +#### Defined in -### removeAllGoals +[packages/core/src/adapters/sqlite.ts:484](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L484) -▸ **removeAllGoals**(`room_id`): `Promise`\<`void`\> +*** -Removes all goals associated with a specific room. +### updateGoal() + +> **updateGoal**(`goal`): `Promise`\<`void`\> + +Updates a specific goal in the database. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------------------------- | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room whose goals should be removed. | +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object with updated properties. #### Returns `Promise`\<`void`\> -A Promise that resolves when all goals have been removed. +A Promise that resolves when the goal has been updated. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[removeAllGoals](DatabaseAdapter.md#removeallgoals) +[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoal`](DatabaseAdapter.md#updategoal) ---- +#### Defined in -### removeAllMemories +[packages/core/src/adapters/sqlite.ts:518](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L518) -▸ **removeAllMemories**(`room_id`, `tableName`): `Promise`\<`void`\> +*** -Removes all memories associated with a specific room. +### createGoal() + +> **createGoal**(`goal`): `Promise`\<`void`\> + +Creates a new goal in the database. #### Parameters -| Name | Type | Description | -| :---------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `room_id` | \`$\{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. | +• **goal**: [`Goal`](../interfaces/Goal.md) + +The goal object to create. #### Returns `Promise`\<`void`\> -A Promise that resolves when all memories have been removed. +A Promise that resolves when the goal has been created. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[removeAllMemories](DatabaseAdapter.md#removeallmemories) +[`DatabaseAdapter`](DatabaseAdapter.md).[`createGoal`](DatabaseAdapter.md#creategoal) + +#### Defined in ---- +[packages/core/src/adapters/sqlite.ts:531](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L531) -### removeGoal +*** -▸ **removeGoal**(`goalId`): `Promise`\<`void`\> +### removeGoal() + +> **removeGoal**(`goalId`): `Promise`\<`void`\> Removes a specific goal from the database. #### Parameters -| Name | Type | Description | -| :------- | :--------------------------------------------------------- | :------------------------------ | -| `goalId` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the goal to remove. | +• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the goal to remove. #### Returns @@ -620,71 +795,81 @@ A Promise that resolves when the goal has been removed. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[removeGoal](DatabaseAdapter.md#removegoal) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeGoal`](DatabaseAdapter.md#removegoal) ---- +#### Defined in -### removeMemory +[packages/core/src/adapters/sqlite.ts:546](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L546) -▸ **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> +*** -Removes a specific memory from the database. +### removeAllGoals() + +> **removeAllGoals**(`roomId`): `Promise`\<`void`\> + +Removes all goals associated with a specific room. #### Parameters -| Name | Type | Description | -| :---------- | :--------------------------------------------------------- | :------------------------------------------------- | -| `memoryId` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the memory to remove. | -| `tableName` | `string` | The table from which the memory should be removed. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room whose goals should be removed. #### Returns `Promise`\<`void`\> -A Promise that resolves when the memory has been removed. +A Promise that resolves when all goals have been removed. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[removeMemory](DatabaseAdapter.md#removememory) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllGoals`](DatabaseAdapter.md#removeallgoals) ---- +#### Defined in -### removeParticipant +[packages/core/src/adapters/sqlite.ts:551](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L551) -▸ **removeParticipant**(`user_id`, `room_id`): `Promise`\<`boolean`\> +*** -Removes a user as a participant from a specific room. +### createRoom() + +> **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> + +Creates a new room with an optional specified ID. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user to remove as a participant. | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room from which the user will be removed. | +• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +Optional UUID to assign to the new room. #### Returns -`Promise`\<`boolean`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> -A Promise that resolves to a boolean indicating success or failure. +A Promise that resolves to the UUID of the created room. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[removeParticipant](DatabaseAdapter.md#removeparticipant) +[`DatabaseAdapter`](DatabaseAdapter.md).[`createRoom`](DatabaseAdapter.md#createroom) ---- +#### Defined in -### removeRoom +[packages/core/src/adapters/sqlite.ts:556](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L556) -▸ **removeRoom**(`room_id`): `Promise`\<`void`\> +*** + +### removeRoom() + +> **removeRoom**(`roomId`): `Promise`\<`void`\> Removes a specific room from the database. #### Parameters -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :------------------------------ | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room to remove. | +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the room to remove. #### Returns @@ -694,114 +879,222 @@ A Promise that resolves when the room has been removed. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[removeRoom](DatabaseAdapter.md#removeroom) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeRoom`](DatabaseAdapter.md#removeroom) ---- +#### Defined in -### searchMemories +[packages/core/src/adapters/sqlite.ts:567](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L567) -▸ **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +*** -Searches for memories based on embeddings and other specified parameters. +### getRoomsForParticipant() + +> **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +Retrieves room IDs for which a specific user is a participant. #### Parameters -| Name | Type | Description | -| :----------------------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the memory search. | -| `params.embedding` | `number`[] | - | -| `params.match_count` | `number` | - | -| `params.match_threshold` | `number` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.tableName` | `string` | - | -| `params.unique` | `boolean` | - | +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +The UUID of the user. #### Returns -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -A Promise that resolves to an array of Memory objects. +A Promise that resolves to an array of room IDs. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[searchMemories](DatabaseAdapter.md#searchmemories) +[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipant`](DatabaseAdapter.md#getroomsforparticipant) ---- +#### Defined in -### searchMemoriesByEmbedding +[packages/core/src/adapters/sqlite.ts:572](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L572) -▸ **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> +*** -Searches for memories by embedding and other specified parameters. +### 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 + +[packages/core/src/adapters/sqlite.ts:578](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L578) + +*** + +### addParticipant() + +> **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +Adds a user as a participant to a specific room. #### Parameters -| Name | Type | Description | -| :------------------------ | :--------------------------------------------------------- | :------------------------------------ | -| `embedding` | `number`[] | The embedding vector to search with. | -| `params` | `Object` | Additional parameters for the search. | -| `params.count?` | `number` | - | -| `params.match_threshold?` | `number` | - | -| `params.room_id?` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.tableName` | `string` | - | -| `params.unique?` | `boolean` | - | +• **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`\<[`Memory`](../interfaces/Memory.md)[]\> +`Promise`\<`boolean`\> -A Promise that resolves to an array of Memory objects. +A Promise that resolves to a boolean indicating success or failure. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[searchMemoriesByEmbedding](DatabaseAdapter.md#searchmemoriesbyembedding) +[`DatabaseAdapter`](DatabaseAdapter.md).[`addParticipant`](DatabaseAdapter.md#addparticipant) ---- +#### Defined in -### updateGoal +[packages/core/src/adapters/sqlite.ts:591](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L591) -▸ **updateGoal**(`goal`): `Promise`\<`void`\> +*** -Updates a specific goal in the database. +### removeParticipant() + +> **removeParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> + +Removes a user as a participant from a specific room. #### Parameters -| Name | Type | Description | -| :----- | :------------------------------ | :--------------------------------------- | -| `goal` | [`Goal`](../interfaces/Goal.md) | The goal object with updated properties. | +• **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`\<`void`\> +`Promise`\<`boolean`\> -A Promise that resolves when the goal has been updated. +A Promise that resolves to a boolean indicating success or failure. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[updateGoal](DatabaseAdapter.md#updategoal) +[`DatabaseAdapter`](DatabaseAdapter.md).[`removeParticipant`](DatabaseAdapter.md#removeparticipant) ---- +#### Defined in -### updateGoalStatus +[packages/core/src/adapters/sqlite.ts:603](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L603) -▸ **updateGoalStatus**(`params`): `Promise`\<`void`\> +*** -Updates the status of a specific goal. +### createRelationship() + +> **createRelationship**(`params`): `Promise`\<`boolean`\> + +Creates a new relationship between two users. #### Parameters -| Name | Type | Description | -| :-------------- | :--------------------------------------------------------- | :-------------------------------------------------- | -| `params` | `Object` | An object containing the goalId and the new status. | -| `params.goalId` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.status` | [`GoalStatus`](../enums/GoalStatus.md) | - | +• **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`\<`void`\> +`Promise`\<`boolean`\> -A Promise that resolves when the goal status has been updated. +A Promise that resolves to a boolean indicating success or failure of the creation. #### Overrides -[DatabaseAdapter](DatabaseAdapter.md).[updateGoalStatus](DatabaseAdapter.md#updategoalstatus) +[`DatabaseAdapter`](DatabaseAdapter.md).[`createRelationship`](DatabaseAdapter.md#createrelationship) + +#### Defined in + +[packages/core/src/adapters/sqlite.ts:615](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L615) + +*** + +### 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 + +[packages/core/src/adapters/sqlite.ts:630](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L630) + +*** + +### 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 + +[packages/core/src/adapters/sqlite.ts:648](https://github.com/ai16z/eliza/blob/main/packages/core/src/adapters/sqlite.ts#L648) diff --git a/docs/api/classes/SupabaseDatabaseAdapter.md b/docs/api/classes/SupabaseDatabaseAdapter.md deleted file mode 100644 index f380b7f80d..0000000000 --- a/docs/api/classes/SupabaseDatabaseAdapter.md +++ /dev/null @@ -1,808 +0,0 @@ ---- -id: "SupabaseDatabaseAdapter" -title: "Class: SupabaseDatabaseAdapter" -sidebar_label: "SupabaseDatabaseAdapter" -sidebar_position: 0 -custom_edit_url: null ---- - -An abstract class representing a database adapter for managing various entities -like accounts, memories, actors, goals, and rooms. - -## Hierarchy - -- [`DatabaseAdapter`](DatabaseAdapter.md) - - ↳ **`SupabaseDatabaseAdapter`** - -## Constructors - -### constructor - -• **new SupabaseDatabaseAdapter**(`supabaseUrl`, `supabaseKey`): [`SupabaseDatabaseAdapter`](SupabaseDatabaseAdapter.md) - -#### Parameters - -| Name | Type | -| :------------ | :------- | -| `supabaseUrl` | `string` | -| `supabaseKey` | `string` | - -#### Returns - -[`SupabaseDatabaseAdapter`](SupabaseDatabaseAdapter.md) - -#### Overrides - -[DatabaseAdapter](DatabaseAdapter.md).[constructor](DatabaseAdapter.md#constructor) - -## Properties - -### supabase - -• **supabase**: `default`\<`any`, `"public"`, `any`\> - -## Methods - -### addParticipant - -▸ **addParticipant**(`user_id`, `room_id`): `Promise`\<`boolean`\> - -Adds a user as a participant to a specific room. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :---------------------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user to add as a participant. | -| `room_id` | \`$\{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) - ---- - -### countMemories - -▸ **countMemories**(`room_id`, `unique?`, `tableName`): `Promise`\<`number`\> - -Counts the number of memories in a specific room. - -#### Parameters - -| Name | Type | Default value | Description | -| :---------- | :--------------------------------------------------------- | :------------ | :------------------------------------------------ | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | `undefined` | The UUID of the room for which to count memories. | -| `unique` | `boolean` | `true` | Specifies whether to count only unique memories. | -| `tableName` | `string` | `undefined` | 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) - ---- - -### createAccount - -▸ **createAccount**(`account`): `Promise`\<`boolean`\> - -Creates a new account in the database. - -#### Parameters - -| Name | Type | Description | -| :-------- | :------------------------------------ | :---------------------------- | -| `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) - ---- - -### createGoal - -▸ **createGoal**(`goal`): `Promise`\<`void`\> - -Creates a new goal in the database. - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------ | :------------------------- | -| `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) - ---- - -### createMemory - -▸ **createMemory**(`memory`, `tableName`, `unique?`): `Promise`\<`void`\> - -Creates a new memory in the database. - -#### Parameters - -| Name | Type | Default value | Description | -| :---------- | :---------------------------------- | :------------ | :------------------------------------------- | -| `memory` | [`Memory`](../interfaces/Memory.md) | `undefined` | The memory object to create. | -| `tableName` | `string` | `undefined` | The table where the memory should be stored. | -| `unique` | `boolean` | `false` | Indicates if the memory should be unique. | - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the memory has been created. - -#### Overrides - -[DatabaseAdapter](DatabaseAdapter.md).[createMemory](DatabaseAdapter.md#creatememory) - ---- - -### createRelationship - -▸ **createRelationship**(`params`): `Promise`\<`boolean`\> - -Creates a new relationship between two users. - -#### Parameters - -| Name | Type | Description | -| :------------- | :--------------------------------------------------------- | :----------------------------------------------------------------- | -| `params` | `Object` | 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) - ---- - -### createRoom - -▸ **createRoom**(`room_id?`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> - -Creates a new room with an optional specified ID. - -#### Parameters - -| Name | Type | Description | -| :--------- | :--------------------------------------------------------- | :--------------------------------------- | -| `room_id?` | \`$\{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) - ---- - -### getAccountById - -▸ **getAccountById**(`user_id`): `Promise`\<`null` \| [`Account`](../interfaces/Account.md)\> - -Retrieves an account by its ID. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :---------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user account to retrieve. | - -#### Returns - -`Promise`\<`null` \| [`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) - ---- - -### getActorDetails - -▸ **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> - -Retrieves details of actors in a given room. - -#### Parameters - -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `params` | `Object` | An object containing the room_id to search for actors. | -| `params.room_id` | \`$\{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) - ---- - -### getCachedEmbeddings - -▸ **getCachedEmbeddings**(`opts`): `Promise`\<\{ `embedding`: `number`[] ; `levenshtein_score`: `number` }[]\> - -Retrieves cached embeddings based on the specified query parameters. - -#### Parameters - -| Name | Type | Description | -| :-------------------------- | :------- | :----------------------------------------------------------- | -| `opts` | `Object` | An object containing parameters for the embedding retrieval. | -| `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`\<\{ `embedding`: `number`[] ; `levenshtein_score`: `number` }[]\> - -A Promise that resolves to an array of objects containing embeddings and levenshtein scores. - -#### Overrides - -[DatabaseAdapter](DatabaseAdapter.md).[getCachedEmbeddings](DatabaseAdapter.md#getcachedembeddings) - ---- - -### getGoals - -▸ **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> - -Retrieves goals based on specified parameters. - -#### Parameters - -| Name | Type | Description | -| :----------------------- | :------------------------------------------------------------------- | :-------------------------------------------------- | -| `params` | `Object` | An object containing parameters for goal retrieval. | -| `params.count?` | `number` | - | -| `params.onlyInProgress?` | `boolean` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.user_id?` | `null` \| \`$\{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) - ---- - -### getMemories - -▸ **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Retrieves memories based on the specified parameters. - -#### Parameters - -| Name | Type | Description | -| :----------------- | :--------------------------------------------------------- | :-------------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the memory retrieval. | -| `params.count?` | `number` | - | -| `params.room_id` | \`$\{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).[getMemories](DatabaseAdapter.md#getmemories) - ---- - -### getParticipantsForAccount - -▸ **getParticipantsForAccount**(`user_id`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> - -Retrieves participants associated with a specific account. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :----------------------- | -| `user_id` | \`$\{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) - ---- - -### getParticipantsForRoom - -▸ **getParticipantsForRoom**(`room_id`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> - -Retrieves participants for a specific room. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :------------------------------------------------------- | -| `room_id` | \`$\{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) - ---- - -### getRelationship - -▸ **getRelationship**(`params`): `Promise`\<`null` \| [`Relationship`](../interfaces/Relationship.md)\> - -Retrieves a relationship between two users if it exists. - -#### Parameters - -| Name | Type | Description | -| :------------- | :--------------------------------------------------------- | :----------------------------------------------------------------- | -| `params` | `Object` | 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`\<`null` \| [`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) - ---- - -### getRelationships - -▸ **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> - -Retrieves all relationships for a specific user. - -#### Parameters - -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :----------------------------------------- | -| `params` | `Object` | An object containing the UUID of the user. | -| `params.user_id` | \`$\{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) - ---- - -### getRoom - -▸ **getRoom**(`room_id`): `Promise`\<`null` \| \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`\> - -Retrieves the room ID for a given room, if it exists. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------- | -| `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the room to retrieve. | - -#### Returns - -`Promise`\<`null` \| \`$\{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) - ---- - -### getRoomsForParticipant - -▸ **getRoomsForParticipant**(`user_id`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> - -Retrieves room IDs for which a specific user is a participant. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------- | -| `user_id` | \`$\{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) - ---- - -### getRoomsForParticipants - -▸ **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> - -Retrieves room IDs for which specific users are participants. - -#### Parameters - -| Name | Type | Description | -| :-------- | :----------------------------------------------------------- | :------------------------------ | -| `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) - ---- - -### log - -▸ **log**(`params`): `Promise`\<`void`\> - -Logs an event or action with the specified details. - -#### Parameters - -| Name | Type | Description | -| :--------------- | :--------------------------------------------------------- | :------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the log entry. | -| `params.body` | `Object` | - | -| `params.room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.type` | `string` | - | -| `params.user_id` | \`$\{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) - ---- - -### removeAllGoals - -▸ **removeAllGoals**(`room_id`): `Promise`\<`void`\> - -Removes all goals associated with a specific room. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------------------------- | -| `room_id` | \`$\{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) - ---- - -### removeAllMemories - -▸ **removeAllMemories**(`room_id`, `tableName`): `Promise`\<`void`\> - -Removes all memories associated with a specific room. - -#### Parameters - -| Name | Type | Description | -| :---------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `room_id` | \`$\{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) - ---- - -### removeGoal - -▸ **removeGoal**(`goalId`): `Promise`\<`void`\> - -Removes a specific goal from the database. - -#### Parameters - -| Name | Type | Description | -| :------- | :--------------------------------------------------------- | :------------------------------ | -| `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) - ---- - -### removeMemory - -▸ **removeMemory**(`memoryId`): `Promise`\<`void`\> - -Removes a specific memory from the database. - -#### Parameters - -| Name | Type | Description | -| :--------- | :--------------------------------------------------------- | :-------------------------------- | -| `memoryId` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the memory to remove. | - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the memory has been removed. - -#### Overrides - -[DatabaseAdapter](DatabaseAdapter.md).[removeMemory](DatabaseAdapter.md#removememory) - ---- - -### removeParticipant - -▸ **removeParticipant**(`user_id`, `room_id`): `Promise`\<`boolean`\> - -Removes a user as a participant from a specific room. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :-------------------------------------------------------- | -| `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | The UUID of the user to remove as a participant. | -| `room_id` | \`$\{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) - ---- - -### removeRoom - -▸ **removeRoom**(`room_id`): `Promise`\<`void`\> - -Removes a specific room from the database. - -#### Parameters - -| Name | Type | Description | -| :-------- | :--------------------------------------------------------- | :------------------------------ | -| `room_id` | \`$\{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) - ---- - -### searchMemories - -▸ **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Searches for memories based on embeddings and other specified parameters. - -#### Parameters - -| Name | Type | Description | -| :----------------------- | :--------------------------------------------------------- | :----------------------------------------------------- | -| `params` | `Object` | An object containing parameters for the memory search. | -| `params.embedding` | `number`[] | - | -| `params.match_count` | `number` | - | -| `params.match_threshold` | `number` | - | -| `params.room_id` | \`$\{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) - ---- - -### searchMemoriesByEmbedding - -▸ **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Searches for memories by embedding and other specified parameters. - -#### Parameters - -| Name | Type | Description | -| :------------------------ | :--------------------------------------------------------- | :------------------------------------ | -| `embedding` | `number`[] | The embedding vector to search with. | -| `params` | `Object` | Additional parameters for the search. | -| `params.count?` | `number` | - | -| `params.match_threshold?` | `number` | - | -| `params.room_id?` | \`$\{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) - ---- - -### updateGoal - -▸ **updateGoal**(`goal`): `Promise`\<`void`\> - -Updates a specific goal in the database. - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------ | :--------------------------------------- | -| `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) - ---- - -### updateGoalStatus - -▸ **updateGoalStatus**(`params`): `Promise`\<`void`\> - -Updates the status of a specific goal. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :--------------------------------------------------------- | :-------------------------------------------------- | -| `params` | `Object` | An object containing the goalId and the new status. | -| `params.goalId` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | - | -| `params.status` | [`GoalStatus`](../enums/GoalStatus.md) | - | - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the goal status has been updated. - -#### Overrides - -[DatabaseAdapter](DatabaseAdapter.md).[updateGoalStatus](DatabaseAdapter.md#updategoalstatus) diff --git a/docs/api/classes/TelegramClient.md b/docs/api/classes/TelegramClient.md index 6f29127555..e3a7b4dd52 100644 --- a/docs/api/classes/TelegramClient.md +++ b/docs/api/classes/TelegramClient.md @@ -18,7 +18,7 @@ #### 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) +[packages/core/src/clients/telegram/src/index.ts:12](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/telegram/src/index.ts#L12) ## Methods @@ -32,9 +32,9 @@ #### 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) +[packages/core/src/clients/telegram/src/index.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/telegram/src/index.ts#L54) ---- +*** ### stop() @@ -46,4 +46,4 @@ #### 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) +[packages/core/src/clients/telegram/src/index.ts:91](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/telegram/src/index.ts#L91) diff --git a/docs/api/classes/TokenProvider.md b/docs/api/classes/TokenProvider.md index 0e0fb8d77e..5109908016 100644 --- a/docs/api/classes/TokenProvider.md +++ b/docs/api/classes/TokenProvider.md @@ -16,77 +16,69 @@ #### Defined in -[core/src/providers/token.ts:38](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L38) +[packages/core/src/providers/token.ts:38](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L38) ## Methods -### analyzeHolderDistribution() - -> **analyzeHolderDistribution**(`tradeData`): `Promise`\<`string`\> - -#### Parameters +### fetchTokenSecurity() -• **tradeData**: `TokenTradeData` +> **fetchTokenSecurity**(): `Promise`\<`TokenSecurityData`\> #### Returns -`Promise`\<`string`\> +`Promise`\<`TokenSecurityData`\> #### Defined in -[core/src/providers/token.ts:461](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L461) - ---- +[packages/core/src/providers/token.ts:166](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L166) -### checkRecentTrades() +*** -> **checkRecentTrades**(`tradeData`): `Promise`\<`boolean`\> - -#### Parameters +### fetchTokenTradeData() -• **tradeData**: `TokenTradeData` +> **fetchTokenTradeData**(): `Promise`\<`TokenTradeData`\> #### Returns -`Promise`\<`boolean`\> +`Promise`\<`TokenTradeData`\> #### Defined in -[core/src/providers/token.ts:631](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L631) - ---- - -### countHighSupplyHolders() +[packages/core/src/providers/token.ts:196](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L196) -> **countHighSupplyHolders**(`securityData`): `Promise`\<`number`\> +*** -#### Parameters +### fetchDexScreenerData() -• **securityData**: `TokenSecurityData` +> **fetchDexScreenerData**(): `Promise`\<`DexScreenerData`\> #### Returns -`Promise`\<`number`\> +`Promise`\<`DexScreenerData`\> #### Defined in -[core/src/providers/token.ts:635](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L635) +[packages/core/src/providers/token.ts:431](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L431) ---- +*** -### fetchDexScreenerData() +### analyzeHolderDistribution() -> **fetchDexScreenerData**(): `Promise`\<`DexScreenerData`\> +> **analyzeHolderDistribution**(`tradeData`): `Promise`\<`string`\> + +#### Parameters + +• **tradeData**: `TokenTradeData` #### Returns -`Promise`\<`DexScreenerData`\> +`Promise`\<`string`\> #### Defined in -[core/src/providers/token.ts:420](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L420) +[packages/core/src/providers/token.ts:472](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L472) ---- +*** ### fetchHolderList() @@ -98,55 +90,77 @@ #### Defined in -[core/src/providers/token.ts:507](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L507) +[packages/core/src/providers/token.ts:518](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L518) ---- +*** -### fetchTokenSecurity() +### filterHighValueHolders() -> **fetchTokenSecurity**(): `Promise`\<`TokenSecurityData`\> +> **filterHighValueHolders**(`tradeData`): `Promise`\<`object`[]\> + +#### Parameters + +• **tradeData**: `TokenTradeData` #### Returns -`Promise`\<`TokenSecurityData`\> +`Promise`\<`object`[]\> #### Defined in -[core/src/providers/token.ts:155](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L155) +[packages/core/src/providers/token.ts:618](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L618) ---- +*** -### fetchTokenTradeData() +### checkRecentTrades() -> **fetchTokenTradeData**(): `Promise`\<`TokenTradeData`\> +> **checkRecentTrades**(`tradeData`): `Promise`\<`boolean`\> + +#### Parameters + +• **tradeData**: `TokenTradeData` #### Returns -`Promise`\<`TokenTradeData`\> +`Promise`\<`boolean`\> #### Defined in -[core/src/providers/token.ts:185](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L185) +[packages/core/src/providers/token.ts:642](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L642) ---- +*** -### filterHighValueHolders() +### countHighSupplyHolders() -> **filterHighValueHolders**(`tradeData`): `Promise`\<`object`[]\> +> **countHighSupplyHolders**(`securityData`): `Promise`\<`number`\> #### Parameters -• **tradeData**: `TokenTradeData` +• **securityData**: `TokenSecurityData` #### Returns -`Promise`\<`object`[]\> +`Promise`\<`number`\> + +#### Defined in + +[packages/core/src/providers/token.ts:646](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L646) + +*** + +### getProcessedTokenData() + +> **getProcessedTokenData**(): `Promise`\<`ProcessedTokenData`\> + +#### Returns + +`Promise`\<`ProcessedTokenData`\> #### Defined in -[core/src/providers/token.ts:607](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L607) +[packages/core/src/providers/token.ts:667](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L667) ---- +*** ### formatTokenData() @@ -162,9 +176,9 @@ #### Defined in -[core/src/providers/token.ts:722](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L722) +[packages/core/src/providers/token.ts:733](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L733) ---- +*** ### getFormattedTokenReport() @@ -176,18 +190,4 @@ #### 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) +[packages/core/src/providers/token.ts:797](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L797) diff --git a/docs/api/classes/TwitterInteractionClient.md b/docs/api/classes/TwitterInteractionClient.md index 7b06e7039e..1cdb485870 100644 --- a/docs/api/classes/TwitterInteractionClient.md +++ b/docs/api/classes/TwitterInteractionClient.md @@ -24,59 +24,65 @@ #### Defined in -[core/src/clients/twitter/interactions.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/interactions.ts#L87) +[packages/core/src/clients/twitter/interactions.ts:87](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/interactions.ts#L87) ## Properties -### callback() +### \_twitterClient -> **callback**: (`self`) => `any` = `null` +> `static` **\_twitterClient**: `Scraper` -#### Parameters +#### Inherited from -• **self**: `ClientBase` +`ClientBase._twitterClient` -#### Returns +#### Defined in -`any` +[packages/core/src/clients/twitter/base.ts:86](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L86) + +*** + +### twitterClient + +> **twitterClient**: `Scraper` #### Inherited from -`ClientBase.callback` +`ClientBase.twitterClient` #### Defined in -[core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L150) +[packages/core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L87) ---- +*** -### directions +### runtime -> **directions**: `string` +> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) #### Inherited from -`ClientBase.directions` +`ClientBase.runtime` #### Defined in -[core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L89) +[packages/core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L88) ---- +*** -### imageDescriptionService +### directions -> **imageDescriptionService**: `ImageDescriptionService` +> **directions**: `string` #### Inherited from -`ClientBase.imageDescriptionService` +`ClientBase.directions` #### Defined in -[core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L92) +[packages/core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L89) ---- +*** ### lastCheckedTweetId @@ -88,37 +94,37 @@ #### Defined in -[core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L90) +[packages/core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L90) ---- +*** -### requestQueue +### tweetCacheFilePath -> **requestQueue**: `RequestQueue` +> **tweetCacheFilePath**: `string` = `"tweetcache/latest_checked_tweet_id.txt"` #### Inherited from -`ClientBase.requestQueue` +`ClientBase.tweetCacheFilePath` #### Defined in -[core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L96) +[packages/core/src/clients/twitter/base.ts:91](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L91) ---- +*** -### runtime +### imageDescriptionService -> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) +> **imageDescriptionService**: `ImageDescriptionService` #### Inherited from -`ClientBase.runtime` +`ClientBase.imageDescriptionService` #### Defined in -[core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L88) +[packages/core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L92) ---- +*** ### temperature @@ -130,37 +136,23 @@ #### 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) +[packages/core/src/clients/twitter/base.ts:93](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L93) ---- +*** -### twitterClient +### requestQueue -> **twitterClient**: `Scraper` +> **requestQueue**: `RequestQueue` #### Inherited from -`ClientBase.twitterClient` +`ClientBase.requestQueue` #### Defined in -[core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L87) +[packages/core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L96) ---- +*** ### twitterUserId @@ -172,208 +164,31 @@ #### 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 +[packages/core/src/clients/twitter/base.ts:97](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L97) -## 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 +### callback() -• **K** +> **callback**: (`self`) => `any` = `null` #### Parameters -• **eventName**: `string` \| `symbol` - -• **listener** +• **self**: `ClientBase` #### Returns -`this` - -#### Since - -v0.1.26 +`any` #### Inherited from -`ClientBase.addListener` +`ClientBase.callback` #### Defined in -node_modules/@types/node/events.d.ts:597 +[packages/core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L150) ---- +## Methods ### cacheTweet() @@ -393,118 +208,53 @@ node_modules/@types/node/events.d.ts:597 #### 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`); -}); +[packages/core/src/clients/twitter/base.ts:99](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L99) -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 +### getCachedTweet() -• **K** +> **getCachedTweet**(`tweetId`): `Promise`\<`Tweet`\> #### Parameters -• **eventName**: `string` \| `symbol` - -• ...**args**: `AnyRest` +• **tweetId**: `string` #### Returns -`boolean` - -#### Since - -v0.1.26 +`Promise`\<`Tweet`\> #### Inherited from -`ClientBase.emit` +`ClientBase.getCachedTweet` #### Defined in -node_modules/@types/node/events.d.ts:859 - ---- - -### eventNames() +[packages/core/src/clients/twitter/base.ts:115](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L115) -> **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"; +### getTweet() -const myEE = new EventEmitter(); -myEE.on("foo", () => {}); -myEE.on("bar", () => {}); +> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> -const sym = Symbol("symbol"); -myEE.on(sym, () => {}); +#### Parameters -console.log(myEE.eventNames()); -// Prints: [ 'foo', 'bar', Symbol(symbol) ] -``` +• **tweetId**: `string` #### Returns -(`string` \| `symbol`)[] - -#### Since - -v6.0.0 +`Promise`\<`Tweet`\> #### Inherited from -`ClientBase.eventNames` +`ClientBase.getTweet` #### Defined in -node_modules/@types/node/events.d.ts:922 +[packages/core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L137) ---- +*** ### fetchHomeTimeline() @@ -524,9 +274,9 @@ node_modules/@types/node/events.d.ts:922 #### Defined in -[core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L278) +[packages/core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L278) ---- +*** ### fetchSearchTweets() @@ -552,78 +302,73 @@ node_modules/@types/node/events.d.ts:922 #### Defined in -[core/src/clients/twitter/base.ts:330](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L330) +[packages/core/src/clients/twitter/base.ts:330](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L330) ---- +*** -### getCachedTweet() +### setCookiesFromArray() -> **getCachedTweet**(`tweetId`): `Promise`\<`Tweet`\> +> **setCookiesFromArray**(`cookiesArray`): `Promise`\<`void`\> #### Parameters -• **tweetId**: `string` +• **cookiesArray**: `any`[] #### Returns -`Promise`\<`Tweet`\> +`Promise`\<`void`\> #### Inherited from -`ClientBase.getCachedTweet` +`ClientBase.setCookiesFromArray` #### Defined in -[core/src/clients/twitter/base.ts:115](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L115) +[packages/core/src/clients/twitter/base.ts:560](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L560) ---- +*** -### getMaxListeners() +### saveRequestMessage() -> **getMaxListeners**(): `number` +> **saveRequestMessage**(`message`, `state`): `Promise`\<`void`\> -Returns the current max listener value for the `EventEmitter` which is either -set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](TwitterInteractionClient.md#defaultmaxlisteners). +#### Parameters -#### Returns +• **message**: [`Memory`](../interfaces/Memory.md) -`number` +• **state**: [`State`](../interfaces/State.md) -#### Since +#### Returns -v1.0.0 +`Promise`\<`void`\> #### Inherited from -`ClientBase.getMaxListeners` +`ClientBase.saveRequestMessage` #### Defined in -node_modules/@types/node/events.d.ts:774 +[packages/core/src/clients/twitter/base.ts:572](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L572) ---- +*** -### getTweet() - -> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> - -#### Parameters +### onReady() -• **tweetId**: `string` +> **onReady**(): `void` #### Returns -`Promise`\<`Tweet`\> +`void` -#### Inherited from +#### Overrides -`ClientBase.getTweet` +`ClientBase.onReady` #### Defined in -[core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L137) +[packages/core/src/clients/twitter/interactions.ts:76](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/interactions.ts#L76) ---- +*** ### handleTwitterInteractions() @@ -635,1164 +380,4 @@ node_modules/@types/node/events.d.ts:774 #### 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 +[packages/core/src/clients/twitter/interactions.ts:93](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/interactions.ts#L93) diff --git a/docs/api/classes/TwitterPostClient.md b/docs/api/classes/TwitterPostClient.md index fbf83d8f83..32b2cc5821 100644 --- a/docs/api/classes/TwitterPostClient.md +++ b/docs/api/classes/TwitterPostClient.md @@ -24,59 +24,65 @@ #### Defined in -[core/src/clients/twitter/post.ts:41](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/post.ts#L41) +[packages/core/src/clients/twitter/post.ts:41](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/post.ts#L41) ## Properties -### callback() +### \_twitterClient -> **callback**: (`self`) => `any` = `null` +> `static` **\_twitterClient**: `Scraper` -#### Parameters +#### Inherited from -• **self**: `ClientBase` +`ClientBase._twitterClient` -#### Returns +#### Defined in -`any` +[packages/core/src/clients/twitter/base.ts:86](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L86) + +*** + +### twitterClient + +> **twitterClient**: `Scraper` #### Inherited from -`ClientBase.callback` +`ClientBase.twitterClient` #### Defined in -[core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L150) +[packages/core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L87) ---- +*** -### directions +### runtime -> **directions**: `string` +> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) #### Inherited from -`ClientBase.directions` +`ClientBase.runtime` #### Defined in -[core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L89) +[packages/core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L88) ---- +*** -### imageDescriptionService +### directions -> **imageDescriptionService**: `ImageDescriptionService` +> **directions**: `string` #### Inherited from -`ClientBase.imageDescriptionService` +`ClientBase.directions` #### Defined in -[core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L92) +[packages/core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L89) ---- +*** ### lastCheckedTweetId @@ -88,37 +94,37 @@ #### Defined in -[core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L90) +[packages/core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L90) ---- +*** -### requestQueue +### tweetCacheFilePath -> **requestQueue**: `RequestQueue` +> **tweetCacheFilePath**: `string` = `"tweetcache/latest_checked_tweet_id.txt"` #### Inherited from -`ClientBase.requestQueue` +`ClientBase.tweetCacheFilePath` #### Defined in -[core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L96) +[packages/core/src/clients/twitter/base.ts:91](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L91) ---- +*** -### runtime +### imageDescriptionService -> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) +> **imageDescriptionService**: `ImageDescriptionService` #### Inherited from -`ClientBase.runtime` +`ClientBase.imageDescriptionService` #### Defined in -[core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L88) +[packages/core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L92) ---- +*** ### temperature @@ -130,37 +136,23 @@ #### 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) +[packages/core/src/clients/twitter/base.ts:93](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L93) ---- +*** -### twitterClient +### requestQueue -> **twitterClient**: `Scraper` +> **requestQueue**: `RequestQueue` #### Inherited from -`ClientBase.twitterClient` +`ClientBase.requestQueue` #### Defined in -[core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L87) +[packages/core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L96) ---- +*** ### twitterUserId @@ -172,208 +164,31 @@ #### 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 +[packages/core/src/clients/twitter/base.ts:97](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L97) -## 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 +### callback() -• **K** +> **callback**: (`self`) => `any` = `null` #### Parameters -• **eventName**: `string` \| `symbol` - -• **listener** +• **self**: `ClientBase` #### Returns -`this` - -#### Since - -v0.1.26 +`any` #### Inherited from -`ClientBase.addListener` +`ClientBase.callback` #### Defined in -node_modules/@types/node/events.d.ts:597 +[packages/core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L150) ---- +## Methods ### cacheTweet() @@ -393,118 +208,53 @@ node_modules/@types/node/events.d.ts:597 #### 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`); -}); +[packages/core/src/clients/twitter/base.ts:99](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L99) -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 +### getCachedTweet() -• **K** +> **getCachedTweet**(`tweetId`): `Promise`\<`Tweet`\> #### Parameters -• **eventName**: `string` \| `symbol` - -• ...**args**: `AnyRest` +• **tweetId**: `string` #### Returns -`boolean` - -#### Since - -v0.1.26 +`Promise`\<`Tweet`\> #### Inherited from -`ClientBase.emit` +`ClientBase.getCachedTweet` #### Defined in -node_modules/@types/node/events.d.ts:859 - ---- - -### eventNames() +[packages/core/src/clients/twitter/base.ts:115](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L115) -> **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"; +### getTweet() -const myEE = new EventEmitter(); -myEE.on("foo", () => {}); -myEE.on("bar", () => {}); +> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> -const sym = Symbol("symbol"); -myEE.on(sym, () => {}); +#### Parameters -console.log(myEE.eventNames()); -// Prints: [ 'foo', 'bar', Symbol(symbol) ] -``` +• **tweetId**: `string` #### Returns -(`string` \| `symbol`)[] - -#### Since - -v6.0.0 +`Promise`\<`Tweet`\> #### Inherited from -`ClientBase.eventNames` +`ClientBase.getTweet` #### Defined in -node_modules/@types/node/events.d.ts:922 +[packages/core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L137) ---- +*** ### fetchHomeTimeline() @@ -524,9 +274,9 @@ node_modules/@types/node/events.d.ts:922 #### Defined in -[core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L278) +[packages/core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L278) ---- +*** ### fetchSearchTweets() @@ -552,1233 +302,68 @@ node_modules/@types/node/events.d.ts:922 #### 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 +[packages/core/src/clients/twitter/base.ts:330](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L330) ---- +*** -### getTweet() +### setCookiesFromArray() -> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> +> **setCookiesFromArray**(`cookiesArray`): `Promise`\<`void`\> #### Parameters -• **tweetId**: `string` +• **cookiesArray**: `any`[] #### Returns -`Promise`\<`Tweet`\> +`Promise`\<`void`\> #### Inherited from -`ClientBase.getTweet` +`ClientBase.setCookiesFromArray` #### Defined in -[core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L137) - ---- - -### listenerCount() +[packages/core/src/clients/twitter/base.ts:560](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L560) -> **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 +### saveRequestMessage() -• **K** +> **saveRequestMessage**(`message`, `state`): `Promise`\<`void`\> #### Parameters -• **eventName**: `string` \| `symbol` - -The name of the event being listened for - -• **listener?**: `Function` +• **message**: [`Memory`](../interfaces/Memory.md) -The event handler function +• **state**: [`State`](../interfaces/State.md) #### Returns -`number` - -#### Since - -v3.2.0 +`Promise`\<`void`\> #### Inherited from -`ClientBase.listenerCount` +`ClientBase.saveRequestMessage` #### Defined in -node_modules/@types/node/events.d.ts:868 - ---- +[packages/core/src/clients/twitter/base.ts:572](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L572) -### 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] ] -``` +### onReady() -#### Type Parameters +> **onReady**(): `void` -• **K** +#### Returns -#### Parameters +`void` -• **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 +#### 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 +[packages/core/src/clients/twitter/post.ts:28](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/post.ts#L28) diff --git a/docs/api/classes/TwitterSearchClient.md b/docs/api/classes/TwitterSearchClient.md index ab977bd41e..54b77a9f1b 100644 --- a/docs/api/classes/TwitterSearchClient.md +++ b/docs/api/classes/TwitterSearchClient.md @@ -24,59 +24,65 @@ #### Defined in -[core/src/clients/twitter/search.ts:53](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/search.ts#L53) +[packages/core/src/clients/twitter/search.ts:53](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/search.ts#L53) ## Properties -### callback() +### \_twitterClient -> **callback**: (`self`) => `any` = `null` +> `static` **\_twitterClient**: `Scraper` -#### Parameters +#### Inherited from -• **self**: `ClientBase` +`ClientBase._twitterClient` -#### Returns +#### Defined in -`any` +[packages/core/src/clients/twitter/base.ts:86](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L86) + +*** + +### twitterClient + +> **twitterClient**: `Scraper` #### Inherited from -`ClientBase.callback` +`ClientBase.twitterClient` #### Defined in -[core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L150) +[packages/core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L87) ---- +*** -### directions +### runtime -> **directions**: `string` +> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) #### Inherited from -`ClientBase.directions` +`ClientBase.runtime` #### Defined in -[core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L89) +[packages/core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L88) ---- +*** -### imageDescriptionService +### directions -> **imageDescriptionService**: `ImageDescriptionService` +> **directions**: `string` #### Inherited from -`ClientBase.imageDescriptionService` +`ClientBase.directions` #### Defined in -[core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L92) +[packages/core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L89) ---- +*** ### lastCheckedTweetId @@ -88,37 +94,37 @@ #### Defined in -[core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L90) +[packages/core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L90) ---- +*** -### requestQueue +### tweetCacheFilePath -> **requestQueue**: `RequestQueue` +> **tweetCacheFilePath**: `string` = `"tweetcache/latest_checked_tweet_id.txt"` #### Inherited from -`ClientBase.requestQueue` +`ClientBase.tweetCacheFilePath` #### Defined in -[core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L96) +[packages/core/src/clients/twitter/base.ts:91](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L91) ---- +*** -### runtime +### imageDescriptionService -> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) +> **imageDescriptionService**: `ImageDescriptionService` #### Inherited from -`ClientBase.runtime` +`ClientBase.imageDescriptionService` #### Defined in -[core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L88) +[packages/core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L92) ---- +*** ### temperature @@ -130,37 +136,23 @@ #### 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) +[packages/core/src/clients/twitter/base.ts:93](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L93) ---- +*** -### twitterClient +### requestQueue -> **twitterClient**: `Scraper` +> **requestQueue**: `RequestQueue` #### Inherited from -`ClientBase.twitterClient` +`ClientBase.requestQueue` #### Defined in -[core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L87) +[packages/core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L96) ---- +*** ### twitterUserId @@ -172,208 +164,31 @@ #### 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 +[packages/core/src/clients/twitter/base.ts:97](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L97) -## 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 +### callback() -• **K** +> **callback**: (`self`) => `any` = `null` #### Parameters -• **eventName**: `string` \| `symbol` - -• **listener** +• **self**: `ClientBase` #### Returns -`this` - -#### Since - -v0.1.26 +`any` #### Inherited from -`ClientBase.addListener` +`ClientBase.callback` #### Defined in -node_modules/@types/node/events.d.ts:597 +[packages/core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L150) ---- +## Methods ### cacheTweet() @@ -393,118 +208,53 @@ node_modules/@types/node/events.d.ts:597 #### Defined in -[core/src/clients/twitter/base.ts:99](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L99) +[packages/core/src/clients/twitter/base.ts:99](https://github.com/ai16z/eliza/blob/main/packages/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 +### getCachedTweet() -• **K** +> **getCachedTweet**(`tweetId`): `Promise`\<`Tweet`\> #### Parameters -• **eventName**: `string` \| `symbol` - -• ...**args**: `AnyRest` +• **tweetId**: `string` #### Returns -`boolean` - -#### Since - -v0.1.26 +`Promise`\<`Tweet`\> #### Inherited from -`ClientBase.emit` +`ClientBase.getCachedTweet` #### Defined in -node_modules/@types/node/events.d.ts:859 - ---- - -### eventNames() - -> **eventNames**(): (`string` \| `symbol`)[] +[packages/core/src/clients/twitter/base.ts:115](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L115) -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"; +### getTweet() -const myEE = new EventEmitter(); -myEE.on("foo", () => {}); -myEE.on("bar", () => {}); +> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> -const sym = Symbol("symbol"); -myEE.on(sym, () => {}); +#### Parameters -console.log(myEE.eventNames()); -// Prints: [ 'foo', 'bar', Symbol(symbol) ] -``` +• **tweetId**: `string` #### Returns -(`string` \| `symbol`)[] - -#### Since - -v6.0.0 +`Promise`\<`Tweet`\> #### Inherited from -`ClientBase.eventNames` +`ClientBase.getTweet` #### Defined in -node_modules/@types/node/events.d.ts:922 +[packages/core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L137) ---- +*** ### fetchHomeTimeline() @@ -524,9 +274,9 @@ node_modules/@types/node/events.d.ts:922 #### Defined in -[core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L278) +[packages/core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L278) ---- +*** ### fetchSearchTweets() @@ -552,324 +302,63 @@ node_modules/@types/node/events.d.ts:922 #### 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) +[packages/core/src/clients/twitter/base.ts:330](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L330) ---- +*** -### 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() +### setCookiesFromArray() -> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> +> **setCookiesFromArray**(`cookiesArray`): `Promise`\<`void`\> #### Parameters -• **tweetId**: `string` +• **cookiesArray**: `any`[] #### Returns -`Promise`\<`Tweet`\> +`Promise`\<`void`\> #### Inherited from -`ClientBase.getTweet` +`ClientBase.setCookiesFromArray` #### 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` +[packages/core/src/clients/twitter/base.ts:560](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L560) -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 +### saveRequestMessage() -• **K** +> **saveRequestMessage**(`message`, `state`): `Promise`\<`void`\> #### Parameters -• **eventName**: `string` \| `symbol` - -The name of the event being listened for - -• **listener?**: `Function` +• **message**: [`Memory`](../interfaces/Memory.md) -The event handler function +• **state**: [`State`](../interfaces/State.md) #### Returns -`number` - -#### Since - -v3.2.0 +`Promise`\<`void`\> #### Inherited from -`ClientBase.listenerCount` +`ClientBase.saveRequestMessage` #### Defined in -node_modules/@types/node/events.d.ts:868 - ---- - -### listeners() +[packages/core/src/clients/twitter/base.ts:572](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/base.ts#L572) -> **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 +### onReady() -• **eventName**: `string` \| `symbol` +> **onReady**(): `Promise`\<`void`\> #### 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`\> +`Promise`\<`void`\> #### Overrides @@ -877,908 +366,4 @@ node_modules/@types/node/events.d.ts:659 #### 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 +[packages/core/src/clients/twitter/search.ts:60](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/twitter/search.ts#L60) diff --git a/docs/api/classes/WalletProvider.md b/docs/api/classes/WalletProvider.md index 7f0284df83..ebbb8ee019 100644 --- a/docs/api/classes/WalletProvider.md +++ b/docs/api/classes/WalletProvider.md @@ -18,7 +18,7 @@ #### Defined in -[core/src/providers/wallet.ts:53](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L53) +[packages/core/src/providers/wallet.ts:53](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L53) ## Methods @@ -36,9 +36,9 @@ #### Defined in -[core/src/providers/wallet.ts:105](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L105) +[packages/core/src/providers/wallet.ts:105](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L105) ---- +*** ### fetchPrices() @@ -54,9 +54,9 @@ #### Defined in -[core/src/providers/wallet.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L150) +[packages/core/src/providers/wallet.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L150) ---- +*** ### formatPortfolio() @@ -76,9 +76,9 @@ #### Defined in -[core/src/providers/wallet.ts:192](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L192) +[packages/core/src/providers/wallet.ts:192](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L192) ---- +*** ### getFormattedPortfolio() @@ -94,4 +94,4 @@ #### Defined in -[core/src/providers/wallet.ts:229](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L229) +[packages/core/src/providers/wallet.ts:229](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L229) diff --git a/docs/api/classes/_category_.yml b/docs/api/classes/_category_.yml deleted file mode 100644 index 7d96d81b4d..0000000000 --- a/docs/api/classes/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Classes" -position: 3 diff --git a/docs/api/concepts.md b/docs/api/concepts.md deleted file mode 100644 index 04e84ccb91..0000000000 --- a/docs/api/concepts.md +++ /dev/null @@ -1,75 +0,0 @@ -# Key Concepts in Eliza - -Eliza is a comprehensive and flexible framework for building intelligent agents. It provides a set of tools and abstractions that enable developers to create sophisticated agents tailored to their specific needs. The following concepts are the building blocks of eliza and form the foundation for understanding and working with the framework. - -## Actions - -Actions define the behaviors or responses an agent can perform in a given context. They contain the logic for handling specific user intents or situations and can be added or modified to extend the agent's capabilities. Actions are a fundamental building block of eliza's extensibility, allowing developers to customize their agents without modifying the underlying framework. - -When a user interacts with the agent, the appropriate action is triggered based on the context and the user's input. Actions can perform various tasks, such as generating responses, making API calls, updating the agent's state, or triggering other actions. Developers can create custom actions to define the specific behaviors and functionalities of their agents. - -## Evaluators - -Evaluators are similar to actions but are invoked after each interaction is stored. They assess the agent's state and provide insights or recommendations on how the agent should proceed. Evaluators analyze the context, user input, and other relevant factors to make decisions or generate additional information. - -Evaluators can be used for various purposes, such as sentiment analysis, entity recognition, topic classification, or generating personalized recommendations. By implementing custom evaluators, developers can add advanced reasoning capabilities to their agents and enable them to make informed decisions based on the interaction flow. - -## Providers - -Providers are components that add context to the agent's interactions by integrating external data sources or APIs. They allow agents to access and utilize relevant information during interactions, enhancing the agent's knowledge and capabilities. Providers can be used to retrieve data from databases, invoke external services, or fetch real-time information. - -For example, a weather provider can be implemented to provide the agent with current weather information based on the user's location. Similarly, a product catalog provider can be used to retrieve product details and recommendations based on the user's preferences. Providers enable agents to deliver more accurate and informative responses by incorporating external data sources. - -## State and Context - -Eliza emphasizes the importance of maintaining state and context to ensure coherent and contextually relevant interactions. The state represents a snapshot of the agent's current situation, capturing essential information such as user details, recent interactions, goals, and relevant facts. It provides a comprehensive view of the current context and helps the agent make informed decisions. - -The context is derived from the state and represents the information that is sent to the AI model for response generation. It includes relevant details from the state, such as the user's input, previous interactions, and any additional contextual information required by the AI model. The context is dynamically generated based on the current state and is used to guide the AI model in generating appropriate responses. - -## Memories - -Memories enable agents to store and retrieve interaction-related data. They are stored in the database as `Memory` objects and are managed by the `MemoryManager` class. Memories can be of different types, such as messages, facts, and lore, each serving a specific purpose. - -Messages represent the user inputs and agent responses that form the interaction history. They contain information such as the user ID, content, and associated action. Facts represent the knowledge or information derived from the interactions. They can be used to store key insights, important details, or conclusions drawn from the interactions. - -Lore is another type of memory that represents the contextual knowledge or information that the agent can access and retrieve during interactions. It can include a wide range of data, such as product information, FAQs, historical facts, domain-specific knowledge, or even creative content like stories or character backgrounds. Lore enables agents to provide informed and relevant responses by incorporating pre-existing knowledge. - -Developers can extend the memory system by adding custom memory types to suit their specific requirements. The `MemoryManager` class provides methods for storing, retrieving, and managing memories efficiently. - -## Messages - -Messages are the core unit of communication between users and agents in eliza. They are represented as objects that contain information such as the user ID, content, and associated action. Messages are exchanged between users and agents during interactions and form the basis for understanding and response generation. - -When a user sends a message, it is processed by the agent, triggering the appropriate actions and evaluators. The agent analyzes the message content, extracts relevant information, and generates a response based on the defined behaviors and rules. Messages can also be stored as memories to maintain a history of the interactions and enable the agent to refer back to previous exchanges. - -## Goals - -Goals represent high-level objectives or tasks that the agent aims to accomplish during its interactions. They provide a way to guide the agent's behavior towards specific outcomes and enable the agent to make decisions aligned with the desired results. Goals can be defined and tracked using the eliza framework. - -For example, in a task-oriented scenario, a goal could be to assist the user in completing a specific task or answering their question satisfactorily. The agent can break down the goal into smaller sub-goals or steps and work towards achieving them throughout the interaction. By defining and tracking goals, agents can adapt their behavior, ask relevant questions, and provide targeted responses to help users accomplish their objectives. - -## Relationships - -Relationships capture the connections and associations between entities in the agent's domain. They represent the social dynamics, roles, and interactions between users, objects, or other entities. Relationships enable agents to personalize interactions and maintain a coherent understanding of the domain. - -In eliza, relationships can be defined and managed using the `Relationship` object. It contains information such as the IDs of the related entities, the type of relationship (e.g., user-user, user-object), and any additional metadata relevant to the relationship. - -By understanding and utilizing relationships, agents can tailor their responses, provide personalized recommendations, and maintain a contextually appropriate interaction flow. Relationships can also be used to enforce access controls, permissions, and domain-specific constraints. - -## Stateful vs. Stateless Pattern - -Eliza supports both stateful and stateless patterns for managing the agent's state, providing flexibility to developers based on their specific requirements. The choice between stateful and stateless patterns depends on factors such as the nature of the agent's domain, the level of personalization required, and the scalability needs of the application. - -In the stateful pattern, the agent maintains a persistent state throughout its interactions. It retains the context and history across multiple exchanges, allowing for more complex and personalized interactions. The stateful pattern is particularly useful when dealing with multi-turn dialogues, user-specific preferences, or scenarios that require tracking long-term information. - -On the other hand, the stateless pattern treats each interaction as independent and self-contained. The agent does not maintain a persistent state across interactions, and each request is processed in isolation. Stateless agents rely solely on the information provided in the current input and external data sources to generate responses. This pattern offers simplicity and scalability, as it eliminates the need to manage and store interaction-specific data. - -Eliza provides the flexibility to adopt either approach or even combine them based on the specific requirements of the agent. Developers can choose the appropriate pattern based on their needs and design their agents accordingly. - -## Database Adapters - -Eliza includes database adapters to enable seamless integration with various storage systems. The default adapter supports Supabase, a cloud-based database service, allowing agents to persist and retrieve interaction-related data. However, the framework's modular design allows developers to create custom database adapters to integrate with other databases or storage solutions that best fit their needs. - -Database adapters abstract the underlying storage mechanisms, providing a consistent interface for querying and manipulating data related to the agent's interactions. They handle tasks such as storing and retrieving memories, managing goals and relationships, and persisting other relevant information. - -By using database adapters, developers can focus on building the agent's logic and capabilities without concerning themselves with the intricacies of data storage and retrieval. The adapters provide a layer of abstraction, allowing developers to switch between different storage solutions or migrate their data easily. diff --git a/docs/api/docs/_category_.yml b/docs/api/docs/_category_.yml deleted file mode 100644 index c5d5974f55..0000000000 --- a/docs/api/docs/_category_.yml +++ /dev/null @@ -1 +0,0 @@ -label: "API" diff --git a/docs/api/docs/index.md b/docs/api/docs/index.md deleted file mode 100644 index 16cccba53e..0000000000 --- a/docs/api/docs/index.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -id: "index" -title: "eliza" -sidebar_label: "Readme" -sidebar_position: 0 -custom_edit_url: null ---- - -# Eliza - -Eliza Banner - -_As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAIndreessen](https://x.com/pmairca)_ - -- Multi-agent simulation framework -- Add as many unique characters as you want with [characterfile](https://github.com/lalalune/characterfile/) -- Full-featured Discord and Twitter connectors, with Discord voice channel support -- Full conversational and document RAG memory -- Can read links and PDFs, transcribe audio and videos, summarize conversations, and more -- Highly extensible - create your own actions and clients to extend Eliza's capabilities -- Supports open source and local models (default configured with Nous Hermes Llama 3.1B) -- Supports OpenAI for cloud inference on a light-weight device -- "Ask Claude" mode for calling Claude on more complex queries -- 100% Typescript - -# Getting Started - -## Install Node.js - -https://docs.npmjs.com/downloading-and-installing-node-js-and-npm - -## Edit the .env file - -- Copy .env.example to .env and fill in the appropriate values -- Edit the TWITTER environment variables to add your bot's username and password - -## Edit the character file - -- 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. - -### Linux Installation - -You might need these - -``` -npm install --include=optional sharp -``` - -### Run with Llama - -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` - -### Run with Grok - -You can run Grok models by setting the `XAI_MODEL` environment variable to `grok-beta` - -### Run with OpenAI - -You can run OpenAI models by setting the `XAI_MODEL` environment variable to `gpt-4o-mini` or `gpt-4o` - -# Requires Node 20+ - -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). - -## Additional Requirements - -You may need to install Sharp. If you see an error when starting up, try installing it with the following command: - -``` -npm install --include=optional sharp -``` - -# Environment Setup - -You will need to add environment variables to your .env file to connect to various platforms: - -``` -# 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 -``` - -# Local Setup - -## CUDA Setup - -If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically. - -``` -npm install -npx --no node-llama-cpp source download --gpu cuda -``` - -Make sure that you've installed the CUDA Toolkit, including cuDNN and cuBLAS. - -## Running locally - -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 - -# Cloud Setup (with OpenAI) - -In addition to the environment variables above, you will need to add the following: - -``` -# 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 -``` - -# Discord Bot - -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/api/docs/modules.md b/docs/api/docs/modules.md deleted file mode 100644 index 8200f88ad9..0000000000 --- a/docs/api/docs/modules.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -id: "modules" -title: "eliza" -sidebar_label: "Exports" -sidebar_position: 0.5 -custom_edit_url: null ---- diff --git a/docs/api/enumerations/Clients.md b/docs/api/enumerations/Clients.md index 2639b8da95..b9a3a37f93 100644 --- a/docs/api/enumerations/Clients.md +++ b/docs/api/enumerations/Clients.md @@ -2,40 +2,40 @@ ## Enumeration Members -### DIRECT +### DISCORD -> **DIRECT**: `"direct"` +> **DISCORD**: `"discord"` #### Defined in -[core/src/core/types.ts:300](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L300) +[packages/core/src/core/types.ts:312](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L312) ---- +*** -### DISCORD +### DIRECT -> **DISCORD**: `"discord"` +> **DIRECT**: `"direct"` #### Defined in -[core/src/core/types.ts:299](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L299) +[packages/core/src/core/types.ts:313](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L313) ---- +*** -### TELEGRAM +### TWITTER -> **TELEGRAM**: `"telegram"` +> **TWITTER**: `"twitter"` #### Defined in -[core/src/core/types.ts:302](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L302) +[packages/core/src/core/types.ts:314](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L314) ---- +*** -### TWITTER +### TELEGRAM -> **TWITTER**: `"twitter"` +> **TELEGRAM**: `"telegram"` #### Defined in -[core/src/core/types.ts:301](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L301) +[packages/core/src/core/types.ts:315](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L315) diff --git a/docs/api/enumerations/GoalStatus.md b/docs/api/enumerations/GoalStatus.md index 3bec50a388..f5eebfc839 100644 --- a/docs/api/enumerations/GoalStatus.md +++ b/docs/api/enumerations/GoalStatus.md @@ -8,9 +8,9 @@ #### Defined in -[core/src/core/types.ts:58](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L58) +[packages/core/src/core/types.ts:58](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L58) ---- +*** ### FAILED @@ -18,14 +18,14 @@ #### Defined in -[core/src/core/types.ts:59](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L59) +[packages/core/src/core/types.ts:59](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L59) ---- +*** -### IN_PROGRESS +### IN\_PROGRESS -> **IN_PROGRESS**: `"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) +[packages/core/src/core/types.ts:60](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L60) diff --git a/docs/api/enumerations/ImageGenModel.md b/docs/api/enumerations/ImageGenModel.md index e9b366064b..ff02d2e827 100644 --- a/docs/api/enumerations/ImageGenModel.md +++ b/docs/api/enumerations/ImageGenModel.md @@ -2,20 +2,20 @@ ## Enumeration Members -### Dalle +### TogetherAI -> **Dalle**: `"Dalle"` +> **TogetherAI**: `"TogetherAI"` #### Defined in -[core/src/core/imageGenModels.ts:3](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L3) +[packages/core/src/core/imageGenModels.ts:2](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/imageGenModels.ts#L2) ---- +*** -### TogetherAI +### Dalle -> **TogetherAI**: `"TogetherAI"` +> **Dalle**: `"Dalle"` #### Defined in -[core/src/core/imageGenModels.ts:2](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L2) +[packages/core/src/core/imageGenModels.ts:3](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/imageGenModels.ts#L3) diff --git a/docs/api/enumerations/ModelClass.md b/docs/api/enumerations/ModelClass.md index ff8b624239..b24183cdfb 100644 --- a/docs/api/enumerations/ModelClass.md +++ b/docs/api/enumerations/ModelClass.md @@ -2,40 +2,40 @@ ## Enumeration Members -### EMBEDDING +### SMALL -> **EMBEDDING**: `"embedding"` +> **SMALL**: `"small"` #### Defined in -[core/src/core/types.ts:79](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L79) +[packages/core/src/core/types.ts:76](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L76) ---- +*** -### LARGE +### MEDIUM -> **LARGE**: `"large"` +> **MEDIUM**: `"medium"` #### Defined in -[core/src/core/types.ts:78](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L78) +[packages/core/src/core/types.ts:77](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L77) ---- +*** -### MEDIUM +### LARGE -> **MEDIUM**: `"medium"` +> **LARGE**: `"large"` #### Defined in -[core/src/core/types.ts:77](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L77) +[packages/core/src/core/types.ts:78](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L78) ---- +*** -### SMALL +### EMBEDDING -> **SMALL**: `"small"` +> **EMBEDDING**: `"embedding"` #### Defined in -[core/src/core/types.ts:76](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L76) +[packages/core/src/core/types.ts:79](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L79) diff --git a/docs/api/enumerations/ModelProvider.md b/docs/api/enumerations/ModelProvider.md index 8cea253f24..f93e9d8427 100644 --- a/docs/api/enumerations/ModelProvider.md +++ b/docs/api/enumerations/ModelProvider.md @@ -2,100 +2,100 @@ ## Enumeration Members -### ANTHROPIC +### OPENAI -> **ANTHROPIC**: `"anthropic"` +> **OPENAI**: `"openai"` #### Defined in -[core/src/core/types.ts:103](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L103) +[packages/core/src/core/types.ts:115](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L115) ---- +*** -### CLAUDE_VERTEX +### ANTHROPIC -> **CLAUDE_VERTEX**: `"claude_vertex"` +> **ANTHROPIC**: `"anthropic"` #### Defined in -[core/src/core/types.ts:109](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L109) +[packages/core/src/core/types.ts:116](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L116) ---- +*** -### GITHUB +### GROK -> **GITHUB**: `"GITHUB"` +> **GROK**: `"grok"` #### Defined in -[core/src/core/types.ts:111](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L111) +[packages/core/src/core/types.ts:117](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L117) ---- +*** -### GOOGLE +### GROQ -> **GOOGLE**: `"google"` +> **GROQ**: `"groq"` #### Defined in -[core/src/core/types.ts:108](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L108) +[packages/core/src/core/types.ts:118](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L118) ---- +*** -### GROK +### LLAMACLOUD -> **GROK**: `"grok"` +> **LLAMACLOUD**: `"llama_cloud"` #### Defined in -[core/src/core/types.ts:104](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L104) +[packages/core/src/core/types.ts:119](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L119) ---- +*** -### GROQ +### LLAMALOCAL -> **GROQ**: `"groq"` +> **LLAMALOCAL**: `"llama_local"` #### Defined in -[core/src/core/types.ts:105](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L105) +[packages/core/src/core/types.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L120) ---- +*** -### LLAMACLOUD +### GOOGLE -> **LLAMACLOUD**: `"llama_cloud"` +> **GOOGLE**: `"google"` #### Defined in -[core/src/core/types.ts:106](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L106) +[packages/core/src/core/types.ts:121](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L121) ---- +*** -### LLAMALOCAL +### CLAUDE\_VERTEX -> **LLAMALOCAL**: `"llama_local"` +> **CLAUDE\_VERTEX**: `"claude_vertex"` #### Defined in -[core/src/core/types.ts:107](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L107) +[packages/core/src/core/types.ts:122](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L122) ---- +*** -### OPENAI +### REDPILL -> **OPENAI**: `"openai"` +> **REDPILL**: `"redpill"` #### Defined in -[core/src/core/types.ts:102](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L102) +[packages/core/src/core/types.ts:123](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L123) ---- +*** -### REDPILL +### OLLAMA -> **REDPILL**: `"redpill"` +> **OLLAMA**: `"ollama"` #### Defined in -[core/src/core/types.ts:110](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L110) +[packages/core/src/core/types.ts:124](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L124) diff --git a/docs/api/enums/GoalStatus.md b/docs/api/enums/GoalStatus.md deleted file mode 100644 index 533e76a121..0000000000 --- a/docs/api/enums/GoalStatus.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -id: "GoalStatus" -title: "Enumeration: GoalStatus" -sidebar_label: "GoalStatus" -sidebar_position: 0 -custom_edit_url: null ---- - -## Enumeration Members - -### DONE - -• **DONE** = `"DONE"` - ---- - -### FAILED - -• **FAILED** = `"FAILED"` - ---- - -### IN_PROGRESS - -• **IN_PROGRESS** = `"IN_PROGRESS"` diff --git a/docs/api/enums/_category_.yml b/docs/api/enums/_category_.yml deleted file mode 100644 index b4951c1ae9..0000000000 --- a/docs/api/enums/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Enumerations" -position: 2 diff --git a/docs/api/functions/_category_.yml b/docs/api/functions/_category_.yml deleted file mode 100644 index bd69e82d5f..0000000000 --- a/docs/api/functions/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Functions" -position: 7 diff --git a/docs/api/functions/addHeader.md b/docs/api/functions/addHeader.md index 24a26b0927..8dab9cae91 100644 --- a/docs/api/functions/addHeader.md +++ b/docs/api/functions/addHeader.md @@ -1,32 +1,29 @@ ---- -id: "addHeader" -title: "Function: addHeader" -sidebar_label: "addHeader" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: addHeader() -▸ **addHeader**(`header`, `body`): `string` +> **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 +## Parameters -| Name | Type | Description | -| :------- | :------- | :----------------------------------- | -| `header` | `string` | The header to add to the body. | -| `body` | `string` | The body to which to add the header. | +• **header**: `string` -#### Returns +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`** +## Example ```ts // Given a header and a body @@ -37,3 +34,7 @@ const body = "Body"; // "Header\nBody" const text = addHeader(header, body); ``` + +## Defined in + +[packages/core/src/core/context.ts:58](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/context.ts#L58) diff --git a/docs/api/functions/addLore.md b/docs/api/functions/addLore.md deleted file mode 100644 index 4f90686f55..0000000000 --- a/docs/api/functions/addLore.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -id: "addLore" -title: "Function: addLore" -sidebar_label: "addLore" -sidebar_position: 0 -custom_edit_url: null ---- - -▸ **addLore**(`params`): `Promise`\<`void`\> - -Adds a piece of lore to the lore database. Lore can include static information like documents, historical facts, game lore, etc. - -#### Parameters - -| Name | Type | Default value | Description | -| :--------------------- | :--------------------------------------------------------- | :------------ | :-------------------------------------------------------------------------- | -| `params` | `Object` | `undefined` | The parameters for adding lore. | -| `params.content` | [`Content`](../interfaces/Content.md) | `undefined` | The actual content of the lore. | -| `params.embedContent?` | [`Content`](../interfaces/Content.md) | `undefined` | Optional content used to generate an embedding if different from `content`. | -| `params.room_id?` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | `zeroUuid` | The room ID associated with the lore, defaults to a zero UUID. | -| `params.runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | `undefined` | The runtime environment of the agent. | -| `params.source` | `string` | `undefined` | The source of the lore content. | -| `params.user_id?` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | `zeroUuid` | The user ID associated with the lore, defaults to a zero UUID. | - -#### Returns - -`Promise`\<`void`\> - -A promise that resolves when the lore has been added successfully. diff --git a/docs/api/functions/buyToken.md b/docs/api/functions/buyToken.md index 98dfb5f0d5..85a10ba310 100644 --- a/docs/api/functions/buyToken.md +++ b/docs/api/functions/buyToken.md @@ -6,26 +6,26 @@ • **\_\_namedParameters** -• **\_\_namedParameters.allowOffCurve**: `boolean` - -• **\_\_namedParameters.amount**: `bigint` +• **\_\_namedParameters.sdk**: `PumpFunSDK` • **\_\_namedParameters.buyer**: `Keypair` -• **\_\_namedParameters.connection**: `Connection` - • **\_\_namedParameters.mint**: `PublicKey` +• **\_\_namedParameters.amount**: `bigint` + • **\_\_namedParameters.priorityFee**: `PriorityFee` -• **\_\_namedParameters.sdk**: `PumpFunSDK` +• **\_\_namedParameters.allowOffCurve**: `boolean` • **\_\_namedParameters.slippage**: `string` +• **\_\_namedParameters.connection**: `Connection` + ## Returns `Promise`\<`void`\> ## Defined in -[core/src/actions/pumpfun.ts:119](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L119) +[packages/core/src/actions/pumpfun.ts:119](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L119) diff --git a/docs/api/functions/composeActionExamples.md b/docs/api/functions/composeActionExamples.md index 9810d45f8e..8fd9a666f9 100644 --- a/docs/api/functions/composeActionExamples.md +++ b/docs/api/functions/composeActionExamples.md @@ -1,25 +1,26 @@ ---- -id: "composeActionExamples" -title: "Function: composeActionExamples" -sidebar_label: "composeActionExamples" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: composeActionExamples() -▸ **composeActionExamples**(`actionsData`, `count`): `string` +> **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 +## Parameters -| Name | Type | Description | -| :------------ | :------------------------------------ | :-------------------------------------------------------- | -| `actionsData` | [`Action`](../interfaces/Action.md)[] | An array of `Action` objects from which to draw examples. | -| `count` | `number` | The number of examples to generate. | +• **actionsData**: [`Action`](../interfaces/Action.md)[] -#### Returns +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 + +[packages/core/src/core/actions.ts:18](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/actions.ts#L18) diff --git a/docs/api/functions/composeContext.md b/docs/api/functions/composeContext.md index 878f2abdaf..b35fad5e37 100644 --- a/docs/api/functions/composeContext.md +++ b/docs/api/functions/composeContext.md @@ -1,12 +1,6 @@ ---- -id: "composeContext" -title: "Function: composeContext" -sidebar_label: "composeContext" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: composeContext() -▸ **composeContext**(`params`): `string` +> **composeContext**(`params`): `string` Composes a context string by replacing placeholders in a template with corresponding values from the state. @@ -14,28 +8,38 @@ This function takes a template string with placeholders in the format `{{placeho 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 +## Parameters -| Name | Type | Description | -| :---------------- | :-------------------------------- | :------------------------------------------------------------------------------ | -| `params` | `Object` | 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. | +• **params** -#### Returns +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`** +## Example ```ts // Given a state object and a template const state = { userName: "Alice", userAge: 30 }; -const template = "Hello, {{userName}}! You are {{userAge}} years old."; +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 + +[packages/core/src/core/context.ts:24](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/context.ts#L24) diff --git a/docs/api/functions/createAgentRuntime.md b/docs/api/functions/createAgentRuntime.md index ef33390ee9..6f40883152 100644 --- a/docs/api/functions/createAgentRuntime.md +++ b/docs/api/functions/createAgentRuntime.md @@ -18,4 +18,4 @@ ## Defined in -[core/src/cli/index.ts:139](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L139) +[packages/core/src/cli/index.ts:142](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L142) diff --git a/docs/api/functions/createAndBuyToken.md b/docs/api/functions/createAndBuyToken.md index 06add69922..f0074ba6ac 100644 --- a/docs/api/functions/createAndBuyToken.md +++ b/docs/api/functions/createAndBuyToken.md @@ -6,25 +6,25 @@ • **\_\_namedParameters** -• **\_\_namedParameters.allowOffCurve**: `boolean` +• **\_\_namedParameters.deployer**: `Keypair` -• **\_\_namedParameters.buyAmountSol**: `bigint` +• **\_\_namedParameters.mint**: `Keypair` -• **\_\_namedParameters.commitment?**: `"processed"` \| `"confirmed"` \| `"finalized"` \| `"recent"` \| `"single"` \| `"singleGossip"` \| `"root"` \| `"max"` = `"finalized"` +• **\_\_namedParameters.tokenMetadata**: `CreateTokenMetadata` -• **\_\_namedParameters.connection**: `Connection` +• **\_\_namedParameters.buyAmountSol**: `bigint` -• **\_\_namedParameters.deployer**: `Keypair` +• **\_\_namedParameters.priorityFee**: `PriorityFee` -• **\_\_namedParameters.mint**: `Keypair` +• **\_\_namedParameters.allowOffCurve**: `boolean` -• **\_\_namedParameters.priorityFee**: `PriorityFee` +• **\_\_namedParameters.commitment?**: `"processed"` \| `"confirmed"` \| `"finalized"` \| `"recent"` \| `"single"` \| `"singleGossip"` \| `"root"` \| `"max"` = `"finalized"` • **\_\_namedParameters.sdk**: `PumpFunSDK` -• **\_\_namedParameters.slippage**: `string` +• **\_\_namedParameters.connection**: `Connection` -• **\_\_namedParameters.tokenMetadata**: `CreateTokenMetadata` +• **\_\_namedParameters.slippage**: `string` ## Returns @@ -32,4 +32,4 @@ ## Defined in -[core/src/actions/pumpfun.ts:51](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L51) +[packages/core/src/actions/pumpfun.ts:51](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L51) diff --git a/docs/api/functions/createDirectRuntime.md b/docs/api/functions/createDirectRuntime.md index 256a9cf0b0..64ce50167c 100644 --- a/docs/api/functions/createDirectRuntime.md +++ b/docs/api/functions/createDirectRuntime.md @@ -18,4 +18,4 @@ ## Defined in -[core/src/cli/index.ts:174](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L174) +[packages/core/src/cli/index.ts:177](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L177) diff --git a/docs/api/functions/createGoal.md b/docs/api/functions/createGoal.md index 1e732271fe..d2fc00b280 100644 --- a/docs/api/functions/createGoal.md +++ b/docs/api/functions/createGoal.md @@ -1,21 +1,19 @@ ---- -id: "createGoal" -title: "Function: createGoal" -sidebar_label: "createGoal" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: createGoal() -▸ **createGoal**(`«destructured»`): `Promise`\<`void`\> +> **createGoal**(`__namedParameters`): `Promise`\<`void`\> -#### Parameters +## Parameters -| Name | Type | -| :--------------- | :------------------------------------------- | -| `«destructured»` | `Object` | -| › `goal` | [`Goal`](../interfaces/Goal.md) | -| › `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | +• **\_\_namedParameters** -#### Returns +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **\_\_namedParameters.goal**: [`Goal`](../interfaces/Goal.md) + +## Returns `Promise`\<`void`\> + +## Defined in + +[packages/core/src/core/goals.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/goals.ts#L54) diff --git a/docs/api/functions/createRelationship.md b/docs/api/functions/createRelationship.md index 0994aac69b..a784ce4517 100644 --- a/docs/api/functions/createRelationship.md +++ b/docs/api/functions/createRelationship.md @@ -1,22 +1,21 @@ ---- -id: "createRelationship" -title: "Function: createRelationship" -sidebar_label: "createRelationship" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: createRelationship() -▸ **createRelationship**(`«destructured»`): `Promise`\<`boolean`\> +> **createRelationship**(`__namedParameters`): `Promise`\<`boolean`\> -#### Parameters +## Parameters -| Name | Type | -| :--------------- | :--------------------------------------------------------- | -| `«destructured»` | `Object` | -| › `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | -| › `userA` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | -| › `userB` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | +• **\_\_namedParameters** -#### Returns +• **\_\_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 + +[packages/core/src/core/relationships.ts:3](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/relationships.ts#L3) diff --git a/docs/api/functions/embed.md b/docs/api/functions/embed.md index 9c9492cbc5..54b84f3fe4 100644 --- a/docs/api/functions/embed.md +++ b/docs/api/functions/embed.md @@ -20,4 +20,4 @@ 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) +[packages/core/src/core/embedding.ts:9](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/embedding.ts#L9) diff --git a/docs/api/functions/formatActionConditions.md b/docs/api/functions/formatActionConditions.md deleted file mode 100644 index 6aad1feedb..0000000000 --- a/docs/api/functions/formatActionConditions.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -id: "formatActionConditions" -title: "Function: formatActionConditions" -sidebar_label: "formatActionConditions" -sidebar_position: 0 -custom_edit_url: null ---- - -▸ **formatActionConditions**(`actions`): `string` - -Formats the conditions for each provided action into a string, listing each action's name and its associated condition, separated by commas and newlines. - -#### Parameters - -| Name | Type | Description | -| :-------- | :------------------------------------ | :------------------------------------------------------------- | -| `actions` | [`Action`](../interfaces/Action.md)[] | An array of `Action` objects from which to extract conditions. | - -#### Returns - -`string` - -A string listing each action's name and its condition. diff --git a/docs/api/functions/formatActionNames.md b/docs/api/functions/formatActionNames.md index 1c2ffc112c..e0073f7547 100644 --- a/docs/api/functions/formatActionNames.md +++ b/docs/api/functions/formatActionNames.md @@ -1,23 +1,21 @@ ---- -id: "formatActionNames" -title: "Function: formatActionNames" -sidebar_label: "formatActionNames" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: formatActionNames() -▸ **formatActionNames**(`actions`): `string` +> **formatActionNames**(`actions`): `string` Formats the names of the provided actions into a comma-separated string. -#### Parameters +## Parameters -| Name | Type | Description | -| :-------- | :------------------------------------ | :-------------------------------------------------------- | -| `actions` | [`Action`](../interfaces/Action.md)[] | An array of `Action` objects from which to extract names. | +• **actions**: [`Action`](../interfaces/Action.md)[] -#### Returns +An array of `Action` objects from which to extract names. + +## Returns `string` A comma-separated string of action names. + +## Defined in + +[packages/core/src/core/actions.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/actions.ts#L54) diff --git a/docs/api/functions/formatActions.md b/docs/api/functions/formatActions.md index 50a83a67ac..9a3645e78e 100644 --- a/docs/api/functions/formatActions.md +++ b/docs/api/functions/formatActions.md @@ -1,23 +1,21 @@ ---- -id: "formatActions" -title: "Function: formatActions" -sidebar_label: "formatActions" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: formatActions() -▸ **formatActions**(`actions`): `string` +> **formatActions**(`actions`): `string` Formats the provided actions into a detailed string listing each action's name and description, separated by commas and newlines. -#### Parameters +## Parameters -| Name | Type | Description | -| :-------- | :------------------------------------ | :-------------------------------------- | -| `actions` | [`Action`](../interfaces/Action.md)[] | An array of `Action` objects to format. | +• **actions**: [`Action`](../interfaces/Action.md)[] -#### Returns +An array of `Action` objects to format. + +## Returns `string` A detailed string of actions, including names and descriptions. + +## Defined in + +[packages/core/src/core/actions.ts:66](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/actions.ts#L66) diff --git a/docs/api/functions/formatActors.md b/docs/api/functions/formatActors.md index dba84ed1a2..ba8500d848 100644 --- a/docs/api/functions/formatActors.md +++ b/docs/api/functions/formatActors.md @@ -1,24 +1,23 @@ ---- -id: "formatActors" -title: "Function: formatActors" -sidebar_label: "formatActors" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: formatActors() -▸ **formatActors**(`actors`): `string` +> **formatActors**(`actors`): `string` Format actors into a string -#### Parameters +## Parameters -| Name | Type | Description | -| :-------------- | :---------------------------------- | :------------- | -| `actors` | `Object` | list of actors | -| `actors.actors` | [`Actor`](../interfaces/Actor.md)[] | - | +• **actors** -#### Returns +list of actors + +• **actors.actors**: [`Actor`](../interfaces/Actor.md)[] + +## Returns `string` string + +## Defined in + +[packages/core/src/core/messages.ts:45](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/messages.ts#L45) diff --git a/docs/api/functions/formatEvaluatorConditions.md b/docs/api/functions/formatEvaluatorConditions.md deleted file mode 100644 index ee7dc6cd2f..0000000000 --- a/docs/api/functions/formatEvaluatorConditions.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -id: "formatEvaluatorConditions" -title: "Function: formatEvaluatorConditions" -sidebar_label: "formatEvaluatorConditions" -sidebar_position: 0 -custom_edit_url: null ---- - -▸ **formatEvaluatorConditions**(`evaluators`): `string` - -Formats the conditions under which each evaluator is relevant into a readable string. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------ | :----------------------------- | -| `evaluators` | [`Evaluator`](../interfaces/Evaluator.md)[] | An array of evaluator objects. | - -#### Returns - -`string` - -A string that concatenates the name and condition of each evaluator, separated by a colon and a newline character. diff --git a/docs/api/functions/formatEvaluatorExampleConditions.md b/docs/api/functions/formatEvaluatorExampleConditions.md deleted file mode 100644 index d4554a442a..0000000000 --- a/docs/api/functions/formatEvaluatorExampleConditions.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -id: "formatEvaluatorExampleConditions" -title: "Function: formatEvaluatorExampleConditions" -sidebar_label: "formatEvaluatorExampleConditions" -sidebar_position: 0 -custom_edit_url: null ---- - -▸ **formatEvaluatorExampleConditions**(`evaluators`): `string` - -Generates a string describing the conditions under which each evaluator example is relevant. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------ | :------------------------------------------------------- | -| `evaluators` | [`Evaluator`](../interfaces/Evaluator.md)[] | An array of evaluator objects, each containing examples. | - -#### Returns - -`string` - -A string that describes the conditions for each evaluator example, formatted with the evaluator name, example number, and condition. diff --git a/docs/api/functions/formatEvaluatorExampleDescriptions.md b/docs/api/functions/formatEvaluatorExampleDescriptions.md index 4e942c1fc0..45bcb4d89b 100644 --- a/docs/api/functions/formatEvaluatorExampleDescriptions.md +++ b/docs/api/functions/formatEvaluatorExampleDescriptions.md @@ -1,23 +1,21 @@ ---- -id: "formatEvaluatorExampleDescriptions" -title: "Function: formatEvaluatorExampleDescriptions" -sidebar_label: "formatEvaluatorExampleDescriptions" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: formatEvaluatorExampleDescriptions() -▸ **formatEvaluatorExampleDescriptions**(`evaluators`): `string` +> **formatEvaluatorExampleDescriptions**(`evaluators`): `string` Generates a string summarizing the descriptions of each evaluator example. -#### Parameters +## Parameters -| Name | Type | Description | -| :----------- | :------------------------------------------ | :------------------------------------------------------- | -| `evaluators` | [`Evaluator`](../interfaces/Evaluator.md)[] | An array of evaluator objects, each containing examples. | +• **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] -#### Returns +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 + +[packages/core/src/core/evaluators.ts:114](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L114) diff --git a/docs/api/functions/formatEvaluatorExamples.md b/docs/api/functions/formatEvaluatorExamples.md index 4b3c6cc0c9..ef74094bc0 100644 --- a/docs/api/functions/formatEvaluatorExamples.md +++ b/docs/api/functions/formatEvaluatorExamples.md @@ -1,23 +1,21 @@ ---- -id: "formatEvaluatorExamples" -title: "Function: formatEvaluatorExamples" -sidebar_label: "formatEvaluatorExamples" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: formatEvaluatorExamples() -▸ **formatEvaluatorExamples**(`evaluators`): `string` +> **formatEvaluatorExamples**(`evaluators`): `string` Formats evaluator examples into a readable string, replacing placeholders with generated names. -#### Parameters +## Parameters -| Name | Type | Description | -| :----------- | :------------------------------------------ | :----------------------------------------------------------------- | -| `evaluators` | [`Evaluator`](../interfaces/Evaluator.md)[] | An array of evaluator objects, each containing examples to format. | +• **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] -#### Returns +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 + +[packages/core/src/core/evaluators.ts:59](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L59) diff --git a/docs/api/functions/formatEvaluatorNames.md b/docs/api/functions/formatEvaluatorNames.md index 076f74a1b2..365e0b6efa 100644 --- a/docs/api/functions/formatEvaluatorNames.md +++ b/docs/api/functions/formatEvaluatorNames.md @@ -1,23 +1,21 @@ ---- -id: "formatEvaluatorNames" -title: "Function: formatEvaluatorNames" -sidebar_label: "formatEvaluatorNames" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: formatEvaluatorNames() -▸ **formatEvaluatorNames**(`evaluators`): `string` +> **formatEvaluatorNames**(`evaluators`): `string` Formats the names of evaluators into a comma-separated list, each enclosed in single quotes. -#### Parameters +## Parameters -| Name | Type | Description | -| :----------- | :------------------------------------------ | :----------------------------- | -| `evaluators` | [`Evaluator`](../interfaces/Evaluator.md)[] | An array of evaluator objects. | +• **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] -#### Returns +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 + +[packages/core/src/core/evaluators.ts:34](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L34) diff --git a/docs/api/functions/formatEvaluators.md b/docs/api/functions/formatEvaluators.md index 854d499199..daf7ee3391 100644 --- a/docs/api/functions/formatEvaluators.md +++ b/docs/api/functions/formatEvaluators.md @@ -1,23 +1,21 @@ ---- -id: "formatEvaluators" -title: "Function: formatEvaluators" -sidebar_label: "formatEvaluators" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: formatEvaluators() -▸ **formatEvaluators**(`evaluators`): `string` +> **formatEvaluators**(`evaluators`): `string` Formats evaluator details into a string, including both the name and description of each evaluator. -#### Parameters +## Parameters -| Name | Type | Description | -| :----------- | :------------------------------------------ | :----------------------------- | -| `evaluators` | [`Evaluator`](../interfaces/Evaluator.md)[] | An array of evaluator objects. | +• **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] -#### Returns +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 + +[packages/core/src/core/evaluators.ts:45](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L45) diff --git a/docs/api/functions/formatGoalsAsString.md b/docs/api/functions/formatGoalsAsString.md index ecee1f9f5c..66f23f1e17 100644 --- a/docs/api/functions/formatGoalsAsString.md +++ b/docs/api/functions/formatGoalsAsString.md @@ -1,20 +1,17 @@ ---- -id: "formatGoalsAsString" -title: "Function: formatGoalsAsString" -sidebar_label: "formatGoalsAsString" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: formatGoalsAsString() -▸ **formatGoalsAsString**(`«destructured»`): `string` +> **formatGoalsAsString**(`__namedParameters`): `string` -#### Parameters +## Parameters -| Name | Type | -| :--------------- | :-------------------------------- | -| `«destructured»` | `Object` | -| › `goals` | [`Goal`](../interfaces/Goal.md)[] | +• **\_\_namedParameters** -#### Returns +• **\_\_namedParameters.goals**: [`Goal`](../interfaces/Goal.md)[] + +## Returns `string` + +## Defined in + +[packages/core/src/core/goals.ts:29](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/goals.ts#L29) diff --git a/docs/api/functions/formatLore.md b/docs/api/functions/formatLore.md deleted file mode 100644 index 990d5cabd8..0000000000 --- a/docs/api/functions/formatLore.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -id: "formatLore" -title: "Function: formatLore" -sidebar_label: "formatLore" -sidebar_position: 0 -custom_edit_url: null ---- - -▸ **formatLore**(`lore`): `string` - -Formats an array of lore entries into a single string. Each entry is separated by a newline, and sources are annotated. - -#### Parameters - -| Name | Type | Description | -| :----- | :------------------------------------ | :---------------------------------- | -| `lore` | [`Memory`](../interfaces/Memory.md)[] | An array of lore entries to format. | - -#### Returns - -`string` - -A formatted string containing all the lore entries, each separated by a newline, with sources annotated. diff --git a/docs/api/functions/formatMessages.md b/docs/api/functions/formatMessages.md index 51e084c840..d2e5ee0a0b 100644 --- a/docs/api/functions/formatMessages.md +++ b/docs/api/functions/formatMessages.md @@ -1,25 +1,23 @@ ---- -id: "formatMessages" -title: "Function: formatMessages" -sidebar_label: "formatMessages" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: formatMessages() -▸ **formatMessages**(`«destructured»`): `string` +> **formatMessages**(`__namedParameters`): `string` Format messages into a string -#### Parameters +## Parameters -| Name | Type | -| :--------------- | :------------------------------------ | -| `«destructured»` | `Object` | -| › `actors` | [`Actor`](../interfaces/Actor.md)[] | -| › `messages` | [`Memory`](../interfaces/Memory.md)[] | +• **\_\_namedParameters** -#### Returns +• **\_\_namedParameters.messages**: [`Memory`](../interfaces/Memory.md)[] + +• **\_\_namedParameters.actors**: [`Actor`](../interfaces/Actor.md)[] + +## Returns `string` string + +## Defined in + +[packages/core/src/core/messages.ts:60](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/messages.ts#L60) diff --git a/docs/api/functions/formatPosts.md b/docs/api/functions/formatPosts.md index 565fc5d336..de58de9a4b 100644 --- a/docs/api/functions/formatPosts.md +++ b/docs/api/functions/formatPosts.md @@ -6,16 +6,16 @@ • **\_\_namedParameters** +• **\_\_namedParameters.messages**: [`Memory`](../interfaces/Memory.md)[] + • **\_\_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) +[packages/core/src/core/posts.ts:4](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/posts.ts#L4) diff --git a/docs/api/functions/formatRelationships.md b/docs/api/functions/formatRelationships.md index ad6617e8ef..5fbe919c22 100644 --- a/docs/api/functions/formatRelationships.md +++ b/docs/api/functions/formatRelationships.md @@ -1,21 +1,19 @@ ---- -id: "formatRelationships" -title: "Function: formatRelationships" -sidebar_label: "formatRelationships" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: formatRelationships() -▸ **formatRelationships**(`«destructured»`): `Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +> **formatRelationships**(`__namedParameters`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -#### Parameters +## Parameters -| Name | Type | -| :--------------- | :--------------------------------------------------------- | -| `«destructured»` | `Object` | -| › `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | -| › `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | +• **\_\_namedParameters** -#### Returns +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) -`Promise`\<\`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\`[]\> +• **\_\_namedParameters.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +## Returns + +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> + +## Defined in + +[packages/core/src/core/relationships.ts:43](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/relationships.ts#L43) diff --git a/docs/api/functions/formatTimestamp.md b/docs/api/functions/formatTimestamp.md index a33b4ceed5..4fd55ca4c0 100644 --- a/docs/api/functions/formatTimestamp.md +++ b/docs/api/functions/formatTimestamp.md @@ -12,4 +12,4 @@ ## Defined in -[core/src/core/messages.ts:94](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/messages.ts#L94) +[packages/core/src/core/messages.ts:94](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/messages.ts#L94) diff --git a/docs/api/functions/generateCaption.md b/docs/api/functions/generateCaption.md index 3f9b6eaea6..5d2d6376fa 100644 --- a/docs/api/functions/generateCaption.md +++ b/docs/api/functions/generateCaption.md @@ -14,14 +14,14 @@ `Promise`\<`object`\> -### description - -> **description**: `string` - ### title > **title**: `string` +### description + +> **description**: `string` + ## Defined in -[core/src/actions/imageGenerationUtils.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/imageGenerationUtils.ts#L90) +[packages/core/src/actions/imageGenerationUtils.ts:90](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/imageGenerationUtils.ts#L90) diff --git a/docs/api/functions/generateImage.md b/docs/api/functions/generateImage.md index e5b91938b0..5174f3e5bb 100644 --- a/docs/api/functions/generateImage.md +++ b/docs/api/functions/generateImage.md @@ -6,20 +6,24 @@ • **data** -• **data.count?**: `number` - -• **data.height**: `number` - • **data.prompt**: `string` • **data.width**: `number` +• **data.height**: `number` + +• **data.count?**: `number` + • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) ## Returns `Promise`\<`object`\> +### success + +> **success**: `boolean` + ### data? > `optional` **data**: `string`[] @@ -28,10 +32,6 @@ > `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) +[packages/core/src/actions/imageGenerationUtils.ts:8](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/imageGenerationUtils.ts#L8) diff --git a/docs/api/functions/generateMessageResponse.md b/docs/api/functions/generateMessageResponse.md index 90542895ec..08ebd06173 100644 --- a/docs/api/functions/generateMessageResponse.md +++ b/docs/api/functions/generateMessageResponse.md @@ -10,14 +10,14 @@ Send a message to the model for generateText. The options for the generateText request. +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + • **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)\> @@ -26,4 +26,4 @@ The completed message. ## Defined in -[core/src/core/generation.ts:522](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L522) +[packages/core/src/core/generation.ts:549](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L549) diff --git a/docs/api/functions/generateObject.md b/docs/api/functions/generateObject.md index 9d1dbf9eea..e7d371137a 100644 --- a/docs/api/functions/generateObject.md +++ b/docs/api/functions/generateObject.md @@ -6,16 +6,16 @@ • **\_\_namedParameters** +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + • **\_\_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) +[packages/core/src/core/generation.ts:465](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L465) diff --git a/docs/api/functions/generateObjectArray.md b/docs/api/functions/generateObjectArray.md index af24589e74..fc3df4ba65 100644 --- a/docs/api/functions/generateObjectArray.md +++ b/docs/api/functions/generateObjectArray.md @@ -6,16 +6,16 @@ • **\_\_namedParameters** +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + • **\_\_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) +[packages/core/src/core/generation.ts:501](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L501) diff --git a/docs/api/functions/generateShouldRespond.md b/docs/api/functions/generateShouldRespond.md index 5f73dfa705..cdf2d03af5 100644 --- a/docs/api/functions/generateShouldRespond.md +++ b/docs/api/functions/generateShouldRespond.md @@ -10,14 +10,14 @@ Sends a message to the model to determine if it should respond to the given cont The options for the generateText request +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + • **opts.context**: `string` The context to evaluate for response • **opts.modelClass**: `string` -• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - ## Returns `Promise`\<`"RESPOND"` \| `"IGNORE"` \| `"STOP"` \| `null`\> @@ -26,4 +26,4 @@ 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) +[packages/core/src/core/generation.ts:273](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L273) diff --git a/docs/api/functions/generateText.md b/docs/api/functions/generateText.md index 4c5c6da997..fd2f5f220f 100644 --- a/docs/api/functions/generateText.md +++ b/docs/api/functions/generateText.md @@ -10,14 +10,14 @@ Send a message to the model for a text generateText - receive a string back and The options for the generateText request. +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + • **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. @@ -30,4 +30,4 @@ The completed message. ## Defined in -[core/src/core/generation.ts:30](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L30) +[packages/core/src/core/generation.ts:31](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L31) diff --git a/docs/api/functions/generateTextArray.md b/docs/api/functions/generateTextArray.md index 8aa1618631..fed1f124bb 100644 --- a/docs/api/functions/generateTextArray.md +++ b/docs/api/functions/generateTextArray.md @@ -10,14 +10,14 @@ Send a message to the model and parse the response as a string array The options for the generateText request +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + • **opts.context**: `string` The context/prompt to send to the model • **opts.modelClass**: `string` -• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - ## Returns `Promise`\<`string`[]\> @@ -26,4 +26,4 @@ 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) +[packages/core/src/core/generation.ts:429](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L429) diff --git a/docs/api/functions/generateTrueOrFalse.md b/docs/api/functions/generateTrueOrFalse.md index 55a73fb820..ea91c27088 100644 --- a/docs/api/functions/generateTrueOrFalse.md +++ b/docs/api/functions/generateTrueOrFalse.md @@ -10,14 +10,14 @@ Sends a message to the model and parses the response as a boolean value The options for the generateText request +• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + • **opts.context**: `string` = `""` The context to evaluate for the boolean response • **opts.modelClass**: `string` -• **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - ## Returns `Promise`\<`boolean`\> @@ -26,4 +26,4 @@ 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) +[packages/core/src/core/generation.ts:377](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L377) diff --git a/docs/api/functions/getActorDetails.md b/docs/api/functions/getActorDetails.md index efa9b0618c..545a980fa7 100644 --- a/docs/api/functions/getActorDetails.md +++ b/docs/api/functions/getActorDetails.md @@ -1,23 +1,21 @@ ---- -id: "getActorDetails" -title: "Function: getActorDetails" -sidebar_label: "getActorDetails" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: getActorDetails() -▸ **getActorDetails**(`«destructured»`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> +> **getActorDetails**(`__namedParameters`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> Get details for a list of actors. -#### Parameters +## Parameters -| Name | Type | -| :--------------- | :--------------------------------------------------------- | -| `«destructured»` | `Object` | -| › `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | -| › `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | +• **\_\_namedParameters** -#### Returns +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **\_\_namedParameters.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +## Returns `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> + +## Defined in + +[packages/core/src/core/messages.ts:12](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/messages.ts#L12) diff --git a/docs/api/functions/getEndpoint.md b/docs/api/functions/getEndpoint.md index 80d526b74a..65a865daa9 100644 --- a/docs/api/functions/getEndpoint.md +++ b/docs/api/functions/getEndpoint.md @@ -1,6 +1,6 @@ # Function: getEndpoint() -> **getEndpoint**(`provider`): `any` +> **getEndpoint**(`provider`): `string` ## Parameters @@ -8,8 +8,8 @@ ## Returns -`any` +`string` ## Defined in -[core/src/core/models.ts:178](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/models.ts#L178) +[packages/core/src/core/models.ts:183](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/models.ts#L183) diff --git a/docs/api/functions/getFormattedActions.md b/docs/api/functions/getFormattedActions.md deleted file mode 100644 index f2023db2b6..0000000000 --- a/docs/api/functions/getFormattedActions.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -id: "getFormattedActions" -title: "Function: getFormattedActions" -sidebar_label: "getFormattedActions" -sidebar_position: 0 -custom_edit_url: null ---- - -▸ **getFormattedActions**(`actions`): `string` - -Formats the provided actions into a string listing each action's name and description. - -#### Parameters - -| Name | Type | Description | -| :-------- | :------------------------------------ | :-------------------------------------- | -| `actions` | [`Action`](../interfaces/Action.md)[] | An array of `Action` objects to format. | - -#### Returns - -`string` - -A formatted string listing each action's name and description. diff --git a/docs/api/functions/getGoals.md b/docs/api/functions/getGoals.md index 2c280f26eb..52cda4a7c3 100644 --- a/docs/api/functions/getGoals.md +++ b/docs/api/functions/getGoals.md @@ -1,24 +1,25 @@ ---- -id: "getGoals" -title: "Function: getGoals" -sidebar_label: "getGoals" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: getGoals() -▸ **getGoals**(`«destructured»`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> +> **getGoals**(`__namedParameters`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> -#### Parameters +## Parameters -| Name | Type | Default value | -| :------------------ | :--------------------------------------------------------- | :------------ | -| `«destructured»` | `Object` | `undefined` | -| › `count?` | `number` | `5` | -| › `onlyInProgress?` | `boolean` | `true` | -| › `room_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | `undefined` | -| › `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | `undefined` | -| › `user_id?` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | `undefined` | +• **\_\_namedParameters** -#### Returns +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **\_\_namedParameters.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **\_\_namedParameters.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **\_\_namedParameters.onlyInProgress?**: `boolean` = `true` + +• **\_\_namedParameters.count?**: `number` = `5` + +## Returns `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> + +## Defined in + +[packages/core/src/core/goals.ts:8](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/goals.ts#L8) diff --git a/docs/api/functions/getImageGenModel.md b/docs/api/functions/getImageGenModel.md index cb905f5316..2251cc7a8a 100644 --- a/docs/api/functions/getImageGenModel.md +++ b/docs/api/functions/getImageGenModel.md @@ -12,4 +12,4 @@ ## Defined in -[core/src/core/imageGenModels.ts:17](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L17) +[packages/core/src/core/imageGenModels.ts:17](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/imageGenModels.ts#L17) diff --git a/docs/api/functions/getLore.md b/docs/api/functions/getLore.md deleted file mode 100644 index 96b1420859..0000000000 --- a/docs/api/functions/getLore.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -id: "getLore" -title: "Function: getLore" -sidebar_label: "getLore" -sidebar_position: 0 -custom_edit_url: null ---- - -▸ **getLore**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Retrieves lore from the lore database based on a search query. This function uses embedding to find similar lore entries. - -#### Parameters - -| Name | Type | Default value | Description | -| :------------------------ | :--------------------------------------------------------- | :------------ | :------------------------------------------------------------------------------------------ | -| `params` | `Object` | `undefined` | The parameters for retrieving lore. | -| `params.count?` | `number` | `undefined` | The maximum number of lore entries to retrieve. | -| `params.match_threshold?` | `number` | `undefined` | The similarity threshold for matching lore entries, lower values mean more strict matching. | -| `params.message` | `string` | `undefined` | The search query message to find relevant lore. | -| `params.room_id?` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | `zeroUuid` | - | -| `params.runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | `undefined` | The runtime environment of the agent. | - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -A promise that resolves to an array of lore entries that match the search query. diff --git a/docs/api/functions/getModel.md b/docs/api/functions/getModel.md index 9c980265b4..38c8293d58 100644 --- a/docs/api/functions/getModel.md +++ b/docs/api/functions/getModel.md @@ -1,6 +1,6 @@ # Function: getModel() -> **getModel**(`provider`, `type`): `any` +> **getModel**(`provider`, `type`): `string` ## Parameters @@ -10,8 +10,8 @@ ## Returns -`any` +`string` ## Defined in -[core/src/core/models.ts:174](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/models.ts#L174) +[packages/core/src/core/models.ts:179](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/models.ts#L179) diff --git a/docs/api/functions/getProviders.md b/docs/api/functions/getProviders.md index 06f07f6ea7..83846e7478 100644 --- a/docs/api/functions/getProviders.md +++ b/docs/api/functions/getProviders.md @@ -1,25 +1,29 @@ ---- -id: "getProviders" -title: "Function: getProviders" -sidebar_label: "getProviders" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: getProviders() -▸ **getProviders**(`runtime`, `message`, `state?`): `Promise`\<`string`\> +> **getProviders**(`runtime`, `message`, `state`?): `Promise`\<`string`\> Formats provider outputs into a string which can be injected into the context. -#### Parameters +## Parameters -| Name | Type | Description | -| :-------- | :------------------------------------------- | :--------------------------- | -| `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | The Eliza runtime object. | -| `message` | [`Message`](../interfaces/Message.md) | The incoming message object. | -| `state?` | [`State`](../interfaces/State.md) | The current state object. | +• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) -#### Returns +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 + +[packages/core/src/core/providers.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/providers.ts#L13) diff --git a/docs/api/functions/getRelationship.md b/docs/api/functions/getRelationship.md index bfffa5c6fa..5d15b6edde 100644 --- a/docs/api/functions/getRelationship.md +++ b/docs/api/functions/getRelationship.md @@ -1,22 +1,21 @@ ---- -id: "getRelationship" -title: "Function: getRelationship" -sidebar_label: "getRelationship" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: getRelationship() -▸ **getRelationship**(`«destructured»`): `Promise`\<`null` \| [`Relationship`](../interfaces/Relationship.md)\> +> **getRelationship**(`__namedParameters`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> -#### Parameters +## Parameters -| Name | Type | -| :--------------- | :--------------------------------------------------------- | -| `«destructured»` | `Object` | -| › `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | -| › `userA` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | -| › `userB` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | +• **\_\_namedParameters** -#### Returns +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) -`Promise`\<`null` \| [`Relationship`](../interfaces/Relationship.md)\> +• **\_\_namedParameters.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **\_\_namedParameters.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +## Returns + +`Promise`\<[`Relationship`](../interfaces/Relationship.md)\> + +## Defined in + +[packages/core/src/core/relationships.ts:18](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/relationships.ts#L18) diff --git a/docs/api/functions/getRelationships.md b/docs/api/functions/getRelationships.md index b35c131957..80813aaeac 100644 --- a/docs/api/functions/getRelationships.md +++ b/docs/api/functions/getRelationships.md @@ -1,21 +1,19 @@ ---- -id: "getRelationships" -title: "Function: getRelationships" -sidebar_label: "getRelationships" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: getRelationships() -▸ **getRelationships**(`«destructured»`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> +> **getRelationships**(`__namedParameters`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> -#### Parameters +## Parameters -| Name | Type | -| :--------------- | :--------------------------------------------------------- | -| `«destructured»` | `Object` | -| › `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | -| › `user_id` | \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` | +• **\_\_namedParameters** -#### Returns +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **\_\_namedParameters.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +## Returns `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> + +## Defined in + +[packages/core/src/core/relationships.ts:33](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/relationships.ts#L33) diff --git a/docs/api/functions/getTokenForProvider.md b/docs/api/functions/getTokenForProvider.md index 0177abf0f6..017040b43b 100644 --- a/docs/api/functions/getTokenForProvider.md +++ b/docs/api/functions/getTokenForProvider.md @@ -14,4 +14,4 @@ ## Defined in -[core/src/cli/index.ts:105](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L105) +[packages/core/src/cli/index.ts:108](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L108) diff --git a/docs/api/functions/initializeClients.md b/docs/api/functions/initializeClients.md index 9549c70a10..dec2f80f63 100644 --- a/docs/api/functions/initializeClients.md +++ b/docs/api/functions/initializeClients.md @@ -14,4 +14,4 @@ ## Defined in -[core/src/cli/index.ts:21](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L21) +[packages/core/src/cli/index.ts:21](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L21) diff --git a/docs/api/functions/initializeDatabase.md b/docs/api/functions/initializeDatabase.md index d7d58df27f..486775902c 100644 --- a/docs/api/functions/initializeDatabase.md +++ b/docs/api/functions/initializeDatabase.md @@ -8,4 +8,4 @@ ## Defined in -[core/src/cli/index.ts:129](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L129) +[packages/core/src/cli/index.ts:132](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L132) diff --git a/docs/api/functions/isCreateAndBuyContent.md b/docs/api/functions/isCreateAndBuyContent.md index da8cdbee1a..4107ab0dde 100644 --- a/docs/api/functions/isCreateAndBuyContent.md +++ b/docs/api/functions/isCreateAndBuyContent.md @@ -14,4 +14,4 @@ ## Defined in -[core/src/actions/pumpfun.ts:33](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L33) +[packages/core/src/actions/pumpfun.ts:33](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L33) diff --git a/docs/api/functions/loadActionConfigs.md b/docs/api/functions/loadActionConfigs.md index 3348a03d81..5ada901167 100644 --- a/docs/api/functions/loadActionConfigs.md +++ b/docs/api/functions/loadActionConfigs.md @@ -12,4 +12,4 @@ ## Defined in -[core/src/cli/config.ts:15](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/config.ts#L15) +[packages/core/src/cli/config.ts:15](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/config.ts#L15) diff --git a/docs/api/functions/loadCharacters.md b/docs/api/functions/loadCharacters.md index 43f4922c04..59bb5adcc4 100644 --- a/docs/api/functions/loadCharacters.md +++ b/docs/api/functions/loadCharacters.md @@ -12,4 +12,4 @@ ## Defined in -[core/src/cli/index.ts:70](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L70) +[packages/core/src/cli/index.ts:70](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L70) diff --git a/docs/api/functions/loadCustomActions.md b/docs/api/functions/loadCustomActions.md index c1d81f66a4..bb8ce794b6 100644 --- a/docs/api/functions/loadCustomActions.md +++ b/docs/api/functions/loadCustomActions.md @@ -12,4 +12,4 @@ ## Defined in -[core/src/cli/config.ts:26](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/config.ts#L26) +[packages/core/src/cli/config.ts:26](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/config.ts#L26) diff --git a/docs/api/functions/parseArguments.md b/docs/api/functions/parseArguments.md index b70bd97354..4600ec4d62 100644 --- a/docs/api/functions/parseArguments.md +++ b/docs/api/functions/parseArguments.md @@ -8,4 +8,4 @@ ## Defined in -[core/src/cli/index.ts:46](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L46) +[packages/core/src/cli/index.ts:46](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L46) diff --git a/docs/api/functions/parseJSONObjectFromText.md b/docs/api/functions/parseJSONObjectFromText.md deleted file mode 100644 index 9c2e99ccce..0000000000 --- a/docs/api/functions/parseJSONObjectFromText.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -id: "parseJSONObjectFromText" -title: "Function: parseJSONObjectFromText" -sidebar_label: "parseJSONObjectFromText" -sidebar_position: 0 -custom_edit_url: null ---- - -▸ **parseJSONObjectFromText**(`text`): `any` - -Parses a JSON object from a given text. The function looks for a JSON block wrapped in triple backticks -with `json` language identifier, and if not found, it searches for an object pattern within the text. -It then attempts to parse the JSON string into a JavaScript object. If parsing is successful and the result -is an object (but not an array), it returns the object; otherwise, it tries to parse an array if the result -is an array, or returns null if parsing is unsuccessful or the result is neither an object nor an array. - -#### Parameters - -| Name | Type | Description | -| :----- | :------- | :-------------------------------------------------------------- | -| `text` | `string` | The input text from which to extract and parse the JSON object. | - -#### Returns - -`any` - -An object parsed from the JSON string if successful; otherwise, null or the result of parsing an array. diff --git a/docs/api/functions/parseJsonArrayFromText.md b/docs/api/functions/parseJsonArrayFromText.md deleted file mode 100644 index 7380c0096b..0000000000 --- a/docs/api/functions/parseJsonArrayFromText.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -id: "parseJsonArrayFromText" -title: "Function: parseJsonArrayFromText" -sidebar_label: "parseJsonArrayFromText" -sidebar_position: 0 -custom_edit_url: null ---- - -▸ **parseJsonArrayFromText**(`text`): `null` \| `any`[] - -Parses a JSON array from a given text. The function looks for a JSON block wrapped in triple backticks -with `json` language identifier, and if not found, it searches for an array pattern within the text. -It then attempts to parse the JSON string into a JavaScript object. If parsing is successful and the result -is an array, it returns the array; otherwise, it returns null. - -#### Parameters - -| Name | Type | Description | -| :----- | :------- | :------------------------------------------------------------- | -| `text` | `string` | The input text from which to extract and parse the JSON array. | - -#### Returns - -`null` \| `any`[] - -An array parsed from the JSON string if successful; otherwise, null. diff --git a/docs/api/functions/retrieveCachedEmbedding.md b/docs/api/functions/retrieveCachedEmbedding.md index 31922d1ebc..4b7f74e01f 100644 --- a/docs/api/functions/retrieveCachedEmbedding.md +++ b/docs/api/functions/retrieveCachedEmbedding.md @@ -14,4 +14,4 @@ ## Defined in -[core/src/core/embedding.ts:65](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/embedding.ts#L65) +[packages/core/src/core/embedding.ts:68](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/embedding.ts#L68) diff --git a/docs/api/functions/sellToken.md b/docs/api/functions/sellToken.md index c275a4ae4e..78039a6dff 100644 --- a/docs/api/functions/sellToken.md +++ b/docs/api/functions/sellToken.md @@ -6,26 +6,26 @@ • **\_\_namedParameters** -• **\_\_namedParameters.allowOffCurve**: `boolean` - -• **\_\_namedParameters.amount**: `bigint` +• **\_\_namedParameters.sdk**: `PumpFunSDK` -• **\_\_namedParameters.connection**: `Connection` +• **\_\_namedParameters.seller**: `Keypair` • **\_\_namedParameters.mint**: `PublicKey` -• **\_\_namedParameters.priorityFee**: `PriorityFee` +• **\_\_namedParameters.amount**: `bigint` -• **\_\_namedParameters.sdk**: `PumpFunSDK` +• **\_\_namedParameters.priorityFee**: `PriorityFee` -• **\_\_namedParameters.seller**: `Keypair` +• **\_\_namedParameters.allowOffCurve**: `boolean` • **\_\_namedParameters.slippage**: `string` +• **\_\_namedParameters.connection**: `Connection` + ## Returns `Promise`\<`void`\> ## Defined in -[core/src/actions/pumpfun.ts:167](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L167) +[packages/core/src/actions/pumpfun.ts:167](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L167) diff --git a/docs/api/functions/splitChunks.md b/docs/api/functions/splitChunks.md index 7e8758b533..d58c11b0b7 100644 --- a/docs/api/functions/splitChunks.md +++ b/docs/api/functions/splitChunks.md @@ -30,4 +30,4 @@ 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) +[packages/core/src/core/generation.ts:329](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L329) diff --git a/docs/api/functions/startDiscord.md b/docs/api/functions/startDiscord.md index 1c46e116f3..0602444dab 100644 --- a/docs/api/functions/startDiscord.md +++ b/docs/api/functions/startDiscord.md @@ -12,4 +12,4 @@ ## Defined in -[core/src/cli/index.ts:211](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L211) +[packages/core/src/cli/index.ts:214](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L214) diff --git a/docs/api/functions/startTelegram.md b/docs/api/functions/startTelegram.md index f70aa9fbab..99a6509929 100644 --- a/docs/api/functions/startTelegram.md +++ b/docs/api/functions/startTelegram.md @@ -14,4 +14,4 @@ ## Defined in -[core/src/cli/index.ts:215](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L215) +[packages/core/src/cli/index.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L218) diff --git a/docs/api/functions/startTwitter.md b/docs/api/functions/startTwitter.md index ab9859190d..ebfc410413 100644 --- a/docs/api/functions/startTwitter.md +++ b/docs/api/functions/startTwitter.md @@ -12,4 +12,4 @@ ## Defined in -[core/src/cli/index.ts:245](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L245) +[packages/core/src/cli/index.ts:248](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L248) diff --git a/docs/api/functions/trimTokens.md b/docs/api/functions/trimTokens.md index b42f5b1671..18c3612928 100644 --- a/docs/api/functions/trimTokens.md +++ b/docs/api/functions/trimTokens.md @@ -22,4 +22,4 @@ The model to use for generateText. ## Defined in -[core/src/core/generation.ts:223](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L223) +[packages/core/src/core/generation.ts:247](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L247) diff --git a/docs/api/functions/updateGoal.md b/docs/api/functions/updateGoal.md index 1cbb1605ee..26555d87c2 100644 --- a/docs/api/functions/updateGoal.md +++ b/docs/api/functions/updateGoal.md @@ -1,21 +1,19 @@ ---- -id: "updateGoal" -title: "Function: updateGoal" -sidebar_label: "updateGoal" -sidebar_position: 0 -custom_edit_url: null ---- +# Function: updateGoal() -▸ **updateGoal**(`«destructured»`): `Promise`\<`void`\> +> **updateGoal**(`__namedParameters`): `Promise`\<`void`\> -#### Parameters +## Parameters -| Name | Type | -| :--------------- | :------------------------------------------- | -| `«destructured»` | `Object` | -| › `goal` | [`Goal`](../interfaces/Goal.md) | -| › `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | +• **\_\_namedParameters** -#### Returns +• **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +• **\_\_namedParameters.goal**: [`Goal`](../interfaces/Goal.md) + +## Returns `Promise`\<`void`\> + +## Defined in + +[packages/core/src/core/goals.ts:44](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/goals.ts#L44) diff --git a/docs/api/globals.md b/docs/api/globals.md deleted file mode 100644 index c01b63de24..0000000000 --- a/docs/api/globals.md +++ /dev/null @@ -1,156 +0,0 @@ -# @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/api/index.md b/docs/api/index.md index 680164c13b..3486519b90 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1,137 +1,158 @@ ---- -id: "index" -title: "eliza" -sidebar_label: "Readme" -sidebar_position: 0 -custom_edit_url: null ---- - -# Eliza - -Eliza Banner - -_As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAIndreessen](https://x.com/pmairca)_ - -- Multi-agent simulation framework -- Add as many unique characters as you want with [characterfile](https://github.com/lalalune/characterfile/) -- Full-featured Discord and Twitter connectors, with Discord voice channel support -- Full conversational and document RAG memory -- Can read links and PDFs, transcribe audio and videos, summarize conversations, and more -- Highly extensible - create your own actions and clients to extend Eliza's capabilities -- Supports open source and local models (default configured with Nous Hermes Llama 3.1B) -- Supports OpenAI for cloud inference on a light-weight device -- "Ask Claude" mode for calling Claude on more complex queries -- 100% Typescript - -# Getting Started - -## Install Node.js - -https://docs.npmjs.com/downloading-and-installing-node-js-and-npm - -## Edit the .env file - -- Copy .env.example to .env and fill in the appropriate values -- Edit the TWITTER environment variables to add your bot's username and password - -## Edit the character file - -- 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. - -### Linux Installation - -You might need these - -``` -npm install --include=optional sharp -``` - -### Run with Llama - -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` - -### Run with Grok - -You can run Grok models by setting the `XAI_MODEL` environment variable to `grok-beta` - -### Run with OpenAI - -You can run OpenAI models by setting the `XAI_MODEL` environment variable to `gpt-4o-mini` or `gpt-4o` - -# Requires Node 20+ - -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). - -## Additional Requirements - -You may need to install Sharp. If you see an error when starting up, try installing it with the following command: - -``` -npm install --include=optional sharp -``` - -# Environment Setup - -You will need to add environment variables to your .env file to connect to various platforms: - -``` -# 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 -``` - -# Local Setup - -## CUDA Setup - -If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically. - -``` -npm install -npx --no node-llama-cpp source download --gpu cuda -``` - -Make sure that you've installed the CUDA Toolkit, including cuDNN and cuBLAS. - -## Running locally - -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 - -# Cloud Setup (with OpenAI) - -In addition to the environment variables above, you will need to add the following: - -``` -# 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 -``` - -# Discord Bot - -For help with setting up your Discord Bot, check out here: https://discordjs.guide/preparations/setting-up-a-bot-application.html +# @eliza/core v1.0.0 + +## Enumerations + +- [ImageGenModel](enumerations/ImageGenModel.md) +- [GoalStatus](enumerations/GoalStatus.md) +- [ModelClass](enumerations/ModelClass.md) +- [ModelProvider](enumerations/ModelProvider.md) +- [Clients](enumerations/Clients.md) + +## Classes + +- [PostgresDatabaseAdapter](classes/PostgresDatabaseAdapter.md) +- [SqliteDatabaseAdapter](classes/SqliteDatabaseAdapter.md) +- [DirectClient](classes/DirectClient.md) +- [DiscordClient](classes/DiscordClient.md) +- [TelegramClient](classes/TelegramClient.md) +- [TwitterInteractionClient](classes/TwitterInteractionClient.md) +- [TwitterPostClient](classes/TwitterPostClient.md) +- [TwitterSearchClient](classes/TwitterSearchClient.md) +- [DatabaseAdapter](classes/DatabaseAdapter.md) +- [MemoryManager](classes/MemoryManager.md) +- [AgentRuntime](classes/AgentRuntime.md) +- [TokenProvider](classes/TokenProvider.md) +- [WalletProvider](classes/WalletProvider.md) + +## Interfaces + +- [CreateAndBuyContent](interfaces/CreateAndBuyContent.md) +- [Content](interfaces/Content.md) +- [ActionExample](interfaces/ActionExample.md) +- [ConversationExample](interfaces/ConversationExample.md) +- [Actor](interfaces/Actor.md) +- [Objective](interfaces/Objective.md) +- [Goal](interfaces/Goal.md) +- [State](interfaces/State.md) +- [Memory](interfaces/Memory.md) +- [MessageExample](interfaces/MessageExample.md) +- [Action](interfaces/Action.md) +- [EvaluationExample](interfaces/EvaluationExample.md) +- [Evaluator](interfaces/Evaluator.md) +- [Provider](interfaces/Provider.md) +- [Relationship](interfaces/Relationship.md) +- [Account](interfaces/Account.md) +- [Participant](interfaces/Participant.md) +- [Room](interfaces/Room.md) +- [IDatabaseAdapter](interfaces/IDatabaseAdapter.md) +- [IMemoryManager](interfaces/IMemoryManager.md) +- [IAgentRuntime](interfaces/IAgentRuntime.md) +- [IImageRecognitionService](interfaces/IImageRecognitionService.md) +- [ITranscriptionService](interfaces/ITranscriptionService.md) +- [IVideoService](interfaces/IVideoService.md) +- [ILlamaService](interfaces/ILlamaService.md) +- [IBrowserService](interfaces/IBrowserService.md) +- [ISpeechService](interfaces/ISpeechService.md) +- [IPdfService](interfaces/IPdfService.md) + +## Type Aliases + +- [UUID](type-aliases/UUID.md) +- [Model](type-aliases/Model.md) +- [Models](type-aliases/Models.md) +- [Handler](type-aliases/Handler.md) +- [HandlerCallback](type-aliases/HandlerCallback.md) +- [Validator](type-aliases/Validator.md) +- [Media](type-aliases/Media.md) +- [Plugin](type-aliases/Plugin.md) +- [Character](type-aliases/Character.md) + +## Variables + +- [messageHandlerTemplate](variables/messageHandlerTemplate.md) +- [shouldContinueTemplate](variables/shouldContinueTemplate.md) +- [continueAction](variables/continueAction.md) +- [shouldFollowTemplate](variables/shouldFollowTemplate.md) +- [followRoom](variables/followRoom.md) +- [ignore](variables/ignore.md) +- [imageGeneration](variables/imageGeneration.md) +- [shouldMuteTemplate](variables/shouldMuteTemplate.md) +- [muteRoom](variables/muteRoom.md) +- [none](variables/none.md) +- [executeSwap](variables/executeSwap.md) +- [unfollowRoom](variables/unfollowRoom.md) +- [shouldUnmuteTemplate](variables/shouldUnmuteTemplate.md) +- [unmuteRoom](variables/unmuteRoom.md) +- [defaultActions](variables/defaultActions.md) +- [defaultCharacter](variables/defaultCharacter.md) +- [defaultEvaluators](variables/defaultEvaluators.md) +- [evaluationTemplate](variables/evaluationTemplate.md) +- [imageGenModels](variables/imageGenModels.md) +- [embeddingDimension](variables/embeddingDimension.md) +- [embeddingZeroVector](variables/embeddingZeroVector.md) +- [defaultProviders](variables/defaultProviders.md) +- [settings](variables/settings.md) +- [elizaLogger](variables/elizaLogger.md) +- [boredomProvider](variables/boredomProvider.md) +- [orderBookProvider](variables/orderBookProvider.md) +- [timeProvider](variables/timeProvider.md) +- [tokenProvider](variables/tokenProvider.md) +- [walletProvider](variables/walletProvider.md) + +## Functions + +- [generateImage](functions/generateImage.md) +- [generateCaption](functions/generateCaption.md) +- [isCreateAndBuyContent](functions/isCreateAndBuyContent.md) +- [createAndBuyToken](functions/createAndBuyToken.md) +- [buyToken](functions/buyToken.md) +- [sellToken](functions/sellToken.md) +- [loadActionConfigs](functions/loadActionConfigs.md) +- [loadCustomActions](functions/loadCustomActions.md) +- [initializeClients](functions/initializeClients.md) +- [parseArguments](functions/parseArguments.md) +- [loadCharacters](functions/loadCharacters.md) +- [getTokenForProvider](functions/getTokenForProvider.md) +- [initializeDatabase](functions/initializeDatabase.md) +- [createAgentRuntime](functions/createAgentRuntime.md) +- [createDirectRuntime](functions/createDirectRuntime.md) +- [startDiscord](functions/startDiscord.md) +- [startTelegram](functions/startTelegram.md) +- [startTwitter](functions/startTwitter.md) +- [composeActionExamples](functions/composeActionExamples.md) +- [formatActionNames](functions/formatActionNames.md) +- [formatActions](functions/formatActions.md) +- [composeContext](functions/composeContext.md) +- [addHeader](functions/addHeader.md) +- [embed](functions/embed.md) +- [retrieveCachedEmbedding](functions/retrieveCachedEmbedding.md) +- [formatEvaluatorNames](functions/formatEvaluatorNames.md) +- [formatEvaluators](functions/formatEvaluators.md) +- [formatEvaluatorExamples](functions/formatEvaluatorExamples.md) +- [formatEvaluatorExampleDescriptions](functions/formatEvaluatorExampleDescriptions.md) +- [generateText](functions/generateText.md) +- [trimTokens](functions/trimTokens.md) +- [generateShouldRespond](functions/generateShouldRespond.md) +- [splitChunks](functions/splitChunks.md) +- [generateTrueOrFalse](functions/generateTrueOrFalse.md) +- [generateTextArray](functions/generateTextArray.md) +- [generateObject](functions/generateObject.md) +- [generateObjectArray](functions/generateObjectArray.md) +- [generateMessageResponse](functions/generateMessageResponse.md) +- [getGoals](functions/getGoals.md) +- [formatGoalsAsString](functions/formatGoalsAsString.md) +- [updateGoal](functions/updateGoal.md) +- [createGoal](functions/createGoal.md) +- [getImageGenModel](functions/getImageGenModel.md) +- [getActorDetails](functions/getActorDetails.md) +- [formatActors](functions/formatActors.md) +- [formatMessages](functions/formatMessages.md) +- [formatTimestamp](functions/formatTimestamp.md) +- [getModel](functions/getModel.md) +- [getEndpoint](functions/getEndpoint.md) +- [formatPosts](functions/formatPosts.md) +- [getProviders](functions/getProviders.md) +- [createRelationship](functions/createRelationship.md) +- [getRelationship](functions/getRelationship.md) +- [getRelationships](functions/getRelationships.md) +- [formatRelationships](functions/formatRelationships.md) diff --git a/docs/api/interfaces/Account.md b/docs/api/interfaces/Account.md index c5f131148c..e542287f97 100644 --- a/docs/api/interfaces/Account.md +++ b/docs/api/interfaces/Account.md @@ -1,43 +1,67 @@ ---- -id: "Account" -title: "Interface: Account" -sidebar_label: "Account" -sidebar_position: 0 -custom_edit_url: null ---- +# Interface: Account Represents a user, including their name, details, and a unique identifier. ## Properties -### avatar_url +### id -• `Optional` **avatar_url**: `string` +> **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` ---- +#### Defined in -### details +[packages/core/src/core/types.ts:270](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L270) -• `Optional` **details**: `Object` +*** -#### Index signature +### name -▪ [key: `string`]: `unknown` +> **name**: `string` ---- +#### Defined in -### email +[packages/core/src/core/types.ts:271](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L271) -• `Optional` **email**: `string` +*** ---- +### username -### id +> **username**: `string` -• **id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +#### Defined in ---- +[packages/core/src/core/types.ts:272](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L272) -### name +*** + +### details? + +> `optional` **details**: `object` + +#### Index Signature + + \[`key`: `string`\]: `any` + +#### Defined in + +[packages/core/src/core/types.ts:273](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L273) + +*** + +### email? + +> `optional` **email**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:274](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L274) + +*** + +### avatarUrl? + +> `optional` **avatarUrl**: `string` + +#### Defined in -• **name**: `string` +[packages/core/src/core/types.ts:275](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L275) diff --git a/docs/api/interfaces/Action.md b/docs/api/interfaces/Action.md index 5ed091a1e5..7dda1af78f 100644 --- a/docs/api/interfaces/Action.md +++ b/docs/api/interfaces/Action.md @@ -1,45 +1,63 @@ ---- -id: "Action" -title: "Interface: Action" -sidebar_label: "Action" -sidebar_position: 0 -custom_edit_url: null ---- +# 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 -### condition +### similes -• **condition**: `string` +> **similes**: `string`[] ---- +#### Defined in + +[packages/core/src/core/types.ts:213](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L213) + +*** ### description -• **description**: `string` +> **description**: `string` + +#### Defined in ---- +[packages/core/src/core/types.ts:214](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L214) + +*** ### examples -• **examples**: [`ActionExample`](ActionExample.md)[][] +> **examples**: [`ActionExample`](ActionExample.md)[][] + +#### Defined in + +[packages/core/src/core/types.ts:215](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L215) ---- +*** ### handler -• **handler**: [`Handler`](../types/Handler.md) +> **handler**: [`Handler`](../type-aliases/Handler.md) ---- +#### Defined in + +[packages/core/src/core/types.ts:216](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L216) + +*** ### name -• **name**: `string` +> **name**: `string` + +#### Defined in ---- +[packages/core/src/core/types.ts:217](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L217) + +*** ### validate -• **validate**: [`Validator`](../types/Validator.md) +> **validate**: [`Validator`](../type-aliases/Validator.md) + +#### Defined in + +[packages/core/src/core/types.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L218) diff --git a/docs/api/interfaces/ActionExample.md b/docs/api/interfaces/ActionExample.md index 431fd40c0c..2ac9ca3b45 100644 --- a/docs/api/interfaces/ActionExample.md +++ b/docs/api/interfaces/ActionExample.md @@ -1,21 +1,23 @@ ---- -id: "ActionExample" -title: "Interface: ActionExample" -sidebar_label: "ActionExample" -sidebar_position: 0 -custom_edit_url: null ---- +# Interface: ActionExample Represents an example of content, typically used for demonstrating or testing purposes. Includes user, content, optional action, and optional source. ## Properties -### content +### user -• **content**: [`Content`](Content.md) +> **user**: `string` ---- +#### Defined in -### user +[packages/core/src/core/types.ts:26](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L26) + +*** + +### content + +> **content**: [`Content`](Content.md) + +#### Defined in -• **user**: `string` +[packages/core/src/core/types.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L27) diff --git a/docs/api/interfaces/Actor.md b/docs/api/interfaces/Actor.md index 41bf539785..3607f9e71f 100644 --- a/docs/api/interfaces/Actor.md +++ b/docs/api/interfaces/Actor.md @@ -1,35 +1,55 @@ ---- -id: "Actor" -title: "Interface: Actor" -sidebar_label: "Actor" -sidebar_position: 0 -custom_edit_url: null ---- +# 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 +### name + +> **name**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:42](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L42) + +*** + +### username + +> **username**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:43](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L43) + +*** + ### details -• **details**: `Object` +> **details**: `object` -#### Type declaration +#### tagline -| Name | Type | -| :-------- | :------- | -| `quote` | `string` | -| `summary` | `string` | -| `tagline` | `string` | +> **tagline**: `string` ---- +#### summary -### id +> **summary**: `string` -• **id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +#### quote ---- +> **quote**: `string` -### name +#### Defined in + +[packages/core/src/core/types.ts:44](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L44) + +*** + +### id + +> **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in -• **name**: `string` +[packages/core/src/core/types.ts:45](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L45) diff --git a/docs/api/interfaces/Content.md b/docs/api/interfaces/Content.md index 33cdcad95d..1722c7d4df 100644 --- a/docs/api/interfaces/Content.md +++ b/docs/api/interfaces/Content.md @@ -1,31 +1,71 @@ ---- -id: "Content" -title: "Interface: Content" -sidebar_label: "Content" -sidebar_position: 0 -custom_edit_url: null ---- +# 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` + \[`key`: `string`\]: `unknown` ## Properties -### action +### text + +> **text**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L13) + +*** + +### action? + +> `optional` **action**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:14](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L14) + +*** + +### source? + +> `optional` **source**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:15](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L15) + +*** + +### url? + +> `optional` **url**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:16](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L16) + +*** + +### inReplyTo? + +> `optional` **inReplyTo**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• `Optional` **action**: `string` +#### Defined in ---- +[packages/core/src/core/types.ts:17](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L17) -### content +*** -• **content**: `string` +### attachments? ---- +> `optional` **attachments**: [`Media`](../type-aliases/Media.md)[] -### source +#### Defined in -• `Optional` **source**: `string` +[packages/core/src/core/types.ts:18](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L18) diff --git a/docs/api/interfaces/ConversationExample.md b/docs/api/interfaces/ConversationExample.md index 41c7f7bea2..de457d9bbc 100644 --- a/docs/api/interfaces/ConversationExample.md +++ b/docs/api/interfaces/ConversationExample.md @@ -1,21 +1,23 @@ ---- -id: "ConversationExample" -title: "Interface: ConversationExample" -sidebar_label: "ConversationExample" -sidebar_position: 0 -custom_edit_url: null ---- +# Interface: ConversationExample Represents an example of content, typically used for demonstrating or testing purposes. Includes user, content, optional action, and optional source. ## Properties -### content +### userId + +> **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in -• **content**: [`Content`](Content.md) +[packages/core/src/core/types.ts:34](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L34) + +*** + +### content ---- +> **content**: [`Content`](Content.md) -### user_id +#### Defined in -• **user_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +[packages/core/src/core/types.ts:35](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L35) diff --git a/docs/api/interfaces/CreateAndBuyContent.md b/docs/api/interfaces/CreateAndBuyContent.md index fd158d5710..2fa7a79714 100644 --- a/docs/api/interfaces/CreateAndBuyContent.md +++ b/docs/api/interfaces/CreateAndBuyContent.md @@ -8,95 +8,91 @@ Represents the content of a message, including its main text (`content`), any as ## Properties -### action? - -> `optional` **action**: `string` - -#### Inherited from +### deployerPrivateKey -[`Content`](Content.md).[`action`](Content.md#action) +> **deployerPrivateKey**: `string` #### Defined in -[core/src/core/types.ts:14](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L14) +[packages/core/src/actions/pumpfun.ts:23](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L23) ---- +*** -### allowOffCurve +### tokenMetadata -> **allowOffCurve**: `boolean` +> **tokenMetadata**: `CreateTokenMetadata` #### Defined in -[core/src/actions/pumpfun.ts:30](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L30) +[packages/core/src/actions/pumpfun.ts:24](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L24) ---- +*** -### attachments? +### buyAmountSol -> `optional` **attachments**: [`Media`](../type-aliases/Media.md)[] +> **buyAmountSol**: `string` \| `number` -#### Inherited from +#### Defined in -[`Content`](Content.md).[`attachments`](Content.md#attachments) +[packages/core/src/actions/pumpfun.ts:25](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L25) -#### Defined in +*** -[core/src/core/types.ts:18](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L18) +### priorityFee ---- +> **priorityFee**: `object` -### buyAmountSol +#### unitLimit -> **buyAmountSol**: `string` \| `number` +> **unitLimit**: `number` + +#### unitPrice + +> **unitPrice**: `number` #### Defined in -[core/src/actions/pumpfun.ts:25](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L25) +[packages/core/src/actions/pumpfun.ts:26](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L26) ---- +*** -### deployerPrivateKey +### allowOffCurve -> **deployerPrivateKey**: `string` +> **allowOffCurve**: `boolean` #### Defined in -[core/src/actions/pumpfun.ts:23](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L23) +[packages/core/src/actions/pumpfun.ts:30](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L30) ---- +*** -### inReplyTo? +### text -> `optional` **inReplyTo**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +> **text**: `string` #### Inherited from -[`Content`](Content.md).[`inReplyTo`](Content.md#inreplyto) +[`Content`](Content.md).[`text`](Content.md#text) #### Defined in -[core/src/core/types.ts:17](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L17) +[packages/core/src/core/types.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L13) ---- +*** -### priorityFee - -> **priorityFee**: `object` - -#### unitLimit +### action? -> **unitLimit**: `number` +> `optional` **action**: `string` -#### unitPrice +#### Inherited from -> **unitPrice**: `number` +[`Content`](Content.md).[`action`](Content.md#action) #### Defined in -[core/src/actions/pumpfun.ts:26](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L26) +[packages/core/src/core/types.ts:14](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L14) ---- +*** ### source? @@ -108,42 +104,46 @@ Represents the content of a message, including its main text (`content`), any as #### Defined in -[core/src/core/types.ts:15](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L15) +[packages/core/src/core/types.ts:15](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L15) ---- +*** -### text +### url? -> **text**: `string` +> `optional` **url**: `string` #### Inherited from -[`Content`](Content.md).[`text`](Content.md#text) +[`Content`](Content.md).[`url`](Content.md#url) #### Defined in -[core/src/core/types.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L13) +[packages/core/src/core/types.ts:16](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L16) ---- +*** -### tokenMetadata +### inReplyTo? -> **tokenMetadata**: `CreateTokenMetadata` +> `optional` **inReplyTo**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Inherited from + +[`Content`](Content.md).[`inReplyTo`](Content.md#inreplyto) #### Defined in -[core/src/actions/pumpfun.ts:24](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L24) +[packages/core/src/core/types.ts:17](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L17) ---- +*** -### url? +### attachments? -> `optional` **url**: `string` +> `optional` **attachments**: [`Media`](../type-aliases/Media.md)[] #### Inherited from -[`Content`](Content.md).[`url`](Content.md#url) +[`Content`](Content.md).[`attachments`](Content.md#attachments) #### Defined in -[core/src/core/types.ts:16](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L16) +[packages/core/src/core/types.ts:18](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L18) diff --git a/docs/api/interfaces/EvaluationExample.md b/docs/api/interfaces/EvaluationExample.md index 88e2ab46ff..2decbec51b 100644 --- a/docs/api/interfaces/EvaluationExample.md +++ b/docs/api/interfaces/EvaluationExample.md @@ -1,10 +1,4 @@ ---- -id: "EvaluationExample" -title: "Interface: EvaluationExample" -sidebar_label: "EvaluationExample" -sidebar_position: 0 -custom_edit_url: null ---- +# Interface: EvaluationExample Represents an example for evaluation, including the context, an array of message examples, and the expected outcome. @@ -12,16 +6,28 @@ Represents an example for evaluation, including the context, an array of message ### context -• **context**: `string` +> **context**: `string` ---- +#### Defined in + +[packages/core/src/core/types.ts:225](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L225) + +*** ### messages -• **messages**: [`ActionExample`](ActionExample.md)[] +> **messages**: [`ActionExample`](ActionExample.md)[] + +#### Defined in ---- +[packages/core/src/core/types.ts:226](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L226) + +*** ### outcome -• **outcome**: `string` +> **outcome**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:227](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L227) diff --git a/docs/api/interfaces/Evaluator.md b/docs/api/interfaces/Evaluator.md index 61b2fa4dd5..327f11fc97 100644 --- a/docs/api/interfaces/Evaluator.md +++ b/docs/api/interfaces/Evaluator.md @@ -1,45 +1,63 @@ ---- -id: "Evaluator" -title: "Interface: Evaluator" -sidebar_label: "Evaluator" -sidebar_position: 0 -custom_edit_url: null ---- +# Interface: Evaluator Represents an evaluator, which is used to assess and guide the agent's responses based on the current context and state. ## Properties -### condition +### description -• **condition**: `string` +> **description**: `string` ---- +#### Defined in -### description +[packages/core/src/core/types.ts:234](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L234) + +*** + +### similes -• **description**: `string` +> **similes**: `string`[] ---- +#### Defined in + +[packages/core/src/core/types.ts:235](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L235) + +*** ### examples -• **examples**: [`EvaluationExample`](EvaluationExample.md)[] +> **examples**: [`EvaluationExample`](EvaluationExample.md)[] + +#### Defined in ---- +[packages/core/src/core/types.ts:236](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L236) + +*** ### handler -• **handler**: [`Handler`](../types/Handler.md) +> **handler**: [`Handler`](../type-aliases/Handler.md) + +#### Defined in ---- +[packages/core/src/core/types.ts:237](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L237) + +*** ### name -• **name**: `string` +> **name**: `string` + +#### Defined in ---- +[packages/core/src/core/types.ts:238](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L238) + +*** ### validate -• **validate**: [`Validator`](../types/Validator.md) +> **validate**: [`Validator`](../type-aliases/Validator.md) + +#### Defined in + +[packages/core/src/core/types.ts:239](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L239) diff --git a/docs/api/interfaces/Goal.md b/docs/api/interfaces/Goal.md index b10d8fb41d..771fdb1362 100644 --- a/docs/api/interfaces/Goal.md +++ b/docs/api/interfaces/Goal.md @@ -1,45 +1,63 @@ ---- -id: "Goal" -title: "Interface: Goal" -sidebar_label: "Goal" -sidebar_position: 0 -custom_edit_url: null ---- +# 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 +### id? -• `Optional` **id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +> `optional` **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` ---- +#### Defined in -### name +[packages/core/src/core/types.ts:67](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L67) -• **name**: `string` +*** ---- +### roomId -### objectives +> **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[packages/core/src/core/types.ts:68](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L68) + +*** + +### userId + +> **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in -• **objectives**: [`Objective`](Objective.md)[] +[packages/core/src/core/types.ts:69](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L69) ---- +*** -### room_id +### name + +> **name**: `string` -• **room_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +#### Defined in ---- +[packages/core/src/core/types.ts:70](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L70) + +*** ### status -• **status**: [`GoalStatus`](../enums/GoalStatus.md) +> **status**: [`GoalStatus`](../enumerations/GoalStatus.md) + +#### Defined in + +[packages/core/src/core/types.ts:71](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L71) + +*** + +### objectives ---- +> **objectives**: [`Objective`](Objective.md)[] -### user_id +#### Defined in -• **user_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +[packages/core/src/core/types.ts:72](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L72) diff --git a/docs/api/interfaces/IAgentRuntime.md b/docs/api/interfaces/IAgentRuntime.md index 61b5234f98..ee92a64ef1 100644 --- a/docs/api/interfaces/IAgentRuntime.md +++ b/docs/api/interfaces/IAgentRuntime.md @@ -2,261 +2,251 @@ ## Properties -### actions +### agentId -> **actions**: [`Action`](Action.md)[] +> **agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Defined in -[core/src/core/types.ts:494](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L494) +[packages/core/src/core/types.ts:499](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L499) ---- +*** -### agentId +### serverUrl -> **agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +> **serverUrl**: `string` #### Defined in -[core/src/core/types.ts:486](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L486) +[packages/core/src/core/types.ts:500](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L500) ---- +*** -### browserService +### databaseAdapter -> **browserService**: [`IBrowserService`](IBrowserService.md) +> **databaseAdapter**: [`IDatabaseAdapter`](IDatabaseAdapter.md) #### Defined in -[core/src/core/types.ts:504](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L504) +[packages/core/src/core/types.ts:501](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L501) ---- +*** -### character +### token -> **character**: [`Character`](../type-aliases/Character.md) +> **token**: `string` #### Defined in -[core/src/core/types.ts:492](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L492) +[packages/core/src/core/types.ts:502](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L502) ---- +*** -### databaseAdapter +### modelProvider -> **databaseAdapter**: [`IDatabaseAdapter`](IDatabaseAdapter.md) +> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) #### Defined in -[core/src/core/types.ts:488](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L488) +[packages/core/src/core/types.ts:503](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L503) ---- +*** -### descriptionManager +### imageGenModel -> **descriptionManager**: [`IMemoryManager`](IMemoryManager.md) +> **imageGenModel**: [`ImageGenModel`](../enumerations/ImageGenModel.md) #### Defined in -[core/src/core/types.ts:497](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L497) +[packages/core/src/core/types.ts:504](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L504) ---- +*** -### factManager +### character -> **factManager**: [`IMemoryManager`](IMemoryManager.md) +> **character**: [`Character`](../type-aliases/Character.md) #### Defined in -[core/src/core/types.ts:498](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L498) +[packages/core/src/core/types.ts:505](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L505) ---- +*** -### imageDescriptionService +### providers -> **imageDescriptionService**: [`IImageRecognitionService`](IImageRecognitionService.md) +> **providers**: [`Provider`](Provider.md)[] #### Defined in -[core/src/core/types.ts:500](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L500) +[packages/core/src/core/types.ts:506](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L506) ---- +*** -### imageGenModel +### actions -> **imageGenModel**: [`ImageGenModel`](../enumerations/ImageGenModel.md) +> **actions**: [`Action`](Action.md)[] #### Defined in -[core/src/core/types.ts:491](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L491) +[packages/core/src/core/types.ts:507](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L507) ---- +*** -### llamaService +### messageManager -> **llamaService**: [`ILlamaService`](ILlamaService.md) +> **messageManager**: [`IMemoryManager`](IMemoryManager.md) #### Defined in -[core/src/core/types.ts:503](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L503) +[packages/core/src/core/types.ts:509](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L509) ---- +*** -### loreManager +### descriptionManager -> **loreManager**: [`IMemoryManager`](IMemoryManager.md) +> **descriptionManager**: [`IMemoryManager`](IMemoryManager.md) #### Defined in -[core/src/core/types.ts:499](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L499) +[packages/core/src/core/types.ts:510](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L510) ---- +*** -### messageManager +### factManager -> **messageManager**: [`IMemoryManager`](IMemoryManager.md) +> **factManager**: [`IMemoryManager`](IMemoryManager.md) #### Defined in -[core/src/core/types.ts:496](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L496) +[packages/core/src/core/types.ts:511](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L511) ---- +*** -### modelProvider +### loreManager -> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) +> **loreManager**: [`IMemoryManager`](IMemoryManager.md) #### Defined in -[core/src/core/types.ts:490](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L490) +[packages/core/src/core/types.ts:512](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L512) ---- +*** -### pdfService +### imageDescriptionService -> **pdfService**: [`IPdfService`](IPdfService.md) +> **imageDescriptionService**: [`IImageRecognitionService`](IImageRecognitionService.md) #### Defined in -[core/src/core/types.ts:506](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L506) +[packages/core/src/core/types.ts:513](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L513) ---- +*** -### providers +### transcriptionService -> **providers**: [`Provider`](Provider.md)[] +> **transcriptionService**: [`ITranscriptionService`](ITranscriptionService.md) #### Defined in -[core/src/core/types.ts:493](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L493) +[packages/core/src/core/types.ts:514](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L514) ---- +*** -### serverUrl +### videoService -> **serverUrl**: `string` +> **videoService**: [`IVideoService`](IVideoService.md) #### Defined in -[core/src/core/types.ts:487](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L487) +[packages/core/src/core/types.ts:515](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L515) ---- +*** -### speechService +### llamaService -> **speechService**: [`ISpeechService`](ISpeechService.md) +> **llamaService**: [`ILlamaService`](ILlamaService.md) #### Defined in -[core/src/core/types.ts:505](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L505) +[packages/core/src/core/types.ts:516](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L516) ---- +*** -### token +### browserService -> **token**: `string` +> **browserService**: [`IBrowserService`](IBrowserService.md) #### Defined in -[core/src/core/types.ts:489](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L489) +[packages/core/src/core/types.ts:517](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L517) ---- +*** -### transcriptionService +### speechService -> **transcriptionService**: [`ITranscriptionService`](ITranscriptionService.md) +> **speechService**: [`ISpeechService`](ISpeechService.md) #### Defined in -[core/src/core/types.ts:501](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L501) +[packages/core/src/core/types.ts:518](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L518) ---- +*** -### videoService +### pdfService -> **videoService**: [`IVideoService`](IVideoService.md) +> **pdfService**: [`IPdfService`](IPdfService.md) #### Defined in -[core/src/core/types.ts:502](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L502) +[packages/core/src/core/types.ts:519](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L519) ## Methods -### composeState() +### getSetting() -> **composeState**(`message`, `additionalKeys`?): `Promise`\<[`State`](State.md)\> +> **getSetting**(`key`): `string` #### Parameters -• **message**: [`Memory`](Memory.md) - -• **additionalKeys?** +• **key**: `string` #### Returns -`Promise`\<[`State`](State.md)\> +`string` #### 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\}\` +[packages/core/src/core/types.ts:521](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L521) -• **userName?**: `string` +*** -• **userScreenName?**: `string` +### getConversationLength() -• **source?**: `string` +> **getConversationLength**(): `number` #### Returns -`Promise`\<`void`\> +`number` #### Defined in -[core/src/core/types.ts:527](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L527) +[packages/core/src/core/types.ts:524](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L524) ---- +*** -### ensureParticipantExists() +### processActions() -> **ensureParticipantExists**(`userId`, `roomId`): `Promise`\<`void`\> +> **processActions**(`message`, `responses`, `state`?, `callback`?): `Promise`\<`void`\> #### Parameters -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **message**: [`Memory`](Memory.md) -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **responses**: [`Memory`](Memory.md)[] + +• **state?**: [`State`](State.md) + +• **callback?**: [`HandlerCallback`](../type-aliases/HandlerCallback.md) #### Returns @@ -264,36 +254,38 @@ #### Defined in -[core/src/core/types.ts:519](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L519) +[packages/core/src/core/types.ts:525](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L525) ---- +*** -### ensureParticipantInRoom() +### evaluate() -> **ensureParticipantInRoom**(`userId`, `roomId`): `Promise`\<`void`\> +> **evaluate**(`message`, `state`?): `Promise`\<`string`[]\> #### Parameters -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **message**: [`Memory`](Memory.md) -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **state?**: [`State`](State.md) #### Returns -`Promise`\<`void`\> +`Promise`\<`string`[]\> #### Defined in -[core/src/core/types.ts:534](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L534) +[packages/core/src/core/types.ts:531](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L531) ---- +*** -### ensureRoomExists() +### ensureParticipantExists() -> **ensureRoomExists**(`roomId`): `Promise`\<`void`\> +> **ensureParticipantExists**(`userId`, `roomId`): `Promise`\<`void`\> #### Parameters +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + • **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns @@ -302,9 +294,9 @@ #### Defined in -[core/src/core/types.ts:535](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L535) +[packages/core/src/core/types.ts:532](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L532) ---- +*** ### ensureUserExists() @@ -326,75 +318,81 @@ #### Defined in -[core/src/core/types.ts:520](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L520) +[packages/core/src/core/types.ts:533](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L533) ---- +*** -### evaluate() +### registerAction() -> **evaluate**(`message`, `state`?): `Promise`\<`string`[]\> +> **registerAction**(`action`): `void` #### Parameters -• **message**: [`Memory`](Memory.md) - -• **state?**: [`State`](State.md) +• **action**: [`Action`](Action.md) #### Returns -`Promise`\<`string`[]\> +`void` #### Defined in -[core/src/core/types.ts:518](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L518) +[packages/core/src/core/types.ts:539](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L539) ---- +*** -### getConversationLength() +### ensureConnection() -> **getConversationLength**(): `number` +> **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 -`number` +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:511](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L511) +[packages/core/src/core/types.ts:540](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L540) ---- +*** -### getSetting() +### ensureParticipantInRoom() -> **getSetting**(`key`): `string` +> **ensureParticipantInRoom**(`userId`, `roomId`): `Promise`\<`void`\> #### Parameters -• **key**: `string` +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`string` +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:508](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L508) +[packages/core/src/core/types.ts:547](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L547) ---- +*** -### processActions() +### ensureRoomExists() -> **processActions**(`message`, `responses`, `state`?, `callback`?): `Promise`\<`void`\> +> **ensureRoomExists**(`roomId`): `Promise`\<`void`\> #### Parameters -• **message**: [`Memory`](Memory.md) - -• **responses**: [`Memory`](Memory.md)[] - -• **state?**: [`State`](State.md) - -• **callback?**: [`HandlerCallback`](../type-aliases/HandlerCallback.md) +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns @@ -402,27 +400,29 @@ #### Defined in -[core/src/core/types.ts:512](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L512) +[packages/core/src/core/types.ts:548](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L548) ---- +*** -### registerAction() +### composeState() -> **registerAction**(`action`): `void` +> **composeState**(`message`, `additionalKeys`?): `Promise`\<[`State`](State.md)\> #### Parameters -• **action**: [`Action`](Action.md) +• **message**: [`Memory`](Memory.md) + +• **additionalKeys?** #### Returns -`void` +`Promise`\<[`State`](State.md)\> #### Defined in -[core/src/core/types.ts:526](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L526) +[packages/core/src/core/types.ts:549](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L549) ---- +*** ### updateRecentMessageState() @@ -438,4 +438,4 @@ #### Defined in -[core/src/core/types.ts:540](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L540) +[packages/core/src/core/types.ts:553](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L553) diff --git a/docs/api/interfaces/IBrowserService.md b/docs/api/interfaces/IBrowserService.md index 445c72451b..d33fdb9a58 100644 --- a/docs/api/interfaces/IBrowserService.md +++ b/docs/api/interfaces/IBrowserService.md @@ -2,6 +2,20 @@ ## Methods +### initialize() + +> **initialize**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[packages/core/src/core/types.ts:599](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L599) + +*** + ### closeBrowser() > **closeBrowser**(): `Promise`\<`void`\> @@ -12,9 +26,9 @@ #### Defined in -[core/src/core/types.ts:587](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L587) +[packages/core/src/core/types.ts:600](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L600) ---- +*** ### getPageContent() @@ -28,32 +42,18 @@ `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() +##### description -> **initialize**(): `Promise`\<`void`\> +> **description**: `string` -#### Returns +##### bodyContent -`Promise`\<`void`\> +> **bodyContent**: `string` #### Defined in -[core/src/core/types.ts:586](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L586) +[packages/core/src/core/types.ts:601](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L601) diff --git a/docs/api/interfaces/IDatabaseAdapter.md b/docs/api/interfaces/IDatabaseAdapter.md index 76d1544b16..0cfcf39725 100644 --- a/docs/api/interfaces/IDatabaseAdapter.md +++ b/docs/api/interfaces/IDatabaseAdapter.md @@ -8,167 +8,173 @@ #### Defined in -[core/src/core/types.ts:342](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L342) +[packages/core/src/core/types.ts:355](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L355) ## Methods -### addParticipant() +### getAccountById() -> **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> +> **getAccountById**(`userId`): `Promise`\<[`Account`](Account.md)\> #### Parameters • **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - #### Returns -`Promise`\<`boolean`\> +`Promise`\<[`Account`](Account.md)\> #### Defined in -[core/src/core/types.ts:424](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L424) +[packages/core/src/core/types.ts:356](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L356) ---- +*** -### countMemories() +### createAccount() -> **countMemories**(`roomId`, `unique`?, `tableName`?): `Promise`\<`number`\> +> **createAccount**(`account`): `Promise`\<`boolean`\> #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **unique?**: `boolean` - -• **tableName?**: `string` +• **account**: [`Account`](Account.md) #### Returns -`Promise`\<`number`\> +`Promise`\<`boolean`\> #### Defined in -[core/src/core/types.ts:404](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L404) +[packages/core/src/core/types.ts:357](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L357) ---- +*** -### createAccount() +### getMemories() -> **createAccount**(`account`): `Promise`\<`boolean`\> +> **getMemories**(`params`): `Promise`\<[`Memory`](Memory.md)[]\> #### Parameters -• **account**: [`Account`](Account.md) - -#### Returns - -`Promise`\<`boolean`\> +• **params** -#### Defined in +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -[core/src/core/types.ts:344](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L344) +• **params.count?**: `number` ---- +• **params.unique?**: `boolean` -### createGoal() +• **params.tableName**: `string` -> **createGoal**(`goal`): `Promise`\<`void`\> +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -#### Parameters +• **params.start?**: `number` -• **goal**: [`Goal`](Goal.md) +• **params.end?**: `number` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Memory`](Memory.md)[]\> #### Defined in -[core/src/core/types.ts:416](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L416) +[packages/core/src/core/types.ts:358](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L358) ---- +*** -### createMemory() +### getMemoryById() -> **createMemory**(`memory`, `tableName`, `unique`?): `Promise`\<`void`\> +> **getMemoryById**(`id`): `Promise`\<[`Memory`](Memory.md)\> #### Parameters -• **memory**: [`Memory`](Memory.md) - -• **tableName**: `string` - -• **unique?**: `boolean` +• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Memory`](Memory.md)\> #### Defined in -[core/src/core/types.ts:397](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L397) +[packages/core/src/core/types.ts:367](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L367) ---- +*** -### createRelationship() +### getMemoriesByRoomIds() -> **createRelationship**(`params`): `Promise`\<`boolean`\> +> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](Memory.md)[]\> #### Parameters • **params** -• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] #### Returns -`Promise`\<`boolean`\> +`Promise`\<[`Memory`](Memory.md)[]\> #### Defined in -[core/src/core/types.ts:437](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L437) +[packages/core/src/core/types.ts:368](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L368) ---- +*** -### createRoom() +### getCachedEmbeddings() -> **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> +> **getCachedEmbeddings**(`params`): `Promise`\<`object`[]\> #### Parameters -• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params** + +• **params.query\_table\_name**: `string` + +• **params.query\_threshold**: `number` + +• **params.query\_input**: `string` + +• **params.query\_field\_name**: `string` + +• **params.query\_field\_sub\_name**: `string` + +• **params.query\_match\_count**: `number` #### Returns -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> +`Promise`\<`object`[]\> #### Defined in -[core/src/core/types.ts:420](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L420) +[packages/core/src/core/types.ts:372](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L372) ---- +*** -### getAccountById() +### log() -> **getAccountById**(`userId`): `Promise`\<[`Account`](Account.md)\> +> **log**(`params`): `Promise`\<`void`\> #### Parameters -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params** + +• **params.body** + +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.type**: `string` #### Returns -`Promise`\<[`Account`](Account.md)\> +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:343](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L343) +[packages/core/src/core/types.ts:380](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L380) ---- +*** ### getActorDetails() @@ -186,319 +192,315 @@ #### Defined in -[core/src/core/types.ts:373](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L373) +[packages/core/src/core/types.ts:386](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L386) ---- +*** -### getCachedEmbeddings() +### searchMemories() -> **getCachedEmbeddings**(`params`): `Promise`\<`object`[]\> +> **searchMemories**(`params`): `Promise`\<[`Memory`](Memory.md)[]\> #### Parameters • **params** -• **params.query_field_name**: `string` +• **params.tableName**: `string` -• **params.query_field_sub_name**: `string` +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.query_input**: `string` +• **params.embedding**: `number`[] -• **params.query_match_count**: `number` +• **params.match\_threshold**: `number` -• **params.query_table_name**: `string` +• **params.match\_count**: `number` -• **params.query_threshold**: `number` +• **params.unique**: `boolean` #### Returns -`Promise`\<`object`[]\> +`Promise`\<[`Memory`](Memory.md)[]\> #### Defined in -[core/src/core/types.ts:359](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L359) +[packages/core/src/core/types.ts:387](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L387) ---- +*** -### getGoals() +### updateGoalStatus() -> **getGoals**(`params`): `Promise`\<[`Goal`](Goal.md)[]\> +> **updateGoalStatus**(`params`): `Promise`\<`void`\> #### Parameters • **params** -• **params.count?**: `number` - -• **params.onlyInProgress?**: `boolean` - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.status**: [`GoalStatus`](../enumerations/GoalStatus.md) #### Returns -`Promise`\<[`Goal`](Goal.md)[]\> +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:409](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L409) +[packages/core/src/core/types.ts:395](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L395) ---- +*** -### getMemories() +### searchMemoriesByEmbedding() -> **getMemories**(`params`): `Promise`\<[`Memory`](Memory.md)[]\> +> **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](Memory.md)[]\> #### Parameters +• **embedding**: `number`[] + • **params** -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.match\_threshold?**: `number` • **params.count?**: `number` -• **params.end?**: `number` +• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.start?**: `number` +• **params.unique?**: `boolean` • **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) +[packages/core/src/core/types.ts:399](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L399) ---- +*** -### getMemoriesByRoomIds() +### createMemory() -> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](Memory.md)[]\> +> **createMemory**(`memory`, `tableName`, `unique`?): `Promise`\<`void`\> #### Parameters -• **params** +• **memory**: [`Memory`](Memory.md) -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **tableName**: `string` -• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] +• **unique?**: `boolean` #### Returns -`Promise`\<[`Memory`](Memory.md)[]\> +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:355](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L355) +[packages/core/src/core/types.ts:410](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L410) ---- +*** -### getMemoryById() +### removeMemory() -> **getMemoryById**(`id`): `Promise`\<[`Memory`](Memory.md)\> +> **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> #### Parameters -• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **tableName**: `string` #### Returns -`Promise`\<[`Memory`](Memory.md)\> +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:354](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L354) +[packages/core/src/core/types.ts:415](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L415) ---- +*** -### getParticipantsForAccount() +### removeAllMemories() -> **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](Participant.md)[]\> +> **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> #### Parameters -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **tableName**: `string` #### Returns -`Promise`\<[`Participant`](Participant.md)[]\> +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:426](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L426) +[packages/core/src/core/types.ts:416](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L416) ---- +*** -### getParticipantsForRoom() +### countMemories() -> **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +> **countMemories**(`roomId`, `unique`?, `tableName`?): `Promise`\<`number`\> #### Parameters • **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **unique?**: `boolean` + +• **tableName?**: `string` + #### Returns -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +`Promise`\<`number`\> #### Defined in -[core/src/core/types.ts:427](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L427) +[packages/core/src/core/types.ts:417](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L417) ---- +*** -### getParticipantUserState() +### getGoals() -> **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> +> **getGoals**(`params`): `Promise`\<[`Goal`](Goal.md)[]\> #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params** -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.onlyInProgress?**: `boolean` + +• **params.count?**: `number` #### Returns -`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> +`Promise`\<[`Goal`](Goal.md)[]\> #### Defined in -[core/src/core/types.ts:428](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L428) +[packages/core/src/core/types.ts:422](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L422) ---- +*** -### getRelationship() +### updateGoal() -> **getRelationship**(`params`): `Promise`\<[`Relationship`](Relationship.md)\> +> **updateGoal**(`goal`): `Promise`\<`void`\> #### Parameters -• **params** - -• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **goal**: [`Goal`](Goal.md) #### Returns -`Promise`\<[`Relationship`](Relationship.md)\> +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:438](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L438) +[packages/core/src/core/types.ts:428](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L428) ---- +*** -### getRelationships() +### createGoal() -> **getRelationships**(`params`): `Promise`\<[`Relationship`](Relationship.md)[]\> +> **createGoal**(`goal`): `Promise`\<`void`\> #### Parameters -• **params** - -• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **goal**: [`Goal`](Goal.md) #### Returns -`Promise`\<[`Relationship`](Relationship.md)[]\> +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:442](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L442) +[packages/core/src/core/types.ts:429](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L429) ---- +*** -### getRoom() +### removeGoal() -> **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> +> **removeGoal**(`goalId`): `Promise`\<`void`\> #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:419](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L419) +[packages/core/src/core/types.ts:430](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L430) ---- +*** -### getRoomsForParticipant() +### removeAllGoals() -> **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +> **removeAllGoals**(`roomId`): `Promise`\<`void`\> #### Parameters -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:422](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L422) +[packages/core/src/core/types.ts:431](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L431) ---- +*** -### getRoomsForParticipants() +### getRoom() -> **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +> **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> #### Parameters -• **userIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> +`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) +[packages/core/src/core/types.ts:432](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L432) ---- +*** -### log() +### createRoom() -> **log**(`params`): `Promise`\<`void`\> +> **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> #### Parameters -• **params** - -• **params.body** - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.type**: `string` - -• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`void`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> #### Defined in -[core/src/core/types.ts:367](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L367) +[packages/core/src/core/types.ts:433](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L433) ---- +*** -### removeAllGoals() +### removeRoom() -> **removeAllGoals**(`roomId`): `Promise`\<`void`\> +> **removeRoom**(`roomId`): `Promise`\<`void`\> #### Parameters @@ -510,67 +512,65 @@ #### Defined in -[core/src/core/types.ts:418](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L418) +[packages/core/src/core/types.ts:434](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L434) ---- +*** -### removeAllMemories() +### getRoomsForParticipant() -> **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> +> **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **tableName**: `string` +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`void`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> #### Defined in -[core/src/core/types.ts:403](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L403) +[packages/core/src/core/types.ts:435](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L435) ---- +*** -### removeGoal() +### getRoomsForParticipants() -> **removeGoal**(`goalId`): `Promise`\<`void`\> +> **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> #### Parameters -• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **userIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] #### Returns -`Promise`\<`void`\> +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> #### Defined in -[core/src/core/types.ts:417](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L417) +[packages/core/src/core/types.ts:436](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L436) ---- +*** -### removeMemory() +### addParticipant() -> **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> +> **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> #### Parameters -• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **tableName**: `string` +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`void`\> +`Promise`\<`boolean`\> #### Defined in -[core/src/core/types.ts:402](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L402) +[packages/core/src/core/types.ts:437](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L437) ---- +*** ### removeParticipant() @@ -588,146 +588,146 @@ #### Defined in -[core/src/core/types.ts:425](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L425) +[packages/core/src/core/types.ts:438](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L438) ---- +*** -### removeRoom() +### getParticipantsForAccount() -> **removeRoom**(`roomId`): `Promise`\<`void`\> +> **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](Participant.md)[]\> #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Participant`](Participant.md)[]\> #### Defined in -[core/src/core/types.ts:421](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L421) +[packages/core/src/core/types.ts:439](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L439) ---- +*** -### searchMemories() +### getParticipantsForRoom() -> **searchMemories**(`params`): `Promise`\<[`Memory`](Memory.md)[]\> +> **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> #### Parameters -• **params** - -• **params.embedding**: `number`[] +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.match_count**: `number` +#### Returns -• **params.match_threshold**: `number` +`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +#### Defined in -• **params.tableName**: `string` +[packages/core/src/core/types.ts:440](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L440) -• **params.unique**: `boolean` +*** -#### Returns +### getParticipantUserState() -`Promise`\<[`Memory`](Memory.md)[]\> +> **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> -#### Defined in +#### Parameters -[core/src/core/types.ts:374](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L374) +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` ---- +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -### searchMemoriesByEmbedding() +#### Returns -> **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](Memory.md)[]\> +`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> -#### Parameters +#### Defined in -• **embedding**: `number`[] +[packages/core/src/core/types.ts:441](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L441) -• **params** +*** -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +### setParticipantUserState() -• **params.count?**: `number` +> **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> -• **params.match_threshold?**: `number` +#### Parameters -• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.tableName**: `string` +• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **params.unique?**: `boolean` +• **state**: `"FOLLOWED"` \| `"MUTED"` #### Returns -`Promise`\<[`Memory`](Memory.md)[]\> +`Promise`\<`void`\> #### Defined in -[core/src/core/types.ts:386](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L386) +[packages/core/src/core/types.ts:445](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L445) ---- +*** -### setParticipantUserState() +### createRelationship() -> **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> +> **createRelationship**(`params`): `Promise`\<`boolean`\> #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params** -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **state**: `"FOLLOWED"` \| `"MUTED"` +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`void`\> +`Promise`\<`boolean`\> #### Defined in -[core/src/core/types.ts:432](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L432) +[packages/core/src/core/types.ts:450](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L450) ---- +*** -### updateGoal() +### getRelationship() -> **updateGoal**(`goal`): `Promise`\<`void`\> +> **getRelationship**(`params`): `Promise`\<[`Relationship`](Relationship.md)\> #### Parameters -• **goal**: [`Goal`](Goal.md) +• **params** + +• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Relationship`](Relationship.md)\> #### Defined in -[core/src/core/types.ts:415](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L415) +[packages/core/src/core/types.ts:451](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L451) ---- +*** -### updateGoalStatus() +### getRelationships() -> **updateGoalStatus**(`params`): `Promise`\<`void`\> +> **getRelationships**(`params`): `Promise`\<[`Relationship`](Relationship.md)[]\> #### Parameters • **params** -• **params.goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.status**: [`GoalStatus`](../enumerations/GoalStatus.md) +• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Relationship`](Relationship.md)[]\> #### Defined in -[core/src/core/types.ts:382](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L382) +[packages/core/src/core/types.ts:455](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L455) diff --git a/docs/api/interfaces/IImageRecognitionService.md b/docs/api/interfaces/IImageRecognitionService.md index 80743e38c6..7b56ddbcf0 100644 --- a/docs/api/interfaces/IImageRecognitionService.md +++ b/docs/api/interfaces/IImageRecognitionService.md @@ -2,46 +2,46 @@ ## Methods -### describeImage() +### initialize() -> **describeImage**(`imageUrl`): `Promise`\<`object`\> +> **initialize**(`modelId`?, `device`?): `Promise`\<`void`\> #### Parameters -• **imageUrl**: `string` +• **modelId?**: `string` -#### Returns +• **device?**: `string` -`Promise`\<`object`\> +#### Returns -##### description +`Promise`\<`void`\> -> **description**: `string` +#### Defined in -##### title +[packages/core/src/core/types.ts:557](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L557) -> **title**: `string` +*** -#### Defined in +### describeImage() -[core/src/core/types.ts:545](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L545) +> **describeImage**(`imageUrl`): `Promise`\<`object`\> ---- +#### Parameters -### initialize() +• **imageUrl**: `string` -> **initialize**(`modelId`?, `device`?): `Promise`\<`void`\> +#### Returns -#### Parameters +`Promise`\<`object`\> -• **modelId?**: `string` +##### title -• **device?**: `string` +> **title**: `string` -#### Returns +##### description -`Promise`\<`void`\> +> **description**: `string` #### Defined in -[core/src/core/types.ts:544](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L544) +[packages/core/src/core/types.ts:558](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L558) diff --git a/docs/api/interfaces/ILlamaService.md b/docs/api/interfaces/ILlamaService.md index 99f1d512e7..6236ef3f11 100644 --- a/docs/api/interfaces/ILlamaService.md +++ b/docs/api/interfaces/ILlamaService.md @@ -2,24 +2,6 @@ ## 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`\> @@ -30,9 +12,9 @@ #### Defined in -[core/src/core/types.ts:565](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L565) +[packages/core/src/core/types.ts:578](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L578) ---- +*** ### queueMessageCompletion() @@ -46,11 +28,11 @@ • **stop**: `string`[] -• **frequency_penalty**: `number` +• **frequency\_penalty**: `number` -• **presence_penalty**: `number` +• **presence\_penalty**: `number` -• **max_tokens**: `number` +• **max\_tokens**: `number` #### Returns @@ -58,9 +40,9 @@ #### Defined in -[core/src/core/types.ts:566](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L566) +[packages/core/src/core/types.ts:579](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L579) ---- +*** ### queueTextCompletion() @@ -74,11 +56,11 @@ • **stop**: `string`[] -• **frequency_penalty**: `number` +• **frequency\_penalty**: `number` -• **presence_penalty**: `number` +• **presence\_penalty**: `number` -• **max_tokens**: `number` +• **max\_tokens**: `number` #### Returns @@ -86,4 +68,22 @@ #### Defined in -[core/src/core/types.ts:574](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L574) +[packages/core/src/core/types.ts:587](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L587) + +*** + +### getEmbeddingResponse() + +> **getEmbeddingResponse**(`input`): `Promise`\<`number`[]\> + +#### Parameters + +• **input**: `string` + +#### Returns + +`Promise`\<`number`[]\> + +#### Defined in + +[packages/core/src/core/types.ts:595](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L595) diff --git a/docs/api/interfaces/IMemoryManager.md b/docs/api/interfaces/IMemoryManager.md index 9026f0b807..d0f34e102d 100644 --- a/docs/api/interfaces/IMemoryManager.md +++ b/docs/api/interfaces/IMemoryManager.md @@ -2,33 +2,33 @@ ## Properties -### constructor +### runtime -> **constructor**: `Function` +> **runtime**: [`IAgentRuntime`](IAgentRuntime.md) #### Defined in -[core/src/core/types.ts:449](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L449) +[packages/core/src/core/types.ts:459](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L459) ---- +*** -### runtime +### tableName -> **runtime**: [`IAgentRuntime`](IAgentRuntime.md) +> **tableName**: `string` #### Defined in -[core/src/core/types.ts:446](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L446) +[packages/core/src/core/types.ts:460](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L460) ---- +*** -### tableName +### constructor -> **tableName**: `string` +> **constructor**: `Function` #### Defined in -[core/src/core/types.ts:447](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L447) +[packages/core/src/core/types.ts:462](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L462) ## Methods @@ -46,49 +46,39 @@ #### Defined in -[core/src/core/types.ts:451](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L451) +[packages/core/src/core/types.ts:464](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L464) ---- +*** -### countMemories() +### getMemories() -> **countMemories**(`roomId`, `unique`?): `Promise`\<`number`\> +> **getMemories**(`opts`): `Promise`\<[`Memory`](Memory.md)[]\> #### 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) +• **opts** ---- +• **opts.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -### createMemory() +• **opts.count?**: `number` -> **createMemory**(`memory`, `unique`?): `Promise`\<`void`\> +• **opts.unique?**: `boolean` -#### Parameters +• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **memory**: [`Memory`](Memory.md) +• **opts.start?**: `number` -• **unique?**: `boolean` +• **opts.end?**: `number` #### Returns -`Promise`\<`void`\> +`Promise`\<[`Memory`](Memory.md)[]\> #### Defined in -[core/src/core/types.ts:478](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L478) +[packages/core/src/core/types.ts:465](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L465) ---- +*** ### getCachedEmbeddings() @@ -104,39 +94,27 @@ #### Defined in -[core/src/core/types.ts:460](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L460) +[packages/core/src/core/types.ts:473](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L473) ---- +*** -### getMemories() +### getMemoryById() -> **getMemories**(`opts`): `Promise`\<[`Memory`](Memory.md)[]\> +> **getMemoryById**(`id`): `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` +• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<[`Memory`](Memory.md)[]\> +`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) +[packages/core/src/core/types.ts:476](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L476) ---- +*** ### getMemoriesByRoomIds() @@ -146,45 +124,59 @@ • **params** -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - • **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] +• **params.agentId?**: \`$\{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) +[packages/core/src/core/types.ts:477](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L477) ---- +*** -### getMemoryById() +### searchMemoriesByEmbedding() -> **getMemoryById**(`id`): `Promise`\<[`Memory`](Memory.md)\> +> **searchMemoriesByEmbedding**(`embedding`, `opts`): `Promise`\<[`Memory`](Memory.md)[]\> #### Parameters -• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **embedding**: `number`[] + +• **opts** + +• **opts.match\_threshold?**: `number` + +• **opts.count?**: `number` + +• **opts.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **opts.unique?**: `boolean` + +• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` #### Returns -`Promise`\<[`Memory`](Memory.md)\> +`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) +[packages/core/src/core/types.ts:481](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L481) ---- +*** -### removeAllMemories() +### createMemory() -> **removeAllMemories**(`roomId`): `Promise`\<`void`\> +> **createMemory**(`memory`, `unique`?): `Promise`\<`void`\> #### Parameters -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +• **memory**: [`Memory`](Memory.md) + +• **unique?**: `boolean` #### Returns @@ -192,9 +184,9 @@ #### Defined in -[core/src/core/types.ts:480](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L480) +[packages/core/src/core/types.ts:491](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L491) ---- +*** ### removeMemory() @@ -210,34 +202,42 @@ #### Defined in -[core/src/core/types.ts:479](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L479) +[packages/core/src/core/types.ts:492](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L492) ---- +*** -### searchMemoriesByEmbedding() +### removeAllMemories() -> **searchMemoriesByEmbedding**(`embedding`, `opts`): `Promise`\<[`Memory`](Memory.md)[]\> +> **removeAllMemories**(`roomId`): `Promise`\<`void`\> #### Parameters -• **embedding**: `number`[] +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **opts** +#### Returns -• **opts.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +`Promise`\<`void`\> -• **opts.count?**: `number` +#### Defined in -• **opts.match_threshold?**: `number` +[packages/core/src/core/types.ts:493](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L493) -• **opts.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` +*** -• **opts.unique?**: `boolean` +### countMemories() + +> **countMemories**(`roomId`, `unique`?): `Promise`\<`number`\> + +#### Parameters + +• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +• **unique?**: `boolean` #### Returns -`Promise`\<[`Memory`](Memory.md)[]\> +`Promise`\<`number`\> #### Defined in -[core/src/core/types.ts:468](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L468) +[packages/core/src/core/types.ts:494](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L494) diff --git a/docs/api/interfaces/IPdfService.md b/docs/api/interfaces/IPdfService.md index a4d4b01171..2bc1c0d94e 100644 --- a/docs/api/interfaces/IPdfService.md +++ b/docs/api/interfaces/IPdfService.md @@ -16,4 +16,4 @@ #### Defined in -[core/src/core/types.ts:598](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L598) +[packages/core/src/core/types.ts:611](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L611) diff --git a/docs/api/interfaces/ISpeechService.md b/docs/api/interfaces/ISpeechService.md index 1fd5891420..1380849b52 100644 --- a/docs/api/interfaces/ISpeechService.md +++ b/docs/api/interfaces/ISpeechService.md @@ -18,4 +18,4 @@ #### Defined in -[core/src/core/types.ts:594](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L594) +[packages/core/src/core/types.ts:607](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L607) diff --git a/docs/api/interfaces/ITranscriptionService.md b/docs/api/interfaces/ITranscriptionService.md index e21318f281..7dd8d7abc2 100644 --- a/docs/api/interfaces/ITranscriptionService.md +++ b/docs/api/interfaces/ITranscriptionService.md @@ -2,9 +2,9 @@ ## Methods -### transcribe() +### transcribeAttachment() -> **transcribe**(`audioBuffer`): `Promise`\<`string`\> +> **transcribeAttachment**(`audioBuffer`): `Promise`\<`string`\> #### Parameters @@ -16,13 +16,13 @@ #### Defined in -[core/src/core/types.ts:555](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L555) +[packages/core/src/core/types.ts:564](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L564) ---- +*** -### transcribeAttachment() +### transcribeAttachmentLocally() -> **transcribeAttachment**(`audioBuffer`): `Promise`\<`string`\> +> **transcribeAttachmentLocally**(`audioBuffer`): `Promise`\<`string`\> #### Parameters @@ -34,13 +34,13 @@ #### Defined in -[core/src/core/types.ts:551](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L551) +[packages/core/src/core/types.ts:565](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L565) ---- +*** -### transcribeAttachmentLocally() +### transcribe() -> **transcribeAttachmentLocally**(`audioBuffer`): `Promise`\<`string`\> +> **transcribe**(`audioBuffer`): `Promise`\<`string`\> #### Parameters @@ -52,9 +52,9 @@ #### Defined in -[core/src/core/types.ts:552](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L552) +[packages/core/src/core/types.ts:568](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L568) ---- +*** ### transcribeLocally() @@ -70,4 +70,4 @@ #### Defined in -[core/src/core/types.ts:556](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L556) +[packages/core/src/core/types.ts:569](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L569) diff --git a/docs/api/interfaces/IVideoService.md b/docs/api/interfaces/IVideoService.md index 37974807ef..94b9fba7b9 100644 --- a/docs/api/interfaces/IVideoService.md +++ b/docs/api/interfaces/IVideoService.md @@ -16,9 +16,9 @@ #### Defined in -[core/src/core/types.ts:560](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L560) +[packages/core/src/core/types.ts:573](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L573) ---- +*** ### processVideo() @@ -34,4 +34,4 @@ #### Defined in -[core/src/core/types.ts:561](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L561) +[packages/core/src/core/types.ts:574](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L574) diff --git a/docs/api/interfaces/Memory.md b/docs/api/interfaces/Memory.md index d9de6d2a67..f4dabd14cf 100644 --- a/docs/api/interfaces/Memory.md +++ b/docs/api/interfaces/Memory.md @@ -1,45 +1,83 @@ ---- -id: "Memory" -title: "Interface: Memory" -sidebar_label: "Memory" -sidebar_position: 0 -custom_edit_url: null ---- +# 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 +### id? + +> `optional` **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[packages/core/src/core/types.ts:165](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L165) + +*** + +### userId + +> **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[packages/core/src/core/types.ts:166](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L166) + +*** + +### agentId + +> **agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[packages/core/src/core/types.ts:167](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L167) + +*** + +### createdAt? + +> `optional` **createdAt**: `number` + +#### Defined in + +[packages/core/src/core/types.ts:168](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L168) + +*** + ### content -• **content**: [`Content`](Content.md) +> **content**: [`Content`](Content.md) + +#### Defined in + +[packages/core/src/core/types.ts:169](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L169) ---- +*** -### created_at +### embedding? -• `Optional` **created_at**: `string` +> `optional` **embedding**: `number`[] ---- +#### Defined in -### embedding +[packages/core/src/core/types.ts:170](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L170) -• `Optional` **embedding**: `number`[] +*** ---- +### roomId -### id +> **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• `Optional` **id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +#### Defined in ---- +[packages/core/src/core/types.ts:171](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L171) -### room_id +*** -• **room_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +### unique? ---- +> `optional` **unique**: `boolean` -### user_id +#### Defined in -• **user_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +[packages/core/src/core/types.ts:172](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L172) diff --git a/docs/api/interfaces/Message.md b/docs/api/interfaces/Message.md deleted file mode 100644 index 6787778d5a..0000000000 --- a/docs/api/interfaces/Message.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -id: "Message" -title: "Interface: Message" -sidebar_label: "Message" -sidebar_position: 0 -custom_edit_url: null ---- - -Represents a message within the conversation, including its content and associated metadata such as the sender, agent, and room IDs. - -## Properties - -### content - -• **content**: [`Content`](Content.md) - ---- - -### room_id - -• **room_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` - ---- - -### user_id - -• **user_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` diff --git a/docs/api/interfaces/MessageExample.md b/docs/api/interfaces/MessageExample.md index 9d1edcd80e..c62d417504 100644 --- a/docs/api/interfaces/MessageExample.md +++ b/docs/api/interfaces/MessageExample.md @@ -1,21 +1,23 @@ ---- -id: "MessageExample" -title: "Interface: MessageExample" -sidebar_label: "MessageExample" -sidebar_position: 0 -custom_edit_url: null ---- +# Interface: MessageExample Represents an example of a message, typically used for demonstrating or testing purposes, including optional content and action. ## Properties -### content +### user -• **content**: [`Content`](Content.md) +> **user**: `string` ---- +#### Defined in -### user +[packages/core/src/core/types.ts:179](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L179) + +*** + +### content + +> **content**: [`Content`](Content.md) + +#### Defined in -• **user**: `string` +[packages/core/src/core/types.ts:180](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L180) diff --git a/docs/api/interfaces/Objective.md b/docs/api/interfaces/Objective.md index 71bbc907c6..044db417c4 100644 --- a/docs/api/interfaces/Objective.md +++ b/docs/api/interfaces/Objective.md @@ -1,27 +1,33 @@ ---- -id: "Objective" -title: "Interface: Objective" -sidebar_label: "Objective" -sidebar_position: 0 -custom_edit_url: null ---- +# Interface: Objective Represents an objective within a goal, detailing what needs to be achieved and whether it has been completed. ## Properties -### completed +### id? + +> `optional` **id**: `string` -• **completed**: `boolean` +#### Defined in ---- +[packages/core/src/core/types.ts:52](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L52) + +*** ### description -• **description**: `string` +> **description**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:53](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L53) + +*** + +### completed ---- +> **completed**: `boolean` -### id +#### Defined in -• `Optional` **id**: `string` +[packages/core/src/core/types.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L54) diff --git a/docs/api/interfaces/Participant.md b/docs/api/interfaces/Participant.md index e1710b005e..01f2dc6d4c 100644 --- a/docs/api/interfaces/Participant.md +++ b/docs/api/interfaces/Participant.md @@ -1,21 +1,23 @@ ---- -id: "Participant" -title: "Interface: Participant" -sidebar_label: "Participant" -sidebar_position: 0 -custom_edit_url: null ---- +# Interface: Participant Represents a participant in a room, including their ID and account details. ## Properties -### account +### id -• **account**: [`Account`](Account.md) +> **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` ---- +#### Defined in -### id +[packages/core/src/core/types.ts:282](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L282) + +*** + +### account + +> **account**: [`Account`](Account.md) + +#### Defined in -• **id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +[packages/core/src/core/types.ts:283](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L283) diff --git a/docs/api/interfaces/Provider.md b/docs/api/interfaces/Provider.md index f1d89fcae4..8b61c76dea 100644 --- a/docs/api/interfaces/Provider.md +++ b/docs/api/interfaces/Provider.md @@ -1,31 +1,25 @@ ---- -id: "Provider" -title: "Interface: Provider" -sidebar_label: "Provider" -sidebar_position: 0 -custom_edit_url: null ---- +# 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() -• **get**: (`runtime`: [`AgentRuntime`](../classes/AgentRuntime.md), `message`: [`Message`](Message.md), `state?`: [`State`](State.md)) => `Promise`\<`unknown`\> +> **get**: (`runtime`, `message`, `state`?) => `Promise`\<`any`\> -#### Type declaration +#### Parameters -▸ (`runtime`, `message`, `state?`): `Promise`\<`unknown`\> +• **runtime**: [`IAgentRuntime`](IAgentRuntime.md) -##### Parameters +• **message**: [`Memory`](Memory.md) -| Name | Type | -| :-------- | :------------------------------------------- | -| `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | -| `message` | [`Message`](Message.md) | -| `state?` | [`State`](State.md) | +• **state?**: [`State`](State.md) -##### Returns +#### Returns -`Promise`\<`unknown`\> +`Promise`\<`any`\> + +#### Defined in + +[packages/core/src/core/types.ts:246](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L246) diff --git a/docs/api/interfaces/Relationship.md b/docs/api/interfaces/Relationship.md index e7c9c95b6d..7f2f1d371b 100644 --- a/docs/api/interfaces/Relationship.md +++ b/docs/api/interfaces/Relationship.md @@ -1,51 +1,73 @@ ---- -id: "Relationship" -title: "Interface: Relationship" -sidebar_label: "Relationship" -sidebar_position: 0 -custom_edit_url: null ---- +# 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 -### created_at +### id -• `Optional` **created_at**: `string` +> **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` ---- +#### Defined in -### id +[packages/core/src/core/types.ts:257](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L257) -• **id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +*** ---- +### userA -### room_id +> **userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• **room_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +#### Defined in ---- +[packages/core/src/core/types.ts:258](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L258) -### status +*** + +### userB + +> **userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[packages/core/src/core/types.ts:259](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L259) + +*** + +### userId -• **status**: `string` +> **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` ---- +#### Defined in + +[packages/core/src/core/types.ts:260](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L260) + +*** + +### roomId + +> **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` + +#### Defined in + +[packages/core/src/core/types.ts:261](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L261) + +*** + +### status -### user_a +> **status**: `string` -• **user_a**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +#### Defined in ---- +[packages/core/src/core/types.ts:262](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L262) -### user_b +*** -• **user_b**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +### createdAt? ---- +> `optional` **createdAt**: `string` -### user_id +#### Defined in -• **user_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +[packages/core/src/core/types.ts:263](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L263) diff --git a/docs/api/interfaces/Room.md b/docs/api/interfaces/Room.md index 04a85413dc..b06aa68d12 100644 --- a/docs/api/interfaces/Room.md +++ b/docs/api/interfaces/Room.md @@ -1,10 +1,4 @@ ---- -id: "Room" -title: "Interface: Room" -sidebar_label: "Room" -sidebar_position: 0 -custom_edit_url: null ---- +# Interface: Room Represents a room or conversation context, including its ID and a list of participants. @@ -12,10 +6,18 @@ Represents a room or conversation context, including its ID and a list of partic ### id -• **id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +> **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` ---- +#### Defined in + +[packages/core/src/core/types.ts:290](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L290) + +*** ### participants -• **participants**: [`Participant`](Participant.md)[] +> **participants**: [`Participant`](Participant.md)[] + +#### Defined in + +[packages/core/src/core/types.ts:291](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L291) diff --git a/docs/api/interfaces/State.md b/docs/api/interfaces/State.md index 97ea31ba0d..9bd2a2f324 100644 --- a/docs/api/interfaces/State.md +++ b/docs/api/interfaces/State.md @@ -1,139 +1,277 @@ ---- -id: "State" -title: "Interface: State" -sidebar_label: "State" -sidebar_position: 0 -custom_edit_url: null ---- +# 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` + \[`key`: `string`\]: `unknown` ## Properties -### actionExamples +### userId? -• `Optional` **actionExamples**: `string` +> `optional` **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` ---- +#### Defined in -### actionNames +[packages/core/src/core/types.ts:131](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L131) -• `Optional` **actionNames**: `string` +*** ---- +### agentId? -### actions +> `optional` **agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` -• `Optional` **actions**: `string` +#### Defined in ---- +[packages/core/src/core/types.ts:132](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L132) -### actionsData +*** -• `Optional` **actionsData**: [`Action`](Action.md)[] +### bio ---- +> **bio**: `string` -### actors +#### Defined in + +[packages/core/src/core/types.ts:133](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L133) + +*** + +### lore + +> **lore**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:134](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L134) + +*** + +### messageDirections + +> **messageDirections**: `string` -• **actors**: `string` +#### Defined in ---- +[packages/core/src/core/types.ts:135](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L135) -### actorsData +*** -• `Optional` **actorsData**: [`Actor`](Actor.md)[] +### postDirections ---- +> **postDirections**: `string` -### agentId +#### Defined in -• `Optional` **agentId**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +[packages/core/src/core/types.ts:136](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L136) ---- +*** -### agentName +### roomId -• `Optional` **agentName**: `string` +> **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` ---- +#### Defined in -### goals +[packages/core/src/core/types.ts:137](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L137) -• `Optional` **goals**: `string` +*** ---- +### agentName? -### goalsData +> `optional` **agentName**: `string` -• `Optional` **goalsData**: [`Goal`](Goal.md)[] +#### Defined in + +[packages/core/src/core/types.ts:138](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L138) + +*** + +### senderName? + +> `optional` **senderName**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:139](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L139) + +*** + +### actors ---- +> **actors**: `string` -### providers +#### Defined in -• `Optional` **providers**: `string` +[packages/core/src/core/types.ts:140](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L140) ---- +*** -### recentFacts +### actorsData? -• `Optional` **recentFacts**: `string` +> `optional` **actorsData**: [`Actor`](Actor.md)[] ---- +#### Defined in -### recentFactsData +[packages/core/src/core/types.ts:141](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L141) -• `Optional` **recentFactsData**: [`Memory`](Memory.md)[] +*** ---- +### goals? + +> `optional` **goals**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:142](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L142) + +*** + +### goalsData? + +> `optional` **goalsData**: [`Goal`](Goal.md)[] + +#### Defined in + +[packages/core/src/core/types.ts:143](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L143) + +*** ### recentMessages -• **recentMessages**: `string` +> **recentMessages**: `string` ---- +#### Defined in + +[packages/core/src/core/types.ts:144](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L144) + +*** ### recentMessagesData -• **recentMessagesData**: [`Memory`](Memory.md)[] +> **recentMessagesData**: [`Memory`](Memory.md)[] + +#### Defined in + +[packages/core/src/core/types.ts:145](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L145) + +*** + +### recentFacts? + +> `optional` **recentFacts**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:146](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L146) + +*** + +### recentFactsData? + +> `optional` **recentFactsData**: [`Memory`](Memory.md)[] + +#### Defined in + +[packages/core/src/core/types.ts:147](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L147) + +*** + +### relevantFacts? + +> `optional` **relevantFacts**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:148](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L148) + +*** + +### relevantFactsData? + +> `optional` **relevantFactsData**: [`Memory`](Memory.md)[] + +#### Defined in + +[packages/core/src/core/types.ts:149](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L149) + +*** + +### actionNames? + +> `optional` **actionNames**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L150) + +*** + +### actions? + +> `optional` **actions**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:151](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L151) + +*** + +### actionsData? + +> `optional` **actionsData**: [`Action`](Action.md)[] + +#### Defined in + +[packages/core/src/core/types.ts:152](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L152) + +*** + +### actionExamples? + +> `optional` **actionExamples**: `string` + +#### Defined in + +[packages/core/src/core/types.ts:153](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L153) + +*** + +### providers? ---- +> `optional` **providers**: `string` -### relevantFacts +#### Defined in -• `Optional` **relevantFacts**: `string` +[packages/core/src/core/types.ts:154](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L154) ---- +*** -### relevantFactsData +### responseData? -• `Optional` **relevantFactsData**: [`Memory`](Memory.md)[] +> `optional` **responseData**: [`Content`](Content.md) ---- +#### Defined in -### responseData +[packages/core/src/core/types.ts:155](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L155) -• `Optional` **responseData**: [`Content`](Content.md) +*** ---- +### recentInteractionsData? -### room_id +> `optional` **recentInteractionsData**: [`Memory`](Memory.md)[] -• **room_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +#### Defined in ---- +[packages/core/src/core/types.ts:156](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L156) -### senderName +*** -• `Optional` **senderName**: `string` +### recentInteractions? ---- +> `optional` **recentInteractions**: `string` -### user_id +#### Defined in -• `Optional` **user_id**: \`$\{string}-$\{string}-$\{string}-$\{string}-$\{string}\` +[packages/core/src/core/types.ts:157](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L157) diff --git a/docs/api/interfaces/_category_.yml b/docs/api/interfaces/_category_.yml deleted file mode 100644 index 2fb3459e08..0000000000 --- a/docs/api/interfaces/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Interfaces" -position: 4 diff --git a/docs/api/modules.md b/docs/api/modules.md deleted file mode 100644 index 8200f88ad9..0000000000 --- a/docs/api/modules.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -id: "modules" -title: "eliza" -sidebar_label: "Exports" -sidebar_position: 0.5 -custom_edit_url: null ---- diff --git a/docs/api/rooms.md b/docs/api/rooms.md deleted file mode 100644 index f8c82a00cc..0000000000 --- a/docs/api/rooms.md +++ /dev/null @@ -1,25 +0,0 @@ -# Room Model - -The 'room model' represents a physical or virtual space where interactions between agents and users take place. - -In a typical user-to-agent conversation, such as in ChatGPT, the conversation can be stored in the database with a key for the user and a key for the agent. When they agent needs to look at the recnt conversation history, they can search the database and filter by the person they are talking to. In a multi-agent environment, the conversation can be a lot more complex, with multiple people joining and leaving the conversation, multiple agents interacting with each other, and more. - -The room model is popular in multiplayer gaming, where a room can be associated with a server. For many open-world multiplayer games, the world is divided into chunks that players can move between. - -In the context of eliza, a room can be a physical space, such as a chat room, or a virtual space, such as a game world. The room model provides a way to organize interactions, manage participants, and maintain context within a specific environment. - -## Key Concepts - -### Room - -A room contains a list of participants which can be agents or users, and can be added or removed from at any time. The room is keyed by the `room_id`. - -### Participant - -A participant is an agent or user that is part of the room. Participants are identified by their 'user_id' which is keyed to the account of the user or agent. - -### Ensuring that a Room and Participant Exists - -Every memory needs to be associated with a room and a participant. On databases where foreign keys are available, we try to enforce this constraint. - -When handling messages, you can use the built-in `AgentRuntime.ensureRoomExists(user_id, room_id)` and `AgentRuntime.ensureParticipantExists()` methods to ensure that the room and participant are correctly set up. A wrapper function has also been added to the runtime to make this easier: `AgentRuntime.ensureConnection(user_id, room_id, user_name, user_screen_name, source)`. diff --git a/docs/api/type-aliases/Character.md b/docs/api/type-aliases/Character.md index 511d14ef77..dde52a529e 100644 --- a/docs/api/type-aliases/Character.md +++ b/docs/api/type-aliases/Character.md @@ -4,73 +4,81 @@ ## Type declaration -### adjectives +### id? -> **adjectives**: `string`[] +> `optional` **id**: [`UUID`](UUID.md) -### bio +### name -> **bio**: `string` \| `string`[] +> **name**: `string` -### clients +### system? -> **clients**: [`Clients`](../enumerations/Clients.md)[] +> `optional` **system**: `string` -### id? +### modelProvider -> `optional` **id**: [`UUID`](UUID.md) +> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) + +### modelEndpointOverride? + +> `optional` **modelEndpointOverride**: `string` ### imageGenModel? > `optional` **imageGenModel**: [`ImageGenModel`](../enumerations/ImageGenModel.md) -### knowledge? +### templates? -> `optional` **knowledge**: `string`[] +> `optional` **templates**: `object` -### lore +#### Index Signature -> **lore**: `string`[] + \[`key`: `string`\]: `string` -### messageExamples +### bio -> **messageExamples**: [`MessageExample`](../interfaces/MessageExample.md)[][] +> **bio**: `string` \| `string`[] -### modelEndpointOverride? +### lore -> `optional` **modelEndpointOverride**: `string` +> **lore**: `string`[] -### modelProvider +### messageExamples -> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) +> **messageExamples**: [`MessageExample`](../interfaces/MessageExample.md)[][] -### name +### postExamples -> **name**: `string` +> **postExamples**: `string`[] ### people > **people**: `string`[] -### plugins +### topics -> **plugins**: [`Plugin`](Plugin.md)[] +> **topics**: `string`[] -### postExamples +### adjectives -> **postExamples**: `string`[] +> **adjectives**: `string`[] -### settings? +### knowledge? -> `optional` **settings**: `object` +> `optional` **knowledge**: `string`[] -### settings.embeddingModel? +### clients -> `optional` **embeddingModel**: `string` +> **clients**: [`Clients`](../enumerations/Clients.md)[] -### settings.model? +### plugins -> `optional` **model**: `string` +> **plugins**: [`Plugin`](Plugin.md)[] + +### settings? + +> `optional` **settings**: `object` ### settings.secrets? @@ -78,7 +86,7 @@ #### Index Signature -\[`key`: `string`\]: `string` + \[`key`: `string`\]: `string` ### settings.voice? @@ -92,6 +100,14 @@ > `optional` **url**: `string` +### settings.model? + +> `optional` **model**: `string` + +### settings.embeddingModel? + +> `optional` **embeddingModel**: `string` + ### style > **style**: `object` @@ -108,22 +124,6 @@ > **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) +[packages/core/src/core/types.ts:318](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L318) diff --git a/docs/api/type-aliases/Handler.md b/docs/api/type-aliases/Handler.md index 6b3e13d5b4..3c03fbb419 100644 --- a/docs/api/type-aliases/Handler.md +++ b/docs/api/type-aliases/Handler.md @@ -22,4 +22,4 @@ Represents the type of a handler function, which takes a runtime instance, a mes ## Defined in -[core/src/core/types.ts:173](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L173) +[packages/core/src/core/types.ts:186](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L186) diff --git a/docs/api/type-aliases/HandlerCallback.md b/docs/api/type-aliases/HandlerCallback.md index 2d9641aea5..263b9bcdbf 100644 --- a/docs/api/type-aliases/HandlerCallback.md +++ b/docs/api/type-aliases/HandlerCallback.md @@ -14,4 +14,4 @@ ## Defined in -[core/src/core/types.ts:182](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L182) +[packages/core/src/core/types.ts:195](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L195) diff --git a/docs/api/type-aliases/Media.md b/docs/api/type-aliases/Media.md index 0585ea6b84..7230457de1 100644 --- a/docs/api/type-aliases/Media.md +++ b/docs/api/type-aliases/Media.md @@ -4,30 +4,30 @@ ## Type declaration -### description - -> **description**: `string` - ### id > **id**: `string` -### source - -> **source**: `string` - -### text +### url -> **text**: `string` +> **url**: `string` ### title > **title**: `string` -### url +### source -> **url**: `string` +> **source**: `string` + +### description + +> **description**: `string` + +### text + +> **text**: `string` ## Defined in -[core/src/core/types.ts:281](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L281) +[packages/core/src/core/types.ts:294](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L294) diff --git a/docs/api/type-aliases/Model.md b/docs/api/type-aliases/Model.md index 0449532f65..0047f5c697 100644 --- a/docs/api/type-aliases/Model.md +++ b/docs/api/type-aliases/Model.md @@ -8,58 +8,58 @@ > `optional` **endpoint**: `string` -### model +### settings -> **model**: `object` +> **settings**: `object` -### model.embedding? +### settings.maxInputTokens -> `optional` **embedding**: `string` +> **maxInputTokens**: `number` -### model.large +### settings.maxOutputTokens -> **large**: `string` +> **maxOutputTokens**: `number` -### model.medium +### settings.frequency\_penalty? -> **medium**: `string` +> `optional` **frequency\_penalty**: `number` -### model.small +### settings.presence\_penalty? -> **small**: `string` +> `optional` **presence\_penalty**: `number` -### settings +### settings.repetition\_penalty? -> **settings**: `object` +> `optional` **repetition\_penalty**: `number` -### settings.frequency_penalty? +### settings.stop -> `optional` **frequency_penalty**: `number` +> **stop**: `string`[] -### settings.maxInputTokens +### settings.temperature -> **maxInputTokens**: `number` +> **temperature**: `number` -### settings.maxOutputTokens +### model -> **maxOutputTokens**: `number` +> **model**: `object` -### settings.presence_penalty? +### model.small -> `optional` **presence_penalty**: `number` +> **small**: `string` -### settings.repetition_penalty? +### model.medium -> `optional` **repetition_penalty**: `number` +> **medium**: `string` -### settings.stop +### model.large -> **stop**: `string`[] +> **large**: `string` -### settings.temperature +### model.embedding? -> **temperature**: `number` +> `optional` **embedding**: `string` ## Defined in -[core/src/core/types.ts:82](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L82) +[packages/core/src/core/types.ts:82](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L82) diff --git a/docs/api/type-aliases/Models.md b/docs/api/type-aliases/Models.md new file mode 100644 index 0000000000..40aac2db60 --- /dev/null +++ b/docs/api/type-aliases/Models.md @@ -0,0 +1,49 @@ +# Type Alias: Models + +> **Models**: `object` + +## Type declaration + +### openai + +> **openai**: [`Model`](Model.md) + +### anthropic + +> **anthropic**: [`Model`](Model.md) + +### grok + +> **grok**: [`Model`](Model.md) + +### groq + +> **groq**: [`Model`](Model.md) + +### llama\_cloud + +> **llama\_cloud**: [`Model`](Model.md) + +### llama\_local + +> **llama\_local**: [`Model`](Model.md) + +### google + +> **google**: [`Model`](Model.md) + +### claude\_vertex + +> **claude\_vertex**: [`Model`](Model.md) + +### redpill + +> **redpill**: [`Model`](Model.md) + +### ollama + +> **ollama**: [`Model`](Model.md) + +## Defined in + +[packages/core/src/core/types.ts:101](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L101) diff --git a/docs/api/type-aliases/Plugin.md b/docs/api/type-aliases/Plugin.md index 3598e5ac7b..354c482322 100644 --- a/docs/api/type-aliases/Plugin.md +++ b/docs/api/type-aliases/Plugin.md @@ -4,26 +4,26 @@ ## Type declaration -### actions +### name -> **actions**: [`Action`](../interfaces/Action.md)[] +> **name**: `string` ### description > **description**: `string` -### evaluators - -> **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] - -### name +### actions -> **name**: `string` +> **actions**: [`Action`](../interfaces/Action.md)[] ### providers > **providers**: [`Provider`](../interfaces/Provider.md)[] +### evaluators + +> **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] + ## Defined in -[core/src/core/types.ts:290](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L290) +[packages/core/src/core/types.ts:303](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L303) diff --git a/docs/api/type-aliases/UUID.md b/docs/api/type-aliases/UUID.md index bf620cb27d..5c19678a79 100644 --- a/docs/api/type-aliases/UUID.md +++ b/docs/api/type-aliases/UUID.md @@ -6,4 +6,4 @@ Represents a UUID, which is a universally unique identifier conforming to the UU ## Defined in -[core/src/core/types.ts:7](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L7) +[packages/core/src/core/types.ts:7](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L7) diff --git a/docs/api/type-aliases/Validator.md b/docs/api/type-aliases/Validator.md index 3289d9e2e5..ea0b84a0bd 100644 --- a/docs/api/type-aliases/Validator.md +++ b/docs/api/type-aliases/Validator.md @@ -18,4 +18,4 @@ Represents the type of a validator function, which takes a runtime instance, a m ## Defined in -[core/src/core/types.ts:190](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L190) +[packages/core/src/core/types.ts:203](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L203) diff --git a/docs/api/typedoc-sidebar.cjs b/docs/api/typedoc-sidebar.cjs index 6c759f89fe..c8394d68f5 100644 --- a/docs/api/typedoc-sidebar.cjs +++ b/docs/api/typedoc-sidebar.cjs @@ -1,552 +1,4 @@ // @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; +const typedocSidebar = { items: [{"type":"category","label":"Enumerations","items":[{"type":"doc","id":"enumerations/ImageGenModel","label":"ImageGenModel"},{"type":"doc","id":"enumerations/GoalStatus","label":"GoalStatus"},{"type":"doc","id":"enumerations/ModelClass","label":"ModelClass"},{"type":"doc","id":"enumerations/ModelProvider","label":"ModelProvider"},{"type":"doc","id":"enumerations/Clients","label":"Clients"}]},{"type":"category","label":"Classes","items":[{"type":"doc","id":"classes/PostgresDatabaseAdapter","label":"PostgresDatabaseAdapter"},{"type":"doc","id":"classes/SqliteDatabaseAdapter","label":"SqliteDatabaseAdapter"},{"type":"doc","id":"classes/DirectClient","label":"DirectClient"},{"type":"doc","id":"classes/DiscordClient","label":"DiscordClient"},{"type":"doc","id":"classes/TelegramClient","label":"TelegramClient"},{"type":"doc","id":"classes/TwitterInteractionClient","label":"TwitterInteractionClient"},{"type":"doc","id":"classes/TwitterPostClient","label":"TwitterPostClient"},{"type":"doc","id":"classes/TwitterSearchClient","label":"TwitterSearchClient"},{"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/TokenProvider","label":"TokenProvider"},{"type":"doc","id":"classes/WalletProvider","label":"WalletProvider"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"interfaces/CreateAndBuyContent","label":"CreateAndBuyContent"},{"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/IImageRecognitionService","label":"IImageRecognitionService"},{"type":"doc","id":"interfaces/ITranscriptionService","label":"ITranscriptionService"},{"type":"doc","id":"interfaces/IVideoService","label":"IVideoService"},{"type":"doc","id":"interfaces/ILlamaService","label":"ILlamaService"},{"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/Plugin","label":"Plugin"},{"type":"doc","id":"type-aliases/Character","label":"Character"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"variables/messageHandlerTemplate","label":"messageHandlerTemplate"},{"type":"doc","id":"variables/shouldContinueTemplate","label":"shouldContinueTemplate"},{"type":"doc","id":"variables/continueAction","label":"continueAction"},{"type":"doc","id":"variables/shouldFollowTemplate","label":"shouldFollowTemplate"},{"type":"doc","id":"variables/followRoom","label":"followRoom"},{"type":"doc","id":"variables/ignore","label":"ignore"},{"type":"doc","id":"variables/imageGeneration","label":"imageGeneration"},{"type":"doc","id":"variables/shouldMuteTemplate","label":"shouldMuteTemplate"},{"type":"doc","id":"variables/muteRoom","label":"muteRoom"},{"type":"doc","id":"variables/none","label":"none"},{"type":"doc","id":"variables/executeSwap","label":"executeSwap"},{"type":"doc","id":"variables/unfollowRoom","label":"unfollowRoom"},{"type":"doc","id":"variables/shouldUnmuteTemplate","label":"shouldUnmuteTemplate"},{"type":"doc","id":"variables/unmuteRoom","label":"unmuteRoom"},{"type":"doc","id":"variables/defaultActions","label":"defaultActions"},{"type":"doc","id":"variables/defaultCharacter","label":"defaultCharacter"},{"type":"doc","id":"variables/defaultEvaluators","label":"defaultEvaluators"},{"type":"doc","id":"variables/evaluationTemplate","label":"evaluationTemplate"},{"type":"doc","id":"variables/imageGenModels","label":"imageGenModels"},{"type":"doc","id":"variables/embeddingDimension","label":"embeddingDimension"},{"type":"doc","id":"variables/embeddingZeroVector","label":"embeddingZeroVector"},{"type":"doc","id":"variables/defaultProviders","label":"defaultProviders"},{"type":"doc","id":"variables/settings","label":"settings"},{"type":"doc","id":"variables/elizaLogger","label":"elizaLogger"},{"type":"doc","id":"variables/boredomProvider","label":"boredomProvider"},{"type":"doc","id":"variables/orderBookProvider","label":"orderBookProvider"},{"type":"doc","id":"variables/timeProvider","label":"timeProvider"},{"type":"doc","id":"variables/tokenProvider","label":"tokenProvider"},{"type":"doc","id":"variables/walletProvider","label":"walletProvider"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"functions/generateImage","label":"generateImage"},{"type":"doc","id":"functions/generateCaption","label":"generateCaption"},{"type":"doc","id":"functions/isCreateAndBuyContent","label":"isCreateAndBuyContent"},{"type":"doc","id":"functions/createAndBuyToken","label":"createAndBuyToken"},{"type":"doc","id":"functions/buyToken","label":"buyToken"},{"type":"doc","id":"functions/sellToken","label":"sellToken"},{"type":"doc","id":"functions/loadActionConfigs","label":"loadActionConfigs"},{"type":"doc","id":"functions/loadCustomActions","label":"loadCustomActions"},{"type":"doc","id":"functions/initializeClients","label":"initializeClients"},{"type":"doc","id":"functions/parseArguments","label":"parseArguments"},{"type":"doc","id":"functions/loadCharacters","label":"loadCharacters"},{"type":"doc","id":"functions/getTokenForProvider","label":"getTokenForProvider"},{"type":"doc","id":"functions/initializeDatabase","label":"initializeDatabase"},{"type":"doc","id":"functions/createAgentRuntime","label":"createAgentRuntime"},{"type":"doc","id":"functions/createDirectRuntime","label":"createDirectRuntime"},{"type":"doc","id":"functions/startDiscord","label":"startDiscord"},{"type":"doc","id":"functions/startTelegram","label":"startTelegram"},{"type":"doc","id":"functions/startTwitter","label":"startTwitter"},{"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/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/getImageGenModel","label":"getImageGenModel"},{"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"}]}]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/docs/api/types/Handler.md b/docs/api/types/Handler.md deleted file mode 100644 index 37562f6d3a..0000000000 --- a/docs/api/types/Handler.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -id: "Handler" -title: "Type alias: Handler" -sidebar_label: "Handler" -sidebar_position: 0 -custom_edit_url: null ---- - -Ƭ **Handler**: (`runtime`: [`AgentRuntime`](../classes/AgentRuntime.md), `message`: [`Message`](../interfaces/Message.md), `state?`: [`State`](../interfaces/State.md), `options?`: \{ `[key: string]`: `unknown`; }) => `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. - -#### Type declaration - -▸ (`runtime`, `message`, `state?`, `options?`): `Promise`\<`unknown`\> - -##### Parameters - -| Name | Type | -| :--------- | :------------------------------------------- | -| `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | -| `message` | [`Message`](../interfaces/Message.md) | -| `state?` | [`State`](../interfaces/State.md) | -| `options?` | `Object` | - -##### Returns - -`Promise`\<`unknown`\> diff --git a/docs/api/types/Validator.md b/docs/api/types/Validator.md deleted file mode 100644 index f3624c669c..0000000000 --- a/docs/api/types/Validator.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -id: "Validator" -title: "Type alias: Validator" -sidebar_label: "Validator" -sidebar_position: 0 -custom_edit_url: null ---- - -Ƭ **Validator**: (`runtime`: [`AgentRuntime`](../classes/AgentRuntime.md), `message`: [`Message`](../interfaces/Message.md), `state?`: [`State`](../interfaces/State.md)) => `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. - -#### Type declaration - -▸ (`runtime`, `message`, `state?`): `Promise`\<`boolean`\> - -##### Parameters - -| Name | Type | -| :-------- | :------------------------------------------- | -| `runtime` | [`AgentRuntime`](../classes/AgentRuntime.md) | -| `message` | [`Message`](../interfaces/Message.md) | -| `state?` | [`State`](../interfaces/State.md) | - -##### Returns - -`Promise`\<`boolean`\> diff --git a/docs/api/types/_category_.yml b/docs/api/types/_category_.yml deleted file mode 100644 index ab809aa490..0000000000 --- a/docs/api/types/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Type aliases" -position: 5 diff --git a/docs/api/variables/_category_.yml b/docs/api/variables/_category_.yml deleted file mode 100644 index f4d4bc5ac9..0000000000 --- a/docs/api/variables/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Variables" -position: 6 diff --git a/docs/api/variables/boredomProvider.md b/docs/api/variables/boredomProvider.md index f9fdc3d727..f72f1515df 100644 --- a/docs/api/variables/boredomProvider.md +++ b/docs/api/variables/boredomProvider.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/providers/boredom.ts:275](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/boredom.ts#L275) +[packages/core/src/providers/boredom.ts:275](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/boredom.ts#L275) diff --git a/docs/api/variables/continueAction.md b/docs/api/variables/continueAction.md index 030165236d..83be0eff42 100644 --- a/docs/api/variables/continueAction.md +++ b/docs/api/variables/continueAction.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/continue.ts:58](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/continue.ts#L58) +[packages/core/src/actions/continue.ts:58](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/continue.ts#L58) diff --git a/docs/api/variables/defaultActions.md b/docs/api/variables/defaultActions.md index c6a0181599..8db9d30ca5 100644 --- a/docs/api/variables/defaultActions.md +++ b/docs/api/variables/defaultActions.md @@ -1,9 +1,7 @@ ---- -id: "defaultActions" -title: "Variable: defaultActions" -sidebar_label: "defaultActions" -sidebar_position: 0 -custom_edit_url: null ---- +# Variable: defaultActions -• `Const` **defaultActions**: [`Action`](../interfaces/Action.md)[] +> `const` **defaultActions**: [`Action`](../interfaces/Action.md)[] + +## Defined in + +[packages/core/src/core/actions.ts:6](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/actions.ts#L6) diff --git a/docs/api/variables/defaultCharacter.md b/docs/api/variables/defaultCharacter.md index 58de13c19f..60b1e1c6df 100644 --- a/docs/api/variables/defaultCharacter.md +++ b/docs/api/variables/defaultCharacter.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/core/defaultCharacter.ts:3](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/defaultCharacter.ts#L3) +[packages/core/src/core/defaultCharacter.ts:3](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/defaultCharacter.ts#L3) diff --git a/docs/api/variables/defaultEvaluators.md b/docs/api/variables/defaultEvaluators.md index 02d55b2815..9278f369d0 100644 --- a/docs/api/variables/defaultEvaluators.md +++ b/docs/api/variables/defaultEvaluators.md @@ -1,9 +1,7 @@ ---- -id: "defaultEvaluators" -title: "Variable: defaultEvaluators" -sidebar_label: "defaultEvaluators" -sidebar_position: 0 -custom_edit_url: null ---- +# Variable: defaultEvaluators -• `Const` **defaultEvaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] +> `const` **defaultEvaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] + +## Defined in + +[packages/core/src/core/evaluators.ts:7](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L7) diff --git a/docs/api/variables/defaultProviders.md b/docs/api/variables/defaultProviders.md index f051f455ee..a551828de5 100644 --- a/docs/api/variables/defaultProviders.md +++ b/docs/api/variables/defaultProviders.md @@ -1,9 +1,7 @@ ---- -id: "defaultProviders" -title: "Variable: defaultProviders" -sidebar_label: "defaultProviders" -sidebar_position: 0 -custom_edit_url: null ---- +# Variable: defaultProviders -• `Const` **defaultProviders**: [`Provider`](../interfaces/Provider.md)[] +> `const` **defaultProviders**: [`Provider`](../interfaces/Provider.md)[] + +## Defined in + +[packages/core/src/core/providers.ts:4](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/providers.ts#L4) diff --git a/docs/api/variables/elizaLogger.md b/docs/api/variables/elizaLogger.md index ffb378d63f..d1be61a1a0 100644 --- a/docs/api/variables/elizaLogger.md +++ b/docs/api/variables/elizaLogger.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/index.ts:12](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/index.ts#L12) +[packages/core/src/index.ts:12](https://github.com/ai16z/eliza/blob/main/packages/core/src/index.ts#L12) diff --git a/docs/api/variables/embeddingDimension.md b/docs/api/variables/embeddingDimension.md index f563c76e57..62a6edfb7a 100644 --- a/docs/api/variables/embeddingDimension.md +++ b/docs/api/variables/embeddingDimension.md @@ -1,9 +1,7 @@ ---- -id: "embeddingDimension" -title: "Variable: embeddingDimension" -sidebar_label: "embeddingDimension" -sidebar_position: 0 -custom_edit_url: null ---- +# Variable: embeddingDimension -• `Const` **embeddingDimension**: `1536` +> `const` **embeddingDimension**: `1536` = `1536` + +## Defined in + +[packages/core/src/core/memory.ts:9](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L9) diff --git a/docs/api/variables/embeddingZeroVector.md b/docs/api/variables/embeddingZeroVector.md index 2d2b386764..c3767e306a 100644 --- a/docs/api/variables/embeddingZeroVector.md +++ b/docs/api/variables/embeddingZeroVector.md @@ -1,9 +1,7 @@ ---- -id: "embeddingZeroVector" -title: "Variable: embeddingZeroVector" -sidebar_label: "embeddingZeroVector" -sidebar_position: 0 -custom_edit_url: null ---- +# Variable: embeddingZeroVector -• `Const` **embeddingZeroVector**: `any`[] +> `const` **embeddingZeroVector**: `any`[] + +## Defined in + +[packages/core/src/core/memory.ts:10](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L10) diff --git a/docs/api/variables/evaluationTemplate.md b/docs/api/variables/evaluationTemplate.md index d0c5622011..c6dc9cfab5 100644 --- a/docs/api/variables/evaluationTemplate.md +++ b/docs/api/variables/evaluationTemplate.md @@ -1,11 +1,9 @@ ---- -id: "evaluationTemplate" -title: "Variable: evaluationTemplate" -sidebar_label: "evaluationTemplate" -sidebar_position: 0 -custom_edit_url: null ---- +# Variable: evaluationTemplate -• `Const` **evaluationTemplate**: `"TASK: Based on the conversation and conditions, determine which evaluation functions are appropriate to call.\nExamples:\n{{evaluatorExamples}}\n\nINSTRUCTIONS: You are helping me to decide which appropriate functions to call based on the conversation between {{senderName}} and {{agentName}}.\n\n{{recentMessages}}\n\nEvaluator Functions:\n{{evaluators}}\n\nEvaluator Conditions:\n{{evaluatorConditions}}\n\nTASK: Based on the most recent conversation, determine which evaluators functions are appropriate to call to call.\nInclude the name of evaluators that are relevant and should be called in the array\nAvailable evaluator names to include are {{evaluatorNames}}\nRespond with a JSON array containing a field for description in a JSON block formatted for markdown with this structure:\n```json\n[\n 'evaluatorName',\n 'evaluatorName'\n]\n```\n\nYour response must include the JSON block."` +> `const` **evaluationTemplate**: `string` -Template used for the evaluation completion. +Template used for the evaluation generateText. + +## Defined in + +[packages/core/src/core/evaluators.ts:12](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L12) diff --git a/docs/api/variables/executeSwap.md b/docs/api/variables/executeSwap.md index 15018dafaa..af1315167d 100644 --- a/docs/api/variables/executeSwap.md +++ b/docs/api/variables/executeSwap.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/swap.ts:178](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/swap.ts#L178) +[packages/core/src/actions/swap.ts:178](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/swap.ts#L178) diff --git a/docs/api/variables/followRoom.md b/docs/api/variables/followRoom.md index 37276e24ce..aa95fc439a 100644 --- a/docs/api/variables/followRoom.md +++ b/docs/api/variables/followRoom.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/followRoom.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/followRoom.ts#L27) +[packages/core/src/actions/followRoom.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/followRoom.ts#L27) diff --git a/docs/api/variables/ignore.md b/docs/api/variables/ignore.md index 151124d718..481d52bcc9 100644 --- a/docs/api/variables/ignore.md +++ b/docs/api/variables/ignore.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/ignore.ts:8](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/ignore.ts#L8) +[packages/core/src/actions/ignore.ts:8](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/ignore.ts#L8) diff --git a/docs/api/variables/imageGenModels.md b/docs/api/variables/imageGenModels.md index 7f38921b9e..fdc92a06a6 100644 --- a/docs/api/variables/imageGenModels.md +++ b/docs/api/variables/imageGenModels.md @@ -4,18 +4,6 @@ ## Type declaration -### Dalle - -> **Dalle**: `object` - -### Dalle.steps - -> **steps**: `number` = `0` - -### Dalle.subModel - -> **subModel**: `string` = `"dall-e-3"` - ### TogetherAI > **TogetherAI**: `object` @@ -28,6 +16,18 @@ > **subModel**: `string` = `"black-forest-labs/FLUX.1-schnell"` +### Dalle + +> **Dalle**: `object` + +### Dalle.steps + +> **steps**: `number` = `0` + +### Dalle.subModel + +> **subModel**: `string` = `"dall-e-3"` + ## Defined in -[core/src/core/imageGenModels.ts:6](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L6) +[packages/core/src/core/imageGenModels.ts:6](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/imageGenModels.ts#L6) diff --git a/docs/api/variables/imageGeneration.md b/docs/api/variables/imageGeneration.md index 2ca52ee544..6e4847b1e9 100644 --- a/docs/api/variables/imageGeneration.md +++ b/docs/api/variables/imageGeneration.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/imageGeneration.ts:11](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/imageGeneration.ts#L11) +[packages/core/src/actions/imageGeneration.ts:11](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/imageGeneration.ts#L11) diff --git a/docs/api/variables/messageHandlerTemplate.md b/docs/api/variables/messageHandlerTemplate.md index abe2e0b646..45548796f5 100644 --- a/docs/api/variables/messageHandlerTemplate.md +++ b/docs/api/variables/messageHandlerTemplate.md @@ -1,9 +1,7 @@ ---- -id: "messageHandlerTemplate" -title: "Variable: messageHandlerTemplate" -sidebar_label: "messageHandlerTemplate" -sidebar_position: 0 -custom_edit_url: null ---- +# Variable: messageHandlerTemplate -• `Const` **messageHandlerTemplate**: `"{{actionExamples}}\n\n# IMPORTANT: DO NOT USE THE INFORMATION FROM THE EXAMPLES ABOVE. THE EXAMPLES ARE FOR REFERENCE ONLY.\n\n~~~\n\n# TASK: GENERATE THE NEXT MESSAGE IN THE SCENE FOR {{agentName}}\n- Generate the next message in the scene for {{agentName}}\n- {{agentName}} is not an assistant - do not write assistant-like responses or ask questions\n- Include content and action in the response\n- Available actions are {{actionNames}}\n\n{{lore}}\n{{relevantFacts}}\n{{recentFacts}}\n{{goals}}\n{{actors}}\n{{actionNames}}\n{{actions}}\n{{providers}}\n\n# INSTRUCTIONS: Generate the next message in the scene for {{agentName}}\n\nResponse format should be formatted in a JSON block like this:\n```json\n{ \"user\": \"{{agentName}}\", \"content\": string, \"action\": string }\n```\n\n{{recentMessages}}"` +> `const` **messageHandlerTemplate**: `string` + +## Defined in + +[packages/core/src/actions/continue.ts:20](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/continue.ts#L20) diff --git a/docs/api/variables/muteRoom.md b/docs/api/variables/muteRoom.md index e955e04375..07b7c2b679 100644 --- a/docs/api/variables/muteRoom.md +++ b/docs/api/variables/muteRoom.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/muteRoom.ts:28](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/muteRoom.ts#L28) +[packages/core/src/actions/muteRoom.ts:28](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/muteRoom.ts#L28) diff --git a/docs/api/variables/none.md b/docs/api/variables/none.md index 583c9f86f1..4dfb235bf8 100644 --- a/docs/api/variables/none.md +++ b/docs/api/variables/none.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/none.ts:8](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/none.ts#L8) +[packages/core/src/actions/none.ts:8](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/none.ts#L8) diff --git a/docs/api/variables/orderBookProvider.md b/docs/api/variables/orderBookProvider.md index 1a727c6a82..3ab3043393 100644 --- a/docs/api/variables/orderBookProvider.md +++ b/docs/api/variables/orderBookProvider.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/providers/orderBook.ts:14](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/orderBook.ts#L14) +[packages/core/src/providers/orderBook.ts:14](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/orderBook.ts#L14) diff --git a/docs/api/variables/settings.md b/docs/api/variables/settings.md new file mode 100644 index 0000000000..40c67832fb --- /dev/null +++ b/docs/api/variables/settings.md @@ -0,0 +1,7 @@ +# Variable: settings + +> `const` **settings**: `ProcessEnv` + +## Defined in + +[packages/core/src/core/settings.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/settings.ts#L54) diff --git a/docs/api/variables/shouldContinueTemplate.md b/docs/api/variables/shouldContinueTemplate.md index a6f189eb0b..f97b57d62f 100644 --- a/docs/api/variables/shouldContinueTemplate.md +++ b/docs/api/variables/shouldContinueTemplate.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/continue.ts:47](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/continue.ts#L47) +[packages/core/src/actions/continue.ts:47](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/continue.ts#L47) diff --git a/docs/api/variables/shouldFollowTemplate.md b/docs/api/variables/shouldFollowTemplate.md index 682da6f91b..7216c0f212 100644 --- a/docs/api/variables/shouldFollowTemplate.md +++ b/docs/api/variables/shouldFollowTemplate.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/followRoom.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/followRoom.ts#L13) +[packages/core/src/actions/followRoom.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/followRoom.ts#L13) diff --git a/docs/api/variables/shouldMuteTemplate.md b/docs/api/variables/shouldMuteTemplate.md index c999f23e56..0a82ad2ea0 100644 --- a/docs/api/variables/shouldMuteTemplate.md +++ b/docs/api/variables/shouldMuteTemplate.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/muteRoom.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/muteRoom.ts#L13) +[packages/core/src/actions/muteRoom.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/muteRoom.ts#L13) diff --git a/docs/api/variables/shouldUnmuteTemplate.md b/docs/api/variables/shouldUnmuteTemplate.md index e69a5fc9aa..70abfcd5eb 100644 --- a/docs/api/variables/shouldUnmuteTemplate.md +++ b/docs/api/variables/shouldUnmuteTemplate.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/unmuteRoom.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/unmuteRoom.ts#L13) +[packages/core/src/actions/unmuteRoom.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/unmuteRoom.ts#L13) diff --git a/docs/api/variables/timeProvider.md b/docs/api/variables/timeProvider.md index 495451cd21..f12b023158 100644 --- a/docs/api/variables/timeProvider.md +++ b/docs/api/variables/timeProvider.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/providers/time.ts:3](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/time.ts#L3) +[packages/core/src/providers/time.ts:3](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/time.ts#L3) diff --git a/docs/api/variables/tokenProvider.md b/docs/api/variables/tokenProvider.md index f2af9a6a8b..de8089dee0 100644 --- a/docs/api/variables/tokenProvider.md +++ b/docs/api/variables/tokenProvider.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/providers/token.ts:801](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L801) +[packages/core/src/providers/token.ts:812](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L812) diff --git a/docs/api/variables/unfollowRoom.md b/docs/api/variables/unfollowRoom.md index a35743195c..010f73530e 100644 --- a/docs/api/variables/unfollowRoom.md +++ b/docs/api/variables/unfollowRoom.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/unfollowRoom.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/unfollowRoom.ts#L27) +[packages/core/src/actions/unfollowRoom.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/unfollowRoom.ts#L27) diff --git a/docs/api/variables/unmuteRoom.md b/docs/api/variables/unmuteRoom.md index 95fd4dabbe..1265884bbe 100644 --- a/docs/api/variables/unmuteRoom.md +++ b/docs/api/variables/unmuteRoom.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/actions/unmuteRoom.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/unmuteRoom.ts#L27) +[packages/core/src/actions/unmuteRoom.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/unmuteRoom.ts#L27) diff --git a/docs/api/variables/walletProvider.md b/docs/api/variables/walletProvider.md index 32f4688f60..7ad788f273 100644 --- a/docs/api/variables/walletProvider.md +++ b/docs/api/variables/walletProvider.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/providers/wallet.ts:244](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L244) +[packages/core/src/providers/wallet.ts:244](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L244) diff --git a/docs/backup_docusaurus.config.js b/docs/backup_docusaurus.config.js new file mode 100644 index 0000000000..aa269e981a --- /dev/null +++ b/docs/backup_docusaurus.config.js @@ -0,0 +1,164 @@ +// @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", + + // GitHub Pages Configuration + url: "https://ai16z.github.io", + baseUrl: "/eliza/", + organizationName: "ai16z", + projectName: "eliza", + deploymentBranch: "gh-pages", + trailingSlash: true, + onBrokenLinks: "throw", + onBrokenMarkdownLinks: "warn", + + i18n: { + defaultLocale: "en", + locales: ["en"], + }, + markdown: { + mermaid: true, + }, + themes: [ + '@docusaurus/theme-mermaid', + // Any other themes... + ], + plugins: [ + [ + "docusaurus-plugin-typedoc", + { + entryPoints: ["../packages/core/src/index.ts"], + tsconfig: "../packages/core/src/tsconfig.json", + out: "./api", + skipErrorChecking: true, + excludeExternals: true, + excludeProtected: true, + excludePrivate: true, + stripInternal: true, // Add this + excludeNotDocumented: true, // Add this + cleanOutputDir: true, + hideGenerator: true, + exclude: ["**/_media/**", "**/node_modules/**"], + excludeReferences: true, + }, + ], + // Search functionality + require.resolve("docusaurus-lunr-search"), + // Separate API docs plugin instance + [ + "@docusaurus/plugin-content-docs", + { + id: "api", + path: "api", + routeBasePath: "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", + }, + theme: { + customCss: "./src/css/custom.css", + }, + }), + ], + ], + themeConfig: + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ + ({ + // Enable dark mode by default + colorMode: { + defaultMode: 'dark', + disableSwitch: false, + respectPrefersColorScheme: true, + }, + // Add sidebar configuration + docs: { + sidebar: { + hideable: true, + autoCollapseCategories: true, + }, + }, + navbar: { + title: "eliza", + logo: { + alt: "Eliza Logo", + src: "img/favicon.ico", + }, + 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/docusaurus.config.js b/docs/docusaurus.config.js index fe8f1a0399..1394f13d77 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -13,7 +13,7 @@ const config = { projectName: "eliza", deploymentBranch: "gh-pages", trailingSlash: true, - onBrokenLinks: "throw", + onBrokenLinks: "ignore", onBrokenMarkdownLinks: "warn", i18n: { @@ -25,22 +25,70 @@ const config = { }, themes: [ '@docusaurus/theme-mermaid', - // Any other themes... ], plugins: [ - // TypeDoc plugin for API documentation [ "docusaurus-plugin-typedoc", { - entryPoints: ["src/index.ts"], + entryPoints: ["../packages/core/src/index.ts"], tsconfig: "../tsconfig.json", out: "./api", - skipErrorChecking: true, + skipErrorChecking: true, + + // Documentation Enhancement Options + excludeExternals: false, + excludePrivate: true, + excludeProtected: false, + excludeInternal: false, + excludeNotDocumented: false, + + // Output Formatting + plugin: ['typedoc-plugin-markdown'], + //theme: 'markdown', + hideGenerator: true, + cleanOutputDir: true, + + // Enhanced Navigation + categoryOrder: [ + "Classes", + "Interfaces", + "Enumerations", + "Type Aliases", + "Variables", + "Functions" + ], + + // Documentation Features + includeVersion: true, + sort: ["source-order"], + gitRevision: 'main', + readme: 'none', + + // Code Examples + preserveWatchOutput: true, + disableSources: false, + + // Validation Settings + validation: { + notExported: false, + invalidLink: false, + notDocumented: false + }, + + // File exclusions + exclude: [ + "**/_media/**", + "**/node_modules/@types/node/events.d.ts", + "**/dist/**" + ], + + // Build settings + watch: false, + treatWarningsAsErrors: false, + treatValidationWarningsAsErrors: false }, ], - // Search functionality require.resolve("docusaurus-lunr-search"), - // Separate API docs plugin instance [ "@docusaurus/plugin-content-docs", { @@ -60,6 +108,7 @@ const config = { sidebarPath: "./sidebars.js", editUrl: "https://github.com/ai16z/eliza/tree/main/docs/", routeBasePath: "docs", + exclude: ["**/_media/**"], // Add exclude pattern here too }, theme: { customCss: "./src/css/custom.css", @@ -70,13 +119,12 @@ const config = { themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ - // Enable dark mode by default + // Rest of themeConfig remains the same colorMode: { defaultMode: 'dark', disableSwitch: false, respectPrefersColorScheme: true, }, - // Add sidebar configuration docs: { sidebar: { hideable: true, diff --git a/docs/package-lock.json b/docs/package-lock.json index dd18ed2bb1..fd9775949e 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -27,7 +27,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" }, "engines": { "node": "23.1.0" @@ -17946,9 +17946,9 @@ } }, "node_modules/typedoc-plugin-markdown": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.2.9.tgz", - "integrity": "sha512-Wqmx+7ezKFgtTklEq/iUhQ5uFeBDhAT6wiS2na9cFLidIpl9jpDHJy/COYh8jUZXgIRIZVQ/bPNjyrnPFoDwzg==", + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.2.10.tgz", + "integrity": "sha512-PLX3pc1/7z13UJm4TDE9vo9jWGcClFUErXXtd5LdnoLjV6mynPpqZLU992DwMGFSRqJFZeKbVyqlNNeNHnk2tQ==", "dev": true, "license": "MIT", "engines": { diff --git a/docs/package.json b/docs/package.json index 9b26464411..d284ffb691 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": [