diff --git a/.env.example b/.env.example index ecd965fc4c..59fbb56440 100644 --- a/.env.example +++ b/.env.example @@ -29,6 +29,9 @@ X_SERVER_URL= XAI_API_KEY= XAI_MODEL= +#USE IMAGE GEN +IMAGE_GEN= #TRUE + #Leave blank to use local embeddings USE_OPENAI_EMBEDDING= #TRUE diff --git a/README.md b/README.md index 664327c45f..8ab9db62d2 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ ### [For Chinese Version: 中文说明](./README_CN.md) ### [For Japanese Version: 日本語の説明](./README_JA.md) +### [For Korean Version: 한국어 설명](./README_KOR.md) +### [For French Version: Instructions en français](./README_FR.md) +### [For Portuguese Version: Instruções em português](./README_PTBR.md) ## Features @@ -27,7 +30,7 @@ **Prerequisites (MUST):** - [Python 2.7+](https://www.python.org/downloads/) -- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- [Node.js 23.1+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) - [pnpm](https://pnpm.io/installation) ### Edit the .env file diff --git a/README_CN.md b/README_CN.md index 9147f78738..6bb9de9c51 100644 --- a/README_CN.md +++ b/README_CN.md @@ -23,7 +23,7 @@ **前置要求(必须):** -- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) - Nodejs安装 - [pnpm](https://pnpm.io/installation) - 使用pnpm diff --git a/README_FR.md b/README_FR.md new file mode 100644 index 0000000000..a0e96bda4e --- /dev/null +++ b/README_FR.md @@ -0,0 +1,172 @@ +# Eliza + +Eliza Banner + +## la fonctionnalité + +- 🛠 soutenir la connexion discord/ twitter /telegram +- 👥 soutien aux agents multimodaux +- 📚 simple à importer des documents et interagir avec les documents +- mémoire et stockage des documents accessibles +- 🚀 haute scalabilité, vous pouvez personnaliser les clients et les comportements pour une extension fonctionnelle +- ☁ ️ plusieurs modèles, y compris Llama, OpenAI Grok Anthropic, etc. +- 📦 simple et facile à utiliser + +Que pouvez-vous faire avec Eliza? + +- 🤖 le chatbot +- 🕵 ️ Agents autonomes +- 📈 processus métier pour automatiser le traitement +- 🎮 jeux PNJ + +# commencez à utiliser + +**pré-requis (obligatoire) :** + +- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- installation Nodejs +- [pnpm](https://pnpm.io/installation) +- travailler avec PNPM + +### éditer le fichier.env + +- copiez.env.example en.env et remplissez la valeur appropriée +- modifier l’environnement twitter et entrer votre compte twitter et mot de passe + +### modifier les fichiers de rôles + +- voir le document ` src/core/defaultCharacter ts ` - vous pouvez le modifier +- vous pouvez également utiliser `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json" ` et simultanément plusieurs robots. + +Après avoir terminé la configuration des fichiers de compte et de rôle, lancez votre bot en tapant la ligne de commande suivante: + + +``` +pnpm i +pnpm start +``` + +# personnalisez votre Eliza + +### ajouter un comportement régulier + +Pour éviter les conflits Git dans le répertoire core, nous vous recommandons d’ajouter les actions personnalisées dans le répertoire custom_actions et de les configurer dans le fichier elizaconfig.yaml. Vous pouvez consulter l’exemple dans le fichier elizaconfig.example.yaml. + +## configurez différents grands modèles + +### configurer Llama + +Vous pouvez exécuter en définissant la variable d’environnement `XAI_MODEL` à `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` ou `meta-llama/Meta-Llama-3.1-405B-Instruct` Llama 70B ou 405B modèle + +### configurer OpenAI + +Vous pouvez exécuter le modèle OpenAI en définissant la variable d’environnement `XAI_MODEL` à `gpt-4o-mini` ou `gpt-4o` + +## autres demandes + +Vous devrez peut-être installer Sharp. Si vous voyez une erreur au démarrage, essayez d’installer avec la commande suivante: + +``` +pnpm install --include=optional sharp +``` + +# paramètres de l’environnement + +Vous devez ajouter des variables d’environnement à votre fichier.env pour vous connecter à différentes plates-formes: + +``` +# Required environment variables +DISCORD_APPLICATION_ID= +DISCORD_API_TOKEN= # Bot token +OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk- +ELEVENLABS_XI_API_KEY= # API key from elevenlabs + +# ELEVENLABS SETTINGS +ELEVENLABS_MODEL_ID=eleven_multilingual_v2 +ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM +ELEVENLABS_VOICE_STABILITY=0.5 +ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9 +ELEVENLABS_VOICE_STYLE=0.66 +ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false +ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4 +ELEVENLABS_OUTPUT_FORMAT=pcm_16000 + +TWITTER_DRY_RUN=false +TWITTER_USERNAME= # Account username +TWITTER_PASSWORD= # Account password +TWITTER_EMAIL= # Account email +TWITTER_COOKIES= # Account cookies + +X_SERVER_URL= +XAI_API_KEY= +XAI_MODEL= + + +# For asking Claude stuff +ANTHROPIC_API_KEY= + +WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY +WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY + +BIRDEYE_API_KEY= + +SOL_ADDRESS=So11111111111111111111111111111111111111112 +SLIPPAGE=1 +RPC_URL=https://api.mainnet-beta.solana.com +HELIUS_API_KEY= + + +## Telegram +TELEGRAM_BOT_TOKEN= + +TOGETHER_API_KEY= +``` + +# paramètres locaux + +### ensemble CUDA + +Si vous avez une carte graphique nvidia haute performance, vous pouvez faire l’accélération locale avec la ligne de commande suivante CUDA + +``` +pnpm install +npx --no node-llama-cpp source download --gpu cuda +``` + +Assurez-vous d’avoir le kit complet CUDA installé, y compris cuDNN et cuBLAS + +### exécution locale + +Ajoutez XAI_MODEL et définissez-le à l’une des options ci-dessus [use Llama run](#run-with-llama) +Vous pouvez laisser X_SERVER_URL et XAI_API_KEY vides, qui téléchargera le modèle de huggingface et le consultera localement + +# le client + +Pour savoir comment configurer votre bot discord, vous pouvez consulter la documentation officielle de discord + +# le développement + +## le test + +Ligne de commande pour plusieurs méthodes de test: + +```bash +pnpm test # Run tests once +pnpm test:watch # Run tests in watch mode +``` + +Pour les tests spécifiques à la base de données: + +```bash +pnpm test:sqlite # Run tests with SQLite +pnpm test:sqljs # Run tests with SQL.js +``` + +Les tests sont écrits en Jest et se trouvent dans le fichier SRC /\*_/_.test.ts. L’environnement de test est configuré comme suit: + +- chargement des variables d’environnement de.env.test +- utilisez un temps d’attente de 2 minutes pour exécuter des tests de longue durée +- support du module ESM +- exécuter les tests dans l’ordre (--runInBand) + +Pour créer un nouveau test, ajoutez un fichier.test.ts à côté du code à tester. \ No newline at end of file diff --git a/README_KOR.md b/README_KOR.md new file mode 100644 index 0000000000..6cbc3063ba --- /dev/null +++ b/README_KOR.md @@ -0,0 +1,171 @@ +# Eliza + +eliza banner + +## 기능 + +- 🛠 지지 discord 트위터/telegram 연결 +- 👥 지지여 모드 agent +- 📚 간단 한 문서를 가져오기와 문서를 번갈아 +- 💾 검색 할 수 있는 메모리와 문서 저장 +- 🚀 확장 가능 성이 높은, 사용자 정의 클라이언트와 행위를 확장 기능 +- ☁ ️여 모형 지지 llama · openai grok anthropic 등 +- 📦 간단 하기도 좋습니다. + +eliza로 뭘 할 수 있나요? + +- 🤖 챗 봇 +- 🕵 ️ 자주 agents +- 📈 업무 처리 과정을 자동화 +- 🎮 게임 npc + +# 사용시작 + +**전제 요구(필수):** + +- [Node.js 22 +](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- Nodejs 설치 +- [pnpm](https://pnpm.io/installation) +- pnpm을사용한다 + +## 편집.env 파일 + +- .env.example을.env로 복사하고 적절한 값을 입력한다 +- 트위터 환경을 편집하고, 트위터 계정과 비밀번호를 입력한다 + +## 캐릭터 파일 편집 + +- 파일 `src/core/defaultcharacter.ts ` - 그것을 수정 할 수 있다 +- 사용하셔도됩니다 `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` 여러 로봇을 동시에 실행하여 캐릭터를 불러옵니다. + +아이디와 캐릭터 파일 설정이 완료되었다면, 다음 명령줄을 입력하여 로봇을 실행시키십시오: + +``` +pnpm i +pnpm start +``` + +# 사용자 정의 Eliza + +### 일반 행동을 추가한다 + +커널 디렉터리에서 git 충돌을 방지하기 위해 custom_actions 디렉터리에 사용자 정의 동작을 추가하고 elizaconfig.yaml 파일에서 동작을 설정할 것을 제안한다.elizaconfig.example.yaml 파일의 예제는 참조할 수 있다. + +다른 대형 모델들을 배치한다 + +### 프로필Llama + +`XAI_MODEL`환경 변수를`meta-llama/meta-llam-3.1-70b-instruct-turbo`또는`meta-llama/meta-llam-3.1-405b-instruct`로 설정하여 실행할 수 있다라마 70b 405b 모델 + +## openai 설정 + +`XAI_MODEL`환경 변수를`gpt-4o-mini`또는`gpt-4o`로 설정하여 OpenAI 모델을 실행할 수 있다 + +## 기타 요구 사항 + +Sharp를 설치해야 할 수도 있습니다.시작시 오류가 발견되면 다음 명령으로 설치하십시오: + +``` +pnpm install-include=optional sharp +``` + +# 환경 설정 + +다양한 플랫폼에 연결하기 위해서는.env 파일에서 환경 변수를 추가해야 합니다: + +``` +# Required environment variables +DISCORD_APPLICATION_ID= +DISCORD_API_TOKEN= # Bot token +OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk- +ELEVENLABS_XI_API_KEY= # API key from elevenlabs + +# ELEVENLABS SETTINGS +ELEVENLABS_MODEL_ID=eleven_multilingual_v2 +ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM +ELEVENLABS_VOICE_STABILITY=0.5 +ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9 +ELEVENLABS_VOICE_STYLE=0.66 +ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false +ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4 +ELEVENLABS_OUTPUT_FORMAT=pcm_16000 + +TWITTER_DRY_RUN=false +TWITTER_USERNAME= # Account username +TWITTER_PASSWORD= # Account password +TWITTER_EMAIL= # Account email +TWITTER_COOKIES= # Account cookies + +X_SERVER_URL= +XAI_API_KEY= +XAI_MODEL= + + +# For asking Claude stuff +ANTHROPIC_API_KEY= + +WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY +WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY + +BIRDEYE_API_KEY= + +SOL_ADDRESS=So11111111111111111111111111111111111111112 +SLIPPAGE=1 +RPC_URL=https://api.mainnet-beta.solana.com +HELIUS_API_KEY= + + +## Telegram +TELEGRAM_BOT_TOKEN= + +TOGETHER_API_KEY= +``` + +# 로컬 설정 + +### cuda 설정 + +고성능 엔비디아 그래픽을 가지고 있다면 다음 명령줄에서 cuda를 사용하여 로컬 가속을 할 수 있다 + +``` +pnpm install +npx --no node-llama-cpp source download --gpu cuda +``` + +cuDNN과 cuBLAS를 포함한 완전한 cuda 키트를 설치했는지 확인하세요 + +### 로컬 실행 + +위의 [Llama로 실행](#run-with-llama) 옵션 중 하나로 XAI_MODEL을 추가한다 +X_SERVER_URL과 xai_api_key를 공백으로 두면 huggingface에서 모델을 다운로드하고 현지에서 쿼리한다 + +# 클라이언트 + +discord bot을 설정하는 방법에 대해 discord의 공식 문서를 볼 수 있습니까 + +# 개발 + +## 테스트 + +여러 테스트 방법을 위한 명령줄: + +```bash +pnpm test # Run tests once +pnpm test:watch # Run tests in watch mode +``` + +데이터베이스에 특화된 테스트: + +```bash +pnpm test:sqlite # Run tests with SQLite +pnpm test:sqljs # Run tests with SQL.js +``` + +테스트는 src/\*_/_.test.ts 파일에 있는 Jest로 작성된다.테스트 환경 설정은 다음과 같습니다: + +- .env.test에서 환경 변수를 불러온다 +- 장기 실행 테스트를 실행하기 위해 2분 제한 시간을 사용합니다 +- esm 모듈을 지원한다 +- 테스트 실행 순서 (--runInBand) + +새 테스트를 만들려면, 테스트할 코드 옆에.test.ts 파일을 추가하세요. \ No newline at end of file diff --git a/README_PTBR.md b/README_PTBR.md new file mode 100644 index 0000000000..a5fa17a426 --- /dev/null +++ b/README_PTBR.md @@ -0,0 +1,176 @@ +# Eliza + +Eliza Banner + +## Funcionalidades + +- 🛠 Conectores completos para Discord, Twitter e Telegram +- 👥 Suporte a múltiplos agentes e salas +- 📚 Ingestão e interação fácil com seus documentos +- 💾 Memória recuperável e armazenamento de documentos +- 🚀 Altamente extensível - crie suas próprias ações e clientes para estender as capacidades +- ☁️ Suporta muitos modelos, incluindo Llama local, OpenAI, Anthropic, Groq e mais +- 📦 Funciona perfeitamente! + +## Para que posso usá-lo? + +- 🤖 Chatbots +- 🕵️ Agentes autônomos +- 📈 Gestão de processos empresariais +- 🎮 NPCs em jogos de vídeo + +# Começando + +**Pré-requisitos (OBRIGATÓRIO):** + +- [Python 2.7+](https://www.python.org/downloads/) +- [Node.js 23.1+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- [pnpm](https://pnpm.io/installation) + +### Edite o arquivo .env + +- Copie .env.example para .env e preencha os valores apropriados +- Edite as variáveis de ambiente do TWITTER para adicionar o nome de usuário e senha do seu bot + +### Edite o arquivo de personagem + +- Confira o arquivo `src/core/defaultCharacter.ts` - você pode modificá-lo +- Você também pode carregar personagens com o comando `pnpm start --characters="path/to/your/character.json"` e executar múltiplos bots ao mesmo tempo. + +Após configurar o arquivo .env e o arquivo de personagem, você pode iniciar o bot com o seguinte comando: + +``` +pnpm i +pnpm start +``` + +# Personalizando Eliza + +### Adicionando ações personalizadas + +Para evitar conflitos no diretório core, recomendamos adicionar ações personalizadas a um diretório `custom_actions` e depois adicioná-las ao arquivo `elizaConfig.yaml`. Veja o arquivo `elizaConfig.example.yaml` para um exemplo. + +## Executando com diferentes modelos + +### Executar com Llama + +Você pode executar modelos Llama 70B ou 405B configurando a variável de ambiente `XAI_MODEL` para `meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` ou `meta-llama/Meta-Llama-3.1-405B-Instruct` + +### Executar com Grok + +Você pode executar modelos Grok configurando a variável de ambiente `XAI_MODEL` para `grok-beta` + +### Executar com OpenAI + +Você pode executar modelos OpenAI configurando a variável de ambiente `XAI_MODEL` para `gpt-4o-mini` ou `gpt-4o` + +## Requisitos Adicionais + +Pode ser necessário instalar o Sharp. Se você encontrar um erro ao iniciar, tente instalá-lo com o seguinte comando: + +``` +pnpm install --include=optional sharp +``` + +# Configuração do Ambiente + +Você precisará adicionar variáveis de ambiente ao seu arquivo .env para se conectar a várias plataformas: + +``` +# Variáveis de ambiente obrigatórias +DISCORD_APPLICATION_ID= +DISCORD_API_TOKEN= # Token do bot +OPENAI_API_KEY=sk-* # Chave API do OpenAI, começando com sk- +ELEVENLABS_XI_API_KEY= # Chave API do elevenlabs +GOOGLE_GENERATIVE_AI_API_KEY= # Chave API do Gemini + +# CONFIGURAÇÕES DO ELEVENLABS +ELEVENLABS_MODEL_ID=eleven_multilingual_v2 +ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM +ELEVENLABS_VOICE_STABILITY=0.5 +ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9 +ELEVENLABS_VOICE_STYLE=0.66 +ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false +ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4 +ELEVENLABS_OUTPUT_FORMAT=pcm_16000 + +TWITTER_DRY_RUN=false +TWITTER_USERNAME= # Nome de usuário da conta +TWITTER_PASSWORD= # Senha da conta +TWITTER_EMAIL= # Email da conta +TWITTER_COOKIES= # Cookies da conta + +X_SERVER_URL= +XAI_API_KEY= +XAI_MODEL= + + +# Para perguntar coisas ao Claude +ANTHROPIC_API_KEY= + +WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY +WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY + +BIRDEYE_API_KEY= + +SOL_ADDRESS=So11111111111111111111111111111111111111112 +SLIPPAGE=1 +RPC_URL=https://api.mainnet-beta.solana.com +HELIUS_API_KEY= + + +## Telegram +TELEGRAM_BOT_TOKEN= + +TOGETHER_API_KEY= +``` + +# Configuração de Inferência Local + +### Configuração CUDA + +Se você tiver uma GPU NVIDIA, pode instalar o CUDA para acelerar dramaticamente a inferência local. + +``` +pnpm install +npx --no node-llama-cpp source download --gpu cuda +``` + +Certifique-se de ter instalado o CUDA Toolkit, incluindo cuDNN e cuBLAS. + +### Executando localmente + +Adicione XAI_MODEL e configure-o para uma das opções acima de [Executar com Llama](#executar-com-llama) - você pode deixar X_SERVER_URL e XAI_API_KEY em branco, ele baixa o modelo do huggingface e faz consultas localmente + +# Clientes + +## Bot do Discord + +Para ajuda com a configuração do seu Bot do Discord, confira aqui: https://discordjs.guide/preparations/setting-up-a-bot-application.html + +# Desenvolvimento + +## Testes + +Para executar a suíte de testes: + +```bash +pnpm test # Executar testes uma vez +pnpm test:watch # Executar testes no modo watch +``` + +Para testes específicos de banco de dados: + +```bash +pnpm test:sqlite # Executar testes com SQLite +pnpm test:sqljs # Executar testes com SQL.js +``` + +Os testes são escritos usando Jest e podem ser encontrados em arquivos `src/**/*.test.ts`. O ambiente de teste está configurado para: + +- Carregar variáveis de ambiente de `.env.test` +- Usar um tempo limite de 2 minutos para testes de longa duração +- Suportar módulos ESM +- Executar testes em sequência (--runInBand) + +Para criar novos testes, adicione um arquivo `.test.ts` adjacente ao código que você está testando. diff --git a/docs/README.md b/docs/README.md index 435272f5eb..ffdf6295fe 100644 --- a/docs/README.md +++ b/docs/README.md @@ -19,7 +19,7 @@ _As seen powering [@DegenSpartanAI](https://x.com/degenspartanai) and [@MarcAInd **Prerequisites (MUST):** -- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) - [pnpm](https://pnpm.io/installation) ### Edit the .env file diff --git a/docs/README_CN.md b/docs/README_CN.md index 5a4bfe5c0d..c3a7e624cc 100644 --- a/docs/README_CN.md +++ b/docs/README_CN.md @@ -23,7 +23,7 @@ **前置要求(必须):** -- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) - Nodejs安装 - [pnpm](https://pnpm.io/installation) - 使用pnpm diff --git a/docs/api/classes/AgentRuntime.md b/docs/api/classes/AgentRuntime.md index c421c9980c..8d3e653ecb 100644 --- a/docs/api/classes/AgentRuntime.md +++ b/docs/api/classes/AgentRuntime.md @@ -97,7 +97,7 @@ The ID of the agent [packages/core/src/runtime.ts:59](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L59) ---- +*** ### serverUrl @@ -113,7 +113,7 @@ The base URL of the server where the agent's requests are processed. [packages/core/src/runtime.ts:63](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L63) ---- +*** ### databaseAdapter @@ -129,7 +129,7 @@ The database adapter used for interacting with the database. [packages/core/src/runtime.ts:68](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L68) ---- +*** ### token @@ -145,7 +145,7 @@ Authentication token used for securing requests. [packages/core/src/runtime.ts:73](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L73) ---- +*** ### actions @@ -161,7 +161,7 @@ Custom actions that the agent can perform. [packages/core/src/runtime.ts:78](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L78) ---- +*** ### evaluators @@ -177,7 +177,7 @@ Evaluators used to assess and guide the agent's responses. [packages/core/src/runtime.ts:83](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L83) ---- +*** ### providers @@ -193,7 +193,7 @@ Context providers used to provide context for message generation. [packages/core/src/runtime.ts:88](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L88) ---- +*** ### modelProvider @@ -209,7 +209,7 @@ The model to use for generateText. [packages/core/src/runtime.ts:93](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L93) ---- +*** ### fetch() @@ -244,7 +244,7 @@ Some environments may not have access to the global fetch function and need a cu [packages/core/src/runtime.ts:99](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L99) ---- +*** ### character @@ -260,7 +260,7 @@ The character to use for the agent [packages/core/src/runtime.ts:104](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L104) ---- +*** ### messageManager @@ -276,7 +276,7 @@ Store messages that are sent and received by the agent. [packages/core/src/runtime.ts:109](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L109) ---- +*** ### descriptionManager @@ -292,7 +292,7 @@ Store and recall descriptions of users based on conversations. [packages/core/src/runtime.ts:114](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L114) ---- +*** ### loreManager @@ -308,7 +308,7 @@ Manage the creation and recall of static information (documents, historical game [packages/core/src/runtime.ts:119](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L119) ---- +*** ### documentsManager @@ -320,7 +320,7 @@ Hold large documents that can be referenced [packages/core/src/runtime.ts:124](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L124) ---- +*** ### knowledgeManager @@ -332,7 +332,7 @@ Searchable document fragments [packages/core/src/runtime.ts:129](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L129) ---- +*** ### services @@ -346,7 +346,7 @@ Searchable document fragments [packages/core/src/runtime.ts:131](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L131) ---- +*** ### memoryManagers @@ -378,7 +378,7 @@ Searchable document fragments [packages/core/src/runtime.ts:134](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L134) ---- +*** ### getMemoryManager() @@ -400,15 +400,11 @@ Searchable document fragments [packages/core/src/runtime.ts:149](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L149) ---- +*** ### getService() -> **getService**\<`T`\>(`service`): `T` - -#### Type Parameters - -• **T** +> **getService**(`service`): *typeof* [`Service`](Service.md) #### Parameters @@ -416,7 +412,7 @@ Searchable document fragments #### Returns -`T` +*typeof* [`Service`](Service.md) #### Implementation of @@ -426,7 +422,7 @@ Searchable document fragments [packages/core/src/runtime.ts:153](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L153) ---- +*** ### registerService() @@ -448,7 +444,7 @@ Searchable document fragments [packages/core/src/runtime.ts:161](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L161) ---- +*** ### getSetting() @@ -470,7 +466,7 @@ Searchable document fragments [packages/core/src/runtime.ts:372](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L372) ---- +*** ### getConversationLength() @@ -492,7 +488,7 @@ The number of recent messages to be kept in memory. [packages/core/src/runtime.ts:394](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L394) ---- +*** ### registerAction() @@ -518,7 +514,7 @@ The action to register. [packages/core/src/runtime.ts:402](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L402) ---- +*** ### registerEvaluator() @@ -540,7 +536,7 @@ The evaluator to register. [packages/core/src/runtime.ts:411](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L411) ---- +*** ### registerContextProvider() @@ -562,7 +558,7 @@ The context provider to register. [packages/core/src/runtime.ts:419](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L419) ---- +*** ### processActions() @@ -594,7 +590,7 @@ The message to process. [packages/core/src/runtime.ts:428](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L428) ---- +*** ### evaluate() @@ -630,7 +626,7 @@ The results of the evaluation. [packages/core/src/runtime.ts:501](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L501) ---- +*** ### ensureParticipantExists() @@ -660,9 +656,9 @@ An error if the participant cannot be added. #### Defined in -[packages/core/src/runtime.ts:572](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L572) +[packages/core/src/runtime.ts:571](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L571) ---- +*** ### ensureUserExists() @@ -696,9 +692,9 @@ The user name to ensure the existence of. #### Defined in -[packages/core/src/runtime.ts:588](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L588) +[packages/core/src/runtime.ts:587](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L587) ---- +*** ### ensureParticipantInRoom() @@ -720,9 +716,9 @@ The user name to ensure the existence of. #### Defined in -[packages/core/src/runtime.ts:608](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L608) +[packages/core/src/runtime.ts:607](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L607) ---- +*** ### ensureConnection() @@ -750,9 +746,9 @@ The user name to ensure the existence of. #### Defined in -[packages/core/src/runtime.ts:619](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L619) +[packages/core/src/runtime.ts:618](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L618) ---- +*** ### ensureRoomExists() @@ -781,9 +777,9 @@ An error if the room cannot be created. #### Defined in -[packages/core/src/runtime.ts:655](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L655) +[packages/core/src/runtime.ts:654](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L654) ---- +*** ### composeState() @@ -811,9 +807,9 @@ The state of the agent. #### Defined in -[packages/core/src/runtime.ts:668](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L668) +[packages/core/src/runtime.ts:667](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L667) ---- +*** ### updateRecentMessageState() @@ -833,4 +829,4 @@ The state of the agent. #### Defined in -[packages/core/src/runtime.ts:1126](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L1126) +[packages/core/src/runtime.ts:1124](https://github.com/ai16z/eliza/blob/main/packages/core/src/runtime.ts#L1124) diff --git a/docs/api/classes/DatabaseAdapter.md b/docs/api/classes/DatabaseAdapter.md index 26e39894ed..74de091a3e 100644 --- a/docs/api/classes/DatabaseAdapter.md +++ b/docs/api/classes/DatabaseAdapter.md @@ -63,7 +63,7 @@ A Promise that resolves to the Account object or null if not found. [packages/core/src/database.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L27) ---- +*** ### createAccount() @@ -91,7 +91,7 @@ A Promise that resolves when the account creation is complete. [packages/core/src/database.ts:34](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L34) ---- +*** ### getMemories() @@ -127,7 +127,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:41](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L41) ---- +*** ### getMemoriesByRoomIds() @@ -155,7 +155,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:48](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L48) ---- +*** ### getMemoryById() @@ -177,7 +177,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L54) ---- +*** ### getCachedEmbeddings() @@ -191,17 +191,17 @@ Retrieves cached embeddings based on the specified query parameters. An object containing parameters for the embedding retrieval. -• **params.query_table_name**: `string` +• **params.query\_table\_name**: `string` -• **params.query_threshold**: `number` +• **params.query\_threshold**: `number` -• **params.query_input**: `string` +• **params.query\_input**: `string` -• **params.query_field_name**: `string` +• **params.query\_field\_name**: `string` -• **params.query_field_sub_name**: `string` +• **params.query\_field\_sub\_name**: `string` -• **params.query_match_count**: `number` +• **params.query\_match\_count**: `number` #### Returns @@ -217,7 +217,7 @@ A Promise that resolves to an array of objects containing embeddings and levensh [packages/core/src/database.ts:61](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L61) ---- +*** ### log() @@ -253,7 +253,7 @@ A Promise that resolves when the log entry has been saved. [packages/core/src/database.ts:87](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L87) ---- +*** ### getActorDetails() @@ -283,7 +283,7 @@ A Promise that resolves to an array of Actor objects. [packages/core/src/database.ts:99](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L99) ---- +*** ### searchMemories() @@ -303,9 +303,9 @@ An object containing parameters for the memory search. • **params.embedding**: `number`[] -• **params.match_threshold**: `number` +• **params.match\_threshold**: `number` -• **params.match_count**: `number` +• **params.match\_count**: `number` • **params.unique**: `boolean` @@ -323,7 +323,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:106](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L106) ---- +*** ### updateGoalStatus() @@ -355,7 +355,7 @@ A Promise that resolves when the goal status has been updated. [packages/core/src/database.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L120) ---- +*** ### searchMemoriesByEmbedding() @@ -373,7 +373,7 @@ The embedding vector to search with. Additional parameters for the search. -• **params.match_threshold?**: `number` +• **params.match\_threshold?**: `number` • **params.count?**: `number` @@ -399,7 +399,7 @@ A Promise that resolves to an array of Memory objects. [packages/core/src/database.ts:131](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L131) ---- +*** ### createMemory() @@ -435,7 +435,7 @@ A Promise that resolves when the memory has been created. [packages/core/src/database.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L150) ---- +*** ### removeMemory() @@ -467,7 +467,7 @@ A Promise that resolves when the memory has been removed. [packages/core/src/database.ts:162](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L162) ---- +*** ### removeAllMemories() @@ -499,7 +499,7 @@ A Promise that resolves when all memories have been removed. [packages/core/src/database.ts:170](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L170) ---- +*** ### countMemories() @@ -535,7 +535,7 @@ A Promise that resolves to the number of memories. [packages/core/src/database.ts:179](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L179) ---- +*** ### getGoals() @@ -571,7 +571,7 @@ A Promise that resolves to an array of Goal objects. [packages/core/src/database.ts:190](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L190) ---- +*** ### updateGoal() @@ -599,7 +599,7 @@ A Promise that resolves when the goal has been updated. [packages/core/src/database.ts:202](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L202) ---- +*** ### createGoal() @@ -627,7 +627,7 @@ A Promise that resolves when the goal has been created. [packages/core/src/database.ts:209](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L209) ---- +*** ### removeGoal() @@ -655,7 +655,7 @@ A Promise that resolves when the goal has been removed. [packages/core/src/database.ts:216](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L216) ---- +*** ### removeAllGoals() @@ -683,7 +683,7 @@ A Promise that resolves when all goals have been removed. [packages/core/src/database.ts:223](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L223) ---- +*** ### getRoom() @@ -711,7 +711,7 @@ A Promise that resolves to the room ID or null if not found. [packages/core/src/database.ts:230](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L230) ---- +*** ### createRoom() @@ -739,7 +739,7 @@ A Promise that resolves to the UUID of the created room. [packages/core/src/database.ts:237](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L237) ---- +*** ### removeRoom() @@ -767,7 +767,7 @@ A Promise that resolves when the room has been removed. [packages/core/src/database.ts:244](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L244) ---- +*** ### getRoomsForParticipant() @@ -795,7 +795,7 @@ A Promise that resolves to an array of room IDs. [packages/core/src/database.ts:251](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L251) ---- +*** ### getRoomsForParticipants() @@ -823,7 +823,7 @@ A Promise that resolves to an array of room IDs. [packages/core/src/database.ts:258](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L258) ---- +*** ### addParticipant() @@ -855,7 +855,7 @@ A Promise that resolves to a boolean indicating success or failure. [packages/core/src/database.ts:266](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L266) ---- +*** ### removeParticipant() @@ -887,7 +887,7 @@ A Promise that resolves to a boolean indicating success or failure. [packages/core/src/database.ts:274](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L274) ---- +*** ### getParticipantsForAccount() @@ -943,7 +943,7 @@ A Promise that resolves to an array of Participant objects. [packages/core/src/database.ts:288](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L288) ---- +*** ### getParticipantsForRoom() @@ -971,7 +971,7 @@ A Promise that resolves to an array of UUIDs representing the participants. [packages/core/src/database.ts:295](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L295) ---- +*** ### getParticipantUserState() @@ -995,7 +995,7 @@ A Promise that resolves to an array of UUIDs representing the participants. [packages/core/src/database.ts:297](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L297) ---- +*** ### setParticipantUserState() @@ -1021,7 +1021,7 @@ A Promise that resolves to an array of UUIDs representing the participants. [packages/core/src/database.ts:301](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L301) ---- +*** ### createRelationship() @@ -1053,7 +1053,7 @@ A Promise that resolves to a boolean indicating success or failure of the creati [packages/core/src/database.ts:312](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L312) ---- +*** ### getRelationship() @@ -1085,7 +1085,7 @@ A Promise that resolves to the Relationship object or null if not found. [packages/core/src/database.ts:322](https://github.com/ai16z/eliza/blob/main/packages/core/src/database.ts#L322) ---- +*** ### getRelationships() diff --git a/docs/api/classes/MemoryManager.md b/docs/api/classes/MemoryManager.md index e01cbf4d07..8beb89e784 100644 --- a/docs/api/classes/MemoryManager.md +++ b/docs/api/classes/MemoryManager.md @@ -54,7 +54,7 @@ The AgentRuntime instance associated with this manager. [packages/core/src/memory.ts:22](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L22) ---- +*** ### tableName @@ -98,7 +98,7 @@ A Promise resolving to the memory object, potentially updated with an embedding [packages/core/src/memory.ts:45](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L45) ---- +*** ### getMemories() @@ -144,7 +144,7 @@ A Promise resolving to an array of Memory objects. [packages/core/src/memory.ts:66](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L66) ---- +*** ### getCachedEmbeddings() @@ -166,7 +166,7 @@ A Promise resolving to an array of Memory objects. [packages/core/src/memory.ts:93](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L93) ---- +*** ### searchMemoriesByEmbedding() @@ -184,7 +184,7 @@ The embedding vector to search with. Options including match threshold, count, user IDs, and uniqueness. -• **opts.match_threshold?**: `number` +• **opts.match\_threshold?**: `number` The similarity threshold for matching memories. @@ -216,7 +216,7 @@ A Promise resolving to an array of Memory objects that match the embedding. [packages/core/src/memory.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L120) ---- +*** ### createMemory() @@ -248,7 +248,7 @@ A Promise that resolves when the operation completes. [packages/core/src/memory.ts:158](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L158) ---- +*** ### getMemoriesByRoomIds() @@ -272,9 +272,9 @@ A Promise that resolves when the operation completes. #### Defined in -[packages/core/src/memory.ts:172](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L172) +[packages/core/src/memory.ts:173](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L173) ---- +*** ### getMemoryById() @@ -294,9 +294,9 @@ A Promise that resolves when the operation completes. #### Defined in -[packages/core/src/memory.ts:183](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L183) +[packages/core/src/memory.ts:184](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L184) ---- +*** ### removeMemory() @@ -322,9 +322,9 @@ A Promise that resolves when the operation completes. #### Defined in -[packages/core/src/memory.ts:193](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L193) +[packages/core/src/memory.ts:194](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L194) ---- +*** ### removeAllMemories() @@ -350,9 +350,9 @@ A Promise that resolves when the operation completes. #### Defined in -[packages/core/src/memory.ts:205](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L205) +[packages/core/src/memory.ts:206](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L206) ---- +*** ### countMemories() @@ -382,4 +382,4 @@ A Promise resolving to the count of memories. #### Defined in -[packages/core/src/memory.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L218) +[packages/core/src/memory.ts:219](https://github.com/ai16z/eliza/blob/main/packages/core/src/memory.ts#L219) diff --git a/docs/api/classes/Service.md b/docs/api/classes/Service.md index 4169b52981..6a3195df4c 100644 --- a/docs/api/classes/Service.md +++ b/docs/api/classes/Service.md @@ -40,7 +40,7 @@ #### Type Parameters -• **T** _extends_ [`Service`](Service.md) +• **T** *extends* [`Service`](Service.md) #### Returns diff --git a/docs/api/enumerations/Clients.md b/docs/api/enumerations/Clients.md index 9ab3b0b70e..48b250fd84 100644 --- a/docs/api/enumerations/Clients.md +++ b/docs/api/enumerations/Clients.md @@ -12,7 +12,7 @@ [packages/core/src/types.ts:321](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L321) ---- +*** ### DIRECT @@ -22,7 +22,7 @@ [packages/core/src/types.ts:322](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L322) ---- +*** ### TWITTER @@ -32,7 +32,7 @@ [packages/core/src/types.ts:323](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L323) ---- +*** ### TELEGRAM diff --git a/docs/api/enumerations/GoalStatus.md b/docs/api/enumerations/GoalStatus.md index 1608c034ed..f8c11f9fc2 100644 --- a/docs/api/enumerations/GoalStatus.md +++ b/docs/api/enumerations/GoalStatus.md @@ -12,7 +12,7 @@ [packages/core/src/types.ts:57](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L57) ---- +*** ### FAILED @@ -22,11 +22,11 @@ [packages/core/src/types.ts:58](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L58) ---- +*** -### IN_PROGRESS +### IN\_PROGRESS -> **IN_PROGRESS**: `"IN_PROGRESS"` +> **IN\_PROGRESS**: `"IN_PROGRESS"` #### Defined in diff --git a/docs/api/enumerations/ModelClass.md b/docs/api/enumerations/ModelClass.md index d4f3cafaf3..2ee04c649b 100644 --- a/docs/api/enumerations/ModelClass.md +++ b/docs/api/enumerations/ModelClass.md @@ -12,7 +12,7 @@ [packages/core/src/types.ts:75](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L75) ---- +*** ### MEDIUM @@ -22,7 +22,7 @@ [packages/core/src/types.ts:76](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L76) ---- +*** ### LARGE @@ -32,7 +32,7 @@ [packages/core/src/types.ts:77](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L77) ---- +*** ### EMBEDDING @@ -42,7 +42,7 @@ [packages/core/src/types.ts:78](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L78) ---- +*** ### IMAGE diff --git a/docs/api/enumerations/ModelProviderName.md b/docs/api/enumerations/ModelProviderName.md index 2c020738f3..1f6e6ce0b2 100644 --- a/docs/api/enumerations/ModelProviderName.md +++ b/docs/api/enumerations/ModelProviderName.md @@ -12,7 +12,7 @@ [packages/core/src/types.ts:120](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L120) ---- +*** ### ANTHROPIC @@ -22,7 +22,7 @@ [packages/core/src/types.ts:121](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L121) ---- +*** ### GROK @@ -32,7 +32,7 @@ [packages/core/src/types.ts:122](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L122) ---- +*** ### GROQ @@ -42,7 +42,7 @@ [packages/core/src/types.ts:123](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L123) ---- +*** ### LLAMACLOUD @@ -52,7 +52,7 @@ [packages/core/src/types.ts:124](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L124) ---- +*** ### LLAMALOCAL @@ -62,7 +62,7 @@ [packages/core/src/types.ts:125](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L125) ---- +*** ### GOOGLE @@ -72,17 +72,17 @@ [packages/core/src/types.ts:126](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L126) ---- +*** -### CLAUDE_VERTEX +### CLAUDE\_VERTEX -> **CLAUDE_VERTEX**: `"claude_vertex"` +> **CLAUDE\_VERTEX**: `"claude_vertex"` #### Defined in [packages/core/src/types.ts:127](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L127) ---- +*** ### REDPILL @@ -92,7 +92,7 @@ [packages/core/src/types.ts:128](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L128) ---- +*** ### OPENROUTER @@ -102,7 +102,7 @@ [packages/core/src/types.ts:129](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L129) ---- +*** ### OLLAMA diff --git a/docs/api/enumerations/ServiceType.md b/docs/api/enumerations/ServiceType.md index f69795aeab..0cc2345ec3 100644 --- a/docs/api/enumerations/ServiceType.md +++ b/docs/api/enumerations/ServiceType.md @@ -4,15 +4,15 @@ ## Enumeration Members -### IMAGE_DESCRIPTION +### IMAGE\_DESCRIPTION -> **IMAGE_DESCRIPTION**: `"image_description"` +> **IMAGE\_DESCRIPTION**: `"image_description"` #### Defined in [packages/core/src/types.ts:646](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L646) ---- +*** ### TRANSCRIPTION @@ -22,7 +22,7 @@ [packages/core/src/types.ts:647](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L647) ---- +*** ### VIDEO @@ -32,17 +32,17 @@ [packages/core/src/types.ts:648](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L648) ---- +*** -### TEXT_GENERATION +### TEXT\_GENERATION -> **TEXT_GENERATION**: `"text_generation"` +> **TEXT\_GENERATION**: `"text_generation"` #### Defined in [packages/core/src/types.ts:649](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L649) ---- +*** ### BROWSER @@ -52,17 +52,17 @@ [packages/core/src/types.ts:650](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L650) ---- +*** -### SPEECH_GENERATION +### SPEECH\_GENERATION -> **SPEECH_GENERATION**: `"speech_generation"` +> **SPEECH\_GENERATION**: `"speech_generation"` #### Defined in [packages/core/src/types.ts:651](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L651) ---- +*** ### PDF diff --git a/docs/api/functions/generateCaption.md b/docs/api/functions/generateCaption.md index d297235f5a..9589aadfb0 100644 --- a/docs/api/functions/generateCaption.md +++ b/docs/api/functions/generateCaption.md @@ -26,4 +26,4 @@ ## Defined in -[packages/core/src/generation.ts:742](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L742) +[packages/core/src/generation.ts:734](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L734) diff --git a/docs/api/functions/generateImage.md b/docs/api/functions/generateImage.md index 026a22807f..4566374056 100644 --- a/docs/api/functions/generateImage.md +++ b/docs/api/functions/generateImage.md @@ -36,4 +36,4 @@ ## Defined in -[packages/core/src/generation.ts:658](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L658) +[packages/core/src/generation.ts:650](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L650) diff --git a/docs/api/functions/generateMessageResponse.md b/docs/api/functions/generateMessageResponse.md index f870df8cd9..d2ebe4025a 100644 --- a/docs/api/functions/generateMessageResponse.md +++ b/docs/api/functions/generateMessageResponse.md @@ -28,4 +28,4 @@ The completed message. ## Defined in -[packages/core/src/generation.ts:620](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L620) +[packages/core/src/generation.ts:612](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L612) diff --git a/docs/api/functions/generateObject.md b/docs/api/functions/generateObject.md index be589cb879..94902c9491 100644 --- a/docs/api/functions/generateObject.md +++ b/docs/api/functions/generateObject.md @@ -20,4 +20,4 @@ ## Defined in -[packages/core/src/generation.ts:536](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L536) +[packages/core/src/generation.ts:528](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L528) diff --git a/docs/api/functions/generateObjectArray.md b/docs/api/functions/generateObjectArray.md index 332e5a2a1c..9802b9b5ca 100644 --- a/docs/api/functions/generateObjectArray.md +++ b/docs/api/functions/generateObjectArray.md @@ -20,4 +20,4 @@ ## Defined in -[packages/core/src/generation.ts:572](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L572) +[packages/core/src/generation.ts:564](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L564) diff --git a/docs/api/functions/generateShouldRespond.md b/docs/api/functions/generateShouldRespond.md index adc9daf537..f7ecec92a4 100644 --- a/docs/api/functions/generateShouldRespond.md +++ b/docs/api/functions/generateShouldRespond.md @@ -28,4 +28,4 @@ Promise resolving to "RESPOND", "IGNORE", "STOP" or null ## Defined in -[packages/core/src/generation.ts:332](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L332) +[packages/core/src/generation.ts:334](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L334) diff --git a/docs/api/functions/generateTextArray.md b/docs/api/functions/generateTextArray.md index 619e152adc..0eecde977d 100644 --- a/docs/api/functions/generateTextArray.md +++ b/docs/api/functions/generateTextArray.md @@ -28,4 +28,4 @@ Promise resolving to an array of strings parsed from the model's response ## Defined in -[packages/core/src/generation.ts:500](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L500) +[packages/core/src/generation.ts:492](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L492) diff --git a/docs/api/functions/generateTrueOrFalse.md b/docs/api/functions/generateTrueOrFalse.md index 82897d399b..31302262b9 100644 --- a/docs/api/functions/generateTrueOrFalse.md +++ b/docs/api/functions/generateTrueOrFalse.md @@ -28,4 +28,4 @@ Promise resolving to a boolean value parsed from the model's response ## Defined in -[packages/core/src/generation.ts:444](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L444) +[packages/core/src/generation.ts:436](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L436) diff --git a/docs/api/functions/retrieveCachedEmbedding.md b/docs/api/functions/retrieveCachedEmbedding.md index ca23f0557f..b03afaabfc 100644 --- a/docs/api/functions/retrieveCachedEmbedding.md +++ b/docs/api/functions/retrieveCachedEmbedding.md @@ -16,4 +16,4 @@ ## Defined in -[packages/core/src/embedding.ts:149](https://github.com/ai16z/eliza/blob/main/packages/core/src/embedding.ts#L149) +[packages/core/src/embedding.ts:146](https://github.com/ai16z/eliza/blob/main/packages/core/src/embedding.ts#L146) diff --git a/docs/api/functions/splitChunks.md b/docs/api/functions/splitChunks.md index 3cdf1e1870..4cadae0c11 100644 --- a/docs/api/functions/splitChunks.md +++ b/docs/api/functions/splitChunks.md @@ -2,14 +2,12 @@ # Function: splitChunks() -> **splitChunks**(`runtime`, `content`, `chunkSize`, `bleed`, `modelClass`): `Promise`\<`string`[]\> +> **splitChunks**(`content`, `chunkSize`, `bleed`): `Promise`\<`string`[]\> Splits content into chunks of specified size with optional overlapping bleed sections ## Parameters -• **runtime**: `any` - • **content**: `string` The text content to split into chunks @@ -22,8 +20,6 @@ The maximum size of each chunk in tokens Number of characters to overlap between chunks (default: 100) -• **modelClass**: `string` - ## Returns `Promise`\<`string`[]\> @@ -32,4 +28,4 @@ Promise resolving to array of text chunks with bleed sections ## Defined in -[packages/core/src/generation.ts:388](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L388) +[packages/core/src/generation.ts:390](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L390) diff --git a/docs/api/functions/trimTokens.md b/docs/api/functions/trimTokens.md index bd4fa086ee..779f13964e 100644 --- a/docs/api/functions/trimTokens.md +++ b/docs/api/functions/trimTokens.md @@ -24,4 +24,4 @@ The model to use for generateText. ## Defined in -[packages/core/src/generation.ts:306](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L306) +[packages/core/src/generation.ts:308](https://github.com/ai16z/eliza/blob/main/packages/core/src/generation.ts#L308) diff --git a/docs/api/interfaces/Account.md b/docs/api/interfaces/Account.md index 7abf588a02..7dcca4d6d7 100644 --- a/docs/api/interfaces/Account.md +++ b/docs/api/interfaces/Account.md @@ -14,7 +14,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:273](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L273) ---- +*** ### name @@ -24,7 +24,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:274](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L274) ---- +*** ### username @@ -34,7 +34,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:275](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L275) ---- +*** ### details? @@ -42,13 +42,13 @@ Represents a user, including their name, details, and a unique identifier. #### Index Signature -\[`key`: `string`\]: `any` + \[`key`: `string`\]: `any` #### Defined in [packages/core/src/types.ts:276](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L276) ---- +*** ### email? @@ -58,7 +58,7 @@ Represents a user, including their name, details, and a unique identifier. [packages/core/src/types.ts:277](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L277) ---- +*** ### avatarUrl? diff --git a/docs/api/interfaces/Action.md b/docs/api/interfaces/Action.md index 6fffa3db0e..63a4028f51 100644 --- a/docs/api/interfaces/Action.md +++ b/docs/api/interfaces/Action.md @@ -14,7 +14,7 @@ Represents an action that the agent can perform, including conditions for its us [packages/core/src/types.ts:215](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L215) ---- +*** ### description @@ -24,7 +24,7 @@ Represents an action that the agent can perform, including conditions for its us [packages/core/src/types.ts:216](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L216) ---- +*** ### examples @@ -34,7 +34,7 @@ Represents an action that the agent can perform, including conditions for its us [packages/core/src/types.ts:217](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L217) ---- +*** ### handler @@ -44,7 +44,7 @@ Represents an action that the agent can perform, including conditions for its us [packages/core/src/types.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L218) ---- +*** ### name @@ -54,7 +54,7 @@ Represents an action that the agent can perform, including conditions for its us [packages/core/src/types.ts:219](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L219) ---- +*** ### validate diff --git a/docs/api/interfaces/ActionExample.md b/docs/api/interfaces/ActionExample.md index c17ef42017..4b9857324d 100644 --- a/docs/api/interfaces/ActionExample.md +++ b/docs/api/interfaces/ActionExample.md @@ -14,7 +14,7 @@ Represents an example of content, typically used for demonstrating or testing pu [packages/core/src/types.ts:25](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L25) ---- +*** ### content diff --git a/docs/api/interfaces/Actor.md b/docs/api/interfaces/Actor.md index 0e613ce860..f6d2aac023 100644 --- a/docs/api/interfaces/Actor.md +++ b/docs/api/interfaces/Actor.md @@ -14,7 +14,7 @@ Represents an actor in the conversation, which could be a user or the agent itse [packages/core/src/types.ts:41](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L41) ---- +*** ### username @@ -24,7 +24,7 @@ Represents an actor in the conversation, which could be a user or the agent itse [packages/core/src/types.ts:42](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L42) ---- +*** ### details @@ -46,7 +46,7 @@ Represents an actor in the conversation, which could be a user or the agent itse [packages/core/src/types.ts:43](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L43) ---- +*** ### id diff --git a/docs/api/interfaces/Content.md b/docs/api/interfaces/Content.md index fbdbbdc649..8ed06147ca 100644 --- a/docs/api/interfaces/Content.md +++ b/docs/api/interfaces/Content.md @@ -6,7 +6,7 @@ Represents the content of a message, including its main text (`content`), any as ## Indexable -\[`key`: `string`\]: `unknown` + \[`key`: `string`\]: `unknown` ## Properties @@ -18,7 +18,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:12](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L12) ---- +*** ### action? @@ -28,7 +28,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L13) ---- +*** ### source? @@ -38,7 +38,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:14](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L14) ---- +*** ### url? @@ -48,7 +48,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:15](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L15) ---- +*** ### inReplyTo? @@ -58,7 +58,7 @@ Represents the content of a message, including its main text (`content`), any as [packages/core/src/types.ts:16](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L16) ---- +*** ### attachments? diff --git a/docs/api/interfaces/ConversationExample.md b/docs/api/interfaces/ConversationExample.md index 28f7f975a5..85d70796dd 100644 --- a/docs/api/interfaces/ConversationExample.md +++ b/docs/api/interfaces/ConversationExample.md @@ -14,7 +14,7 @@ Represents an example of content, typically used for demonstrating or testing pu [packages/core/src/types.ts:33](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L33) ---- +*** ### content diff --git a/docs/api/interfaces/EvaluationExample.md b/docs/api/interfaces/EvaluationExample.md index c003b86882..9a44022faf 100644 --- a/docs/api/interfaces/EvaluationExample.md +++ b/docs/api/interfaces/EvaluationExample.md @@ -14,7 +14,7 @@ Represents an example for evaluation, including the context, an array of message [packages/core/src/types.ts:227](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L227) ---- +*** ### messages @@ -24,7 +24,7 @@ Represents an example for evaluation, including the context, an array of message [packages/core/src/types.ts:228](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L228) ---- +*** ### outcome diff --git a/docs/api/interfaces/Evaluator.md b/docs/api/interfaces/Evaluator.md index 458113851f..84c4c47e93 100644 --- a/docs/api/interfaces/Evaluator.md +++ b/docs/api/interfaces/Evaluator.md @@ -14,7 +14,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:236](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L236) ---- +*** ### description @@ -24,7 +24,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:237](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L237) ---- +*** ### similes @@ -34,7 +34,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:238](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L238) ---- +*** ### examples @@ -44,7 +44,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:239](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L239) ---- +*** ### handler @@ -54,7 +54,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:240](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L240) ---- +*** ### name @@ -64,7 +64,7 @@ Represents an evaluator, which is used to assess and guide the agent's responses [packages/core/src/types.ts:241](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L241) ---- +*** ### validate diff --git a/docs/api/interfaces/Goal.md b/docs/api/interfaces/Goal.md index 41456943b3..ddc338ab47 100644 --- a/docs/api/interfaces/Goal.md +++ b/docs/api/interfaces/Goal.md @@ -14,7 +14,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:66](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L66) ---- +*** ### roomId @@ -24,7 +24,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:67](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L67) ---- +*** ### userId @@ -34,7 +34,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:68](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L68) ---- +*** ### name @@ -44,7 +44,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:69](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L69) ---- +*** ### status @@ -54,7 +54,7 @@ Represents a goal, which is a higher-level aim composed of one or more objective [packages/core/src/types.ts:70](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L70) ---- +*** ### objectives diff --git a/docs/api/interfaces/IAgentRuntime.md b/docs/api/interfaces/IAgentRuntime.md index a7faddfe73..476f0e62b1 100644 --- a/docs/api/interfaces/IAgentRuntime.md +++ b/docs/api/interfaces/IAgentRuntime.md @@ -14,7 +14,7 @@ Properties [packages/core/src/types.ts:520](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L520) ---- +*** ### serverUrl @@ -24,7 +24,7 @@ Properties [packages/core/src/types.ts:521](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L521) ---- +*** ### databaseAdapter @@ -34,7 +34,7 @@ Properties [packages/core/src/types.ts:522](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L522) ---- +*** ### token @@ -44,7 +44,7 @@ Properties [packages/core/src/types.ts:523](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L523) ---- +*** ### modelProvider @@ -54,7 +54,7 @@ Properties [packages/core/src/types.ts:524](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L524) ---- +*** ### character @@ -64,7 +64,7 @@ Properties [packages/core/src/types.ts:525](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L525) ---- +*** ### providers @@ -74,7 +74,7 @@ Properties [packages/core/src/types.ts:526](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L526) ---- +*** ### actions @@ -84,7 +84,7 @@ Properties [packages/core/src/types.ts:527](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L527) ---- +*** ### evaluators @@ -94,7 +94,7 @@ Properties [packages/core/src/types.ts:528](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L528) ---- +*** ### messageManager @@ -104,7 +104,7 @@ Properties [packages/core/src/types.ts:530](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L530) ---- +*** ### descriptionManager @@ -114,7 +114,7 @@ Properties [packages/core/src/types.ts:531](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L531) ---- +*** ### loreManager @@ -124,7 +124,7 @@ Properties [packages/core/src/types.ts:532](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L532) ---- +*** ### services @@ -152,7 +152,7 @@ Properties [packages/core/src/types.ts:535](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L535) ---- +*** ### getMemoryManager() @@ -170,15 +170,11 @@ Properties [packages/core/src/types.ts:537](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L537) ---- +*** ### getService() -> **getService**\<`Service`\>(`service`): `Service` - -#### Type Parameters - -• **Service** +> **getService**(`service`): *typeof* [`Service`](../classes/Service.md) #### Parameters @@ -186,13 +182,13 @@ Properties #### Returns -`Service` +*typeof* [`Service`](../classes/Service.md) #### Defined in [packages/core/src/types.ts:539](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L539) ---- +*** ### registerService() @@ -210,7 +206,7 @@ Properties [packages/core/src/types.ts:541](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L541) ---- +*** ### getSetting() @@ -228,7 +224,7 @@ Properties [packages/core/src/types.ts:543](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L543) ---- +*** ### getConversationLength() @@ -244,7 +240,7 @@ Methods [packages/core/src/types.ts:546](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L546) ---- +*** ### processActions() @@ -268,7 +264,7 @@ Methods [packages/core/src/types.ts:547](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L547) ---- +*** ### evaluate() @@ -290,7 +286,7 @@ Methods [packages/core/src/types.ts:553](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L553) ---- +*** ### ensureParticipantExists() @@ -310,7 +306,7 @@ Methods [packages/core/src/types.ts:558](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L558) ---- +*** ### ensureUserExists() @@ -334,7 +330,7 @@ Methods [packages/core/src/types.ts:559](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L559) ---- +*** ### registerAction() @@ -352,7 +348,7 @@ Methods [packages/core/src/types.ts:565](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L565) ---- +*** ### ensureConnection() @@ -378,7 +374,7 @@ Methods [packages/core/src/types.ts:566](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L566) ---- +*** ### ensureParticipantInRoom() @@ -398,7 +394,7 @@ Methods [packages/core/src/types.ts:573](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L573) ---- +*** ### ensureRoomExists() @@ -416,7 +412,7 @@ Methods [packages/core/src/types.ts:574](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L574) ---- +*** ### composeState() @@ -436,7 +432,7 @@ Methods [packages/core/src/types.ts:575](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L575) ---- +*** ### updateRecentMessageState() diff --git a/docs/api/interfaces/IBrowserService.md b/docs/api/interfaces/IBrowserService.md index 909a110b51..7801113637 100644 --- a/docs/api/interfaces/IBrowserService.md +++ b/docs/api/interfaces/IBrowserService.md @@ -20,7 +20,7 @@ [packages/core/src/types.ts:629](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L629) ---- +*** ### closeBrowser() @@ -34,7 +34,7 @@ [packages/core/src/types.ts:630](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L630) ---- +*** ### getPageContent() diff --git a/docs/api/interfaces/IDatabaseAdapter.md b/docs/api/interfaces/IDatabaseAdapter.md index a02cf9408f..6517333911 100644 --- a/docs/api/interfaces/IDatabaseAdapter.md +++ b/docs/api/interfaces/IDatabaseAdapter.md @@ -30,7 +30,7 @@ [packages/core/src/types.ts:364](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L364) ---- +*** ### createAccount() @@ -48,7 +48,7 @@ [packages/core/src/types.ts:365](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L365) ---- +*** ### getMemories() @@ -80,7 +80,7 @@ [packages/core/src/types.ts:366](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L366) ---- +*** ### getMemoryById() @@ -98,7 +98,7 @@ [packages/core/src/types.ts:375](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L375) ---- +*** ### getMemoriesByRoomIds() @@ -120,7 +120,7 @@ [packages/core/src/types.ts:376](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L376) ---- +*** ### getCachedEmbeddings() @@ -130,17 +130,17 @@ • **params** -• **params.query_table_name**: `string` +• **params.query\_table\_name**: `string` -• **params.query_threshold**: `number` +• **params.query\_threshold**: `number` -• **params.query_input**: `string` +• **params.query\_input**: `string` -• **params.query_field_name**: `string` +• **params.query\_field\_name**: `string` -• **params.query_field_sub_name**: `string` +• **params.query\_field\_sub\_name**: `string` -• **params.query_match_count**: `number` +• **params.query\_match\_count**: `number` #### Returns @@ -150,7 +150,7 @@ [packages/core/src/types.ts:380](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L380) ---- +*** ### log() @@ -176,7 +176,7 @@ [packages/core/src/types.ts:388](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L388) ---- +*** ### getActorDetails() @@ -196,7 +196,7 @@ [packages/core/src/types.ts:394](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L394) ---- +*** ### searchMemories() @@ -212,9 +212,9 @@ • **params.embedding**: `number`[] -• **params.match_threshold**: `number` +• **params.match\_threshold**: `number` -• **params.match_count**: `number` +• **params.match\_count**: `number` • **params.unique**: `boolean` @@ -226,7 +226,7 @@ [packages/core/src/types.ts:395](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L395) ---- +*** ### updateGoalStatus() @@ -248,7 +248,7 @@ [packages/core/src/types.ts:403](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L403) ---- +*** ### searchMemoriesByEmbedding() @@ -260,7 +260,7 @@ • **params** -• **params.match_threshold?**: `number` +• **params.match\_threshold?**: `number` • **params.count?**: `number` @@ -280,7 +280,7 @@ [packages/core/src/types.ts:407](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L407) ---- +*** ### createMemory() @@ -302,7 +302,7 @@ [packages/core/src/types.ts:418](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L418) ---- +*** ### removeMemory() @@ -322,7 +322,7 @@ [packages/core/src/types.ts:423](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L423) ---- +*** ### removeAllMemories() @@ -342,7 +342,7 @@ [packages/core/src/types.ts:424](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L424) ---- +*** ### countMemories() @@ -364,7 +364,7 @@ [packages/core/src/types.ts:425](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L425) ---- +*** ### getGoals() @@ -390,7 +390,7 @@ [packages/core/src/types.ts:430](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L430) ---- +*** ### updateGoal() @@ -408,7 +408,7 @@ [packages/core/src/types.ts:436](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L436) ---- +*** ### createGoal() @@ -426,7 +426,7 @@ [packages/core/src/types.ts:437](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L437) ---- +*** ### removeGoal() @@ -444,7 +444,7 @@ [packages/core/src/types.ts:438](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L438) ---- +*** ### removeAllGoals() @@ -462,7 +462,7 @@ [packages/core/src/types.ts:439](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L439) ---- +*** ### getRoom() @@ -480,7 +480,7 @@ [packages/core/src/types.ts:440](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L440) ---- +*** ### createRoom() @@ -498,7 +498,7 @@ [packages/core/src/types.ts:441](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L441) ---- +*** ### removeRoom() @@ -516,7 +516,7 @@ [packages/core/src/types.ts:442](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L442) ---- +*** ### getRoomsForParticipant() @@ -534,7 +534,7 @@ [packages/core/src/types.ts:443](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L443) ---- +*** ### getRoomsForParticipants() @@ -552,7 +552,7 @@ [packages/core/src/types.ts:444](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L444) ---- +*** ### addParticipant() @@ -572,7 +572,7 @@ [packages/core/src/types.ts:445](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L445) ---- +*** ### removeParticipant() @@ -592,7 +592,7 @@ [packages/core/src/types.ts:446](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L446) ---- +*** ### getParticipantsForAccount() @@ -610,7 +610,7 @@ [packages/core/src/types.ts:447](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L447) ---- +*** ### getParticipantsForRoom() @@ -628,7 +628,7 @@ [packages/core/src/types.ts:448](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L448) ---- +*** ### getParticipantUserState() @@ -648,7 +648,7 @@ [packages/core/src/types.ts:449](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L449) ---- +*** ### setParticipantUserState() @@ -670,7 +670,7 @@ [packages/core/src/types.ts:453](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L453) ---- +*** ### createRelationship() @@ -692,7 +692,7 @@ [packages/core/src/types.ts:458](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L458) ---- +*** ### getRelationship() @@ -714,7 +714,7 @@ [packages/core/src/types.ts:459](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L459) ---- +*** ### getRelationships() diff --git a/docs/api/interfaces/IImageDescriptionService.md b/docs/api/interfaces/IImageDescriptionService.md index 29c48b18ed..56cda70ada 100644 --- a/docs/api/interfaces/IImageDescriptionService.md +++ b/docs/api/interfaces/IImageDescriptionService.md @@ -20,7 +20,7 @@ [packages/core/src/types.ts:583](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L583) ---- +*** ### initialize() @@ -40,7 +40,7 @@ [packages/core/src/types.ts:584](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L584) ---- +*** ### describeImage() diff --git a/docs/api/interfaces/IMemoryManager.md b/docs/api/interfaces/IMemoryManager.md index 62bfa4ecc3..56c76a7d98 100644 --- a/docs/api/interfaces/IMemoryManager.md +++ b/docs/api/interfaces/IMemoryManager.md @@ -12,7 +12,7 @@ [packages/core/src/types.ts:467](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L467) ---- +*** ### tableName @@ -22,7 +22,7 @@ [packages/core/src/types.ts:468](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L468) ---- +*** ### constructor @@ -50,7 +50,7 @@ [packages/core/src/types.ts:472](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L472) ---- +*** ### getMemories() @@ -80,7 +80,7 @@ [packages/core/src/types.ts:473](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L473) ---- +*** ### getCachedEmbeddings() @@ -98,7 +98,7 @@ [packages/core/src/types.ts:481](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L481) ---- +*** ### getMemoryById() @@ -116,7 +116,7 @@ [packages/core/src/types.ts:484](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L484) ---- +*** ### getMemoriesByRoomIds() @@ -138,7 +138,7 @@ [packages/core/src/types.ts:485](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L485) ---- +*** ### searchMemoriesByEmbedding() @@ -150,7 +150,7 @@ • **opts** -• **opts.match_threshold?**: `number` +• **opts.match\_threshold?**: `number` • **opts.count?**: `number` @@ -168,7 +168,7 @@ [packages/core/src/types.ts:489](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L489) ---- +*** ### createMemory() @@ -188,7 +188,7 @@ [packages/core/src/types.ts:499](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L499) ---- +*** ### removeMemory() @@ -206,7 +206,7 @@ [packages/core/src/types.ts:500](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L500) ---- +*** ### removeAllMemories() @@ -224,7 +224,7 @@ [packages/core/src/types.ts:501](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L501) ---- +*** ### countMemories() diff --git a/docs/api/interfaces/ITextGenerationService.md b/docs/api/interfaces/ITextGenerationService.md index 49afb06638..bdb94b4447 100644 --- a/docs/api/interfaces/ITextGenerationService.md +++ b/docs/api/interfaces/ITextGenerationService.md @@ -20,7 +20,7 @@ [packages/core/src/types.ts:607](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L607) ---- +*** ### initializeModel() @@ -34,7 +34,7 @@ [packages/core/src/types.ts:608](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L608) ---- +*** ### queueMessageCompletion() @@ -48,11 +48,11 @@ • **stop**: `string`[] -• **frequency_penalty**: `number` +• **frequency\_penalty**: `number` -• **presence_penalty**: `number` +• **presence\_penalty**: `number` -• **max_tokens**: `number` +• **max\_tokens**: `number` #### Returns @@ -62,7 +62,7 @@ [packages/core/src/types.ts:609](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L609) ---- +*** ### queueTextCompletion() @@ -76,11 +76,11 @@ • **stop**: `string`[] -• **frequency_penalty**: `number` +• **frequency\_penalty**: `number` -• **presence_penalty**: `number` +• **presence\_penalty**: `number` -• **max_tokens**: `number` +• **max\_tokens**: `number` #### Returns @@ -90,7 +90,7 @@ [packages/core/src/types.ts:617](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L617) ---- +*** ### getEmbeddingResponse() diff --git a/docs/api/interfaces/ITranscriptionService.md b/docs/api/interfaces/ITranscriptionService.md index 5993b0eb51..27b765ea59 100644 --- a/docs/api/interfaces/ITranscriptionService.md +++ b/docs/api/interfaces/ITranscriptionService.md @@ -24,7 +24,7 @@ [packages/core/src/types.ts:591](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L591) ---- +*** ### transcribeAttachmentLocally() @@ -42,7 +42,7 @@ [packages/core/src/types.ts:592](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L592) ---- +*** ### transcribe() @@ -60,7 +60,7 @@ [packages/core/src/types.ts:595](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L595) ---- +*** ### transcribeLocally() diff --git a/docs/api/interfaces/IVideoService.md b/docs/api/interfaces/IVideoService.md index f8a98f005a..8b5c988628 100644 --- a/docs/api/interfaces/IVideoService.md +++ b/docs/api/interfaces/IVideoService.md @@ -24,7 +24,7 @@ [packages/core/src/types.ts:600](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L600) ---- +*** ### processVideo() @@ -42,7 +42,7 @@ [packages/core/src/types.ts:601](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L601) ---- +*** ### fetchVideoInfo() @@ -60,7 +60,7 @@ [packages/core/src/types.ts:602](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L602) ---- +*** ### downloadVideo() diff --git a/docs/api/interfaces/Memory.md b/docs/api/interfaces/Memory.md index 842dc838fd..f9d743a4a5 100644 --- a/docs/api/interfaces/Memory.md +++ b/docs/api/interfaces/Memory.md @@ -14,7 +14,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:167](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L167) ---- +*** ### userId @@ -24,7 +24,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:168](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L168) ---- +*** ### agentId @@ -34,7 +34,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:169](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L169) ---- +*** ### createdAt? @@ -44,7 +44,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:170](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L170) ---- +*** ### content @@ -54,7 +54,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:171](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L171) ---- +*** ### embedding? @@ -64,7 +64,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:172](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L172) ---- +*** ### roomId @@ -74,7 +74,7 @@ Represents a memory record, which could be a message or any other piece of infor [packages/core/src/types.ts:173](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L173) ---- +*** ### unique? diff --git a/docs/api/interfaces/MessageExample.md b/docs/api/interfaces/MessageExample.md index 674de4854e..8055efc55e 100644 --- a/docs/api/interfaces/MessageExample.md +++ b/docs/api/interfaces/MessageExample.md @@ -14,7 +14,7 @@ Represents an example of a message, typically used for demonstrating or testing [packages/core/src/types.ts:181](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L181) ---- +*** ### content diff --git a/docs/api/interfaces/Objective.md b/docs/api/interfaces/Objective.md index 4a9c5854f7..554e13b00a 100644 --- a/docs/api/interfaces/Objective.md +++ b/docs/api/interfaces/Objective.md @@ -14,7 +14,7 @@ Represents an objective within a goal, detailing what needs to be achieved and w [packages/core/src/types.ts:51](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L51) ---- +*** ### description @@ -24,7 +24,7 @@ Represents an objective within a goal, detailing what needs to be achieved and w [packages/core/src/types.ts:52](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L52) ---- +*** ### completed diff --git a/docs/api/interfaces/Participant.md b/docs/api/interfaces/Participant.md index 997ccb7567..a984de6aa4 100644 --- a/docs/api/interfaces/Participant.md +++ b/docs/api/interfaces/Participant.md @@ -14,7 +14,7 @@ Represents a participant in a room, including their ID and account details. [packages/core/src/types.ts:285](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L285) ---- +*** ### account diff --git a/docs/api/interfaces/Relationship.md b/docs/api/interfaces/Relationship.md index 4a2ab5d47f..b1baf43954 100644 --- a/docs/api/interfaces/Relationship.md +++ b/docs/api/interfaces/Relationship.md @@ -14,7 +14,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:260](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L260) ---- +*** ### userA @@ -24,7 +24,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:261](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L261) ---- +*** ### userB @@ -34,7 +34,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:262](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L262) ---- +*** ### userId @@ -44,7 +44,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:263](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L263) ---- +*** ### roomId @@ -54,7 +54,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:264](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L264) ---- +*** ### status @@ -64,7 +64,7 @@ Represents a relationship between two users, including their IDs, the status of [packages/core/src/types.ts:265](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L265) ---- +*** ### createdAt? diff --git a/docs/api/interfaces/Room.md b/docs/api/interfaces/Room.md index f4053ed55e..7ee81f19fb 100644 --- a/docs/api/interfaces/Room.md +++ b/docs/api/interfaces/Room.md @@ -14,7 +14,7 @@ Represents a room or conversation context, including its ID and a list of partic [packages/core/src/types.ts:293](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L293) ---- +*** ### participants diff --git a/docs/api/interfaces/State.md b/docs/api/interfaces/State.md index d36151ad22..d35b3f5159 100644 --- a/docs/api/interfaces/State.md +++ b/docs/api/interfaces/State.md @@ -6,7 +6,7 @@ Represents the state of the conversation or context in which the agent is operat ## Indexable -\[`key`: `string`\]: `unknown` + \[`key`: `string`\]: `unknown` ## Properties @@ -18,7 +18,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:137](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L137) ---- +*** ### agentId? @@ -28,7 +28,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:138](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L138) ---- +*** ### bio @@ -38,7 +38,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:139](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L139) ---- +*** ### lore @@ -48,7 +48,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:140](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L140) ---- +*** ### messageDirections @@ -58,7 +58,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:141](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L141) ---- +*** ### postDirections @@ -68,7 +68,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:142](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L142) ---- +*** ### roomId @@ -78,7 +78,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:143](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L143) ---- +*** ### agentName? @@ -88,7 +88,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:144](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L144) ---- +*** ### senderName? @@ -98,7 +98,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:145](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L145) ---- +*** ### actors @@ -108,7 +108,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:146](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L146) ---- +*** ### actorsData? @@ -118,7 +118,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:147](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L147) ---- +*** ### goals? @@ -128,7 +128,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:148](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L148) ---- +*** ### goalsData? @@ -138,7 +138,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:149](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L149) ---- +*** ### recentMessages @@ -148,7 +148,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L150) ---- +*** ### recentMessagesData @@ -158,7 +158,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:151](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L151) ---- +*** ### actionNames? @@ -168,7 +168,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:152](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L152) ---- +*** ### actions? @@ -178,7 +178,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:153](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L153) ---- +*** ### actionsData? @@ -188,7 +188,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:154](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L154) ---- +*** ### actionExamples? @@ -198,7 +198,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:155](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L155) ---- +*** ### providers? @@ -208,7 +208,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:156](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L156) ---- +*** ### responseData? @@ -218,7 +218,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:157](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L157) ---- +*** ### recentInteractionsData? @@ -228,7 +228,7 @@ Represents the state of the conversation or context in which the agent is operat [packages/core/src/types.ts:158](https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts#L158) ---- +*** ### recentInteractions? diff --git a/docs/api/type-aliases/Character.md b/docs/api/type-aliases/Character.md index 333df81694..62f9dbfbd7 100644 --- a/docs/api/type-aliases/Character.md +++ b/docs/api/type-aliases/Character.md @@ -32,7 +32,7 @@ #### Index Signature -\[`key`: `string`\]: `string` + \[`key`: `string`\]: `string` ### bio @@ -84,7 +84,7 @@ #### Index Signature -\[`key`: `string`\]: `string` + \[`key`: `string`\]: `string` ### settings.voice? diff --git a/docs/api/type-aliases/Model.md b/docs/api/type-aliases/Model.md index 4d5a45b9d5..de42259011 100644 --- a/docs/api/type-aliases/Model.md +++ b/docs/api/type-aliases/Model.md @@ -22,17 +22,17 @@ > **maxOutputTokens**: `number` -### settings.frequency_penalty? +### settings.frequency\_penalty? -> `optional` **frequency_penalty**: `number` +> `optional` **frequency\_penalty**: `number` -### settings.presence_penalty? +### settings.presence\_penalty? -> `optional` **presence_penalty**: `number` +> `optional` **presence\_penalty**: `number` -### settings.repetition_penalty? +### settings.repetition\_penalty? -> `optional` **repetition_penalty**: `number` +> `optional` **repetition\_penalty**: `number` ### settings.stop diff --git a/docs/api/type-aliases/Models.md b/docs/api/type-aliases/Models.md index eaf5516422..ca4dce75e4 100644 --- a/docs/api/type-aliases/Models.md +++ b/docs/api/type-aliases/Models.md @@ -22,21 +22,21 @@ > **groq**: [`Model`](Model.md) -### llama_cloud +### llama\_cloud -> **llama_cloud**: [`Model`](Model.md) +> **llama\_cloud**: [`Model`](Model.md) -### llama_local +### llama\_local -> **llama_local**: [`Model`](Model.md) +> **llama\_local**: [`Model`](Model.md) ### google > **google**: [`Model`](Model.md) -### claude_vertex +### claude\_vertex -> **claude_vertex**: [`Model`](Model.md) +> **claude\_vertex**: [`Model`](Model.md) ### redpill diff --git a/docs/api/typedoc-sidebar.cjs b/docs/api/typedoc-sidebar.cjs index e7789d1118..0e9b1029c7 100644 --- a/docs/api/typedoc-sidebar.cjs +++ b/docs/api/typedoc-sidebar.cjs @@ -1,299 +1,4 @@ // @ts-check /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ -const typedocSidebar = { - items: [ - { - type: "category", - label: "Enumerations", - items: [ - { type: "doc", id: "enumerations/GoalStatus", label: "GoalStatus" }, - { type: "doc", id: "enumerations/ModelClass", label: "ModelClass" }, - { - type: "doc", - id: "enumerations/ModelProviderName", - label: "ModelProviderName", - }, - { type: "doc", id: "enumerations/Clients", label: "Clients" }, - { type: "doc", id: "enumerations/ServiceType", label: "ServiceType" }, - ], - }, - { - type: "category", - label: "Classes", - items: [ - { - type: "doc", - id: "classes/DatabaseAdapter", - label: "DatabaseAdapter", - }, - { type: "doc", id: "classes/MemoryManager", label: "MemoryManager" }, - { type: "doc", id: "classes/AgentRuntime", label: "AgentRuntime" }, - { type: "doc", id: "classes/Service", label: "Service" }, - ], - }, - { - type: "category", - label: "Interfaces", - items: [ - { type: "doc", id: "interfaces/Content", label: "Content" }, - { type: "doc", id: "interfaces/ActionExample", label: "ActionExample" }, - { - type: "doc", - id: "interfaces/ConversationExample", - label: "ConversationExample", - }, - { type: "doc", id: "interfaces/Actor", label: "Actor" }, - { type: "doc", id: "interfaces/Objective", label: "Objective" }, - { type: "doc", id: "interfaces/Goal", label: "Goal" }, - { type: "doc", id: "interfaces/State", label: "State" }, - { type: "doc", id: "interfaces/Memory", label: "Memory" }, - { - type: "doc", - id: "interfaces/MessageExample", - label: "MessageExample", - }, - { type: "doc", id: "interfaces/Action", label: "Action" }, - { - type: "doc", - id: "interfaces/EvaluationExample", - label: "EvaluationExample", - }, - { type: "doc", id: "interfaces/Evaluator", label: "Evaluator" }, - { type: "doc", id: "interfaces/Provider", label: "Provider" }, - { type: "doc", id: "interfaces/Relationship", label: "Relationship" }, - { type: "doc", id: "interfaces/Account", label: "Account" }, - { type: "doc", id: "interfaces/Participant", label: "Participant" }, - { type: "doc", id: "interfaces/Room", label: "Room" }, - { - type: "doc", - id: "interfaces/IDatabaseAdapter", - label: "IDatabaseAdapter", - }, - { - type: "doc", - id: "interfaces/IMemoryManager", - label: "IMemoryManager", - }, - { type: "doc", id: "interfaces/IAgentRuntime", label: "IAgentRuntime" }, - { - type: "doc", - id: "interfaces/IImageDescriptionService", - label: "IImageDescriptionService", - }, - { - type: "doc", - id: "interfaces/ITranscriptionService", - label: "ITranscriptionService", - }, - { type: "doc", id: "interfaces/IVideoService", label: "IVideoService" }, - { - type: "doc", - id: "interfaces/ITextGenerationService", - label: "ITextGenerationService", - }, - { - type: "doc", - id: "interfaces/IBrowserService", - label: "IBrowserService", - }, - { - type: "doc", - id: "interfaces/ISpeechService", - label: "ISpeechService", - }, - { type: "doc", id: "interfaces/IPdfService", label: "IPdfService" }, - ], - }, - { - type: "category", - label: "Type Aliases", - items: [ - { type: "doc", id: "type-aliases/UUID", label: "UUID" }, - { type: "doc", id: "type-aliases/Model", label: "Model" }, - { type: "doc", id: "type-aliases/Models", label: "Models" }, - { type: "doc", id: "type-aliases/Handler", label: "Handler" }, - { - type: "doc", - id: "type-aliases/HandlerCallback", - label: "HandlerCallback", - }, - { type: "doc", id: "type-aliases/Validator", label: "Validator" }, - { type: "doc", id: "type-aliases/Media", label: "Media" }, - { type: "doc", id: "type-aliases/Client", label: "Client" }, - { type: "doc", id: "type-aliases/Plugin", label: "Plugin" }, - { type: "doc", id: "type-aliases/Character", label: "Character" }, - ], - }, - { - type: "category", - label: "Variables", - items: [ - { - type: "doc", - id: "variables/defaultCharacter", - label: "defaultCharacter", - }, - { - type: "doc", - id: "variables/evaluationTemplate", - label: "evaluationTemplate", - }, - { type: "doc", id: "variables/elizaLogger", label: "elizaLogger" }, - { - type: "doc", - id: "variables/embeddingDimension", - label: "embeddingDimension", - }, - { - type: "doc", - id: "variables/embeddingZeroVector", - label: "embeddingZeroVector", - }, - { type: "doc", id: "variables/settings", label: "settings" }, - ], - }, - { - type: "category", - label: "Functions", - items: [ - { - type: "doc", - id: "functions/composeActionExamples", - label: "composeActionExamples", - }, - { - type: "doc", - id: "functions/formatActionNames", - label: "formatActionNames", - }, - { type: "doc", id: "functions/formatActions", label: "formatActions" }, - { - type: "doc", - id: "functions/composeContext", - label: "composeContext", - }, - { type: "doc", id: "functions/addHeader", label: "addHeader" }, - { type: "doc", id: "functions/embed", label: "embed" }, - { - type: "doc", - id: "functions/retrieveCachedEmbedding", - label: "retrieveCachedEmbedding", - }, - { - type: "doc", - id: "functions/formatEvaluatorNames", - label: "formatEvaluatorNames", - }, - { - type: "doc", - id: "functions/formatEvaluators", - label: "formatEvaluators", - }, - { - type: "doc", - id: "functions/formatEvaluatorExamples", - label: "formatEvaluatorExamples", - }, - { - type: "doc", - id: "functions/formatEvaluatorExampleDescriptions", - label: "formatEvaluatorExampleDescriptions", - }, - { type: "doc", id: "functions/generateText", label: "generateText" }, - { type: "doc", id: "functions/trimTokens", label: "trimTokens" }, - { - type: "doc", - id: "functions/generateShouldRespond", - label: "generateShouldRespond", - }, - { type: "doc", id: "functions/splitChunks", label: "splitChunks" }, - { - type: "doc", - id: "functions/generateTrueOrFalse", - label: "generateTrueOrFalse", - }, - { - type: "doc", - id: "functions/generateTextArray", - label: "generateTextArray", - }, - { - type: "doc", - id: "functions/generateObject", - label: "generateObject", - }, - { - type: "doc", - id: "functions/generateObjectArray", - label: "generateObjectArray", - }, - { - type: "doc", - id: "functions/generateMessageResponse", - label: "generateMessageResponse", - }, - { type: "doc", id: "functions/generateImage", label: "generateImage" }, - { - type: "doc", - id: "functions/generateCaption", - label: "generateCaption", - }, - { type: "doc", id: "functions/getGoals", label: "getGoals" }, - { - type: "doc", - id: "functions/formatGoalsAsString", - label: "formatGoalsAsString", - }, - { type: "doc", id: "functions/updateGoal", label: "updateGoal" }, - { type: "doc", id: "functions/createGoal", label: "createGoal" }, - { - type: "doc", - id: "functions/getActorDetails", - label: "getActorDetails", - }, - { type: "doc", id: "functions/formatActors", label: "formatActors" }, - { - type: "doc", - id: "functions/formatMessages", - label: "formatMessages", - }, - { - type: "doc", - id: "functions/formatTimestamp", - label: "formatTimestamp", - }, - { type: "doc", id: "functions/getModel", label: "getModel" }, - { type: "doc", id: "functions/getEndpoint", label: "getEndpoint" }, - { type: "doc", id: "functions/formatPosts", label: "formatPosts" }, - { type: "doc", id: "functions/getProviders", label: "getProviders" }, - { - type: "doc", - id: "functions/createRelationship", - label: "createRelationship", - }, - { - type: "doc", - id: "functions/getRelationship", - label: "getRelationship", - }, - { - type: "doc", - id: "functions/getRelationships", - label: "getRelationships", - }, - { - type: "doc", - id: "functions/formatRelationships", - label: "formatRelationships", - }, - { - type: "doc", - id: "functions/findNearestEnvFile", - label: "findNearestEnvFile", - }, - { type: "doc", id: "functions/loadEnvConfig", label: "loadEnvConfig" }, - ], - }, - ], -}; -module.exports = typedocSidebar.items; +const typedocSidebar = { items: [{"type":"category","label":"Enumerations","items":[{"type":"doc","id":"enumerations/GoalStatus","label":"GoalStatus"},{"type":"doc","id":"enumerations/ModelClass","label":"ModelClass"},{"type":"doc","id":"enumerations/ModelProviderName","label":"ModelProviderName"},{"type":"doc","id":"enumerations/Clients","label":"Clients"},{"type":"doc","id":"enumerations/ServiceType","label":"ServiceType"}]},{"type":"category","label":"Classes","items":[{"type":"doc","id":"classes/DatabaseAdapter","label":"DatabaseAdapter"},{"type":"doc","id":"classes/MemoryManager","label":"MemoryManager"},{"type":"doc","id":"classes/AgentRuntime","label":"AgentRuntime"},{"type":"doc","id":"classes/Service","label":"Service"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"interfaces/Content","label":"Content"},{"type":"doc","id":"interfaces/ActionExample","label":"ActionExample"},{"type":"doc","id":"interfaces/ConversationExample","label":"ConversationExample"},{"type":"doc","id":"interfaces/Actor","label":"Actor"},{"type":"doc","id":"interfaces/Objective","label":"Objective"},{"type":"doc","id":"interfaces/Goal","label":"Goal"},{"type":"doc","id":"interfaces/State","label":"State"},{"type":"doc","id":"interfaces/Memory","label":"Memory"},{"type":"doc","id":"interfaces/MessageExample","label":"MessageExample"},{"type":"doc","id":"interfaces/Action","label":"Action"},{"type":"doc","id":"interfaces/EvaluationExample","label":"EvaluationExample"},{"type":"doc","id":"interfaces/Evaluator","label":"Evaluator"},{"type":"doc","id":"interfaces/Provider","label":"Provider"},{"type":"doc","id":"interfaces/Relationship","label":"Relationship"},{"type":"doc","id":"interfaces/Account","label":"Account"},{"type":"doc","id":"interfaces/Participant","label":"Participant"},{"type":"doc","id":"interfaces/Room","label":"Room"},{"type":"doc","id":"interfaces/IDatabaseAdapter","label":"IDatabaseAdapter"},{"type":"doc","id":"interfaces/IMemoryManager","label":"IMemoryManager"},{"type":"doc","id":"interfaces/IAgentRuntime","label":"IAgentRuntime"},{"type":"doc","id":"interfaces/IImageDescriptionService","label":"IImageDescriptionService"},{"type":"doc","id":"interfaces/ITranscriptionService","label":"ITranscriptionService"},{"type":"doc","id":"interfaces/IVideoService","label":"IVideoService"},{"type":"doc","id":"interfaces/ITextGenerationService","label":"ITextGenerationService"},{"type":"doc","id":"interfaces/IBrowserService","label":"IBrowserService"},{"type":"doc","id":"interfaces/ISpeechService","label":"ISpeechService"},{"type":"doc","id":"interfaces/IPdfService","label":"IPdfService"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"type-aliases/UUID","label":"UUID"},{"type":"doc","id":"type-aliases/Model","label":"Model"},{"type":"doc","id":"type-aliases/Models","label":"Models"},{"type":"doc","id":"type-aliases/Handler","label":"Handler"},{"type":"doc","id":"type-aliases/HandlerCallback","label":"HandlerCallback"},{"type":"doc","id":"type-aliases/Validator","label":"Validator"},{"type":"doc","id":"type-aliases/Media","label":"Media"},{"type":"doc","id":"type-aliases/Client","label":"Client"},{"type":"doc","id":"type-aliases/Plugin","label":"Plugin"},{"type":"doc","id":"type-aliases/Character","label":"Character"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"variables/defaultCharacter","label":"defaultCharacter"},{"type":"doc","id":"variables/evaluationTemplate","label":"evaluationTemplate"},{"type":"doc","id":"variables/elizaLogger","label":"elizaLogger"},{"type":"doc","id":"variables/embeddingDimension","label":"embeddingDimension"},{"type":"doc","id":"variables/embeddingZeroVector","label":"embeddingZeroVector"},{"type":"doc","id":"variables/settings","label":"settings"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"functions/composeActionExamples","label":"composeActionExamples"},{"type":"doc","id":"functions/formatActionNames","label":"formatActionNames"},{"type":"doc","id":"functions/formatActions","label":"formatActions"},{"type":"doc","id":"functions/composeContext","label":"composeContext"},{"type":"doc","id":"functions/addHeader","label":"addHeader"},{"type":"doc","id":"functions/embed","label":"embed"},{"type":"doc","id":"functions/retrieveCachedEmbedding","label":"retrieveCachedEmbedding"},{"type":"doc","id":"functions/formatEvaluatorNames","label":"formatEvaluatorNames"},{"type":"doc","id":"functions/formatEvaluators","label":"formatEvaluators"},{"type":"doc","id":"functions/formatEvaluatorExamples","label":"formatEvaluatorExamples"},{"type":"doc","id":"functions/formatEvaluatorExampleDescriptions","label":"formatEvaluatorExampleDescriptions"},{"type":"doc","id":"functions/generateText","label":"generateText"},{"type":"doc","id":"functions/trimTokens","label":"trimTokens"},{"type":"doc","id":"functions/generateShouldRespond","label":"generateShouldRespond"},{"type":"doc","id":"functions/splitChunks","label":"splitChunks"},{"type":"doc","id":"functions/generateTrueOrFalse","label":"generateTrueOrFalse"},{"type":"doc","id":"functions/generateTextArray","label":"generateTextArray"},{"type":"doc","id":"functions/generateObject","label":"generateObject"},{"type":"doc","id":"functions/generateObjectArray","label":"generateObjectArray"},{"type":"doc","id":"functions/generateMessageResponse","label":"generateMessageResponse"},{"type":"doc","id":"functions/generateImage","label":"generateImage"},{"type":"doc","id":"functions/generateCaption","label":"generateCaption"},{"type":"doc","id":"functions/getGoals","label":"getGoals"},{"type":"doc","id":"functions/formatGoalsAsString","label":"formatGoalsAsString"},{"type":"doc","id":"functions/updateGoal","label":"updateGoal"},{"type":"doc","id":"functions/createGoal","label":"createGoal"},{"type":"doc","id":"functions/getActorDetails","label":"getActorDetails"},{"type":"doc","id":"functions/formatActors","label":"formatActors"},{"type":"doc","id":"functions/formatMessages","label":"formatMessages"},{"type":"doc","id":"functions/formatTimestamp","label":"formatTimestamp"},{"type":"doc","id":"functions/getModel","label":"getModel"},{"type":"doc","id":"functions/getEndpoint","label":"getEndpoint"},{"type":"doc","id":"functions/formatPosts","label":"formatPosts"},{"type":"doc","id":"functions/getProviders","label":"getProviders"},{"type":"doc","id":"functions/createRelationship","label":"createRelationship"},{"type":"doc","id":"functions/getRelationship","label":"getRelationship"},{"type":"doc","id":"functions/getRelationships","label":"getRelationships"},{"type":"doc","id":"functions/formatRelationships","label":"formatRelationships"},{"type":"doc","id":"functions/findNearestEnvFile","label":"findNearestEnvFile"},{"type":"doc","id":"functions/loadEnvConfig","label":"loadEnvConfig"}]}]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/docs/api/variables/elizaLogger.md b/docs/api/variables/elizaLogger.md index 91ee6eaa63..c33ed0865c 100644 --- a/docs/api/variables/elizaLogger.md +++ b/docs/api/variables/elizaLogger.md @@ -6,4 +6,4 @@ ## Defined in -[packages/core/src/logger.ts:284](https://github.com/ai16z/eliza/blob/main/packages/core/src/logger.ts#L284) +[packages/core/src/logger.ts:282](https://github.com/ai16z/eliza/blob/main/packages/core/src/logger.ts#L282) diff --git a/docs/docs/advanced/autonomous-trading.md b/docs/docs/advanced/autonomous-trading.md index 6c6328573d..68008c484a 100644 --- a/docs/docs/advanced/autonomous-trading.md +++ b/docs/docs/advanced/autonomous-trading.md @@ -1,285 +1,364 @@ --- -sidebar_position: 1 -title: Autonomous Trading +sidebar_position: 16 --- -# Autonomous Trading System +# 📈 Autonomous Trading ## Overview -Eliza's autonomous trading system provides a sophisticated framework for monitoring market conditions, analyzing tokens, and executing trades on Solana-based decentralized exchanges. The system combines real-time market data, technical analysis, and risk management to make informed trading decisions. +Eliza's autonomous trading system enables automated token trading on the Solana blockchain. The system integrates with Jupiter aggregator for efficient swaps, implements smart order routing, and includes risk management features. ## Core Components -### 1. Token Analysis Engine - -The system tracks multiple market indicators: +### Token Provider +Manages token information and market data: ```typescript -interface TokenPerformance { - priceChange24h: number; - volumeChange24h: number; - trade_24h_change: number; - liquidity: number; - liquidityChange24h: number; - holderChange24h: number; - rugPull: boolean; - isScam: boolean; - marketCapChange24h: number; - sustainedGrowth: boolean; - rapidDump: boolean; - suspiciousVolume: boolean; -} -``` - -### 2. Order Book Management - -```typescript -interface Order { - userId: string; - ticker: string; - contractAddress: string; - timestamp: string; - buyAmount: number; - price: number; +class TokenProvider { + constructor( + private tokenAddress: string, + private walletProvider: WalletProvider + ) { + this.cache = new NodeCache({ stdTTL: 300 }); // 5 minutes cache + } + + async fetchPrices(): Promise { + const { SOL, BTC, ETH } = TOKEN_ADDRESSES; + // Fetch current prices + return { + solana: { usd: "0" }, + bitcoin: { usd: "0" }, + ethereum: { usd: "0" } + }; + } + + async getProcessedTokenData(): Promise { + return { + security: await this.fetchTokenSecurity(), + tradeData: await this.fetchTokenTradeData(), + holderDistributionTrend: await this.analyzeHolderDistribution(), + highValueHolders: await this.filterHighValueHolders(), + recentTrades: await this.checkRecentTrades(), + dexScreenerData: await this.fetchDexScreenerData() + }; + } } ``` -### 3. Market Data Integration +### Swap Execution -The system integrates with multiple data sources: - -- BirdEye API for real-time market data -- DexScreener for liquidity analysis -- Helius for on-chain data - -## Trading Features - -### 1. Real-Time Market Analysis +Implementation of token swaps using Jupiter: ```typescript -const PROVIDER_CONFIG = { - BIRDEYE_API: "https://public-api.birdeye.so", - MAX_RETRIES: 3, - RETRY_DELAY: 2000, - TOKEN_SECURITY_ENDPOINT: "/defi/token_security?address=", - TOKEN_TRADE_DATA_ENDPOINT: "/defi/v3/token/trade-data/single?address=", -}; +async function swapToken( + connection: Connection, + walletPublicKey: PublicKey, + inputTokenCA: string, + outputTokenCA: string, + amount: number +): Promise { + // Get token decimals + const decimals = await getTokenDecimals(connection, inputTokenCA); + const adjustedAmount = amount * (10 ** decimals); + + // Fetch quote + const quoteResponse = await fetch( + `https://quote-api.jup.ag/v6/quote?inputMint=${inputTokenCA}` + + `&outputMint=${outputTokenCA}` + + `&amount=${adjustedAmount}` + + `&slippageBps=50` + ); + + // Execute swap + const swapResponse = await fetch("https://quote-api.jup.ag/v6/swap", { + method: "POST", + body: JSON.stringify({ + quoteResponse: await quoteResponse.json(), + userPublicKey: walletPublicKey.toString(), + wrapAndUnwrapSol: true + }) + }); + + return swapResponse.json(); +} ``` -Key metrics monitored: - -- Price movements -- Volume changes -- Liquidity levels -- Holder distribution -- Trading patterns - -### 2. Risk Assessment System +## Position Management -The system evaluates multiple risk factors: +### Order Book System ```typescript -async analyzeRisks(token: string) { - const risks = { - liquidityRisk: await checkLiquidity(), - holderConcentration: await analyzeHolderDistribution(), - priceVolatility: await calculateVolatility(), - marketManipulation: await detectManipulation() - }; - return risks; +interface Order { + userId: string; + ticker: string; + contractAddress: string; + timestamp: string; + buyAmount: number; + price: number; } -``` - -### 3. Trading Strategies -#### Market Analysis - -```typescript -async getProcessedTokenData(): Promise { - const security = await this.fetchTokenSecurity(); - const tradeData = await this.fetchTokenTradeData(); - const dexData = await this.fetchDexScreenerData(); - const holderDistributionTrend = await this.analyzeHolderDistribution(tradeData); - // ... additional analysis +class OrderBookProvider { + async addOrder(order: Order): Promise { + let orderBook = await this.readOrderBook(); + orderBook.push(order); + await this.writeOrderBook(orderBook); + } + + async calculateProfitLoss(userId: string): Promise { + const orders = await this.getUserOrders(userId); + return orders.reduce((total, order) => { + const currentPrice = this.getCurrentPrice(order.ticker); + const pl = (currentPrice - order.price) * order.buyAmount; + return total + pl; + }, 0); + } } ``` -#### Trade Execution +### Position Sizing ```typescript -interface TradePerformance { - token_address: string; - buy_price: number; - sell_price: number; - buy_timeStamp: string; - sell_timeStamp: string; - profit_percent: number; - market_cap_change: number; - liquidity_change: number; +async function calculatePositionSize( + tokenData: ProcessedTokenData, + riskLevel: "LOW" | "MEDIUM" | "HIGH" +): Promise { + const { liquidity, marketCap } = tokenData.dexScreenerData.pairs[0]; + + // Impact percentages based on liquidity + const impactPercentages = { + LOW: 0.01, // 1% of liquidity + MEDIUM: 0.05, // 5% of liquidity + HIGH: 0.1 // 10% of liquidity + }; + + return { + none: 0, + low: liquidity.usd * impactPercentages.LOW, + medium: liquidity.usd * impactPercentages.MEDIUM, + high: liquidity.usd * impactPercentages.HIGH + }; } ``` -## Configuration Options +## Risk Management -### 1. Trading Parameters +### Token Validation ```typescript -const tradingConfig = { - minLiquidity: 50000, // Minimum liquidity in USD - maxSlippage: 0.02, // Maximum allowed slippage - positionSize: 0.01, // Position size as percentage of portfolio - stopLoss: 0.05, // Stop loss percentage - takeProfit: 0.15, // Take profit percentage -}; +async function validateToken(token: TokenPerformance): Promise { + const security = await fetchTokenSecurity(token.tokenAddress); + + // Red flags check + if ( + security.rugPull || + security.isScam || + token.rapidDump || + token.suspiciousVolume || + token.liquidity.usd < 1000 || // Minimum $1000 liquidity + token.marketCap < 100000 // Minimum $100k market cap + ) { + return false; + } + + // Holder distribution check + const holderData = await fetchHolderList(token.tokenAddress); + const topHolderPercent = calculateTopHolderPercentage(holderData); + if (topHolderPercent > 0.5) { // >50% held by top holders + return false; + } + + return true; +} ``` -### 2. Risk Management Settings +### Trade Management ```typescript -const riskSettings = { - maxDrawdown: 0.2, // Maximum portfolio drawdown - maxPositionSize: 0.1, // Maximum single position size - minLiquidityRatio: 50, // Minimum liquidity to market cap ratio - maxHolderConcentration: 0.2, // Maximum single holder concentration -}; +interface TradeManager { + async executeTrade(params: { + inputToken: string, + outputToken: string, + amount: number, + slippage: number + }): Promise; + + async monitorPosition(params: { + tokenAddress: string, + entryPrice: number, + stopLoss: number, + takeProfit: number + }): Promise; + + async closePosition(params: { + tokenAddress: string, + amount: number + }): Promise; +} ``` -## Implementation Guide +## Market Analysis -### 1. Setting Up Market Monitoring +### Price Data Collection ```typescript -async monitorMarket(token: string) { - const provider = new TokenProvider(token); - const marketData = await provider.getProcessedTokenData(); - +async function collectMarketData( + tokenAddress: string +): Promise { return { - price: marketData.tradeData.price, - volume: marketData.tradeData.volume_24h, - liquidity: marketData.tradeData.liquidity, - holderMetrics: marketData.security + price: await fetchCurrentPrice(tokenAddress), + volume_24h: await fetch24HourVolume(tokenAddress), + price_change_24h: await fetch24HourPriceChange(tokenAddress), + liquidity: await fetchLiquidity(tokenAddress), + holder_data: await fetchHolderData(tokenAddress), + trade_history: await fetchTradeHistory(tokenAddress) }; } ``` -### 2. Implementing Trading Logic +### Technical Analysis ```typescript -async evaluateTradeOpportunity(token: string) { - const analysis = await this.getProcessedTokenData(); - - const signals = { - priceSignal: analysis.tradeData.price_change_24h > 0, - volumeSignal: analysis.tradeData.volume_24h_change_percent > 20, - liquiditySignal: analysis.tradeData.liquidity > MIN_LIQUIDITY, - holderSignal: analysis.holderDistributionTrend === "increasing" +function analyzeMarketConditions( + tradeData: TokenTradeData +): MarketAnalysis { + return { + trend: analyzePriceTrend(tradeData.price_history), + volume_profile: analyzeVolumeProfile(tradeData.volume_history), + liquidity_depth: analyzeLiquidityDepth(tradeData.liquidity), + holder_behavior: analyzeHolderBehavior(tradeData.holder_data) }; - - return signals.priceSignal && signals.volumeSignal && - signals.liquiditySignal && signals.holderSignal; } ``` -### 3. Risk Management Implementation +## Trade Execution -```typescript -async checkTradeRisks(token: string): Promise { - const security = await this.fetchTokenSecurity(); - const tradeData = await this.fetchTokenTradeData(); +### Swap Implementation - return { - isRugPull: security.ownerPercentage > 50, - isPumpAndDump: tradeData.price_change_24h > 100, - isLowLiquidity: tradeData.liquidity < MIN_LIQUIDITY, - isSuspiciousVolume: tradeData.suspiciousVolume - }; +```typescript +async function executeSwap( + runtime: IAgentRuntime, + input: { + tokenIn: string, + tokenOut: string, + amountIn: number, + slippage: number + } +): Promise { + // Prepare transaction + const { swapTransaction } = await getSwapTransaction(input); + + // Sign transaction + const keypair = getKeypairFromPrivateKey( + runtime.getSetting("WALLET_PRIVATE_KEY") + ); + transaction.sign([keypair]); + + // Execute swap + const signature = await connection.sendTransaction(transaction); + + // Confirm transaction + await connection.confirmTransaction({ + signature, + blockhash: latestBlockhash.blockhash, + lastValidBlockHeight: latestBlockhash.lastValidBlockHeight + }); + + return signature; } ``` -## Performance Monitoring - -### 1. Trade Tracking +### DAO Integration ```typescript -async trackTradePerformance(trade: TradePerformance): Promise { - const performance = { - entryPrice: trade.buy_price, - exitPrice: trade.sell_price, - profitLoss: trade.profit_percent, - holdingPeriod: calculateHoldingPeriod( - trade.buy_timeStamp, - trade.sell_timeStamp - ), - marketImpact: trade.market_cap_change - }; - - await this.logTradePerformance(performance); +async function executeSwapForDAO( + runtime: IAgentRuntime, + params: { + inputToken: string, + outputToken: string, + amount: number + } +): Promise { + const authority = getAuthorityKeypair(runtime); + const [statePDA, walletPDA] = await derivePDAs(authority); + + // Prepare instruction data + const instructionData = prepareSwapInstruction(params); + + // Execute swap through DAO + return invokeSwapDao( + connection, + authority, + statePDA, + walletPDA, + instructionData + ); } ``` -### 2. Portfolio Analytics +## Monitoring & Safety + +### Health Checks ```typescript -async analyzePortfolioPerformance(userId: string) { - const trades = await this.getTradeHistory(userId); +async function performHealthChecks(): Promise { return { - totalTrades: trades.length, - winRate: calculateWinRate(trades), - averageReturn: calculateAverageReturn(trades), - maxDrawdown: calculateMaxDrawdown(trades), - sharpeRatio: calculateSharpeRatio(trades) + connection: await checkConnectionStatus(), + wallet: await checkWalletBalance(), + orders: await checkOpenOrders(), + positions: await checkPositions() }; } ``` -## Best Practices - -1. **Risk Management** - - - Always implement stop-loss orders - - Diversify trading positions - - Monitor liquidity levels continuously - - Set maximum position sizes - -2. **Trade Execution** +### Safety Limits - - Use slippage protection - - Implement rate limiting - - Monitor gas costs - - Verify transaction success - -3. **Market Analysis** - - - Cross-reference multiple data sources - - Implement data validation - - Monitor market manipulation indicators - - Track historical patterns - -4. **System Maintenance** - - Regular performance reviews - - Strategy backtesting - - Risk parameter adjustments - - System health monitoring - -## Security Considerations +```typescript +const SAFETY_LIMITS = { + MAX_POSITION_SIZE: 0.1, // 10% of portfolio + MAX_SLIPPAGE: 0.05, // 5% slippage + MIN_LIQUIDITY: 1000, // $1000 minimum liquidity + MAX_PRICE_IMPACT: 0.03, // 3% price impact + STOP_LOSS: 0.15 // 15% stop loss +}; +``` -1. **Transaction Security** +## Error Handling - - Implement transaction signing - - Verify contract addresses - - Monitor for malicious tokens - - Implement rate limiting +### Transaction Errors -2. **Data Validation** - - Verify data sources - - Implement error handling - - Monitor for anomalies - - Cross-validate market data +```typescript +async function handleTransactionError( + error: Error, + transaction: Transaction +): Promise { + if (error.message.includes('insufficient funds')) { + await handleInsufficientFunds(); + } else if (error.message.includes('slippage tolerance exceeded')) { + await handleSlippageError(transaction); + } else { + await logTransactionError(error, transaction); + } +} +``` -## Additional Resources +### Recovery Procedures -- [Trust Engine Documentation](./trust-engine.md) -- [Infrastructure Setup](./infrastructure.md) +```typescript +async function recoverFromError( + error: Error, + context: TradingContext +): Promise { + // Stop all active trades + await stopActiveTrades(); + + // Close risky positions + await closeRiskyPositions(); + + // Reset system state + await resetTradingState(); + + // Notify administrators + await notifyAdministrators(error, context); +} +``` -Remember to thoroughly test all trading strategies in a sandbox environment before deploying to production. diff --git a/docs/docs/advanced/fine-tuning.md b/docs/docs/advanced/fine-tuning.md index bb11634f04..1065bf3ba9 100644 --- a/docs/docs/advanced/fine-tuning.md +++ b/docs/docs/advanced/fine-tuning.md @@ -1,211 +1,373 @@ --- -sidebar_position: 1 -title: Fine-tuning +sidebar_position: 13 --- -# Model Selection and Fine-tuning +# 🎯 Fine-tuning Guide ## Overview -Eliza provides a flexible model selection and configuration system that supports multiple AI providers including OpenAI, Anthropic, Google, and various LLaMA implementations. This guide explains how to configure and fine-tune models for optimal performance in your use case. +Eliza supports multiple AI model providers and offers extensive configuration options for fine-tuning model behavior, embedding generation, and performance optimization. -## Supported Models +## Model Providers -### Available Providers +Eliza supports multiple model providers through a flexible configuration system: -Eliza supports the following model providers: +```typescript +enum ModelProviderName { + OPENAI, + ANTHROPIC, + CLAUDE_VERTEX, + GROK, + GROQ, + LLAMACLOUD, + LLAMALOCAL, + GOOGLE, + REDPILL, + OPENROUTER +} +``` -- **OpenAI** +### Provider Configuration - - Small: gpt-4o-mini - - Medium: gpt-4o - - Large: gpt-4o - - Embeddings: text-embedding-3-small +Each provider has specific settings: -- **Anthropic** +```typescript +const models = { + [ModelProviderName.ANTHROPIC]: { + settings: { + stop: [], + maxInputTokens: 200000, + maxOutputTokens: 8192, + frequency_penalty: 0.0, + presence_penalty: 0.0, + temperature: 0.3, + }, + endpoint: "https://api.anthropic.com/v1", + model: { + [ModelClass.SMALL]: "claude-3-5-haiku", + [ModelClass.MEDIUM]: "claude-3-5-sonnet-20241022", + [ModelClass.LARGE]: "claude-3-5-opus-20240229" + } + }, + // ... other providers +}; +``` - - Small: claude-3-haiku - - Medium: claude-3.5-sonnet - - Large: claude-3-opus +## Model Classes -- **Google (Gemini)** +Models are categorized into different classes based on their capabilities: - - Small: gemini-1.5-flash - - Medium: gemini-1.5-flash - - Large: gemini-1.5-pro - - Embeddings: text-embedding-004 +```typescript +enum ModelClass { + SMALL, // Fast, efficient for simple tasks + MEDIUM, // Balanced performance and capability + LARGE, // Most capable but slower/more expensive + EMBEDDING // Specialized for vector embeddings + IMAGE // Image generation capabilities +} +``` -- **LLaMA Cloud** +## Embedding System - - Small: meta-llama/Llama-3.2-3B-Instruct-Turbo - - Medium: meta-llama-3.1-8b-instruct - - Large: meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo - - Embeddings: togethercomputer/m2-bert-80M-32k-retrieval +### Configuration -- **LLaMA Local** - - Various Hermes-3-Llama models optimized for local deployment +```typescript +const embeddingConfig = { + dimensions: 1536, + modelName: "text-embedding-3-small", + cacheEnabled: true +}; +``` -## Configuration Options +### Implementation -### Model Settings +```typescript +async function embed(runtime: IAgentRuntime, input: string): Promise { + // Check cache first + const cachedEmbedding = await retrieveCachedEmbedding(runtime, input); + if (cachedEmbedding) return cachedEmbedding; + + // Generate new embedding + const response = await runtime.fetch( + `${runtime.modelProvider.endpoint}/embeddings`, + { + method: "POST", + headers: { + "Authorization": `Bearer ${runtime.token}`, + "Content-Type": "application/json" + }, + body: JSON.stringify({ + input, + model: runtime.modelProvider.model.EMBEDDING, + dimensions: 1536 + }) + } + ); + + const data = await response.json(); + return data?.data?.[0].embedding; +} +``` + +## Fine-tuning Options -Each model provider can be configured with the following parameters: +### Temperature Control + +Configure model creativity vs. determinism: ```typescript -settings: { - stop: [], // Stop sequences for text generation - maxInputTokens: 128000, // Maximum input context length - maxOutputTokens: 8192, // Maximum response length - frequency_penalty: 0.0, // Penalize frequent tokens - presence_penalty: 0.0, // Penalize repeated content - temperature: 0.3, // Control randomness (0.0-1.0) -} +const temperatureSettings = { + creative: { + temperature: 0.8, + frequency_penalty: 0.7, + presence_penalty: 0.7 + }, + balanced: { + temperature: 0.5, + frequency_penalty: 0.3, + presence_penalty: 0.3 + }, + precise: { + temperature: 0.2, + frequency_penalty: 0.0, + presence_penalty: 0.0 + } +}; ``` -### Model Classes +### Context Window -Models are categorized into four classes: +Manage token limits: -- `SMALL`: Optimized for speed and cost -- `MEDIUM`: Balanced performance and capability -- `LARGE`: Maximum capability for complex tasks -- `EMBEDDING`: Specialized for text embeddings +```typescript +const contextSettings = { + OPENAI: { + maxInputTokens: 128000, + maxOutputTokens: 8192, + }, + ANTHROPIC: { + maxInputTokens: 200000, + maxOutputTokens: 8192, + }, + LLAMALOCAL: { + maxInputTokens: 32768, + maxOutputTokens: 8192, + } +}; +``` -## Fine-tuning Guidelines +## Performance Optimization -### 1. Selecting the Right Model Size +### Caching Strategy -Choose your model class based on your requirements: +```typescript +class EmbeddingCache { + private cache: NodeCache; + private cacheDir: string; + + constructor() { + this.cache = new NodeCache({ stdTTL: 300 }); // 5 minute TTL + this.cacheDir = path.join(__dirname, "cache"); + } + + async get(key: string): Promise { + // Check memory cache first + const cached = this.cache.get(key); + if (cached) return cached; + + // Check disk cache + return this.readFromDisk(key); + } + + async set(key: string, embedding: number[]): Promise { + this.cache.set(key, embedding); + await this.writeToDisk(key, embedding); + } +} +``` -- **SMALL Models** +### Model Selection - - Best for: Quick responses, simple tasks, cost-effective deployment - - Example use cases: Basic chat, simple classifications - - Recommended: `claude-3-haiku` or `gemini-1.5-flash` +```typescript +async function selectOptimalModel( + task: string, + requirements: ModelRequirements +): Promise { + if (requirements.speed === "fast") { + return ModelClass.SMALL; + } else if (requirements.complexity === "high") { + return ModelClass.LARGE; + } + return ModelClass.MEDIUM; +} +``` -- **MEDIUM Models** +## Provider-Specific Optimizations - - Best for: General purpose applications, balanced performance - - Example use cases: Content generation, complex analysis - - Recommended: `claude-3.5-sonnet` or `meta-llama-3.1-8b-instruct` +### OpenAI -- **LARGE Models** - - Best for: Complex reasoning, specialized tasks - - Example use cases: Code generation, detailed analysis - - Recommended: `claude-3-opus` or `Meta-Llama-3.1-405B` +```typescript +const openAISettings = { + endpoint: "https://api.openai.com/v1", + settings: { + stop: [], + maxInputTokens: 128000, + maxOutputTokens: 8192, + frequency_penalty: 0.0, + presence_penalty: 0.0, + temperature: 0.6, + }, + model: { + [ModelClass.SMALL]: "gpt-4o-mini", + [ModelClass.MEDIUM]: "gpt-4o", + [ModelClass.LARGE]: "gpt-4o", + [ModelClass.EMBEDDING]: "text-embedding-3-small", + [ModelClass.IMAGE]: "dall-e-3" + } +}; +``` -### 2. Optimizing Model Parameters +### Anthropic ```typescript -// Example configuration for different use cases -const chatConfig = { - temperature: 0.7, // More creative responses - maxOutputTokens: 2048, // Shorter, focused replies - presence_penalty: 0.6, // Encourage response variety +const anthropicSettings = { + endpoint: "https://api.anthropic.com/v1", + settings: { + stop: [], + maxInputTokens: 200000, + maxOutputTokens: 8192, + temperature: 0.3, + }, + model: { + [ModelClass.SMALL]: "claude-3-5-haiku", + [ModelClass.MEDIUM]: "claude-3-5-sonnet-20241022", + [ModelClass.LARGE]: "claude-3-5-opus-20240229" + } }; +``` + +### Local LLM -const analysisConfig = { - temperature: 0.2, // More deterministic responses - maxOutputTokens: 8192, // Allow detailed analysis - presence_penalty: 0.0, // Maintain focused analysis +```typescript +const llamaLocalSettings = { + settings: { + stop: ["<|eot_id|>", "<|eom_id|>"], + maxInputTokens: 32768, + maxOutputTokens: 8192, + repetition_penalty: 0.0, + temperature: 0.3, + }, + model: { + [ModelClass.SMALL]: "NousResearch/Hermes-3-Llama-3.1-8B-GGUF", + [ModelClass.MEDIUM]: "NousResearch/Hermes-3-Llama-3.1-8B-GGUF", + [ModelClass.LARGE]: "NousResearch/Hermes-3-Llama-3.1-8B-GGUF", + [ModelClass.EMBEDDING]: "togethercomputer/m2-bert-80M-32k-retrieval" + } }; ``` -### 3. Embedding Configuration +## Testing and Validation -Eliza includes a sophisticated embedding system that supports: +### Embedding Tests + +```typescript +async function validateEmbedding( + embedding: number[], + expectedDimensions: number = 1536 +): Promise { + if (!Array.isArray(embedding)) return false; + if (embedding.length !== expectedDimensions) return false; + if (embedding.some(n => typeof n !== 'number')) return false; + return true; +} +``` -- Automatic caching of embeddings -- Provider-specific optimizations -- Fallback to LLaMA service when needed +### Model Performance Testing ```typescript -// Example embedding usage -const embedding = await runtime.llamaService.getEmbeddingResponse(input); +async function benchmarkModel( + runtime: IAgentRuntime, + modelClass: ModelClass, + testCases: TestCase[] +): Promise { + const results = { + latency: [], + tokenUsage: [], + accuracy: [] + }; + + for (const test of testCases) { + const start = Date.now(); + const response = await runtime.generateText({ + context: test.input, + modelClass + }); + results.latency.push(Date.now() - start); + // ... additional metrics + } + + return results; +} ``` ## Best Practices -1. **Model Selection** +### Model Selection Guidelines - - Start with SMALL models and upgrade as needed - - Use MEDIUM models as your default for general tasks - - Reserve LARGE models for specific, complex requirements +1. **Task Complexity** + - Use SMALL for simple, quick responses + - Use MEDIUM for balanced performance + - Use LARGE for complex reasoning -2. **Parameter Tuning** +2. **Context Management** + - Keep prompts concise and focused + - Use context windows efficiently + - Implement proper context truncation - - Keep temperature low (0.2-0.4) for consistent outputs - - Increase temperature (0.6-0.8) for creative tasks - - Adjust maxOutputTokens based on expected response length +3. **Temperature Adjustment** + - Lower for factual responses + - Higher for creative tasks + - Balance based on use case -3. **Embedding Optimization** +### Performance Optimization - - Utilize the caching system for frequently used content - - Choose provider-specific embedding models for best results - - Monitor embedding performance and adjust as needed +1. **Caching Strategy** + - Cache embeddings for frequently accessed content + - Implement tiered caching (memory/disk) + - Regular cache cleanup -4. **Cost Optimization** - - Use SMALL models for development and testing - - Implement caching strategies for embeddings - - Monitor token usage across different model classes +2. **Resource Management** + - Monitor token usage + - Implement rate limiting + - Optimize batch processing -## Common Issues and Solutions +## Troubleshooting -1. **Token Length Errors** +### Common Issues +1. **Token Limits** ```typescript - // Solution: Implement chunking for long inputs - const chunks = splitIntoChunks(input, model.settings.maxInputTokens); + function handleTokenLimit(error: Error) { + if (error.message.includes('token limit')) { + return truncateAndRetry(); + } + } ``` -2. **Response Quality Issues** - +2. **Embedding Errors** ```typescript - // Solution: Adjust temperature and penalties - const enhancedSettings = { - ...defaultSettings, - temperature: 0.4, - presence_penalty: 0.2, - }; + function handleEmbeddingError(error: Error) { + if (error.message.includes('dimension mismatch')) { + return regenerateEmbedding(); + } + } ``` -3. **Embedding Cache Misses** +3. **Model Availability** ```typescript - // Solution: Implement broader similarity thresholds - const similarityThreshold = 0.85; - const cachedEmbedding = await findSimilarEmbedding( - input, - similarityThreshold, - ); + async function handleModelFailover(error: Error) { + if (error.message.includes('model not available')) { + return switchToFallbackModel(); + } + } ``` - -## Advanced Configuration - -For advanced use cases, you can extend the model configuration: - -```typescript -// Custom model configuration -const customConfig = { - model: { - [ModelClass.SMALL]: "your-custom-model", - [ModelClass.MEDIUM]: "your-custom-model", - [ModelClass.LARGE]: "your-custom-model", - [ModelClass.EMBEDDING]: "your-custom-embedding-model", - }, - settings: { - // Custom settings - maxInputTokens: 64000, - temperature: 0.5, - // Add custom parameters - custom_param: "value", - }, -}; -``` - -## Additional Resources - -- Check the [Model Providers](/docs/core/providers) documentation for more details about specific providers -- See [Configuration Guide](/docs/guides/configuration) for general configuration options -- Visit [Advanced Usage](/docs/guides/advanced) for complex deployment scenarios - -Remember to monitor your model's performance and adjust these configurations based on your specific use case and requirements. diff --git a/docs/docs/advanced/infrastructure.md b/docs/docs/advanced/infrastructure.md index 35198e3ba0..a6769e573f 100644 --- a/docs/docs/advanced/infrastructure.md +++ b/docs/docs/advanced/infrastructure.md @@ -1,302 +1,319 @@ --- -sidebar_position: 1 -title: Infrastructure +sidebar_position: 14 --- -# Infrastructure +# 🏗️ Infrastructure Guide ## Overview -Eliza uses a flexible, multi-database architecture that supports different storage backends through a unified adapter interface. The system supports PostgreSQL (with Supabase), SQLite, and SQL.js, allowing for both cloud and local deployments. +Eliza's infrastructure is built on a flexible database architecture that supports multiple adapters and efficient data storage mechanisms for AI agent interactions, memory management, and relationship tracking. -## Database Architecture - -### Adapter Pattern - -Eliza implements a database adapter pattern that provides a consistent interface across different database backends: - -```typescript -// Core adapter interface implemented by all database providers -class DatabaseAdapter { - async getRoom(roomId: UUID): Promise; - async getParticipantsForAccount(userId: UUID): Promise; - async getMemories(params: {...}): Promise; - // ... other interface methods -} -``` - -### Supported Databases - -1. **PostgreSQL/Supabase** (`PostgresDatabaseAdapter`) - - - Full-featured cloud database with vector search capabilities - - Supports real-time subscriptions - - Built-in user authentication - - Row-level security policies - -2. **SQLite** (`SqliteDatabaseAdapter`) +## Core Components - - Local filesystem storage - - Vector similarity search via SQLite extensions - - Suitable for edge deployments - - Embedded database operations +### Database Adapters +Eliza supports multiple database backends through a pluggable adapter system: -3. **SQL.js** (`SqlJsDatabaseAdapter`) - - In-memory database operations - - Browser-compatible - - No filesystem dependencies - - Ideal for testing and development +- **PostgreSQL** - Full-featured adapter with vector search capabilities +- **SQLite** - Lightweight local database option +- **SQL.js** - In-memory database for testing and development +- **Supabase** - Cloud-hosted PostgreSQL with additional features -## Core Components +### Schema Structure -### 1. Memory Storage System - -The memory system uses a sophisticated schema that supports: +The database schema includes several key tables: ```sql -CREATE TABLE memories ( - "id" UUID PRIMARY KEY, - "type" TEXT NOT NULL, - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - "content" JSONB NOT NULL, - "embedding" vector(1536), -- Vector storage for embeddings - "userId" UUID, - "roomId" UUID, - "unique" BOOLEAN DEFAULT true -); +- accounts: User and agent identities +- rooms: Conversation spaces +- memories: Vector-indexed message storage +- goals: Agent objectives and progress +- participants: Room membership tracking +- relationships: Inter-agent connections ``` -Key features: +## Setting Up Infrastructure -- Vector embeddings for semantic search -- Content deduplication via the `unique` flag -- JSON storage for flexible content types -- Relationship tracking through foreign keys +### PostgreSQL Setup -### 2. User Management +1. **Install PostgreSQL Extensions** +```sql +CREATE EXTENSION IF NOT EXISTS vector; +CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; +``` +2. **Initialize Core Tables** ```sql +-- Create base tables CREATE TABLE accounts ( "id" UUID PRIMARY KEY, - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, "name" TEXT, "username" TEXT, "email" TEXT NOT NULL, "avatarUrl" TEXT, - "details" JSONB DEFAULT '{}', - "is_agent" BOOLEAN DEFAULT false + "details" JSONB DEFAULT '{}'::jsonb ); -``` - -Features: - -- Flexible user details storage using JSONB -- Agent/user differentiation -- Integration with auth systems -### 3. Relationship System +CREATE TABLE rooms ( + "id" UUID PRIMARY KEY, + "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP +); -```sql -CREATE TABLE relationships ( +CREATE TABLE memories ( "id" UUID PRIMARY KEY, - "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - "userA" UUID NOT NULL, - "userB" UUID NOT NULL, - "status" TEXT, - "userId" UUID NOT NULL + "type" TEXT NOT NULL, + "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, + "content" JSONB NOT NULL, + "embedding" vector(1536), + "userId" UUID REFERENCES accounts("id"), + "agentId" UUID REFERENCES accounts("id"), + "roomId" UUID REFERENCES rooms("id"), + "unique" BOOLEAN DEFAULT true NOT NULL ); ``` -Supports: +3. **Set Up Indexes** +```sql +CREATE INDEX idx_memories_embedding ON memories + USING hnsw ("embedding" vector_cosine_ops); +CREATE INDEX idx_memories_type_room ON memories("type", "roomId"); +CREATE INDEX idx_participants_user ON participants("userId"); +CREATE INDEX idx_participants_room ON participants("roomId"); +``` -- Bi-directional relationships -- Relationship status tracking -- Friend recommendations +### Connection Configuration -## Security Features +```typescript +// PostgreSQL Configuration +const postgresConfig = { + max: 20, + idleTimeoutMillis: 30000, + connectionTimeoutMillis: 2000, +}; + +// Supabase Configuration +const supabaseConfig = { + supabaseUrl: process.env.SUPABASE_URL, + supabaseKey: process.env.SUPABASE_KEY +}; +``` -### Row Level Security (RLS) +## Memory Management -PostgreSQL deployment includes comprehensive RLS policies: +### Vector Storage -```sql --- Example RLS policies -CREATE POLICY "Enable read access for all users" -ON "public"."accounts" FOR SELECT -USING (true); - -CREATE POLICY "Can select and update all data" -ON "public"."accounts" -USING (("auth"."uid"() = "id")) -WITH CHECK (("auth"."uid"() = "id")); +The memory system uses vector embeddings for semantic search: + +```typescript +async function storeMemory(runtime: IAgentRuntime, content: string) { + const embedding = await runtime.embed(content); + + await runtime.databaseAdapter.createMemory({ + type: "message", + content: { text: content }, + embedding, + roomId: roomId, + userId: userId + }); +} ``` -### Authentication Integration +### Memory Retrieval -- Built-in support for Supabase Auth -- JWT validation -- Role-based access control +```typescript +async function searchMemories(runtime: IAgentRuntime, query: string) { + const embedding = await runtime.embed(query); + + return runtime.databaseAdapter.searchMemoriesByEmbedding( + embedding, + { + match_threshold: 0.8, + count: 10, + tableName: "memories" + } + ); +} +``` -## Deployment Options +## Scaling Considerations -### 1. Cloud Deployment (Supabase) +### Database Optimization -```typescript -// Initialize cloud database -const supabaseAdapter = new SupabaseDatabaseAdapter( - "https://your-project.supabase.co", - "your-supabase-key", -); -``` +1. **Index Management** + - Use HNSW indexes for vector similarity search + - Create appropriate indexes for frequent query patterns + - Regularly analyze and update index statistics + +2. **Connection Pooling** + ```typescript + const pool = new Pool({ + max: 20, // Maximum pool size + idleTimeoutMillis: 30000, + connectionTimeoutMillis: 2000 + }); + ``` -Features: +3. **Query Optimization** + - Use prepared statements + - Implement efficient pagination + - Optimize vector similarity searches -- Automated backups -- Scalable vector operations -- Real-time capabilities -- Built-in monitoring +### High Availability -### 2. Local Deployment (SQLite) +1. **Database Replication** + - Set up read replicas for scaling read operations + - Configure streaming replication for failover + - Implement connection retry logic -```typescript -// Initialize local database -const sqliteAdapter = new SqliteDatabaseAdapter( - new Database("path/to/database.db"), -); -``` +2. **Backup Strategy** + ```sql + -- Regular backups + pg_dump -Fc mydb > backup.dump + + -- Point-in-time recovery + pg_basebackup -D backup -Fp -Xs -P + ``` -Features: +## Security -- File-based storage -- Portable deployment -- Low resource requirements -- Embedded vector operations +### Access Control -### 3. In-Memory Deployment (SQL.js) +1. **Row Level Security** +```sql +ALTER TABLE memories ENABLE ROW LEVEL SECURITY; -```typescript -// Initialize in-memory database -const sqljsAdapter = new SqlJsDatabaseAdapter(new Database()); +CREATE POLICY "memories_isolation" ON memories + USING (auth.uid() = "userId" OR auth.uid() = "agentId"); ``` -Features: +2. **Role Management** +```sql +-- Create application role +CREATE ROLE app_user; -- No persistence requirements -- Fast operations -- Perfect for testing -- Browser compatibility +-- Grant necessary permissions +GRANT SELECT, INSERT ON memories TO app_user; +GRANT USAGE ON SCHEMA public TO app_user; +``` -## Vector Search Capabilities +### Data Protection -All database adapters support vector operations for semantic search: +1. **Encryption** + - Use TLS for connections + - Encrypt sensitive data at rest + - Implement key rotation -```typescript -async searchMemoriesByEmbedding( - embedding: number[], - params: { - match_threshold?: number; - count?: number; - roomId?: UUID; - unique?: boolean; - tableName: string; - } -): Promise +2. **Audit Logging** +```sql +CREATE TABLE logs ( + "id" UUID PRIMARY KEY DEFAULT gen_random_uuid(), + "createdAt" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, + "userId" UUID NOT NULL REFERENCES accounts("id"), + "body" JSONB NOT NULL, + "type" TEXT NOT NULL, + "roomId" UUID NOT NULL REFERENCES rooms("id") +); ``` -### Implementation Details: +## Monitoring -- PostgreSQL: Uses pgvector extension -- SQLite: Uses sqlite-vss extension -- SQL.js: Uses custom vector similarity functions +### Health Checks -## Best Practices +```typescript +async function checkDatabaseHealth(): Promise { + try { + await db.query('SELECT 1'); + return true; + } catch (error) { + console.error('Database health check failed:', error); + return false; + } +} +``` -1. **Database Selection** +### Performance Metrics - - Use Supabase for production deployments - - Use SQLite for edge computing/local deployments - - Use SQL.js for testing and browser-based applications +Track key metrics: +- Query performance +- Connection pool utilization +- Memory usage +- Vector search latency -2. **Memory Management** +## Maintenance - ```typescript - // Example of proper memory handling - async function withConnection(fn: (client: PoolClient) => Promise) { - const client = await pool.connect(); - try { - return await fn(client); - } finally { - client.release(); - } - } - ``` +### Regular Tasks -3. **Error Handling** +1. **Vacuum Operations** +```sql +-- Regular vacuum +VACUUM ANALYZE memories; - ```typescript - try { - await adapter.createMemory(memory, tableName); - } catch (error) { - console.error("Database error:", error); - // Implement proper error recovery - } - ``` +-- Analyze statistics +ANALYZE memories; +``` -4. **Connection Pooling** - ```typescript - const pool = new Pool({ - max: 20, - idleTimeoutMillis: 30000, - connectionTimeoutMillis: 2000, - }); - ``` +2. **Index Maintenance** +```sql +-- Reindex vector similarity index +REINDEX INDEX idx_memories_embedding; +``` -## Performance Optimization +### Data Lifecycle -1. **Indexing Strategy** +1. **Archival Strategy** + - Archive old conversations + - Compress inactive memories + - Implement data retention policies - ```sql - -- Essential indexes for performance - CREATE INDEX idx_memories_embedding ON memories - USING hnsw ("embedding" vector_cosine_ops); - CREATE INDEX idx_memories_type_room ON memories("type", "roomId"); - ``` +2. **Cleanup Jobs** +```typescript +async function cleanupOldMemories() { + const cutoffDate = new Date(); + cutoffDate.setMonth(cutoffDate.getMonth() - 6); + + await db.query(` + DELETE FROM memories + WHERE "createdAt" < $1 + `, [cutoffDate]); +} +``` -2. **Query Optimization** +## Troubleshooting - ```typescript - // Use parameterized queries - const stmt = db.prepare( - "SELECT * FROM memories WHERE type = ? AND roomId = ?", - ); - ``` +### Common Issues -3. **Caching** - - Implement memory caching for frequently accessed data - - Use embedding caching for similar queries +1. **Connection Problems** + - Check connection pool settings + - Verify network connectivity + - Review firewall rules -## Monitoring and Maintenance +2. **Performance Issues** + - Analyze query plans + - Check index usage + - Monitor resource utilization -1. **Health Checks** +3. **Vector Search Problems** + - Verify embedding dimensions + - Check similarity thresholds + - Review index configuration - ```typescript - async testConnection(): Promise { - const result = await client.query("SELECT NOW()"); - return !!result.rows[0]; - } - ``` +### Diagnostic Queries -2. **Logging** - ```typescript - // Implement comprehensive logging - const loggingAdapter = createLoggingDatabaseAdapter(baseAdapter); - ``` +```sql +-- Check connection status +SELECT * FROM pg_stat_activity; + +-- Analyze query performance +EXPLAIN ANALYZE +SELECT * FROM memories +WHERE embedding <-> $1 < 0.3 +LIMIT 10; + +-- Monitor index usage +SELECT schemaname, tablename, indexname, idx_scan +FROM pg_stat_user_indexes; +``` -## Additional Resources +## Further Reading - [PostgreSQL Documentation](https://www.postgresql.org/docs/) -- [SQLite Documentation](https://www.sqlite.org/docs.html) -- [Supabase Documentation](https://supabase.com/docs) -- [Vector Search Guide](https://supabase.com/docs/guides/database/extensions/pgvector) - -For deployment-specific configurations and advanced setup options, refer to the respective database documentation. diff --git a/docs/docs/advanced/trust-engine.md b/docs/docs/advanced/trust-engine.md index 2905ce6047..7f489fad8e 100644 --- a/docs/docs/advanced/trust-engine.md +++ b/docs/docs/advanced/trust-engine.md @@ -1,297 +1,397 @@ --- -sidebar_position: 1 -title: Trust Engine +sidebar_position: 15 --- -# Trust Engine System +# 🤝 Trust Engine ## Overview -The Trust Engine is a sophisticated system for tracking, evaluating, and managing trust scores in decentralized recommendation networks. It provides a comprehensive framework for monitoring recommender performance, token metrics, and trading outcomes. +The Trust Engine is a sophisticated system for evaluating, tracking, and managing trust scores for token recommendations and trading activity. It combines on-chain analysis, trader metrics, and historical performance to create a comprehensive trust framework. ## Core Components -### 1. Recommender Management +### Trust Score Database + +The database schema manages various aspects of trust: ```typescript -interface Recommender { - id: string; // Unique identifier - address: string; // Blockchain address - solanaPubkey?: string; - telegramId?: string; - discordId?: string; - twitterId?: string; - ip?: string; +interface TrustScoreDatabase { + // Core data structures + recommenders: Recommender[]; + metrics: RecommenderMetrics[]; + tokenPerformance: TokenPerformance[]; + recommendations: TokenRecommendation[]; } -``` - -The system tracks recommenders across multiple platforms and identifiers, enabling: -- Cross-platform identity verification -- Multi-channel recommendation tracking -- Unified reputation management - -### 2. Trust Metrics +interface Recommender { + id: string; + address: string; + solanaPubkey?: string; + telegramId?: string; + discordId?: string; + twitterId?: string; + ip?: string; +} -```typescript interface RecommenderMetrics { - recommenderId: string; - trustScore: number; // Overall trust rating - totalRecommendations: number; - successfulRecs: number; - avgTokenPerformance: number; - riskScore: number; - consistencyScore: number; - virtualConfidence: number; - lastUpdated: Date; + recommenderId: string; + trustScore: number; + totalRecommendations: number; + successfulRecs: number; + avgTokenPerformance: number; + riskScore: number; + consistencyScore: number; + virtualConfidence: number; + lastActiveDate: Date; } ``` -Key metrics tracked: - -- Trust Score: Overall reliability rating -- Success Rate: Ratio of successful recommendations -- Risk Assessment: Evaluation of risk-taking behavior -- Consistency: Pattern analysis of recommendations +### Token Analysis -### 3. Token Performance Tracking +The system tracks comprehensive token metrics: ```typescript interface TokenPerformance { - tokenAddress: string; - priceChange24h: number; - volumeChange24h: number; - trade_24h_change: number; - liquidity: number; - liquidityChange24h: number; - holderChange24h: number; - rugPull: boolean; - isScam: boolean; - marketCapChange24h: number; - sustainedGrowth: boolean; - rapidDump: boolean; - suspiciousVolume: boolean; - lastUpdated: Date; + tokenAddress: string; + priceChange24h: number; + volumeChange24h: number; + trade_24h_change: number; + liquidity: number; + liquidityChange24h: number; + holderChange24h: number; + rugPull: boolean; + isScam: boolean; + marketCapChange24h: number; + sustainedGrowth: boolean; + rapidDump: boolean; + suspiciousVolume: boolean; + validationTrust: number; + lastUpdated: Date; } ``` -## Usage Guide +## Trust Scoring System -### 1. Initializing Trust Tracking +### Score Calculation ```typescript -const trustDB = new TrustScoreDatabase(sqliteDb); - -// Add a new recommender -const recommender = { - id: "uuid", - address: "0x...", - telegramId: "@username", -}; -trustDB.addRecommender(recommender); - -// Initialize metrics -trustDB.initializeRecommenderMetrics(recommender.id); +async function calculateTrustScore( + recommenderId: string, + metrics: RecommenderMetrics +): Promise { + const weights = { + successRate: 0.3, + avgPerformance: 0.2, + consistency: 0.2, + riskMetric: 0.15, + timeDecay: 0.15 + }; + + const successRate = metrics.successfulRecs / metrics.totalRecommendations; + const normalizedPerformance = normalizePerformance(metrics.avgTokenPerformance); + const timeDecayFactor = calculateTimeDecay(metrics.lastActiveDate); + + return ( + (successRate * weights.successRate) + + (normalizedPerformance * weights.avgPerformance) + + (metrics.consistencyScore * weights.consistency) + + ((1 - metrics.riskScore) * weights.riskMetric) + + (timeDecayFactor * weights.timeDecay) + ) * 100; +} ``` -### 2. Tracking Recommendations +### Token Validation ```typescript -// Record a new token recommendation -const recommendation = { - id: "uuid", - recommenderId: recommender.id, - tokenAddress: "0x...", - timestamp: new Date(), - initialMarketCap: 1000000, - initialLiquidity: 500000, - initialPrice: 0.001, -}; -trustDB.addTokenRecommendation(recommendation); +async function validateToken( + tokenAddress: string, + performance: TokenPerformance +): Promise { + // Minimum requirements + const requirements = { + minLiquidity: 1000, // $1000 USD + minHolders: 100, + maxOwnership: 0.2, // 20% max single holder + minVolume: 500 // $500 USD daily volume + }; + + // Red flags + if ( + performance.rugPull || + performance.isScam || + performance.rapidDump || + performance.suspiciousVolume + ) { + return false; + } + + // Basic requirements + return ( + performance.liquidity >= requirements.minLiquidity && + !performance.rapidDump && + performance.validationTrust > 0.5 + ); +} ``` -### 3. Performance Monitoring +## Trade Management + +### Trade Performance Tracking ```typescript -// Update token performance metrics -const performance = { - tokenAddress: "0x...", - priceChange24h: 15.5, - volumeChange24h: 25.0, - liquidity: 1000000, - holderChange24h: 5.2, - rugPull: false, - isScam: false, - // ... other metrics -}; -trustDB.upsertTokenPerformance(performance); +interface TradePerformance { + token_address: string; + recommender_id: string; + buy_price: number; + sell_price: number; + buy_timeStamp: string; + sell_timeStamp: string; + profit_usd: number; + profit_percent: number; + market_cap_change: number; + liquidity_change: number; + rapidDump: boolean; +} + +async function recordTradePerformance( + trade: TradePerformance, + isSimulation: boolean +): Promise { + const tableName = isSimulation ? 'simulation_trade' : 'trade'; + await db.query(` + INSERT INTO ${tableName} ( + token_address, + recommender_id, + buy_price, + sell_price, + buy_timeStamp, + sell_timeStamp, + profit_usd, + profit_percent, + market_cap_change, + liquidity_change, + rapidDump + ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) + `, [/* parameters */]); +} ``` -### 4. Trade Tracking +### Risk Management ```typescript -// Record a trade based on recommendation -const trade = { - token_address: "0x...", - recommender_id: "uuid", - buy_price: 0.001, - buy_timeStamp: new Date().toISOString(), - buy_amount: 1000, - buy_sol: 1.5, - buy_value_usd: 1500, - buy_market_cap: 1000000, - buy_liquidity: 500000, -}; -trustDB.addTradePerformance(trade, false); +async function assessTradeRisk( + token: TokenPerformance, + recommender: RecommenderMetrics +): Promise<{ + riskLevel: 'LOW' | 'MEDIUM' | 'HIGH', + maxPositionSize: number +}> { + const riskFactors = { + tokenTrust: token.validationTrust, + recommenderTrust: recommender.trustScore, + marketMetrics: { + liquidity: token.liquidity, + volume: token.volumeChange24h, + holders: token.holderChange24h + } + }; + + // Calculate composite risk score + const riskScore = calculateRiskScore(riskFactors); + + // Determine position sizing + const maxPosition = determinePositionSize(riskScore); + + return { + riskLevel: getRiskLevel(riskScore), + maxPositionSize: maxPosition + }; +} ``` -## Trust Score Calculation - -The system calculates trust scores based on multiple factors: - -1. **Performance Metrics** - - - Success rate of recommendations - - Average token performance - - Risk-adjusted returns - -2. **Risk Factors** +## Recommendation Analysis - ```typescript - const riskFactors = { - rugPull: -1.0, // Maximum penalty - scam: -0.8, // Severe penalty - rapidDump: -0.4, // Moderate penalty - suspicious: -0.2, // Minor penalty - }; - ``` - -3. **Historical Analysis** - - Performance consistency - - Long-term success rate - - Risk pattern analysis - -## Best Practices - -### 1. Regular Updates +### Pattern Detection ```typescript -// Update metrics regularly -function updateRecommenderMetrics(recommenderId: string) { - const metrics = calculateUpdatedMetrics(recommenderId); - trustDB.updateRecommenderMetrics(metrics); - trustDB.logRecommenderMetricsHistory(recommenderId); +async function analyzeRecommendationPatterns( + recommenderId: string +): Promise { + const history = await getRecommenderHistory(recommenderId); + + return { + timeOfDay: analyzeTimingPatterns(history), + tokenTypes: analyzeTokenPreferences(history), + successRateByType: calculateTypeSuccessRates(history), + riskProfile: assessRiskProfile(history) + }; } ``` -### 2. Risk Management - -1. Monitor suspicious patterns: - - ```typescript - const riskFlags = { - rapidPriceChange: price24h > 100, - lowLiquidity: liquidity < minLiquidityThreshold, - suspiciousVolume: volume24h > marketCap, - }; - ``` - -2. Implement automatic warnings: - ```typescript - if (metrics.riskScore > riskThreshold) { - triggerRiskAlert(recommenderId); - } - ``` - -### 3. Performance Tracking +### Performance Metrics ```typescript -// Track historical performance -const history = trustDB.getRecommenderMetricsHistory(recommenderId); -const performanceTrend = analyzePerformanceTrend(history); +interface PerformanceMetrics { + profitability: number; + consistency: number; + riskAdjustedReturn: number; + maxDrawdown: number; + winRate: number; +} + +async function calculatePerformanceMetrics( + recommendations: TokenRecommendation[] +): Promise { + const trades = await getTradesFromRecommendations(recommendations); + + return { + profitability: calculateProfitability(trades), + consistency: calculateConsistency(trades), + riskAdjustedReturn: calculateSharpeRatio(trades), + maxDrawdown: calculateMaxDrawdown(trades), + winRate: calculateWinRate(trades) + }; +} ``` -## Advanced Features +## Integration with Trading System -### 1. Simulation Support +### Trade Execution ```typescript -// Test strategies without affecting real metrics -trustDB.addTradePerformance(trade, true); // Simulation mode +async function executeTrade( + recommendation: TokenRecommendation, + trustScore: number +): Promise { + const riskAssessment = await assessTradeRisk( + recommendation.tokenAddress, + recommendation.recommenderId + ); + + // Calculate position size based on trust score + const positionSize = calculatePositionSize( + trustScore, + riskAssessment.maxPositionSize + ); + + if (positionSize > 0) { + await executeSwap({ + inputToken: "SOL", + outputToken: recommendation.tokenAddress, + amount: positionSize + }); + + await recordTradeEntry(recommendation, positionSize); + return true; + } + + return false; +} ``` -### 2. Cross-Platform Verification +### Position Management ```typescript -const verifyIdentity = async (recommender: Recommender) => { - const telegramVerified = await verifyTelegram(recommender.telegramId); - const walletVerified = await verifyWallet(recommender.address); - return telegramVerified && walletVerified; -}; +async function managePosition( + position: TradePosition, + metrics: TokenPerformance +): Promise { + // Exit conditions + if ( + metrics.rapidDump || + metrics.suspiciousVolume || + calculateDrawdown(position) > MAX_DRAWDOWN + ) { + await executeExit(position); + return; + } + + // Position sizing adjustments + const newSize = recalculatePosition(position, metrics); + if (newSize !== position.size) { + await adjustPosition(position, newSize); + } +} ``` -### 3. Historical Analysis +## Monitoring and Alerts + +### Performance Monitoring ```typescript -const analyzeRecommenderHistory = (recommenderId: string) => { - const recommendations = - trustDB.getRecommendationsByRecommender(recommenderId); - const metrics = trustDB.getRecommenderMetrics(recommenderId); - const history = trustDB.getRecommenderMetricsHistory(recommenderId); - - return { - successRate: metrics.successfulRecs / metrics.totalRecommendations, - averagePerformance: metrics.avgTokenPerformance, - riskProfile: calculateRiskProfile(history), - consistencyScore: metrics.consistencyScore, - }; -}; +async function monitorTrustMetrics(): Promise { + // Monitor trust score changes + const scoreChanges = await getTrustScoreChanges(); + for (const change of scoreChanges) { + if (Math.abs(change.delta) > TRUST_THRESHOLD) { + await notifyTrustChange(change); + } + } + + // Monitor trading performance + const performanceMetrics = await getPerformanceMetrics(); + for (const metric of performanceMetrics) { + if (metric.drawdown > MAX_DRAWDOWN) { + await notifyRiskAlert(metric); + } + } +} ``` -## Security Considerations - -1. **Data Integrity** - - - Use foreign key constraints - - Implement transaction management - - Regular backup of metrics history - -2. **Fraud Prevention** - - ```typescript - // Implement rate limiting - const checkRateLimit = (recommenderId: string) => { - const recentRecs = getRecentRecommendations(recommenderId, timeWindow); - return recentRecs.length < maxRecommendations; - }; - ``` - -3. **Identity Verification** - - Cross-reference multiple identifiers - - Implement progressive trust building - - Regular verification checks +### Alert System -## Future Enhancements - -1. **Machine Learning Integration** - - - Pattern recognition for fraud detection - - Automated risk assessment - - Predictive analytics for recommendation quality +```typescript +interface TrustAlert { + type: 'SCORE_CHANGE' | 'RISK_LEVEL' | 'PERFORMANCE'; + severity: 'LOW' | 'MEDIUM' | 'HIGH'; + message: string; + data: any; +} -2. **Decentralized Validation** +async function handleAlert(alert: TrustAlert): Promise { + switch (alert.severity) { + case 'HIGH': + await sendImmediateNotification(alert); + await pauseTrading(alert.data); + break; + case 'MEDIUM': + await sendNotification(alert); + await adjustRiskLevels(alert.data); + break; + case 'LOW': + await logAlert(alert); + break; + } +} +``` - - Peer verification system - - Consensus-based trust scoring - - Distributed reputation management +## Troubleshooting -3. **Enhanced Metrics** - - Market sentiment analysis - - Social signal integration - - Network effect measurement +### Common Issues -## Additional Resources +1. **Trust Score Anomalies** +```typescript +async function investigateTrustAnomaly( + recommenderId: string +): Promise { + const history = await getRecommenderHistory(recommenderId); + const metrics = await getRecommenderMetrics(recommenderId); + const trades = await getRecommenderTrades(recommenderId); + + return analyzeAnomalies(history, metrics, trades); +} +``` -- [Database Schema Documentation](./infrastructure.md) +2. **Trade Execution Failures** +```typescript +async function handleTradeFailure( + error: Error, + trade: TradeAttempt +): Promise { + await logTradeError(error, trade); + await adjustTrustScore(trade.recommenderId, 'FAILURE'); + await notifyTradeFailure(trade); +} +``` -Remember to regularly monitor and adjust trust parameters based on market conditions and system performance. diff --git a/docs/docs/api/_media/README_CN.md b/docs/docs/api/_media/README_CN.md index 5a4bfe5c0d..9147f78738 100644 --- a/docs/docs/api/_media/README_CN.md +++ b/docs/docs/api/_media/README_CN.md @@ -4,39 +4,39 @@ ## 功能 -- 🛠 支持discord/推特/telegram连接 -- 👥 支持多模态agent -- 📚 简单的导入文档并与文档交互 -- 💾 可检索的内存和文档存储 -- 🚀 高可拓展性,你可以自定义客户端和行为来进行功能拓展 -- ☁️ 多模型支持,包括Llama、OpenAI、Grok、Anthropic等 -- 📦 简单好用 +- 🛠 支持discord/推特/telegram连接 +- 👥 支持多模态agent +- 📚 简单的导入文档并与文档交互 +- 💾 可检索的内存和文档存储 +- 🚀 高可拓展性,你可以自定义客户端和行为来进行功能拓展 +- ☁️ 多模型支持,包括Llama、OpenAI、Grok、Anthropic等 +- 📦 简单好用 你可以用Eliza做什么? -- 🤖 聊天机器人 -- 🕵️ 自主Agents -- 📈 业务流程自动化处理 -- 🎮 游戏NPC +- 🤖 聊天机器人 +- 🕵️ 自主Agents +- 📈 业务流程自动化处理 +- 🎮 游戏NPC # 开始使用 **前置要求(必须):** -- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) -- Nodejs安装 -- [pnpm](https://pnpm.io/installation) -- 使用pnpm +- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- Nodejs安装 +- [pnpm](https://pnpm.io/installation) +- 使用pnpm ### 编辑.env文件 -- - 将 .env.example 复制为 .env 并填写适当的值 -- 编辑推特环境并输入你的推特账号和密码 +- - 将 .env.example 复制为 .env 并填写适当的值 +- 编辑推特环境并输入你的推特账号和密码 ### 编辑角色文件 -- 查看文件 `src/core/defaultCharacter.ts` - 您可以修改它 -- 您也可以使用 `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` 加载角色并同时运行多个机器人。 +- 查看文件 `src/core/defaultCharacter.ts` - 您可以修改它 +- 您也可以使用 `node --loader ts-node/esm src/index.ts --characters="path/to/your/character.json"` 加载角色并同时运行多个机器人。 在完成账号和角色文件的配置后,输入以下命令行启动你的bot: @@ -163,9 +163,9 @@ pnpm test:sqljs # Run tests with SQL.js 测试使用 Jest 编写,位于 src/\*_/_.test.ts 文件中。测试环境配置如下: -- 从 .env.test 加载环境变量 -- 使用 2 分钟的超时时间来运行长时间运行的测试 -- 支持 ESM 模块 -- 按顺序运行测试 (--runInBand) +- 从 .env.test 加载环境变量 +- 使用 2 分钟的超时时间来运行长时间运行的测试 +- 支持 ESM 模块 +- 按顺序运行测试 (--runInBand) 要创建新测试,请在要测试的代码旁边添加一个 .test.ts 文件。 diff --git a/docs/docs/api/_media/eliza_banner.jpg b/docs/docs/api/_media/eliza_banner.jpg deleted file mode 100644 index 8364b209c8..0000000000 Binary files a/docs/docs/api/_media/eliza_banner.jpg and /dev/null differ diff --git a/docs/docs/api/classes/AgentRuntime.md b/docs/docs/api/classes/AgentRuntime.md index 5a7cb26cbf..a86436f3c1 100644 --- a/docs/docs/api/classes/AgentRuntime.md +++ b/docs/docs/api/classes/AgentRuntime.md @@ -47,9 +47,11 @@ Optional custom evaluators. Custom fetch function to use for making requests. -• **opts.imageGenModel?**: [`ImageGenModel`](../enumerations/ImageGenModel.md) +• **opts.managers?**: [`IMemoryManager`](../interfaces/IMemoryManager.md)[] -• **opts.modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) +• **opts.modelProvider**: [`ModelProviderName`](../enumerations/ModelProviderName.md) + +• **opts.plugins?**: [`Plugin`](../type-aliases/Plugin.md)[] • **opts.providers?**: [`Provider`](../interfaces/Provider.md)[] @@ -59,6 +61,10 @@ Optional context providers. The URL of the worker. +• **opts.services?**: [`Service`](Service.md)[] + +Optional custom services. + • **opts.speechModelPath?**: `string` • **opts.token**: `string` @@ -71,7 +77,7 @@ The JWT token, can be a JWT token if outside worker, or an OpenAI token if insid #### Defined in -[core/src/core/runtime.ts:188](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L188) +[packages/core/src/runtime.ts:192](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L192) ## Properties @@ -87,9 +93,9 @@ Custom actions that the agent can perform. #### Defined in -[core/src/core/runtime.ts:91](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L91) +[packages/core/src/runtime.ts:78](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L78) ---- +*** ### agentId @@ -103,23 +109,9 @@ The ID of the agent #### Defined in -[core/src/core/runtime.ts:72](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L72) - ---- - -### browserService - -> **browserService**: [`IBrowserService`](../interfaces/IBrowserService.md) - -#### Implementation of - -[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`browserService`](../interfaces/IAgentRuntime.md#browserservice) - -#### Defined in - -[core/src/core/runtime.ts:125](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L125) +[packages/core/src/runtime.ts:59](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L59) ---- +*** ### character @@ -133,9 +125,9 @@ The character to use for the agent #### Defined in -[core/src/core/runtime.ts:140](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L140) +[packages/core/src/runtime.ts:104](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L104) ---- +*** ### databaseAdapter @@ -149,9 +141,9 @@ The database adapter used for interacting with the database. #### Defined in -[core/src/core/runtime.ts:81](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L81) +[packages/core/src/runtime.ts:68](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L68) ---- +*** ### descriptionManager @@ -165,9 +157,9 @@ Store and recall descriptions of users based on conversations. #### Defined in -[core/src/core/runtime.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L150) +[packages/core/src/runtime.ts:114](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L114) ---- +*** ### documentsManager @@ -177,9 +169,9 @@ Hold large documents that can be referenced #### Defined in -[core/src/core/runtime.ts:165](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L165) +[packages/core/src/runtime.ts:124](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L124) ---- +*** ### evaluators @@ -187,27 +179,15 @@ Hold large documents that can be referenced Evaluators used to assess and guide the agent's responses. -#### Defined in - -[core/src/core/runtime.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L96) - ---- - -### factManager - -> **factManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) - -Manage the fact and recall of facts. - #### Implementation of -[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`factManager`](../interfaces/IAgentRuntime.md#factmanager) +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`evaluators`](../interfaces/IAgentRuntime.md#evaluators) #### Defined in -[core/src/core/runtime.ts:155](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L155) +[packages/core/src/runtime.ts:83](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L83) ---- +*** ### fetch() @@ -240,83 +220,47 @@ Some environments may not have access to the global fetch function and need a cu #### Defined in -[core/src/core/runtime.ts:135](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L135) +[packages/core/src/runtime.ts:99](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L99) ---- +*** -### fragmentsManager +### knowledgeManager -> **fragmentsManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) +> **knowledgeManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) Searchable document fragments #### Defined in -[core/src/core/runtime.ts:170](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L170) - ---- - -### imageDescriptionService - -> **imageDescriptionService**: [`IImageRecognitionService`](../interfaces/IImageRecognitionService.md) - -#### Implementation of - -[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`imageDescriptionService`](../interfaces/IAgentRuntime.md#imagedescriptionservice) - -#### Defined in - -[core/src/core/runtime.ts:123](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L123) - ---- - -### imageGenModel - -> **imageGenModel**: [`ImageGenModel`](../enumerations/ImageGenModel.md) = `ImageGenModel.TogetherAI` - -The model to use for image generation. +[packages/core/src/runtime.ts:129](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L129) -#### Implementation of - -[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`imageGenModel`](../interfaces/IAgentRuntime.md#imagegenmodel) - -#### Defined in +*** -[core/src/core/runtime.ts:111](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L111) - ---- - -### llamaService +### loreManager -> **llamaService**: `LlamaService` = `null` +> **loreManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) -Local Llama if no OpenAI key is present +Manage the creation and recall of static information (documents, historical game lore, etc) #### Implementation of -[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`llamaService`](../interfaces/IAgentRuntime.md#llamaservice) +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`loreManager`](../interfaces/IAgentRuntime.md#loremanager) #### Defined in -[core/src/core/runtime.ts:116](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L116) - ---- - -### loreManager - -> **loreManager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) +[packages/core/src/runtime.ts:119](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L119) -Manage the creation and recall of static information (documents, historical game lore, etc) +*** -#### Implementation of +### memoryManagers -[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`loreManager`](../interfaces/IAgentRuntime.md#loremanager) +> **memoryManagers**: `Map`\<`string`, [`IMemoryManager`](../interfaces/IMemoryManager.md)\> #### Defined in -[core/src/core/runtime.ts:160](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L160) +[packages/core/src/runtime.ts:132](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L132) ---- +*** ### messageManager @@ -330,13 +274,13 @@ Store messages that are sent and received by the agent. #### Defined in -[core/src/core/runtime.ts:145](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L145) +[packages/core/src/runtime.ts:109](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L109) ---- +*** ### modelProvider -> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) = `ModelProvider.LLAMALOCAL` +> **modelProvider**: [`ModelProviderName`](../enumerations/ModelProviderName.md) The model to use for generateText. @@ -346,23 +290,9 @@ The model to use for generateText. #### Defined in -[core/src/core/runtime.ts:106](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L106) +[packages/core/src/runtime.ts:93](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L93) ---- - -### pdfService - -> **pdfService**: [`IPdfService`](../interfaces/IPdfService.md) - -#### Implementation of - -[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`pdfService`](../interfaces/IAgentRuntime.md#pdfservice) - -#### Defined in - -[core/src/core/runtime.ts:129](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L129) - ---- +*** ### providers @@ -376,9 +306,9 @@ Context providers used to provide context for message generation. #### Defined in -[core/src/core/runtime.ts:101](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L101) +[packages/core/src/runtime.ts:88](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L88) ---- +*** ### serverUrl @@ -392,23 +322,23 @@ The base URL of the server where the agent's requests are processed. #### Defined in -[core/src/core/runtime.ts:76](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L76) +[packages/core/src/runtime.ts:63](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L63) ---- +*** -### speechService +### services -> **speechService**: [`ISpeechService`](../interfaces/ISpeechService.md) +> **services**: `Map`\<[`ServiceType`](../enumerations/ServiceType.md), [`Service`](Service.md)\> #### Implementation of -[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`speechService`](../interfaces/IAgentRuntime.md#speechservice) +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`services`](../interfaces/IAgentRuntime.md#services) #### Defined in -[core/src/core/runtime.ts:119](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L119) +[packages/core/src/runtime.ts:131](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L131) ---- +*** ### token @@ -422,35 +352,7 @@ Authentication token used for securing requests. #### Defined in -[core/src/core/runtime.ts:86](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L86) - ---- - -### transcriptionService - -> **transcriptionService**: [`ITranscriptionService`](../interfaces/ITranscriptionService.md) - -#### Implementation of - -[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`transcriptionService`](../interfaces/IAgentRuntime.md#transcriptionservice) - -#### Defined in - -[core/src/core/runtime.ts:121](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L121) - ---- - -### videoService - -> **videoService**: [`IVideoService`](../interfaces/IVideoService.md) - -#### Implementation of - -[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`videoService`](../interfaces/IAgentRuntime.md#videoservice) - -#### Defined in - -[core/src/core/runtime.ts:127](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L127) +[packages/core/src/runtime.ts:73](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L73) ## Methods @@ -480,9 +382,9 @@ The state of the agent. #### Defined in -[core/src/core/runtime.ts:673](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L673) +[packages/core/src/runtime.ts:667](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L667) ---- +*** ### ensureConnection() @@ -510,9 +412,9 @@ The state of the agent. #### Defined in -[core/src/core/runtime.ts:624](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L624) +[packages/core/src/runtime.ts:618](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L618) ---- +*** ### ensureParticipantExists() @@ -542,9 +444,9 @@ An error if the participant cannot be added. #### Defined in -[core/src/core/runtime.ts:577](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L577) +[packages/core/src/runtime.ts:571](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L571) ---- +*** ### ensureParticipantInRoom() @@ -566,9 +468,9 @@ An error if the participant cannot be added. #### Defined in -[core/src/core/runtime.ts:613](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L613) +[packages/core/src/runtime.ts:607](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L607) ---- +*** ### ensureRoomExists() @@ -597,9 +499,9 @@ An error if the room cannot be created. #### Defined in -[core/src/core/runtime.ts:660](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L660) +[packages/core/src/runtime.ts:654](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L654) ---- +*** ### ensureUserExists() @@ -633,13 +535,13 @@ The user name to ensure the existence of. #### Defined in -[core/src/core/runtime.ts:593](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L593) +[packages/core/src/runtime.ts:587](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L587) ---- +*** ### evaluate() -> **evaluate**(`message`, `state`?): `Promise`\<`string`[]\> +> **evaluate**(`message`, `state`?, `didRespond`?): `Promise`\<`string`[]\> Evaluate the message and state using the registered evaluators. @@ -653,6 +555,10 @@ The message to evaluate. The state of the agent. +• **didRespond?**: `boolean` + +Whether the agent responded to the message. + #### Returns `Promise`\<`string`[]\> @@ -665,9 +571,9 @@ The results of the evaluation. #### Defined in -[core/src/core/runtime.ts:511](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L511) +[packages/core/src/runtime.ts:501](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L501) ---- +*** ### getConversationLength() @@ -687,9 +593,53 @@ The number of recent messages to be kept in memory. #### Defined in -[core/src/core/runtime.ts:410](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L410) +[packages/core/src/runtime.ts:394](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L394) + +*** + +### getMemoryManager() + +> **getMemoryManager**(`tableName`): [`IMemoryManager`](../interfaces/IMemoryManager.md) + +#### Parameters + +• **tableName**: `string` + +#### Returns + +[`IMemoryManager`](../interfaces/IMemoryManager.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`getMemoryManager`](../interfaces/IAgentRuntime.md#getmemorymanager) + +#### Defined in + +[packages/core/src/runtime.ts:149](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L149) + +*** + +### getService() + +> **getService**(`service`): *typeof* [`Service`](Service.md) + +#### Parameters + +• **service**: [`ServiceType`](../enumerations/ServiceType.md) + +#### Returns + +*typeof* [`Service`](Service.md) + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`getService`](../interfaces/IAgentRuntime.md#getservice) + +#### Defined in + +[packages/core/src/runtime.ts:153](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L153) ---- +*** ### getSetting() @@ -709,9 +659,9 @@ The number of recent messages to be kept in memory. #### Defined in -[core/src/core/runtime.ts:388](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L388) +[packages/core/src/runtime.ts:372](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L372) ---- +*** ### processActions() @@ -741,9 +691,9 @@ The message to process. #### Defined in -[core/src/core/runtime.ts:444](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L444) +[packages/core/src/runtime.ts:428](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L428) ---- +*** ### registerAction() @@ -767,9 +717,9 @@ The action to register. #### Defined in -[core/src/core/runtime.ts:418](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L418) +[packages/core/src/runtime.ts:402](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L402) ---- +*** ### registerContextProvider() @@ -789,9 +739,9 @@ The context provider to register. #### Defined in -[core/src/core/runtime.ts:435](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L435) +[packages/core/src/runtime.ts:419](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L419) ---- +*** ### registerEvaluator() @@ -811,9 +761,53 @@ The evaluator to register. #### Defined in -[core/src/core/runtime.ts:427](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L427) +[packages/core/src/runtime.ts:411](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L411) + +*** + +### registerMemoryManager() + +> **registerMemoryManager**(`manager`): `void` + +#### Parameters + +• **manager**: [`IMemoryManager`](../interfaces/IMemoryManager.md) + +#### Returns + +`void` + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`registerMemoryManager`](../interfaces/IAgentRuntime.md#registermemorymanager) + +#### Defined in + +[packages/core/src/runtime.ts:134](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L134) + +*** + +### registerService() + +> **registerService**(`service`): `void` + +#### Parameters + +• **service**: [`Service`](Service.md) + +#### Returns + +`void` + +#### Implementation of + +[`IAgentRuntime`](../interfaces/IAgentRuntime.md).[`registerService`](../interfaces/IAgentRuntime.md#registerservice) + +#### Defined in + +[packages/core/src/runtime.ts:161](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L161) ---- +*** ### updateRecentMessageState() @@ -833,4 +827,4 @@ The evaluator to register. #### Defined in -[core/src/core/runtime.ts:1146](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/runtime.ts#L1146) +[packages/core/src/runtime.ts:1124](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/runtime.ts#L1124) diff --git a/docs/docs/api/classes/DatabaseAdapter.md b/docs/docs/api/classes/DatabaseAdapter.md index a25bd0a132..3eeb547466 100644 --- a/docs/docs/api/classes/DatabaseAdapter.md +++ b/docs/docs/api/classes/DatabaseAdapter.md @@ -3,11 +3,6 @@ An abstract class representing a database adapter for managing various entities like accounts, memories, actors, goals, and rooms. -## Extended by - -- [`PostgresDatabaseAdapter`](PostgresDatabaseAdapter.md) -- [`SqliteDatabaseAdapter`](SqliteDatabaseAdapter.md) - ## Implements - [`IDatabaseAdapter`](../interfaces/IDatabaseAdapter.md) @@ -36,7 +31,7 @@ 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/database.ts:21](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L21) ## Methods @@ -68,9 +63,9 @@ A Promise that resolves to a boolean indicating success or failure. #### Defined in -[core/src/core/database.ts:266](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L266) +[packages/core/src/database.ts:266](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L266) ---- +*** ### countMemories() @@ -104,9 +99,9 @@ A Promise that resolves to the number of memories. #### Defined in -[core/src/core/database.ts:179](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L179) +[packages/core/src/database.ts:179](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L179) ---- +*** ### createAccount() @@ -132,9 +127,9 @@ A Promise that resolves when the account creation is complete. #### Defined in -[core/src/core/database.ts:34](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L34) +[packages/core/src/database.ts:34](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L34) ---- +*** ### createGoal() @@ -160,9 +155,9 @@ A Promise that resolves when the goal has been created. #### Defined in -[core/src/core/database.ts:209](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L209) +[packages/core/src/database.ts:209](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L209) ---- +*** ### createMemory() @@ -196,9 +191,9 @@ A Promise that resolves when the memory has been created. #### Defined in -[core/src/core/database.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L150) +[packages/core/src/database.ts:150](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L150) ---- +*** ### createRelationship() @@ -228,9 +223,9 @@ A Promise that resolves to a boolean indicating success or failure of the creati #### Defined in -[core/src/core/database.ts:312](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L312) +[packages/core/src/database.ts:312](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L312) ---- +*** ### createRoom() @@ -256,9 +251,9 @@ A Promise that resolves to the UUID of the created room. #### Defined in -[core/src/core/database.ts:237](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L237) +[packages/core/src/database.ts:237](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L237) ---- +*** ### getAccountById() @@ -284,9 +279,9 @@ A Promise that resolves to the Account object or null if not found. #### Defined in -[core/src/core/database.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L27) +[packages/core/src/database.ts:27](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L27) ---- +*** ### getActorDetails() @@ -314,9 +309,9 @@ A Promise that resolves to an array of Actor objects. #### Defined in -[core/src/core/database.ts:99](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L99) +[packages/core/src/database.ts:99](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L99) ---- +*** ### getCachedEmbeddings() @@ -330,17 +325,17 @@ Retrieves cached embeddings based on the specified query parameters. An object containing parameters for the embedding retrieval. -• **params.query_field_name**: `string` +• **params.query\_field\_name**: `string` -• **params.query_field_sub_name**: `string` +• **params.query\_field\_sub\_name**: `string` -• **params.query_input**: `string` +• **params.query\_input**: `string` -• **params.query_match_count**: `number` +• **params.query\_match\_count**: `number` -• **params.query_table_name**: `string` +• **params.query\_table\_name**: `string` -• **params.query_threshold**: `number` +• **params.query\_threshold**: `number` #### Returns @@ -354,9 +349,9 @@ A Promise that resolves to an array of objects containing embeddings and levensh #### Defined in -[core/src/core/database.ts:61](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L61) +[packages/core/src/database.ts:61](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L61) ---- +*** ### getGoals() @@ -390,9 +385,9 @@ A Promise that resolves to an array of Goal objects. #### Defined in -[core/src/core/database.ts:190](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L190) +[packages/core/src/database.ts:190](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L190) ---- +*** ### getMemories() @@ -426,9 +421,9 @@ A Promise that resolves to an array of Memory objects. #### Defined in -[core/src/core/database.ts:41](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L41) +[packages/core/src/database.ts:41](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L41) ---- +*** ### getMemoriesByRoomIds() @@ -454,9 +449,9 @@ A Promise that resolves to an array of Memory objects. #### Defined in -[core/src/core/database.ts:48](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L48) +[packages/core/src/database.ts:48](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L48) ---- +*** ### getMemoryById() @@ -476,9 +471,9 @@ A Promise that resolves to an array of Memory objects. #### Defined in -[core/src/core/database.ts:54](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L54) +[packages/core/src/database.ts:54](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L54) ---- +*** ### getParticipantsForAccount() @@ -506,7 +501,7 @@ A Promise that resolves to an array of Participant objects. ##### Defined in -[core/src/core/database.ts:281](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L281) +[packages/core/src/database.ts:281](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L281) #### getParticipantsForAccount(userId) @@ -532,9 +527,9 @@ A Promise that resolves to an array of Participant objects. ##### Defined in -[core/src/core/database.ts:288](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L288) +[packages/core/src/database.ts:288](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L288) ---- +*** ### getParticipantsForRoom() @@ -560,9 +555,9 @@ A Promise that resolves to an array of UUIDs representing the participants. #### Defined in -[core/src/core/database.ts:295](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L295) +[packages/core/src/database.ts:295](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L295) ---- +*** ### getParticipantUserState() @@ -584,9 +579,9 @@ A Promise that resolves to an array of UUIDs representing the participants. #### Defined in -[core/src/core/database.ts:297](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L297) +[packages/core/src/database.ts:297](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L297) ---- +*** ### getRelationship() @@ -616,9 +611,9 @@ A Promise that resolves to the Relationship object or null if not found. #### Defined in -[core/src/core/database.ts:322](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L322) +[packages/core/src/database.ts:322](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L322) ---- +*** ### getRelationships() @@ -646,9 +641,9 @@ A Promise that resolves to an array of Relationship objects. #### Defined in -[core/src/core/database.ts:332](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L332) +[packages/core/src/database.ts:332](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L332) ---- +*** ### getRoom() @@ -674,9 +669,9 @@ A Promise that resolves to the room ID or null if not found. #### Defined in -[core/src/core/database.ts:230](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L230) +[packages/core/src/database.ts:230](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L230) ---- +*** ### getRoomsForParticipant() @@ -702,9 +697,9 @@ A Promise that resolves to an array of room IDs. #### Defined in -[core/src/core/database.ts:251](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L251) +[packages/core/src/database.ts:251](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L251) ---- +*** ### getRoomsForParticipants() @@ -730,9 +725,9 @@ A Promise that resolves to an array of room IDs. #### Defined in -[core/src/core/database.ts:258](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L258) +[packages/core/src/database.ts:258](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L258) ---- +*** ### log() @@ -766,9 +761,9 @@ A Promise that resolves when the log entry has been saved. #### Defined in -[core/src/core/database.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L87) +[packages/core/src/database.ts:87](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L87) ---- +*** ### removeAllGoals() @@ -794,9 +789,9 @@ A Promise that resolves when all goals have been removed. #### Defined in -[core/src/core/database.ts:223](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L223) +[packages/core/src/database.ts:223](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L223) ---- +*** ### removeAllMemories() @@ -826,9 +821,9 @@ A Promise that resolves when all memories have been removed. #### Defined in -[core/src/core/database.ts:170](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L170) +[packages/core/src/database.ts:170](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L170) ---- +*** ### removeGoal() @@ -854,9 +849,9 @@ A Promise that resolves when the goal has been removed. #### Defined in -[core/src/core/database.ts:216](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L216) +[packages/core/src/database.ts:216](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L216) ---- +*** ### removeMemory() @@ -886,9 +881,9 @@ A Promise that resolves when the memory has been removed. #### Defined in -[core/src/core/database.ts:162](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L162) +[packages/core/src/database.ts:162](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L162) ---- +*** ### removeParticipant() @@ -918,9 +913,9 @@ A Promise that resolves to a boolean indicating success or failure. #### Defined in -[core/src/core/database.ts:274](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L274) +[packages/core/src/database.ts:274](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L274) ---- +*** ### removeRoom() @@ -946,9 +941,9 @@ A Promise that resolves when the room has been removed. #### Defined in -[core/src/core/database.ts:244](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L244) +[packages/core/src/database.ts:244](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L244) ---- +*** ### searchMemories() @@ -964,9 +959,9 @@ An object containing parameters for the memory search. • **params.embedding**: `number`[] -• **params.match_count**: `number` +• **params.match\_count**: `number` -• **params.match_threshold**: `number` +• **params.match\_threshold**: `number` • **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` @@ -986,9 +981,9 @@ A Promise that resolves to an array of Memory objects. #### Defined in -[core/src/core/database.ts:106](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L106) +[packages/core/src/database.ts:106](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L106) ---- +*** ### searchMemoriesByEmbedding() @@ -1010,7 +1005,7 @@ Additional parameters for the search. • **params.count?**: `number` -• **params.match_threshold?**: `number` +• **params.match\_threshold?**: `number` • **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` @@ -1030,9 +1025,9 @@ A Promise that resolves to an array of Memory objects. #### Defined in -[core/src/core/database.ts:131](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L131) +[packages/core/src/database.ts:131](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L131) ---- +*** ### setParticipantUserState() @@ -1056,9 +1051,9 @@ A Promise that resolves to an array of Memory objects. #### Defined in -[core/src/core/database.ts:301](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L301) +[packages/core/src/database.ts:301](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L301) ---- +*** ### updateGoal() @@ -1084,9 +1079,9 @@ A Promise that resolves when the goal has been updated. #### Defined in -[core/src/core/database.ts:202](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L202) +[packages/core/src/database.ts:202](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L202) ---- +*** ### updateGoalStatus() @@ -1116,4 +1111,4 @@ A Promise that resolves when the goal status has been updated. #### Defined in -[core/src/core/database.ts:120](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L120) +[packages/core/src/database.ts:120](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/database.ts#L120) diff --git a/docs/docs/api/classes/DirectClient.md b/docs/docs/api/classes/DirectClient.md deleted file mode 100644 index 5b0662da0c..0000000000 --- a/docs/docs/api/classes/DirectClient.md +++ /dev/null @@ -1,69 +0,0 @@ -# Class: DirectClient - -## Constructors - -### new DirectClient() - -> **new DirectClient**(): [`DirectClient`](DirectClient.md) - -#### Returns - -[`DirectClient`](DirectClient.md) - -#### Defined in - -[core/src/clients/direct/index.ts:57](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L57) - -## Methods - -### registerAgent() - -> **registerAgent**(`runtime`): `void` - -#### Parameters - -• **runtime**: [`AgentRuntime`](AgentRuntime.md) - -#### Returns - -`void` - -#### Defined in - -[core/src/clients/direct/index.ts:263](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L263) - ---- - -### start() - -> **start**(`port`): `void` - -#### Parameters - -• **port**: `number` - -#### Returns - -`void` - -#### Defined in - -[core/src/clients/direct/index.ts:271](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L271) - ---- - -### unregisterAgent() - -> **unregisterAgent**(`runtime`): `void` - -#### Parameters - -• **runtime**: [`AgentRuntime`](AgentRuntime.md) - -#### Returns - -`void` - -#### Defined in - -[core/src/clients/direct/index.ts:267](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/direct/index.ts#L267) diff --git a/docs/docs/api/classes/DiscordClient.md b/docs/docs/api/classes/DiscordClient.md deleted file mode 100644 index 66dd101ca5..0000000000 --- a/docs/docs/api/classes/DiscordClient.md +++ /dev/null @@ -1,1502 +0,0 @@ -# Class: DiscordClient - -## Extends - -- `EventEmitter` - -## Constructors - -### new DiscordClient() - -> **new DiscordClient**(`runtime`): [`DiscordClient`](DiscordClient.md) - -#### Parameters - -• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -#### Returns - -[`DiscordClient`](DiscordClient.md) - -#### Overrides - -`EventEmitter.constructor` - -#### Defined in - -[core/src/clients/discord/index.ts:34](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L34) - -## Properties - -### apiToken - -> **apiToken**: `string` - -#### Defined in - -[core/src/clients/discord/index.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L27) - ---- - -### character - -> **character**: [`Character`](../type-aliases/Character.md) - -#### Defined in - -[core/src/clients/discord/index.ts:30](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L30) - ---- - -### captureRejections - -> `static` **captureRejections**: `boolean` - -Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - -Change the default `captureRejections` option on all new `EventEmitter` objects. - -#### Since - -v13.4.0, v12.16.0 - -#### Inherited from - -`EventEmitter.captureRejections` - -#### Defined in - -node_modules/@types/node/events.d.ts:459 - ---- - -### captureRejectionSymbol - -> `readonly` `static` **captureRejectionSymbol**: _typeof_ [`captureRejectionSymbol`](TwitterPostClient.md#capturerejectionsymbol) - -Value: `Symbol.for('nodejs.rejection')` - -See how to write a custom `rejection handler`. - -#### Since - -v13.4.0, v12.16.0 - -#### Inherited from - -`EventEmitter.captureRejectionSymbol` - -#### Defined in - -node_modules/@types/node/events.d.ts:452 - ---- - -### defaultMaxListeners - -> `static` **defaultMaxListeners**: `number` - -By default, a maximum of `10` listeners can be registered for any single -event. This limit can be changed for individual `EventEmitter` instances -using the `emitter.setMaxListeners(n)` method. To change the default -for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property -can be used. If this value is not a positive number, a `RangeError` is thrown. - -Take caution when setting the `events.defaultMaxListeners` because the -change affects _all_ `EventEmitter` instances, including those created before -the change is made. However, calling `emitter.setMaxListeners(n)` still has -precedence over `events.defaultMaxListeners`. - -This is not a hard limit. The `EventEmitter` instance will allow -more listeners to be added but will output a trace warning to stderr indicating -that a "possible EventEmitter memory leak" has been detected. For any single -`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to -temporarily avoid this warning: - -```js -import { EventEmitter } from "node:events"; -const emitter = new EventEmitter(); -emitter.setMaxListeners(emitter.getMaxListeners() + 1); -emitter.once("event", () => { - // do stuff - emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); -}); -``` - -The `--trace-warnings` command-line flag can be used to display the -stack trace for such warnings. - -The emitted warning can be inspected with `process.on('warning')` and will -have the additional `emitter`, `type`, and `count` properties, referring to -the event emitter instance, the event's name and the number of attached -listeners, respectively. -Its `name` property is set to `'MaxListenersExceededWarning'`. - -#### Since - -v0.11.2 - -#### Inherited from - -`EventEmitter.defaultMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:498 - ---- - -### errorMonitor - -> `readonly` `static` **errorMonitor**: _typeof_ [`errorMonitor`](TwitterPostClient.md#errormonitor) - -This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. - -Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no -regular `'error'` listener is installed. - -#### Since - -v13.6.0, v12.17.0 - -#### Inherited from - -`EventEmitter.errorMonitor` - -#### Defined in - -node_modules/@types/node/events.d.ts:445 - -## Methods - -### \[captureRejectionSymbol\]()? - -> `optional` **\[captureRejectionSymbol\]**\<`K`\>(`error`, `event`, ...`args`): `void` - -#### Type Parameters - -• **K** - -#### Parameters - -• **error**: `Error` - -• **event**: `string` \| `symbol` - -• ...**args**: `AnyRest` - -#### Returns - -`void` - -#### Inherited from - -`EventEmitter.[captureRejectionSymbol]` - -#### Defined in - -node_modules/@types/node/events.d.ts:136 - ---- - -### addListener() - -> **addListener**\<`K`\>(`eventName`, `listener`): `this` - -Alias for `emitter.on(eventName, listener)`. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`EventEmitter.addListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:597 - ---- - -### emit() - -> **emit**\<`K`\>(`eventName`, ...`args`): `boolean` - -Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments -to each. - -Returns `true` if the event had listeners, `false` otherwise. - -```js -import { EventEmitter } from "node:events"; -const myEmitter = new EventEmitter(); - -// First listener -myEmitter.on("event", function firstListener() { - console.log("Helloooo! first listener"); -}); -// Second listener -myEmitter.on("event", function secondListener(arg1, arg2) { - console.log(`event with parameters ${arg1}, ${arg2} in second listener`); -}); -// Third listener -myEmitter.on("event", function thirdListener(...args) { - const parameters = args.join(", "); - console.log(`event with parameters ${parameters} in third listener`); -}); - -console.log(myEmitter.listeners("event")); - -myEmitter.emit("event", 1, 2, 3, 4, 5); - -// Prints: -// [ -// [Function: firstListener], -// [Function: secondListener], -// [Function: thirdListener] -// ] -// Helloooo! first listener -// event with parameters 1, 2 in second listener -// event with parameters 1, 2, 3, 4, 5 in third listener -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• ...**args**: `AnyRest` - -#### Returns - -`boolean` - -#### Since - -v0.1.26 - -#### Inherited from - -`EventEmitter.emit` - -#### Defined in - -node_modules/@types/node/events.d.ts:859 - ---- - -### eventNames() - -> **eventNames**(): (`string` \| `symbol`)[] - -Returns an array listing the events for which the emitter has registered -listeners. The values in the array are strings or `Symbol`s. - -```js -import { EventEmitter } from "node:events"; - -const myEE = new EventEmitter(); -myEE.on("foo", () => {}); -myEE.on("bar", () => {}); - -const sym = Symbol("symbol"); -myEE.on(sym, () => {}); - -console.log(myEE.eventNames()); -// Prints: [ 'foo', 'bar', Symbol(symbol) ] -``` - -#### Returns - -(`string` \| `symbol`)[] - -#### Since - -v6.0.0 - -#### Inherited from - -`EventEmitter.eventNames` - -#### Defined in - -node_modules/@types/node/events.d.ts:922 - ---- - -### getMaxListeners() - -> **getMaxListeners**(): `number` - -Returns the current max listener value for the `EventEmitter` which is either -set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](DiscordClient.md#defaultmaxlisteners). - -#### Returns - -`number` - -#### Since - -v1.0.0 - -#### Inherited from - -`EventEmitter.getMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:774 - ---- - -### handleReactionAdd() - -> **handleReactionAdd**(`reaction`, `user`): `Promise`\<`void`\> - -#### Parameters - -• **reaction**: `MessageReaction` - -• **user**: `User` - -#### Returns - -`Promise`\<`void`\> - -#### Defined in - -[core/src/clients/discord/index.ts:121](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L121) - ---- - -### handleReactionRemove() - -> **handleReactionRemove**(`reaction`, `user`): `Promise`\<`void`\> - -#### Parameters - -• **reaction**: `MessageReaction` - -• **user**: `User` - -#### Returns - -`Promise`\<`void`\> - -#### Defined in - -[core/src/clients/discord/index.ts:195](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/discord/index.ts#L195) - ---- - -### listenerCount() - -> **listenerCount**\<`K`\>(`eventName`, `listener`?): `number` - -Returns the number of listeners listening for the event named `eventName`. -If `listener` is provided, it will return how many times the listener is found -in the list of the listeners of the event. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event being listened for - -• **listener?**: `Function` - -The event handler function - -#### Returns - -`number` - -#### Since - -v3.2.0 - -#### Inherited from - -`EventEmitter.listenerCount` - -#### Defined in - -node_modules/@types/node/events.d.ts:868 - ---- - -### listeners() - -> **listeners**\<`K`\>(`eventName`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`. - -```js -server.on("connection", (stream) => { - console.log("someone connected!"); -}); -console.log(util.inspect(server.listeners("connection"))); -// Prints: [ [Function] ] -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v0.1.26 - -#### Inherited from - -`EventEmitter.listeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:787 - ---- - -### off() - -> **off**\<`K`\>(`eventName`, `listener`): `this` - -Alias for `emitter.removeListener()`. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v10.0.0 - -#### Inherited from - -`EventEmitter.off` - -#### Defined in - -node_modules/@types/node/events.d.ts:747 - ---- - -### on() - -> **on**\<`K`\>(`eventName`, `listener`): `this` - -Adds the `listener` function to the end of the listeners array for the event -named `eventName`. No checks are made to see if the `listener` has already -been added. Multiple calls passing the same combination of `eventName` and -`listener` will result in the `listener` being added, and called, multiple times. - -```js -server.on("connection", (stream) => { - console.log("someone connected!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the -event listener to the beginning of the listeners array. - -```js -import { EventEmitter } from "node:events"; -const myEE = new EventEmitter(); -myEE.on("foo", () => console.log("a")); -myEE.prependListener("foo", () => console.log("b")); -myEE.emit("foo"); -// Prints: -// b -// a -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v0.1.101 - -#### Inherited from - -`EventEmitter.on` - -#### Defined in - -node_modules/@types/node/events.d.ts:629 - ---- - -### once() - -> **once**\<`K`\>(`eventName`, `listener`): `this` - -Adds a **one-time** `listener` function for the event named `eventName`. The -next time `eventName` is triggered, this listener is removed and then invoked. - -```js -server.once("connection", (stream) => { - console.log("Ah, we have our first user!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the -event listener to the beginning of the listeners array. - -```js -import { EventEmitter } from "node:events"; -const myEE = new EventEmitter(); -myEE.once("foo", () => console.log("a")); -myEE.prependOnceListener("foo", () => console.log("b")); -myEE.emit("foo"); -// Prints: -// b -// a -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v0.3.0 - -#### Inherited from - -`EventEmitter.once` - -#### Defined in - -node_modules/@types/node/events.d.ts:659 - ---- - -### prependListener() - -> **prependListener**\<`K`\>(`eventName`, `listener`): `this` - -Adds the `listener` function to the _beginning_ of the listeners array for the -event named `eventName`. No checks are made to see if the `listener` has -already been added. Multiple calls passing the same combination of `eventName` -and `listener` will result in the `listener` being added, and called, multiple times. - -```js -server.prependListener("connection", (stream) => { - console.log("someone connected!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v6.0.0 - -#### Inherited from - -`EventEmitter.prependListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:886 - ---- - -### prependOnceListener() - -> **prependOnceListener**\<`K`\>(`eventName`, `listener`): `this` - -Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this -listener is removed, and then invoked. - -```js -server.prependOnceListener("connection", (stream) => { - console.log("Ah, we have our first user!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v6.0.0 - -#### Inherited from - -`EventEmitter.prependOnceListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:902 - ---- - -### rawListeners() - -> **rawListeners**\<`K`\>(`eventName`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`, -including any wrappers (such as those created by `.once()`). - -```js -import { EventEmitter } from "node:events"; -const emitter = new EventEmitter(); -emitter.once("log", () => console.log("log once")); - -// Returns a new Array with a function `onceWrapper` which has a property -// `listener` which contains the original listener bound above -const listeners = emitter.rawListeners("log"); -const logFnWrapper = listeners[0]; - -// Logs "log once" to the console and does not unbind the `once` event -logFnWrapper.listener(); - -// Logs "log once" to the console and removes the listener -logFnWrapper(); - -emitter.on("log", () => console.log("log persistently")); -// Will return a new Array with a single function bound by `.on()` above -const newListeners = emitter.rawListeners("log"); - -// Logs "log persistently" twice -newListeners[0](); -emitter.emit("log"); -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v9.4.0 - -#### Inherited from - -`EventEmitter.rawListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:818 - ---- - -### removeAllListeners() - -> **removeAllListeners**(`eventName`?): `this` - -Removes all listeners, or those of the specified `eventName`. - -It is bad practice to remove listeners added elsewhere in the code, -particularly when the `EventEmitter` instance was created by some other -component or module (e.g. sockets or file streams). - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Parameters - -• **eventName?**: `string` \| `symbol` - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`EventEmitter.removeAllListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:758 - ---- - -### removeListener() - -> **removeListener**\<`K`\>(`eventName`, `listener`): `this` - -Removes the specified `listener` from the listener array for the event named `eventName`. - -```js -const callback = (stream) => { - console.log("someone connected!"); -}; -server.on("connection", callback); -// ... -server.removeListener("connection", callback); -``` - -`removeListener()` will remove, at most, one instance of a listener from the -listener array. If any single listener has been added multiple times to the -listener array for the specified `eventName`, then `removeListener()` must be -called multiple times to remove each instance. - -Once an event is emitted, all listeners attached to it at the -time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution -will not remove them from`emit()` in progress. Subsequent events behave as expected. - -```js -import { EventEmitter } from "node:events"; -class MyEmitter extends EventEmitter {} -const myEmitter = new MyEmitter(); - -const callbackA = () => { - console.log("A"); - myEmitter.removeListener("event", callbackB); -}; - -const callbackB = () => { - console.log("B"); -}; - -myEmitter.on("event", callbackA); - -myEmitter.on("event", callbackB); - -// callbackA removes listener callbackB but it will still be called. -// Internal listener array at time of emit [callbackA, callbackB] -myEmitter.emit("event"); -// Prints: -// A -// B - -// callbackB is now removed. -// Internal listener array [callbackA] -myEmitter.emit("event"); -// Prints: -// A -``` - -Because listeners are managed using an internal array, calling this will -change the position indices of any listener registered _after_ the listener -being removed. This will not impact the order in which listeners are called, -but it means that any copies of the listener array as returned by -the `emitter.listeners()` method will need to be recreated. - -When a single function has been added as a handler multiple times for a single -event (as in the example below), `removeListener()` will remove the most -recently added instance. In the example the `once('ping')` listener is removed: - -```js -import { EventEmitter } from "node:events"; -const ee = new EventEmitter(); - -function pong() { - console.log("pong"); -} - -ee.on("ping", pong); -ee.once("ping", pong); -ee.removeListener("ping", pong); - -ee.emit("ping"); -ee.emit("ping"); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`EventEmitter.removeListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:742 - ---- - -### setMaxListeners() - -> **setMaxListeners**(`n`): `this` - -By default `EventEmitter`s will print a warning if more than `10` listeners are -added for a particular event. This is a useful default that helps finding -memory leaks. The `emitter.setMaxListeners()` method allows the limit to be -modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Parameters - -• **n**: `number` - -#### Returns - -`this` - -#### Since - -v0.3.5 - -#### Inherited from - -`EventEmitter.setMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:768 - ---- - -### addAbortListener() - -> `static` **addAbortListener**(`signal`, `resource`): `Disposable` - -**`Experimental`** - -Listens once to the `abort` event on the provided `signal`. - -Listening to the `abort` event on abort signals is unsafe and may -lead to resource leaks since another third party with the signal can -call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change -this since it would violate the web standard. Additionally, the original -API makes it easy to forget to remove listeners. - -This API allows safely using `AbortSignal`s in Node.js APIs by solving these -two issues by listening to the event such that `stopImmediatePropagation` does -not prevent the listener from running. - -Returns a disposable so that it may be unsubscribed from more easily. - -```js -import { addAbortListener } from "node:events"; - -function example(signal) { - let disposable; - try { - signal.addEventListener("abort", (e) => e.stopImmediatePropagation()); - disposable = addAbortListener(signal, (e) => { - // Do something when signal is aborted. - }); - } finally { - disposable?.[Symbol.dispose](); - } -} -``` - -#### Parameters - -• **signal**: `AbortSignal` - -• **resource** - -#### Returns - -`Disposable` - -Disposable that removes the `abort` listener. - -#### Since - -v20.5.0 - -#### Inherited from - -`EventEmitter.addAbortListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:437 - ---- - -### getEventListeners() - -> `static` **getEventListeners**(`emitter`, `name`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`. - -For `EventEmitter`s this behaves exactly the same as calling `.listeners` on -the emitter. - -For `EventTarget`s this is the only way to get the event listeners for the -event target. This is useful for debugging and diagnostic purposes. - -```js -import { getEventListeners, EventEmitter } from "node:events"; - -{ - const ee = new EventEmitter(); - const listener = () => console.log("Events are fun"); - ee.on("foo", listener); - console.log(getEventListeners(ee, "foo")); // [ [Function: listener] ] -} -{ - const et = new EventTarget(); - const listener = () => console.log("Events are fun"); - et.addEventListener("foo", listener); - console.log(getEventListeners(et, "foo")); // [ [Function: listener] ] -} -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` - -• **name**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v15.2.0, v14.17.0 - -#### Inherited from - -`EventEmitter.getEventListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:358 - ---- - -### getMaxListeners() - -> `static` **getMaxListeners**(`emitter`): `number` - -Returns the currently set max amount of listeners. - -For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on -the emitter. - -For `EventTarget`s this is the only way to get the max event listeners for the -event target. If the number of event handlers on a single EventTarget exceeds -the max set, the EventTarget will print a warning. - -```js -import { getMaxListeners, setMaxListeners, EventEmitter } from "node:events"; - -{ - const ee = new EventEmitter(); - console.log(getMaxListeners(ee)); // 10 - setMaxListeners(11, ee); - console.log(getMaxListeners(ee)); // 11 -} -{ - const et = new EventTarget(); - console.log(getMaxListeners(et)); // 10 - setMaxListeners(11, et); - console.log(getMaxListeners(et)); // 11 -} -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` - -#### Returns - -`number` - -#### Since - -v19.9.0 - -#### Inherited from - -`EventEmitter.getMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:387 - ---- - -### ~~listenerCount()~~ - -> `static` **listenerCount**(`emitter`, `eventName`): `number` - -A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. - -```js -import { EventEmitter, listenerCount } from "node:events"; - -const myEmitter = new EventEmitter(); -myEmitter.on("event", () => {}); -myEmitter.on("event", () => {}); -console.log(listenerCount(myEmitter, "event")); -// Prints: 2 -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -The emitter to query - -• **eventName**: `string` \| `symbol` - -The event name - -#### Returns - -`number` - -#### Since - -v0.9.12 - -#### Deprecated - -Since v3.2.0 - Use `listenerCount` instead. - -#### Inherited from - -`EventEmitter.listenerCount` - -#### Defined in - -node_modules/@types/node/events.d.ts:330 - ---- - -### on() - -#### on(emitter, eventName, options) - -> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -// Emit later on -process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); -}); - -for await (const event of on(ee, "foo")) { - // The execution of this inner block is synchronous and it - // processes one event at a time (even with await). Do not use - // if concurrent execution is required. - console.log(event); // prints ['bar'] [42] -} -// Unreachable here -``` - -Returns an `AsyncIterator` that iterates `eventName` events. It will throw -if the `EventEmitter` emits `'error'`. It removes all listeners when -exiting the loop. The `value` returned by each iteration is an array -composed of the emitted event arguments. - -An `AbortSignal` can be used to cancel waiting on events: - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ac = new AbortController(); - -(async () => { - const ee = new EventEmitter(); - - // Emit later on - process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); - }); - - for await (const event of on(ee, "foo", { signal: ac.signal })) { - // The execution of this inner block is synchronous and it - // processes one event at a time (even with await). Do not use - // if concurrent execution is required. - console.log(event); // prints ['bar'] [42] - } - // Unreachable here -})(); - -process.nextTick(() => ac.abort()); -``` - -Use the `close` option to specify an array of event names that will end the iteration: - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -// Emit later on -process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); - ee.emit("close"); -}); - -for await (const event of on(ee, "foo", { close: ["close"] })) { - console.log(event); // prints ['bar'] [42] -} -// the loop will exit after 'close' is emitted -console.log("done"); // prints 'done' -``` - -##### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -• **eventName**: `string` \| `symbol` - -• **options?**: `StaticEventEmitterIteratorOptions` - -##### Returns - -`AsyncIterator`\<`any`[], `any`, `any`\> - -An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` - -##### Since - -v13.6.0, v12.16.0 - -##### Inherited from - -`EventEmitter.on` - -##### Defined in - -node_modules/@types/node/events.d.ts:303 - -#### on(emitter, eventName, options) - -> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> - -##### Parameters - -• **emitter**: `EventTarget` - -• **eventName**: `string` - -• **options?**: `StaticEventEmitterIteratorOptions` - -##### Returns - -`AsyncIterator`\<`any`[], `any`, `any`\> - -##### Inherited from - -`EventEmitter.on` - -##### Defined in - -node_modules/@types/node/events.d.ts:308 - ---- - -### once() - -#### once(emitter, eventName, options) - -> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> - -Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given -event or that is rejected if the `EventEmitter` emits `'error'` while waiting. -The `Promise` will resolve with an array of all the arguments emitted to the -given event. - -This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event -semantics and does not listen to the `'error'` event. - -```js -import { once, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -process.nextTick(() => { - ee.emit("myevent", 42); -}); - -const [value] = await once(ee, "myevent"); -console.log(value); - -const err = new Error("kaboom"); -process.nextTick(() => { - ee.emit("error", err); -}); - -try { - await once(ee, "myevent"); -} catch (err) { - console.error("error happened", err); -} -``` - -The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the -'`error'` event itself, then it is treated as any other kind of event without -special handling: - -```js -import { EventEmitter, once } from "node:events"; - -const ee = new EventEmitter(); - -once(ee, "error") - .then(([err]) => console.log("ok", err.message)) - .catch((err) => console.error("error", err.message)); - -ee.emit("error", new Error("boom")); - -// Prints: ok boom -``` - -An `AbortSignal` can be used to cancel waiting for the event: - -```js -import { EventEmitter, once } from "node:events"; - -const ee = new EventEmitter(); -const ac = new AbortController(); - -async function foo(emitter, event, signal) { - try { - await once(emitter, event, { signal }); - console.log("event emitted!"); - } catch (error) { - if (error.name === "AbortError") { - console.error("Waiting for the event was canceled!"); - } else { - console.error("There was an error", error.message); - } - } -} - -foo(ee, "foo", ac.signal); -ac.abort(); // Abort waiting for the event -ee.emit("foo"); // Prints: Waiting for the event was canceled! -``` - -##### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -• **eventName**: `string` \| `symbol` - -• **options?**: `StaticEventEmitterOptions` - -##### Returns - -`Promise`\<`any`[]\> - -##### Since - -v11.13.0, v10.16.0 - -##### Inherited from - -`EventEmitter.once` - -##### Defined in - -node_modules/@types/node/events.d.ts:217 - -#### once(emitter, eventName, options) - -> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> - -##### Parameters - -• **emitter**: `EventTarget` - -• **eventName**: `string` - -• **options?**: `StaticEventEmitterOptions` - -##### Returns - -`Promise`\<`any`[]\> - -##### Inherited from - -`EventEmitter.once` - -##### Defined in - -node_modules/@types/node/events.d.ts:222 - ---- - -### setMaxListeners() - -> `static` **setMaxListeners**(`n`?, ...`eventTargets`?): `void` - -```js -import { setMaxListeners, EventEmitter } from "node:events"; - -const target = new EventTarget(); -const emitter = new EventEmitter(); - -setMaxListeners(5, target, emitter); -``` - -#### Parameters - -• **n?**: `number` - -A non-negative number. The maximum number of listeners per `EventTarget` event. - -• ...**eventTargets?**: (`EventEmitter`\<`DefaultEventMap`\> \| `EventTarget`)[] - -Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} -objects. - -#### Returns - -`void` - -#### Since - -v15.4.0 - -#### Inherited from - -`EventEmitter.setMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:402 diff --git a/docs/docs/api/classes/MemoryManager.md b/docs/docs/api/classes/MemoryManager.md index 4f605abac5..ae2c008314 100644 --- a/docs/docs/api/classes/MemoryManager.md +++ b/docs/docs/api/classes/MemoryManager.md @@ -34,7 +34,7 @@ The name of the table this manager will operate on. #### Defined in -[core/src/core/memory.ts:35](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L35) +[packages/core/src/memory.ts:35](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L35) ## Properties @@ -50,9 +50,9 @@ The AgentRuntime instance associated with this manager. #### Defined in -[core/src/core/memory.ts:22](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L22) +[packages/core/src/memory.ts:22](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L22) ---- +*** ### tableName @@ -66,7 +66,7 @@ The name of the database table this manager operates on. #### Defined in -[core/src/core/memory.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L27) +[packages/core/src/memory.ts:27](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L27) ## Methods @@ -94,9 +94,9 @@ A Promise resolving to the memory object, potentially updated with an embedding #### Defined in -[core/src/core/memory.ts:45](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L45) +[packages/core/src/memory.ts:45](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L45) ---- +*** ### countMemories() @@ -126,9 +126,9 @@ A Promise resolving to the count of memories. #### Defined in -[core/src/core/memory.ts:218](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L218) +[packages/core/src/memory.ts:219](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L219) ---- +*** ### createMemory() @@ -158,9 +158,9 @@ A Promise that resolves when the operation completes. #### Defined in -[core/src/core/memory.ts:158](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L158) +[packages/core/src/memory.ts:158](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L158) ---- +*** ### getCachedEmbeddings() @@ -180,9 +180,9 @@ A Promise that resolves when the operation completes. #### Defined in -[core/src/core/memory.ts:93](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L93) +[packages/core/src/memory.ts:93](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L93) ---- +*** ### getMemories() @@ -226,9 +226,9 @@ A Promise resolving to an array of Memory objects. #### Defined in -[core/src/core/memory.ts:66](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L66) +[packages/core/src/memory.ts:66](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L66) ---- +*** ### getMemoriesByRoomIds() @@ -252,9 +252,9 @@ A Promise resolving to an array of Memory objects. #### Defined in -[core/src/core/memory.ts:172](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L172) +[packages/core/src/memory.ts:173](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L173) ---- +*** ### getMemoryById() @@ -274,9 +274,9 @@ A Promise resolving to an array of Memory objects. #### Defined in -[core/src/core/memory.ts:183](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L183) +[packages/core/src/memory.ts:184](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L184) ---- +*** ### removeAllMemories() @@ -302,9 +302,9 @@ A Promise that resolves when the operation completes. #### Defined in -[core/src/core/memory.ts:205](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L205) +[packages/core/src/memory.ts:206](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L206) ---- +*** ### removeMemory() @@ -330,9 +330,9 @@ A Promise that resolves when the operation completes. #### Defined in -[core/src/core/memory.ts:193](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L193) +[packages/core/src/memory.ts:194](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L194) ---- +*** ### searchMemoriesByEmbedding() @@ -356,7 +356,7 @@ Options including match threshold, count, user IDs, and uniqueness. The maximum number of memories to retrieve. -• **opts.match_threshold?**: `number` +• **opts.match\_threshold?**: `number` The similarity threshold for matching memories. @@ -380,4 +380,4 @@ A Promise resolving to an array of Memory objects that match the embedding. #### Defined in -[core/src/core/memory.ts:120](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L120) +[packages/core/src/memory.ts:120](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L120) diff --git a/docs/docs/api/classes/PostgresDatabaseAdapter.md b/docs/docs/api/classes/PostgresDatabaseAdapter.md deleted file mode 100644 index 23da6fff34..0000000000 --- a/docs/docs/api/classes/PostgresDatabaseAdapter.md +++ /dev/null @@ -1,1132 +0,0 @@ -# Class: PostgresDatabaseAdapter - -An abstract class representing a database adapter for managing various entities -like accounts, memories, actors, goals, and rooms. - -## Extends - -- [`DatabaseAdapter`](DatabaseAdapter.md) - -## Constructors - -### new PostgresDatabaseAdapter() - -> **new PostgresDatabaseAdapter**(`connectionConfig`): [`PostgresDatabaseAdapter`](PostgresDatabaseAdapter.md) - -#### Parameters - -• **connectionConfig**: `any` - -#### Returns - -[`PostgresDatabaseAdapter`](PostgresDatabaseAdapter.md) - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`constructor`](DatabaseAdapter.md#constructors) - -#### Defined in - -[core/src/adapters/postgres.ts:19](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L19) - -## Properties - -### db - -> **db**: `any` - -The database instance. - -#### Inherited from - -[`DatabaseAdapter`](DatabaseAdapter.md).[`db`](DatabaseAdapter.md#db) - -#### Defined in - -[core/src/core/database.ts:21](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L21) - -## Methods - -### addParticipant() - -> **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> - -Adds a user as a participant to a specific room. - -#### Parameters - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the user to add as a participant. - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room to which the user will be added. - -#### Returns - -`Promise`\<`boolean`\> - -A Promise that resolves to a boolean indicating success or failure. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`addParticipant`](DatabaseAdapter.md#addparticipant) - -#### Defined in - -[core/src/adapters/postgres.ts:681](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L681) - ---- - -### countMemories() - -> **countMemories**(`roomId`, `unique`, `tableName`): `Promise`\<`number`\> - -Counts the number of memories in a specific room. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room for which to count memories. - -• **unique**: `boolean` = `true` - -Specifies whether to count only unique memories. - -• **tableName**: `string` = `""` - -Optional table name to count memories from. - -#### Returns - -`Promise`\<`number`\> - -A Promise that resolves to the number of memories. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`countMemories`](DatabaseAdapter.md#countmemories) - -#### Defined in - -[core/src/adapters/postgres.ts:752](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L752) - ---- - -### createAccount() - -> **createAccount**(`account`): `Promise`\<`boolean`\> - -Creates a new account in the database. - -#### Parameters - -• **account**: [`Account`](../interfaces/Account.md) - -The account object to create. - -#### Returns - -`Promise`\<`boolean`\> - -A Promise that resolves when the account creation is complete. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`createAccount`](DatabaseAdapter.md#createaccount) - -#### Defined in - -[core/src/adapters/postgres.ts:186](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L186) - ---- - -### createGoal() - -> **createGoal**(`goal`): `Promise`\<`void`\> - -Creates a new goal in the database. - -#### Parameters - -• **goal**: [`Goal`](../interfaces/Goal.md) - -The goal object to create. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the goal has been created. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`createGoal`](DatabaseAdapter.md#creategoal) - -#### Defined in - -[core/src/adapters/postgres.ts:454](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L454) - ---- - -### createMemory() - -> **createMemory**(`memory`, `tableName`): `Promise`\<`void`\> - -Creates a new memory in the database. - -#### Parameters - -• **memory**: [`Memory`](../interfaces/Memory.md) - -The memory object to create. - -• **tableName**: `string` - -The table where the memory should be stored. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the memory has been created. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`createMemory`](DatabaseAdapter.md#creatememory) - -#### Defined in - -[core/src/adapters/postgres.ts:253](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L253) - ---- - -### createRelationship() - -> **createRelationship**(`params`): `Promise`\<`boolean`\> - -Creates a new relationship between two users. - -#### Parameters - -• **params** - -An object containing the UUIDs of the two users (userA and userB). - -• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<`boolean`\> - -A Promise that resolves to a boolean indicating success or failure of the creation. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`createRelationship`](DatabaseAdapter.md#createrelationship) - -#### Defined in - -[core/src/adapters/postgres.ts:505](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L505) - ---- - -### createRoom() - -> **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> - -Creates a new room with an optional specified ID. - -#### Parameters - -• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -Optional UUID to assign to the new room. - -#### Returns - -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> - -A Promise that resolves to the UUID of the created room. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`createRoom`](DatabaseAdapter.md#createroom) - -#### Defined in - -[core/src/adapters/postgres.ts:483](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L483) - ---- - -### getAccountById() - -> **getAccountById**(`userId`): `Promise`\<[`Account`](../interfaces/Account.md)\> - -Retrieves an account by its ID. - -#### Parameters - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the user account to retrieve. - -#### Returns - -`Promise`\<[`Account`](../interfaces/Account.md)\> - -A Promise that resolves to the Account object or null if not found. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getAccountById`](DatabaseAdapter.md#getaccountbyid) - -#### Defined in - -[core/src/adapters/postgres.ts:162](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L162) - ---- - -### getActorById() - -> **getActorById**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> - -#### Parameters - -• **params** - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> - -#### Defined in - -[core/src/adapters/postgres.ts:210](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L210) - ---- - -### getActorDetails() - -> **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> - -Retrieves details of actors in a given room. - -#### Parameters - -• **params** - -An object containing the roomId to search for actors. - -• **params.roomId**: `string` - -#### Returns - -`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> - -A Promise that resolves to an array of Actor objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getActorDetails`](DatabaseAdapter.md#getactordetails) - -#### Defined in - -[core/src/adapters/postgres.ts:810](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L810) - ---- - -### getCachedEmbeddings() - -> **getCachedEmbeddings**(`opts`): `Promise`\<`object`[]\> - -Retrieves cached embeddings based on the specified query parameters. - -#### Parameters - -• **opts** - -• **opts.query_field_name**: `string` - -• **opts.query_field_sub_name**: `string` - -• **opts.query_input**: `string` - -• **opts.query_match_count**: `number` - -• **opts.query_table_name**: `string` - -• **opts.query_threshold**: `number` - -#### Returns - -`Promise`\<`object`[]\> - -A Promise that resolves to an array of objects containing embeddings and levenshtein scores. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getCachedEmbeddings`](DatabaseAdapter.md#getcachedembeddings) - -#### Defined in - -[core/src/adapters/postgres.ts:559](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L559) - ---- - -### getGoals() - -> **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> - -Retrieves goals based on specified parameters. - -#### Parameters - -• **params** - -An object containing parameters for goal retrieval. - -• **params.count?**: `number` - -• **params.onlyInProgress?**: `boolean` - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> - -A Promise that resolves to an array of Goal objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getGoals`](DatabaseAdapter.md#getgoals) - -#### Defined in - -[core/src/adapters/postgres.ts:396](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L396) - ---- - -### getMemories() - -> **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Retrieves memories based on the specified parameters. - -#### Parameters - -• **params** - -An object containing parameters for the memory retrieval. - -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.count?**: `number` - -• **params.end?**: `number` - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.start?**: `number` - -• **params.tableName**: `string` - -• **params.unique?**: `boolean` - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -A Promise that resolves to an array of Memory objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemories`](DatabaseAdapter.md#getmemories) - -#### Defined in - -[core/src/adapters/postgres.ts:334](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L334) - ---- - -### getMemoriesByRoomIds() - -> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -#### Parameters - -• **params** - -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] - -• **params.tableName**: `string` - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoriesByRoomIds`](DatabaseAdapter.md#getmemoriesbyroomids) - -#### Defined in - -[core/src/adapters/postgres.ts:103](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L103) - ---- - -### getMemoryById() - -> **getMemoryById**(`id`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> - -#### Parameters - -• **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)\> - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoryById`](DatabaseAdapter.md#getmemorybyid) - -#### Defined in - -[core/src/adapters/postgres.ts:232](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L232) - ---- - -### getParticipantsForAccount() - -> **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> - -Retrieves participants associated with a specific account. - -#### Parameters - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the account. - -#### Returns - -`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> - -A Promise that resolves to an array of Participant objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForAccount`](DatabaseAdapter.md#getparticipantsforaccount) - -#### Defined in - -[core/src/adapters/postgres.ts:72](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L72) - ---- - -### getParticipantsForRoom() - -> **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -Retrieves participants for a specific room. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room for which to retrieve participants. - -#### Returns - -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -A Promise that resolves to an array of UUIDs representing the participants. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForRoom`](DatabaseAdapter.md#getparticipantsforroom) - -#### Defined in - -[core/src/adapters/postgres.ts:149](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L149) - ---- - -### getParticipantUserState() - -> **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantUserState`](DatabaseAdapter.md#getparticipantuserstate) - -#### Defined in - -[core/src/adapters/postgres.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L87) - ---- - -### getRelationship() - -> **getRelationship**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> - -Retrieves a relationship between two users if it exists. - -#### Parameters - -• **params** - -An object containing the UUIDs of the two users (userA and userB). - -• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<[`Relationship`](../interfaces/Relationship.md)\> - -A Promise that resolves to the Relationship object or null if not found. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationship`](DatabaseAdapter.md#getrelationship) - -#### Defined in - -[core/src/adapters/postgres.ts:529](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L529) - ---- - -### getRelationships() - -> **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> - -Retrieves all relationships for a specific user. - -#### Parameters - -• **params** - -An object containing the UUID of the user. - -• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> - -A Promise that resolves to an array of Relationship objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationships`](DatabaseAdapter.md#getrelationships) - -#### Defined in - -[core/src/adapters/postgres.ts:546](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L546) - ---- - -### getRoom() - -> **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> - -Retrieves the room ID for a given room, if it exists. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room to retrieve. - -#### Returns - -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> - -A Promise that resolves to the room ID or null if not found. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoom`](DatabaseAdapter.md#getroom) - -#### Defined in - -[core/src/adapters/postgres.ts:59](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L59) - ---- - -### getRoomsForParticipant() - -> **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -Retrieves room IDs for which a specific user is a participant. - -#### Parameters - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the user. - -#### Returns - -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -A Promise that resolves to an array of room IDs. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipant`](DatabaseAdapter.md#getroomsforparticipant) - -#### Defined in - -[core/src/adapters/postgres.ts:784](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L784) - ---- - -### getRoomsForParticipants() - -> **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -Retrieves room IDs for which specific users are participants. - -#### Parameters - -• **userIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] - -An array of UUIDs of the users. - -#### Returns - -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -A Promise that resolves to an array of room IDs. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipants`](DatabaseAdapter.md#getroomsforparticipants) - -#### Defined in - -[core/src/adapters/postgres.ts:797](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L797) - ---- - -### log() - -> **log**(`params`): `Promise`\<`void`\> - -Logs an event or action with the specified details. - -#### Parameters - -• **params** - -An object containing parameters for the log entry. - -• **params.body** - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.type**: `string` - -• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the log entry has been saved. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`log`](DatabaseAdapter.md#log) - -#### Defined in - -[core/src/adapters/postgres.ts:595](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L595) - ---- - -### removeAllGoals() - -> **removeAllGoals**(`roomId`): `Promise`\<`void`\> - -Removes all goals associated with a specific room. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room whose goals should be removed. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when all goals have been removed. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllGoals`](DatabaseAdapter.md#removeallgoals) - -#### Defined in - -[core/src/adapters/postgres.ts:773](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L773) - ---- - -### removeAllMemories() - -> **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> - -Removes all memories associated with a specific room. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room whose memories should be removed. - -• **tableName**: `string` - -The table from which the memories should be removed. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when all memories have been removed. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllMemories`](DatabaseAdapter.md#removeallmemories) - -#### Defined in - -[core/src/adapters/postgres.ts:740](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L740) - ---- - -### removeGoal() - -> **removeGoal**(`goalId`): `Promise`\<`void`\> - -Removes a specific goal from the database. - -#### Parameters - -• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the goal to remove. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the goal has been removed. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeGoal`](DatabaseAdapter.md#removegoal) - -#### Defined in - -[core/src/adapters/postgres.ts:474](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L474) - ---- - -### removeMemory() - -> **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> - -Removes a specific memory from the database. - -#### Parameters - -• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the memory to remove. - -• **tableName**: `string` - -The table from which the memory should be removed. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the memory has been removed. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeMemory`](DatabaseAdapter.md#removememory) - -#### Defined in - -[core/src/adapters/postgres.ts:728](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L728) - ---- - -### removeParticipant() - -> **removeParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> - -Removes a user as a participant from a specific room. - -#### Parameters - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the user to remove as a participant. - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room from which the user will be removed. - -#### Returns - -`Promise`\<`boolean`\> - -A Promise that resolves to a boolean indicating success or failure. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeParticipant`](DatabaseAdapter.md#removeparticipant) - -#### Defined in - -[core/src/adapters/postgres.ts:697](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L697) - ---- - -### removeRoom() - -> **removeRoom**(`roomId`): `Promise`\<`void`\> - -Removes a specific room from the database. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room to remove. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the room has been removed. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeRoom`](DatabaseAdapter.md#removeroom) - -#### Defined in - -[core/src/adapters/postgres.ts:496](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L496) - ---- - -### searchMemories() - -> **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Searches for memories based on embeddings and other specified parameters. - -#### Parameters - -• **params** - -An object containing parameters for the memory search. - -• **params.embedding**: `number`[] - -• **params.match_count**: `number` - -• **params.match_threshold**: `number` - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.tableName**: `string` - -• **params.unique**: `boolean` - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -A Promise that resolves to an array of Memory objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemories`](DatabaseAdapter.md#searchmemories) - -#### Defined in - -[core/src/adapters/postgres.ts:291](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L291) - ---- - -### searchMemoriesByEmbedding() - -> **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Searches for memories by embedding and other specified parameters. - -#### Parameters - -• **embedding**: `number`[] - -The embedding vector to search with. - -• **params** - -Additional parameters for the search. - -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.count?**: `number` - -• **params.match_threshold?**: `number` - -• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.tableName**: `string` - -• **params.unique?**: `boolean` - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -A Promise that resolves to an array of Memory objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemoriesByEmbedding`](DatabaseAdapter.md#searchmemoriesbyembedding) - -#### Defined in - -[core/src/adapters/postgres.ts:612](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L612) - ---- - -### setParticipantUserState() - -> **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **state**: `"FOLLOWED"` \| `"MUTED"` - -#### Returns - -`Promise`\<`void`\> - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`setParticipantUserState`](DatabaseAdapter.md#setparticipantuserstate) - -#### Defined in - -[core/src/adapters/postgres.ts:133](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L133) - ---- - -### testConnection() - -> **testConnection**(): `Promise`\<`boolean`\> - -#### Returns - -`Promise`\<`boolean`\> - -#### Defined in - -[core/src/adapters/postgres.ts:37](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L37) - ---- - -### updateGoal() - -> **updateGoal**(`goal`): `Promise`\<`void`\> - -Updates a specific goal in the database. - -#### Parameters - -• **goal**: [`Goal`](../interfaces/Goal.md) - -The goal object with updated properties. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the goal has been updated. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoal`](DatabaseAdapter.md#updategoal) - -#### Defined in - -[core/src/adapters/postgres.ts:437](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L437) - ---- - -### updateGoalStatus() - -> **updateGoalStatus**(`params`): `Promise`\<`void`\> - -Updates the status of a specific goal. - -#### Parameters - -• **params** - -An object containing the goalId and the new status. - -• **params.goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.status**: [`GoalStatus`](../enumerations/GoalStatus.md) - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the goal status has been updated. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoalStatus`](DatabaseAdapter.md#updategoalstatus) - -#### Defined in - -[core/src/adapters/postgres.ts:713](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/postgres.ts#L713) diff --git a/docs/docs/api/classes/Service.md b/docs/docs/api/classes/Service.md new file mode 100644 index 0000000000..65b5088e8a --- /dev/null +++ b/docs/docs/api/classes/Service.md @@ -0,0 +1,49 @@ +# Class: `abstract` Service + +## Extended by + +- [`IImageDescriptionService`](../interfaces/IImageDescriptionService.md) +- [`ITranscriptionService`](../interfaces/ITranscriptionService.md) +- [`IVideoService`](../interfaces/IVideoService.md) +- [`ITextGenerationService`](../interfaces/ITextGenerationService.md) +- [`IBrowserService`](../interfaces/IBrowserService.md) +- [`ISpeechService`](../interfaces/ISpeechService.md) +- [`IPdfService`](../interfaces/IPdfService.md) + +## Constructors + +### new Service() + +> **new Service**(): [`Service`](Service.md) + +#### Returns + +[`Service`](Service.md) + +## Properties + +### serviceType + +> `static` **serviceType**: [`ServiceType`](../enumerations/ServiceType.md) + +#### Defined in + +[packages/core/src/types.ts:507](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L507) + +## Methods + +### getInstance() + +> `static` **getInstance**\<`T`\>(): `T` + +#### Type Parameters + +• **T** *extends* [`Service`](Service.md) + +#### Returns + +`T` + +#### Defined in + +[packages/core/src/types.ts:509](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L509) diff --git a/docs/docs/api/classes/SqliteDatabaseAdapter.md b/docs/docs/api/classes/SqliteDatabaseAdapter.md deleted file mode 100644 index 0abba7df7f..0000000000 --- a/docs/docs/api/classes/SqliteDatabaseAdapter.md +++ /dev/null @@ -1,1100 +0,0 @@ -# Class: SqliteDatabaseAdapter - -An abstract class representing a database adapter for managing various entities -like accounts, memories, actors, goals, and rooms. - -## Extends - -- [`DatabaseAdapter`](DatabaseAdapter.md) - -## Constructors - -### new SqliteDatabaseAdapter() - -> **new SqliteDatabaseAdapter**(`db`): [`SqliteDatabaseAdapter`](SqliteDatabaseAdapter.md) - -#### Parameters - -• **db**: `Database` - -#### Returns - -[`SqliteDatabaseAdapter`](SqliteDatabaseAdapter.md) - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`constructor`](DatabaseAdapter.md#constructors) - -#### Defined in - -[core/src/adapters/sqlite.ts:70](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L70) - -## Properties - -### db - -> **db**: `any` - -The database instance. - -#### Inherited from - -[`DatabaseAdapter`](DatabaseAdapter.md).[`db`](DatabaseAdapter.md#db) - -#### Defined in - -[core/src/core/database.ts:21](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/database.ts#L21) - -## Methods - -### addParticipant() - -> **addParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> - -Adds a user as a participant to a specific room. - -#### Parameters - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the user to add as a participant. - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room to which the user will be added. - -#### Returns - -`Promise`\<`boolean`\> - -A Promise that resolves to a boolean indicating success or failure. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`addParticipant`](DatabaseAdapter.md#addparticipant) - -#### Defined in - -[core/src/adapters/sqlite.ts:592](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L592) - ---- - -### countMemories() - -> **countMemories**(`roomId`, `unique`, `tableName`): `Promise`\<`number`\> - -Counts the number of memories in a specific room. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room for which to count memories. - -• **unique**: `boolean` = `true` - -Specifies whether to count only unique memories. - -• **tableName**: `string` = `""` - -Optional table name to count memories from. - -#### Returns - -`Promise`\<`number`\> - -A Promise that resolves to the number of memories. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`countMemories`](DatabaseAdapter.md#countmemories) - -#### Defined in - -[core/src/adapters/sqlite.ts:465](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L465) - ---- - -### createAccount() - -> **createAccount**(`account`): `Promise`\<`boolean`\> - -Creates a new account in the database. - -#### Parameters - -• **account**: [`Account`](../interfaces/Account.md) - -The account object to create. - -#### Returns - -`Promise`\<`boolean`\> - -A Promise that resolves when the account creation is complete. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`createAccount`](DatabaseAdapter.md#createaccount) - -#### Defined in - -[core/src/adapters/sqlite.ts:102](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L102) - ---- - -### createGoal() - -> **createGoal**(`goal`): `Promise`\<`void`\> - -Creates a new goal in the database. - -#### Parameters - -• **goal**: [`Goal`](../interfaces/Goal.md) - -The goal object to create. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the goal has been created. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`createGoal`](DatabaseAdapter.md#creategoal) - -#### Defined in - -[core/src/adapters/sqlite.ts:532](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L532) - ---- - -### createMemory() - -> **createMemory**(`memory`, `tableName`): `Promise`\<`void`\> - -Creates a new memory in the database. - -#### Parameters - -• **memory**: [`Memory`](../interfaces/Memory.md) - -The memory object to create. - -• **tableName**: `string` - -The table where the memory should be stored. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the memory has been created. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`createMemory`](DatabaseAdapter.md#creatememory) - -#### Defined in - -[core/src/adapters/sqlite.ts:196](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L196) - ---- - -### createRelationship() - -> **createRelationship**(`params`): `Promise`\<`boolean`\> - -Creates a new relationship between two users. - -#### Parameters - -• **params** - -An object containing the UUIDs of the two users (userA and userB). - -• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<`boolean`\> - -A Promise that resolves to a boolean indicating success or failure of the creation. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`createRelationship`](DatabaseAdapter.md#createrelationship) - -#### Defined in - -[core/src/adapters/sqlite.ts:616](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L616) - ---- - -### createRoom() - -> **createRoom**(`roomId`?): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> - -Creates a new room with an optional specified ID. - -#### Parameters - -• **roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -Optional UUID to assign to the new room. - -#### Returns - -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> - -A Promise that resolves to the UUID of the created room. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`createRoom`](DatabaseAdapter.md#createroom) - -#### Defined in - -[core/src/adapters/sqlite.ts:557](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L557) - ---- - -### getAccountById() - -> **getAccountById**(`userId`): `Promise`\<[`Account`](../interfaces/Account.md)\> - -Retrieves an account by its ID. - -#### Parameters - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the user account to retrieve. - -#### Returns - -`Promise`\<[`Account`](../interfaces/Account.md)\> - -A Promise that resolves to the Account object or null if not found. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getAccountById`](DatabaseAdapter.md#getaccountbyid) - -#### Defined in - -[core/src/adapters/sqlite.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L88) - ---- - -### getActorDetails() - -> **getActorDetails**(`params`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> - -Retrieves details of actors in a given room. - -#### Parameters - -• **params** - -An object containing the roomId to search for actors. - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<[`Actor`](../interfaces/Actor.md)[]\> - -A Promise that resolves to an array of Actor objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getActorDetails`](DatabaseAdapter.md#getactordetails) - -#### Defined in - -[core/src/adapters/sqlite.ts:123](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L123) - ---- - -### getCachedEmbeddings() - -> **getCachedEmbeddings**(`opts`): `Promise`\<`object`[]\> - -Retrieves cached embeddings based on the specified query parameters. - -#### Parameters - -• **opts** - -• **opts.query_field_name**: `string` - -• **opts.query_field_sub_name**: `string` - -• **opts.query_input**: `string` - -• **opts.query_match_count**: `number` - -• **opts.query_table_name**: `string` - -• **opts.query_threshold**: `number` - -#### Returns - -`Promise`\<`object`[]\> - -A Promise that resolves to an array of objects containing embeddings and levenshtein scores. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getCachedEmbeddings`](DatabaseAdapter.md#getcachedembeddings) - -#### Defined in - -[core/src/adapters/sqlite.ts:336](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L336) - ---- - -### getGoals() - -> **getGoals**(`params`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> - -Retrieves goals based on specified parameters. - -#### Parameters - -• **params** - -An object containing parameters for goal retrieval. - -• **params.count?**: `number` - -• **params.onlyInProgress?**: `boolean` - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<[`Goal`](../interfaces/Goal.md)[]\> - -A Promise that resolves to an array of Goal objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getGoals`](DatabaseAdapter.md#getgoals) - -#### Defined in - -[core/src/adapters/sqlite.ts:485](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L485) - ---- - -### getMemories() - -> **getMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Retrieves memories based on the specified parameters. - -#### Parameters - -• **params** - -An object containing parameters for the memory retrieval. - -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.count?**: `number` - -• **params.end?**: `number` - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.start?**: `number` - -• **params.tableName**: `string` - -• **params.unique?**: `boolean` - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -A Promise that resolves to an array of Memory objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemories`](DatabaseAdapter.md#getmemories) - -#### Defined in - -[core/src/adapters/sqlite.ts:398](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L398) - ---- - -### getMemoriesByRoomIds() - -> **getMemoriesByRoomIds**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -#### Parameters - -• **params** - -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.roomIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] - -• **params.tableName**: `string` - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoriesByRoomIds`](DatabaseAdapter.md#getmemoriesbyroomids) - -#### Defined in - -[core/src/adapters/sqlite.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L150) - ---- - -### getMemoryById() - -> **getMemoryById**(`memoryId`): `Promise`\<[`Memory`](../interfaces/Memory.md)\> - -#### Parameters - -• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)\> - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getMemoryById`](DatabaseAdapter.md#getmemorybyid) - -#### Defined in - -[core/src/adapters/sqlite.ts:180](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L180) - ---- - -### getParticipantsForAccount() - -> **getParticipantsForAccount**(`userId`): `Promise`\<[`Participant`](../interfaces/Participant.md)[]\> - -Retrieves participants associated with a specific account. - -#### Parameters - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the account. - -#### Returns - -`Promise`\<[`Participant`](../interfaces/Participant.md)[]\> - -A Promise that resolves to an array of Participant objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForAccount`](DatabaseAdapter.md#getparticipantsforaccount) - -#### Defined in - -[core/src/adapters/sqlite.ts:30](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L30) - ---- - -### getParticipantsForRoom() - -> **getParticipantsForRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -Retrieves participants for a specific room. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room for which to retrieve participants. - -#### Returns - -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -A Promise that resolves to an array of UUIDs representing the participants. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantsForRoom`](DatabaseAdapter.md#getparticipantsforroom) - -#### Defined in - -[core/src/adapters/sqlite.ts:40](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L40) - ---- - -### getParticipantUserState() - -> **getParticipantUserState**(`roomId`, `userId`): `Promise`\<`"FOLLOWED"` \| `"MUTED"`\> - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<`"FOLLOWED"` \| `"MUTED"`\> - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getParticipantUserState`](DatabaseAdapter.md#getparticipantuserstate) - -#### Defined in - -[core/src/adapters/sqlite.ts:46](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L46) - ---- - -### getRelationship() - -> **getRelationship**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> - -Retrieves a relationship between two users if it exists. - -#### Parameters - -• **params** - -An object containing the UUIDs of the two users (userA and userB). - -• **params.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<[`Relationship`](../interfaces/Relationship.md)\> - -A Promise that resolves to the Relationship object or null if not found. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationship`](DatabaseAdapter.md#getrelationship) - -#### Defined in - -[core/src/adapters/sqlite.ts:631](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L631) - ---- - -### getRelationships() - -> **getRelationships**(`params`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> - -Retrieves all relationships for a specific user. - -#### Parameters - -• **params** - -An object containing the UUID of the user. - -• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> - -A Promise that resolves to an array of Relationship objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRelationships`](DatabaseAdapter.md#getrelationships) - -#### Defined in - -[core/src/adapters/sqlite.ts:649](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L649) - ---- - -### getRoom() - -> **getRoom**(`roomId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> - -Retrieves the room ID for a given room, if it exists. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room to retrieve. - -#### Returns - -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`\> - -A Promise that resolves to the room ID or null if not found. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoom`](DatabaseAdapter.md#getroom) - -#### Defined in - -[core/src/adapters/sqlite.ts:22](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L22) - ---- - -### getRoomsForParticipant() - -> **getRoomsForParticipant**(`userId`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -Retrieves room IDs for which a specific user is a participant. - -#### Parameters - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the user. - -#### Returns - -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -A Promise that resolves to an array of room IDs. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipant`](DatabaseAdapter.md#getroomsforparticipant) - -#### Defined in - -[core/src/adapters/sqlite.ts:573](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L573) - ---- - -### getRoomsForParticipants() - -> **getRoomsForParticipants**(`userIds`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -Retrieves room IDs for which specific users are participants. - -#### Parameters - -• **userIds**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[] - -An array of UUIDs of the users. - -#### Returns - -`Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> - -A Promise that resolves to an array of room IDs. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`getRoomsForParticipants`](DatabaseAdapter.md#getroomsforparticipants) - -#### Defined in - -[core/src/adapters/sqlite.ts:579](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L579) - ---- - -### log() - -> **log**(`params`): `Promise`\<`void`\> - -Logs an event or action with the specified details. - -#### Parameters - -• **params** - -An object containing parameters for the log entry. - -• **params.body** - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.type**: `string` - -• **params.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the log entry has been saved. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`log`](DatabaseAdapter.md#log) - -#### Defined in - -[core/src/adapters/sqlite.ts:380](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L380) - ---- - -### removeAllGoals() - -> **removeAllGoals**(`roomId`): `Promise`\<`void`\> - -Removes all goals associated with a specific room. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room whose goals should be removed. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when all goals have been removed. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllGoals`](DatabaseAdapter.md#removeallgoals) - -#### Defined in - -[core/src/adapters/sqlite.ts:552](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L552) - ---- - -### removeAllMemories() - -> **removeAllMemories**(`roomId`, `tableName`): `Promise`\<`void`\> - -Removes all memories associated with a specific room. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room whose memories should be removed. - -• **tableName**: `string` - -The table from which the memories should be removed. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when all memories have been removed. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeAllMemories`](DatabaseAdapter.md#removeallmemories) - -#### Defined in - -[core/src/adapters/sqlite.ts:460](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L460) - ---- - -### removeGoal() - -> **removeGoal**(`goalId`): `Promise`\<`void`\> - -Removes a specific goal from the database. - -#### Parameters - -• **goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the goal to remove. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the goal has been removed. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeGoal`](DatabaseAdapter.md#removegoal) - -#### Defined in - -[core/src/adapters/sqlite.ts:547](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L547) - ---- - -### removeMemory() - -> **removeMemory**(`memoryId`, `tableName`): `Promise`\<`void`\> - -Removes a specific memory from the database. - -#### Parameters - -• **memoryId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the memory to remove. - -• **tableName**: `string` - -The table from which the memory should be removed. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the memory has been removed. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeMemory`](DatabaseAdapter.md#removememory) - -#### Defined in - -[core/src/adapters/sqlite.ts:455](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L455) - ---- - -### removeParticipant() - -> **removeParticipant**(`userId`, `roomId`): `Promise`\<`boolean`\> - -Removes a user as a participant from a specific room. - -#### Parameters - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the user to remove as a participant. - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room from which the user will be removed. - -#### Returns - -`Promise`\<`boolean`\> - -A Promise that resolves to a boolean indicating success or failure. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeParticipant`](DatabaseAdapter.md#removeparticipant) - -#### Defined in - -[core/src/adapters/sqlite.ts:604](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L604) - ---- - -### removeRoom() - -> **removeRoom**(`roomId`): `Promise`\<`void`\> - -Removes a specific room from the database. - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -The UUID of the room to remove. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the room has been removed. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`removeRoom`](DatabaseAdapter.md#removeroom) - -#### Defined in - -[core/src/adapters/sqlite.ts:568](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L568) - ---- - -### searchMemories() - -> **searchMemories**(`params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Searches for memories based on embeddings and other specified parameters. - -#### Parameters - -• **params** - -An object containing parameters for the memory search. - -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.embedding**: `number`[] - -• **params.match_count**: `number` - -• **params.match_threshold**: `number` - -• **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.tableName**: `string` - -• **params.unique**: `boolean` - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -A Promise that resolves to an array of Memory objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemories`](DatabaseAdapter.md#searchmemories) - -#### Defined in - -[core/src/adapters/sqlite.ts:236](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L236) - ---- - -### searchMemoriesByEmbedding() - -> **searchMemoriesByEmbedding**(`embedding`, `params`): `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -Searches for memories by embedding and other specified parameters. - -#### Parameters - -• **embedding**: `number`[] - -The embedding vector to search with. - -• **params** - -Additional parameters for the search. - -• **params.agentId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.count?**: `number` - -• **params.match_threshold?**: `number` - -• **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.tableName**: `string` - -• **params.unique?**: `boolean` - -#### Returns - -`Promise`\<[`Memory`](../interfaces/Memory.md)[]\> - -A Promise that resolves to an array of Memory objects. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`searchMemoriesByEmbedding`](DatabaseAdapter.md#searchmemoriesbyembedding) - -#### Defined in - -[core/src/adapters/sqlite.ts:282](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L282) - ---- - -### setParticipantUserState() - -> **setParticipantUserState**(`roomId`, `userId`, `state`): `Promise`\<`void`\> - -#### Parameters - -• **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **state**: `"FOLLOWED"` \| `"MUTED"` - -#### Returns - -`Promise`\<`void`\> - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`setParticipantUserState`](DatabaseAdapter.md#setparticipantuserstate) - -#### Defined in - -[core/src/adapters/sqlite.ts:59](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L59) - ---- - -### updateGoal() - -> **updateGoal**(`goal`): `Promise`\<`void`\> - -Updates a specific goal in the database. - -#### Parameters - -• **goal**: [`Goal`](../interfaces/Goal.md) - -The goal object with updated properties. - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the goal has been updated. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoal`](DatabaseAdapter.md#updategoal) - -#### Defined in - -[core/src/adapters/sqlite.ts:519](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L519) - ---- - -### updateGoalStatus() - -> **updateGoalStatus**(`params`): `Promise`\<`void`\> - -Updates the status of a specific goal. - -#### Parameters - -• **params** - -An object containing the goalId and the new status. - -• **params.goalId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -• **params.status**: [`GoalStatus`](../enumerations/GoalStatus.md) - -#### Returns - -`Promise`\<`void`\> - -A Promise that resolves when the goal status has been updated. - -#### Overrides - -[`DatabaseAdapter`](DatabaseAdapter.md).[`updateGoalStatus`](DatabaseAdapter.md#updategoalstatus) - -#### Defined in - -[core/src/adapters/sqlite.ts:372](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/adapters/sqlite.ts#L372) diff --git a/docs/docs/api/classes/TelegramClient.md b/docs/docs/api/classes/TelegramClient.md deleted file mode 100644 index 6f29127555..0000000000 --- a/docs/docs/api/classes/TelegramClient.md +++ /dev/null @@ -1,49 +0,0 @@ -# Class: TelegramClient - -## Constructors - -### new TelegramClient() - -> **new TelegramClient**(`runtime`, `botToken`): [`TelegramClient`](TelegramClient.md) - -#### Parameters - -• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -• **botToken**: `string` - -#### Returns - -[`TelegramClient`](TelegramClient.md) - -#### Defined in - -[core/src/clients/telegram/src/index.ts:12](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/telegram/src/index.ts#L12) - -## Methods - -### start() - -> **start**(): `Promise`\<`void`\> - -#### Returns - -`Promise`\<`void`\> - -#### Defined in - -[core/src/clients/telegram/src/index.ts:54](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/telegram/src/index.ts#L54) - ---- - -### stop() - -> **stop**(): `Promise`\<`void`\> - -#### Returns - -`Promise`\<`void`\> - -#### Defined in - -[core/src/clients/telegram/src/index.ts:91](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/telegram/src/index.ts#L91) diff --git a/docs/docs/api/classes/TokenProvider.md b/docs/docs/api/classes/TokenProvider.md deleted file mode 100644 index 0e0fb8d77e..0000000000 --- a/docs/docs/api/classes/TokenProvider.md +++ /dev/null @@ -1,193 +0,0 @@ -# Class: TokenProvider - -## Constructors - -### new TokenProvider() - -> **new TokenProvider**(`tokenAddress`): [`TokenProvider`](TokenProvider.md) - -#### Parameters - -• **tokenAddress**: `string` - -#### Returns - -[`TokenProvider`](TokenProvider.md) - -#### Defined in - -[core/src/providers/token.ts:38](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L38) - -## Methods - -### analyzeHolderDistribution() - -> **analyzeHolderDistribution**(`tradeData`): `Promise`\<`string`\> - -#### Parameters - -• **tradeData**: `TokenTradeData` - -#### Returns - -`Promise`\<`string`\> - -#### Defined in - -[core/src/providers/token.ts:461](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L461) - ---- - -### checkRecentTrades() - -> **checkRecentTrades**(`tradeData`): `Promise`\<`boolean`\> - -#### Parameters - -• **tradeData**: `TokenTradeData` - -#### Returns - -`Promise`\<`boolean`\> - -#### Defined in - -[core/src/providers/token.ts:631](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L631) - ---- - -### countHighSupplyHolders() - -> **countHighSupplyHolders**(`securityData`): `Promise`\<`number`\> - -#### Parameters - -• **securityData**: `TokenSecurityData` - -#### Returns - -`Promise`\<`number`\> - -#### Defined in - -[core/src/providers/token.ts:635](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L635) - ---- - -### fetchDexScreenerData() - -> **fetchDexScreenerData**(): `Promise`\<`DexScreenerData`\> - -#### Returns - -`Promise`\<`DexScreenerData`\> - -#### Defined in - -[core/src/providers/token.ts:420](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L420) - ---- - -### fetchHolderList() - -> **fetchHolderList**(): `Promise`\<`HolderData`[]\> - -#### Returns - -`Promise`\<`HolderData`[]\> - -#### Defined in - -[core/src/providers/token.ts:507](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L507) - ---- - -### fetchTokenSecurity() - -> **fetchTokenSecurity**(): `Promise`\<`TokenSecurityData`\> - -#### Returns - -`Promise`\<`TokenSecurityData`\> - -#### Defined in - -[core/src/providers/token.ts:155](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L155) - ---- - -### fetchTokenTradeData() - -> **fetchTokenTradeData**(): `Promise`\<`TokenTradeData`\> - -#### Returns - -`Promise`\<`TokenTradeData`\> - -#### Defined in - -[core/src/providers/token.ts:185](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L185) - ---- - -### filterHighValueHolders() - -> **filterHighValueHolders**(`tradeData`): `Promise`\<`object`[]\> - -#### Parameters - -• **tradeData**: `TokenTradeData` - -#### Returns - -`Promise`\<`object`[]\> - -#### Defined in - -[core/src/providers/token.ts:607](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L607) - ---- - -### formatTokenData() - -> **formatTokenData**(`data`): `string` - -#### Parameters - -• **data**: `ProcessedTokenData` - -#### Returns - -`string` - -#### Defined in - -[core/src/providers/token.ts:722](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L722) - ---- - -### getFormattedTokenReport() - -> **getFormattedTokenReport**(): `Promise`\<`string`\> - -#### Returns - -`Promise`\<`string`\> - -#### Defined in - -[core/src/providers/token.ts:786](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L786) - ---- - -### getProcessedTokenData() - -> **getProcessedTokenData**(): `Promise`\<`ProcessedTokenData`\> - -#### Returns - -`Promise`\<`ProcessedTokenData`\> - -#### Defined in - -[core/src/providers/token.ts:656](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L656) diff --git a/docs/docs/api/classes/TwitterInteractionClient.md b/docs/docs/api/classes/TwitterInteractionClient.md deleted file mode 100644 index 7b06e7039e..0000000000 --- a/docs/docs/api/classes/TwitterInteractionClient.md +++ /dev/null @@ -1,1798 +0,0 @@ -# Class: TwitterInteractionClient - -## Extends - -- `ClientBase` - -## Constructors - -### new TwitterInteractionClient() - -> **new TwitterInteractionClient**(`runtime`): [`TwitterInteractionClient`](TwitterInteractionClient.md) - -#### Parameters - -• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -#### Returns - -[`TwitterInteractionClient`](TwitterInteractionClient.md) - -#### Overrides - -`ClientBase.constructor` - -#### Defined in - -[core/src/clients/twitter/interactions.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/interactions.ts#L87) - -## Properties - -### callback() - -> **callback**: (`self`) => `any` = `null` - -#### Parameters - -• **self**: `ClientBase` - -#### Returns - -`any` - -#### Inherited from - -`ClientBase.callback` - -#### Defined in - -[core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L150) - ---- - -### directions - -> **directions**: `string` - -#### Inherited from - -`ClientBase.directions` - -#### Defined in - -[core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L89) - ---- - -### imageDescriptionService - -> **imageDescriptionService**: `ImageDescriptionService` - -#### Inherited from - -`ClientBase.imageDescriptionService` - -#### Defined in - -[core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L92) - ---- - -### lastCheckedTweetId - -> **lastCheckedTweetId**: `number` = `null` - -#### Inherited from - -`ClientBase.lastCheckedTweetId` - -#### Defined in - -[core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L90) - ---- - -### requestQueue - -> **requestQueue**: `RequestQueue` - -#### Inherited from - -`ClientBase.requestQueue` - -#### Defined in - -[core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L96) - ---- - -### runtime - -> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -#### Inherited from - -`ClientBase.runtime` - -#### Defined in - -[core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L88) - ---- - -### temperature - -> **temperature**: `number` = `0.5` - -#### Inherited from - -`ClientBase.temperature` - -#### Defined in - -[core/src/clients/twitter/base.ts:93](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L93) - ---- - -### tweetCacheFilePath - -> **tweetCacheFilePath**: `string` = `"tweetcache/latest_checked_tweet_id.txt"` - -#### Inherited from - -`ClientBase.tweetCacheFilePath` - -#### Defined in - -[core/src/clients/twitter/base.ts:91](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L91) - ---- - -### twitterClient - -> **twitterClient**: `Scraper` - -#### Inherited from - -`ClientBase.twitterClient` - -#### Defined in - -[core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L87) - ---- - -### twitterUserId - -> **twitterUserId**: `string` - -#### Inherited from - -`ClientBase.twitterUserId` - -#### Defined in - -[core/src/clients/twitter/base.ts:97](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L97) - ---- - -### \_twitterClient - -> `static` **\_twitterClient**: `Scraper` - -#### Inherited from - -`ClientBase._twitterClient` - -#### Defined in - -[core/src/clients/twitter/base.ts:86](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L86) - ---- - -### captureRejections - -> `static` **captureRejections**: `boolean` - -Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - -Change the default `captureRejections` option on all new `EventEmitter` objects. - -#### Since - -v13.4.0, v12.16.0 - -#### Inherited from - -`ClientBase.captureRejections` - -#### Defined in - -node_modules/@types/node/events.d.ts:459 - ---- - -### captureRejectionSymbol - -> `readonly` `static` **captureRejectionSymbol**: _typeof_ [`captureRejectionSymbol`](TwitterPostClient.md#capturerejectionsymbol) - -Value: `Symbol.for('nodejs.rejection')` - -See how to write a custom `rejection handler`. - -#### Since - -v13.4.0, v12.16.0 - -#### Inherited from - -`ClientBase.captureRejectionSymbol` - -#### Defined in - -node_modules/@types/node/events.d.ts:452 - ---- - -### defaultMaxListeners - -> `static` **defaultMaxListeners**: `number` - -By default, a maximum of `10` listeners can be registered for any single -event. This limit can be changed for individual `EventEmitter` instances -using the `emitter.setMaxListeners(n)` method. To change the default -for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property -can be used. If this value is not a positive number, a `RangeError` is thrown. - -Take caution when setting the `events.defaultMaxListeners` because the -change affects _all_ `EventEmitter` instances, including those created before -the change is made. However, calling `emitter.setMaxListeners(n)` still has -precedence over `events.defaultMaxListeners`. - -This is not a hard limit. The `EventEmitter` instance will allow -more listeners to be added but will output a trace warning to stderr indicating -that a "possible EventEmitter memory leak" has been detected. For any single -`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to -temporarily avoid this warning: - -```js -import { EventEmitter } from "node:events"; -const emitter = new EventEmitter(); -emitter.setMaxListeners(emitter.getMaxListeners() + 1); -emitter.once("event", () => { - // do stuff - emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); -}); -``` - -The `--trace-warnings` command-line flag can be used to display the -stack trace for such warnings. - -The emitted warning can be inspected with `process.on('warning')` and will -have the additional `emitter`, `type`, and `count` properties, referring to -the event emitter instance, the event's name and the number of attached -listeners, respectively. -Its `name` property is set to `'MaxListenersExceededWarning'`. - -#### Since - -v0.11.2 - -#### Inherited from - -`ClientBase.defaultMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:498 - ---- - -### errorMonitor - -> `readonly` `static` **errorMonitor**: _typeof_ [`errorMonitor`](TwitterPostClient.md#errormonitor) - -This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. - -Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no -regular `'error'` listener is installed. - -#### Since - -v13.6.0, v12.17.0 - -#### Inherited from - -`ClientBase.errorMonitor` - -#### Defined in - -node_modules/@types/node/events.d.ts:445 - -## Methods - -### \[captureRejectionSymbol\]()? - -> `optional` **\[captureRejectionSymbol\]**\<`K`\>(`error`, `event`, ...`args`): `void` - -#### Type Parameters - -• **K** - -#### Parameters - -• **error**: `Error` - -• **event**: `string` \| `symbol` - -• ...**args**: `AnyRest` - -#### Returns - -`void` - -#### Inherited from - -`ClientBase.[captureRejectionSymbol]` - -#### Defined in - -node_modules/@types/node/events.d.ts:136 - ---- - -### addListener() - -> **addListener**\<`K`\>(`eventName`, `listener`): `this` - -Alias for `emitter.on(eventName, listener)`. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.addListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:597 - ---- - -### cacheTweet() - -> **cacheTweet**(`tweet`): `Promise`\<`void`\> - -#### Parameters - -• **tweet**: `Tweet` - -#### Returns - -`Promise`\<`void`\> - -#### Inherited from - -`ClientBase.cacheTweet` - -#### Defined in - -[core/src/clients/twitter/base.ts:99](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L99) - ---- - -### emit() - -> **emit**\<`K`\>(`eventName`, ...`args`): `boolean` - -Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments -to each. - -Returns `true` if the event had listeners, `false` otherwise. - -```js -import { EventEmitter } from "node:events"; -const myEmitter = new EventEmitter(); - -// First listener -myEmitter.on("event", function firstListener() { - console.log("Helloooo! first listener"); -}); -// Second listener -myEmitter.on("event", function secondListener(arg1, arg2) { - console.log(`event with parameters ${arg1}, ${arg2} in second listener`); -}); -// Third listener -myEmitter.on("event", function thirdListener(...args) { - const parameters = args.join(", "); - console.log(`event with parameters ${parameters} in third listener`); -}); - -console.log(myEmitter.listeners("event")); - -myEmitter.emit("event", 1, 2, 3, 4, 5); - -// Prints: -// [ -// [Function: firstListener], -// [Function: secondListener], -// [Function: thirdListener] -// ] -// Helloooo! first listener -// event with parameters 1, 2 in second listener -// event with parameters 1, 2, 3, 4, 5 in third listener -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• ...**args**: `AnyRest` - -#### Returns - -`boolean` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.emit` - -#### Defined in - -node_modules/@types/node/events.d.ts:859 - ---- - -### eventNames() - -> **eventNames**(): (`string` \| `symbol`)[] - -Returns an array listing the events for which the emitter has registered -listeners. The values in the array are strings or `Symbol`s. - -```js -import { EventEmitter } from "node:events"; - -const myEE = new EventEmitter(); -myEE.on("foo", () => {}); -myEE.on("bar", () => {}); - -const sym = Symbol("symbol"); -myEE.on(sym, () => {}); - -console.log(myEE.eventNames()); -// Prints: [ 'foo', 'bar', Symbol(symbol) ] -``` - -#### Returns - -(`string` \| `symbol`)[] - -#### Since - -v6.0.0 - -#### Inherited from - -`ClientBase.eventNames` - -#### Defined in - -node_modules/@types/node/events.d.ts:922 - ---- - -### fetchHomeTimeline() - -> **fetchHomeTimeline**(`count`): `Promise`\<`Tweet`[]\> - -#### Parameters - -• **count**: `number` - -#### Returns - -`Promise`\<`Tweet`[]\> - -#### Inherited from - -`ClientBase.fetchHomeTimeline` - -#### Defined in - -[core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L278) - ---- - -### fetchSearchTweets() - -> **fetchSearchTweets**(`query`, `maxTweets`, `searchMode`, `cursor`?): `Promise`\<`QueryTweetsResponse`\> - -#### Parameters - -• **query**: `string` - -• **maxTweets**: `number` - -• **searchMode**: `SearchMode` - -• **cursor?**: `string` - -#### Returns - -`Promise`\<`QueryTweetsResponse`\> - -#### Inherited from - -`ClientBase.fetchSearchTweets` - -#### Defined in - -[core/src/clients/twitter/base.ts:330](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L330) - ---- - -### getCachedTweet() - -> **getCachedTweet**(`tweetId`): `Promise`\<`Tweet`\> - -#### Parameters - -• **tweetId**: `string` - -#### Returns - -`Promise`\<`Tweet`\> - -#### Inherited from - -`ClientBase.getCachedTweet` - -#### Defined in - -[core/src/clients/twitter/base.ts:115](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L115) - ---- - -### getMaxListeners() - -> **getMaxListeners**(): `number` - -Returns the current max listener value for the `EventEmitter` which is either -set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](TwitterInteractionClient.md#defaultmaxlisteners). - -#### Returns - -`number` - -#### Since - -v1.0.0 - -#### Inherited from - -`ClientBase.getMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:774 - ---- - -### getTweet() - -> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> - -#### Parameters - -• **tweetId**: `string` - -#### Returns - -`Promise`\<`Tweet`\> - -#### Inherited from - -`ClientBase.getTweet` - -#### Defined in - -[core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L137) - ---- - -### handleTwitterInteractions() - -> **handleTwitterInteractions**(): `Promise`\<`void`\> - -#### Returns - -`Promise`\<`void`\> - -#### Defined in - -[core/src/clients/twitter/interactions.ts:93](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/interactions.ts#L93) - ---- - -### listenerCount() - -> **listenerCount**\<`K`\>(`eventName`, `listener`?): `number` - -Returns the number of listeners listening for the event named `eventName`. -If `listener` is provided, it will return how many times the listener is found -in the list of the listeners of the event. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event being listened for - -• **listener?**: `Function` - -The event handler function - -#### Returns - -`number` - -#### Since - -v3.2.0 - -#### Inherited from - -`ClientBase.listenerCount` - -#### Defined in - -node_modules/@types/node/events.d.ts:868 - ---- - -### listeners() - -> **listeners**\<`K`\>(`eventName`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`. - -```js -server.on("connection", (stream) => { - console.log("someone connected!"); -}); -console.log(util.inspect(server.listeners("connection"))); -// Prints: [ [Function] ] -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.listeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:787 - ---- - -### off() - -> **off**\<`K`\>(`eventName`, `listener`): `this` - -Alias for `emitter.removeListener()`. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v10.0.0 - -#### Inherited from - -`ClientBase.off` - -#### Defined in - -node_modules/@types/node/events.d.ts:747 - ---- - -### on() - -> **on**\<`K`\>(`eventName`, `listener`): `this` - -Adds the `listener` function to the end of the listeners array for the event -named `eventName`. No checks are made to see if the `listener` has already -been added. Multiple calls passing the same combination of `eventName` and -`listener` will result in the `listener` being added, and called, multiple times. - -```js -server.on("connection", (stream) => { - console.log("someone connected!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the -event listener to the beginning of the listeners array. - -```js -import { EventEmitter } from "node:events"; -const myEE = new EventEmitter(); -myEE.on("foo", () => console.log("a")); -myEE.prependListener("foo", () => console.log("b")); -myEE.emit("foo"); -// Prints: -// b -// a -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v0.1.101 - -#### Inherited from - -`ClientBase.on` - -#### Defined in - -node_modules/@types/node/events.d.ts:629 - ---- - -### once() - -> **once**\<`K`\>(`eventName`, `listener`): `this` - -Adds a **one-time** `listener` function for the event named `eventName`. The -next time `eventName` is triggered, this listener is removed and then invoked. - -```js -server.once("connection", (stream) => { - console.log("Ah, we have our first user!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the -event listener to the beginning of the listeners array. - -```js -import { EventEmitter } from "node:events"; -const myEE = new EventEmitter(); -myEE.once("foo", () => console.log("a")); -myEE.prependOnceListener("foo", () => console.log("b")); -myEE.emit("foo"); -// Prints: -// b -// a -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v0.3.0 - -#### Inherited from - -`ClientBase.once` - -#### Defined in - -node_modules/@types/node/events.d.ts:659 - ---- - -### onReady() - -> **onReady**(): `void` - -#### Returns - -`void` - -#### Overrides - -`ClientBase.onReady` - -#### Defined in - -[core/src/clients/twitter/interactions.ts:76](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/interactions.ts#L76) - ---- - -### prependListener() - -> **prependListener**\<`K`\>(`eventName`, `listener`): `this` - -Adds the `listener` function to the _beginning_ of the listeners array for the -event named `eventName`. No checks are made to see if the `listener` has -already been added. Multiple calls passing the same combination of `eventName` -and `listener` will result in the `listener` being added, and called, multiple times. - -```js -server.prependListener("connection", (stream) => { - console.log("someone connected!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v6.0.0 - -#### Inherited from - -`ClientBase.prependListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:886 - ---- - -### prependOnceListener() - -> **prependOnceListener**\<`K`\>(`eventName`, `listener`): `this` - -Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this -listener is removed, and then invoked. - -```js -server.prependOnceListener("connection", (stream) => { - console.log("Ah, we have our first user!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v6.0.0 - -#### Inherited from - -`ClientBase.prependOnceListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:902 - ---- - -### rawListeners() - -> **rawListeners**\<`K`\>(`eventName`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`, -including any wrappers (such as those created by `.once()`). - -```js -import { EventEmitter } from "node:events"; -const emitter = new EventEmitter(); -emitter.once("log", () => console.log("log once")); - -// Returns a new Array with a function `onceWrapper` which has a property -// `listener` which contains the original listener bound above -const listeners = emitter.rawListeners("log"); -const logFnWrapper = listeners[0]; - -// Logs "log once" to the console and does not unbind the `once` event -logFnWrapper.listener(); - -// Logs "log once" to the console and removes the listener -logFnWrapper(); - -emitter.on("log", () => console.log("log persistently")); -// Will return a new Array with a single function bound by `.on()` above -const newListeners = emitter.rawListeners("log"); - -// Logs "log persistently" twice -newListeners[0](); -emitter.emit("log"); -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v9.4.0 - -#### Inherited from - -`ClientBase.rawListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:818 - ---- - -### removeAllListeners() - -> **removeAllListeners**(`eventName`?): `this` - -Removes all listeners, or those of the specified `eventName`. - -It is bad practice to remove listeners added elsewhere in the code, -particularly when the `EventEmitter` instance was created by some other -component or module (e.g. sockets or file streams). - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Parameters - -• **eventName?**: `string` \| `symbol` - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.removeAllListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:758 - ---- - -### removeListener() - -> **removeListener**\<`K`\>(`eventName`, `listener`): `this` - -Removes the specified `listener` from the listener array for the event named `eventName`. - -```js -const callback = (stream) => { - console.log("someone connected!"); -}; -server.on("connection", callback); -// ... -server.removeListener("connection", callback); -``` - -`removeListener()` will remove, at most, one instance of a listener from the -listener array. If any single listener has been added multiple times to the -listener array for the specified `eventName`, then `removeListener()` must be -called multiple times to remove each instance. - -Once an event is emitted, all listeners attached to it at the -time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution -will not remove them from`emit()` in progress. Subsequent events behave as expected. - -```js -import { EventEmitter } from "node:events"; -class MyEmitter extends EventEmitter {} -const myEmitter = new MyEmitter(); - -const callbackA = () => { - console.log("A"); - myEmitter.removeListener("event", callbackB); -}; - -const callbackB = () => { - console.log("B"); -}; - -myEmitter.on("event", callbackA); - -myEmitter.on("event", callbackB); - -// callbackA removes listener callbackB but it will still be called. -// Internal listener array at time of emit [callbackA, callbackB] -myEmitter.emit("event"); -// Prints: -// A -// B - -// callbackB is now removed. -// Internal listener array [callbackA] -myEmitter.emit("event"); -// Prints: -// A -``` - -Because listeners are managed using an internal array, calling this will -change the position indices of any listener registered _after_ the listener -being removed. This will not impact the order in which listeners are called, -but it means that any copies of the listener array as returned by -the `emitter.listeners()` method will need to be recreated. - -When a single function has been added as a handler multiple times for a single -event (as in the example below), `removeListener()` will remove the most -recently added instance. In the example the `once('ping')` listener is removed: - -```js -import { EventEmitter } from "node:events"; -const ee = new EventEmitter(); - -function pong() { - console.log("pong"); -} - -ee.on("ping", pong); -ee.once("ping", pong); -ee.removeListener("ping", pong); - -ee.emit("ping"); -ee.emit("ping"); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.removeListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:742 - ---- - -### saveRequestMessage() - -> **saveRequestMessage**(`message`, `state`): `Promise`\<`void`\> - -#### Parameters - -• **message**: [`Memory`](../interfaces/Memory.md) - -• **state**: [`State`](../interfaces/State.md) - -#### Returns - -`Promise`\<`void`\> - -#### Inherited from - -`ClientBase.saveRequestMessage` - -#### Defined in - -[core/src/clients/twitter/base.ts:572](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L572) - ---- - -### setCookiesFromArray() - -> **setCookiesFromArray**(`cookiesArray`): `Promise`\<`void`\> - -#### Parameters - -• **cookiesArray**: `any`[] - -#### Returns - -`Promise`\<`void`\> - -#### Inherited from - -`ClientBase.setCookiesFromArray` - -#### Defined in - -[core/src/clients/twitter/base.ts:560](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L560) - ---- - -### setMaxListeners() - -> **setMaxListeners**(`n`): `this` - -By default `EventEmitter`s will print a warning if more than `10` listeners are -added for a particular event. This is a useful default that helps finding -memory leaks. The `emitter.setMaxListeners()` method allows the limit to be -modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Parameters - -• **n**: `number` - -#### Returns - -`this` - -#### Since - -v0.3.5 - -#### Inherited from - -`ClientBase.setMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:768 - ---- - -### addAbortListener() - -> `static` **addAbortListener**(`signal`, `resource`): `Disposable` - -**`Experimental`** - -Listens once to the `abort` event on the provided `signal`. - -Listening to the `abort` event on abort signals is unsafe and may -lead to resource leaks since another third party with the signal can -call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change -this since it would violate the web standard. Additionally, the original -API makes it easy to forget to remove listeners. - -This API allows safely using `AbortSignal`s in Node.js APIs by solving these -two issues by listening to the event such that `stopImmediatePropagation` does -not prevent the listener from running. - -Returns a disposable so that it may be unsubscribed from more easily. - -```js -import { addAbortListener } from "node:events"; - -function example(signal) { - let disposable; - try { - signal.addEventListener("abort", (e) => e.stopImmediatePropagation()); - disposable = addAbortListener(signal, (e) => { - // Do something when signal is aborted. - }); - } finally { - disposable?.[Symbol.dispose](); - } -} -``` - -#### Parameters - -• **signal**: `AbortSignal` - -• **resource** - -#### Returns - -`Disposable` - -Disposable that removes the `abort` listener. - -#### Since - -v20.5.0 - -#### Inherited from - -`ClientBase.addAbortListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:437 - ---- - -### getEventListeners() - -> `static` **getEventListeners**(`emitter`, `name`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`. - -For `EventEmitter`s this behaves exactly the same as calling `.listeners` on -the emitter. - -For `EventTarget`s this is the only way to get the event listeners for the -event target. This is useful for debugging and diagnostic purposes. - -```js -import { getEventListeners, EventEmitter } from "node:events"; - -{ - const ee = new EventEmitter(); - const listener = () => console.log("Events are fun"); - ee.on("foo", listener); - console.log(getEventListeners(ee, "foo")); // [ [Function: listener] ] -} -{ - const et = new EventTarget(); - const listener = () => console.log("Events are fun"); - et.addEventListener("foo", listener); - console.log(getEventListeners(et, "foo")); // [ [Function: listener] ] -} -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` - -• **name**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v15.2.0, v14.17.0 - -#### Inherited from - -`ClientBase.getEventListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:358 - ---- - -### getMaxListeners() - -> `static` **getMaxListeners**(`emitter`): `number` - -Returns the currently set max amount of listeners. - -For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on -the emitter. - -For `EventTarget`s this is the only way to get the max event listeners for the -event target. If the number of event handlers on a single EventTarget exceeds -the max set, the EventTarget will print a warning. - -```js -import { getMaxListeners, setMaxListeners, EventEmitter } from "node:events"; - -{ - const ee = new EventEmitter(); - console.log(getMaxListeners(ee)); // 10 - setMaxListeners(11, ee); - console.log(getMaxListeners(ee)); // 11 -} -{ - const et = new EventTarget(); - console.log(getMaxListeners(et)); // 10 - setMaxListeners(11, et); - console.log(getMaxListeners(et)); // 11 -} -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` - -#### Returns - -`number` - -#### Since - -v19.9.0 - -#### Inherited from - -`ClientBase.getMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:387 - ---- - -### ~~listenerCount()~~ - -> `static` **listenerCount**(`emitter`, `eventName`): `number` - -A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. - -```js -import { EventEmitter, listenerCount } from "node:events"; - -const myEmitter = new EventEmitter(); -myEmitter.on("event", () => {}); -myEmitter.on("event", () => {}); -console.log(listenerCount(myEmitter, "event")); -// Prints: 2 -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -The emitter to query - -• **eventName**: `string` \| `symbol` - -The event name - -#### Returns - -`number` - -#### Since - -v0.9.12 - -#### Deprecated - -Since v3.2.0 - Use `listenerCount` instead. - -#### Inherited from - -`ClientBase.listenerCount` - -#### Defined in - -node_modules/@types/node/events.d.ts:330 - ---- - -### on() - -#### on(emitter, eventName, options) - -> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -// Emit later on -process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); -}); - -for await (const event of on(ee, "foo")) { - // The execution of this inner block is synchronous and it - // processes one event at a time (even with await). Do not use - // if concurrent execution is required. - console.log(event); // prints ['bar'] [42] -} -// Unreachable here -``` - -Returns an `AsyncIterator` that iterates `eventName` events. It will throw -if the `EventEmitter` emits `'error'`. It removes all listeners when -exiting the loop. The `value` returned by each iteration is an array -composed of the emitted event arguments. - -An `AbortSignal` can be used to cancel waiting on events: - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ac = new AbortController(); - -(async () => { - const ee = new EventEmitter(); - - // Emit later on - process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); - }); - - for await (const event of on(ee, "foo", { signal: ac.signal })) { - // The execution of this inner block is synchronous and it - // processes one event at a time (even with await). Do not use - // if concurrent execution is required. - console.log(event); // prints ['bar'] [42] - } - // Unreachable here -})(); - -process.nextTick(() => ac.abort()); -``` - -Use the `close` option to specify an array of event names that will end the iteration: - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -// Emit later on -process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); - ee.emit("close"); -}); - -for await (const event of on(ee, "foo", { close: ["close"] })) { - console.log(event); // prints ['bar'] [42] -} -// the loop will exit after 'close' is emitted -console.log("done"); // prints 'done' -``` - -##### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -• **eventName**: `string` \| `symbol` - -• **options?**: `StaticEventEmitterIteratorOptions` - -##### Returns - -`AsyncIterator`\<`any`[], `any`, `any`\> - -An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` - -##### Since - -v13.6.0, v12.16.0 - -##### Inherited from - -`ClientBase.on` - -##### Defined in - -node_modules/@types/node/events.d.ts:303 - -#### on(emitter, eventName, options) - -> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> - -##### Parameters - -• **emitter**: `EventTarget` - -• **eventName**: `string` - -• **options?**: `StaticEventEmitterIteratorOptions` - -##### Returns - -`AsyncIterator`\<`any`[], `any`, `any`\> - -##### Inherited from - -`ClientBase.on` - -##### Defined in - -node_modules/@types/node/events.d.ts:308 - ---- - -### once() - -#### once(emitter, eventName, options) - -> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> - -Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given -event or that is rejected if the `EventEmitter` emits `'error'` while waiting. -The `Promise` will resolve with an array of all the arguments emitted to the -given event. - -This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event -semantics and does not listen to the `'error'` event. - -```js -import { once, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -process.nextTick(() => { - ee.emit("myevent", 42); -}); - -const [value] = await once(ee, "myevent"); -console.log(value); - -const err = new Error("kaboom"); -process.nextTick(() => { - ee.emit("error", err); -}); - -try { - await once(ee, "myevent"); -} catch (err) { - console.error("error happened", err); -} -``` - -The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the -'`error'` event itself, then it is treated as any other kind of event without -special handling: - -```js -import { EventEmitter, once } from "node:events"; - -const ee = new EventEmitter(); - -once(ee, "error") - .then(([err]) => console.log("ok", err.message)) - .catch((err) => console.error("error", err.message)); - -ee.emit("error", new Error("boom")); - -// Prints: ok boom -``` - -An `AbortSignal` can be used to cancel waiting for the event: - -```js -import { EventEmitter, once } from "node:events"; - -const ee = new EventEmitter(); -const ac = new AbortController(); - -async function foo(emitter, event, signal) { - try { - await once(emitter, event, { signal }); - console.log("event emitted!"); - } catch (error) { - if (error.name === "AbortError") { - console.error("Waiting for the event was canceled!"); - } else { - console.error("There was an error", error.message); - } - } -} - -foo(ee, "foo", ac.signal); -ac.abort(); // Abort waiting for the event -ee.emit("foo"); // Prints: Waiting for the event was canceled! -``` - -##### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -• **eventName**: `string` \| `symbol` - -• **options?**: `StaticEventEmitterOptions` - -##### Returns - -`Promise`\<`any`[]\> - -##### Since - -v11.13.0, v10.16.0 - -##### Inherited from - -`ClientBase.once` - -##### Defined in - -node_modules/@types/node/events.d.ts:217 - -#### once(emitter, eventName, options) - -> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> - -##### Parameters - -• **emitter**: `EventTarget` - -• **eventName**: `string` - -• **options?**: `StaticEventEmitterOptions` - -##### Returns - -`Promise`\<`any`[]\> - -##### Inherited from - -`ClientBase.once` - -##### Defined in - -node_modules/@types/node/events.d.ts:222 - ---- - -### setMaxListeners() - -> `static` **setMaxListeners**(`n`?, ...`eventTargets`?): `void` - -```js -import { setMaxListeners, EventEmitter } from "node:events"; - -const target = new EventTarget(); -const emitter = new EventEmitter(); - -setMaxListeners(5, target, emitter); -``` - -#### Parameters - -• **n?**: `number` - -A non-negative number. The maximum number of listeners per `EventTarget` event. - -• ...**eventTargets?**: (`EventEmitter`\<`DefaultEventMap`\> \| `EventTarget`)[] - -Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} -objects. - -#### Returns - -`void` - -#### Since - -v15.4.0 - -#### Inherited from - -`ClientBase.setMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:402 diff --git a/docs/docs/api/classes/TwitterPostClient.md b/docs/docs/api/classes/TwitterPostClient.md deleted file mode 100644 index fbf83d8f83..0000000000 --- a/docs/docs/api/classes/TwitterPostClient.md +++ /dev/null @@ -1,1784 +0,0 @@ -# Class: TwitterPostClient - -## Extends - -- `ClientBase` - -## Constructors - -### new TwitterPostClient() - -> **new TwitterPostClient**(`runtime`): [`TwitterPostClient`](TwitterPostClient.md) - -#### Parameters - -• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -#### Returns - -[`TwitterPostClient`](TwitterPostClient.md) - -#### Overrides - -`ClientBase.constructor` - -#### Defined in - -[core/src/clients/twitter/post.ts:41](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/post.ts#L41) - -## Properties - -### callback() - -> **callback**: (`self`) => `any` = `null` - -#### Parameters - -• **self**: `ClientBase` - -#### Returns - -`any` - -#### Inherited from - -`ClientBase.callback` - -#### Defined in - -[core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L150) - ---- - -### directions - -> **directions**: `string` - -#### Inherited from - -`ClientBase.directions` - -#### Defined in - -[core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L89) - ---- - -### imageDescriptionService - -> **imageDescriptionService**: `ImageDescriptionService` - -#### Inherited from - -`ClientBase.imageDescriptionService` - -#### Defined in - -[core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L92) - ---- - -### lastCheckedTweetId - -> **lastCheckedTweetId**: `number` = `null` - -#### Inherited from - -`ClientBase.lastCheckedTweetId` - -#### Defined in - -[core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L90) - ---- - -### requestQueue - -> **requestQueue**: `RequestQueue` - -#### Inherited from - -`ClientBase.requestQueue` - -#### Defined in - -[core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L96) - ---- - -### runtime - -> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -#### Inherited from - -`ClientBase.runtime` - -#### Defined in - -[core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L88) - ---- - -### temperature - -> **temperature**: `number` = `0.5` - -#### Inherited from - -`ClientBase.temperature` - -#### Defined in - -[core/src/clients/twitter/base.ts:93](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L93) - ---- - -### tweetCacheFilePath - -> **tweetCacheFilePath**: `string` = `"tweetcache/latest_checked_tweet_id.txt"` - -#### Inherited from - -`ClientBase.tweetCacheFilePath` - -#### Defined in - -[core/src/clients/twitter/base.ts:91](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L91) - ---- - -### twitterClient - -> **twitterClient**: `Scraper` - -#### Inherited from - -`ClientBase.twitterClient` - -#### Defined in - -[core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L87) - ---- - -### twitterUserId - -> **twitterUserId**: `string` - -#### Inherited from - -`ClientBase.twitterUserId` - -#### Defined in - -[core/src/clients/twitter/base.ts:97](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L97) - ---- - -### \_twitterClient - -> `static` **\_twitterClient**: `Scraper` - -#### Inherited from - -`ClientBase._twitterClient` - -#### Defined in - -[core/src/clients/twitter/base.ts:86](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L86) - ---- - -### captureRejections - -> `static` **captureRejections**: `boolean` - -Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - -Change the default `captureRejections` option on all new `EventEmitter` objects. - -#### Since - -v13.4.0, v12.16.0 - -#### Inherited from - -`ClientBase.captureRejections` - -#### Defined in - -node_modules/@types/node/events.d.ts:459 - ---- - -### captureRejectionSymbol - -> `readonly` `static` **captureRejectionSymbol**: _typeof_ [`captureRejectionSymbol`](TwitterPostClient.md#capturerejectionsymbol) - -Value: `Symbol.for('nodejs.rejection')` - -See how to write a custom `rejection handler`. - -#### Since - -v13.4.0, v12.16.0 - -#### Inherited from - -`ClientBase.captureRejectionSymbol` - -#### Defined in - -node_modules/@types/node/events.d.ts:452 - ---- - -### defaultMaxListeners - -> `static` **defaultMaxListeners**: `number` - -By default, a maximum of `10` listeners can be registered for any single -event. This limit can be changed for individual `EventEmitter` instances -using the `emitter.setMaxListeners(n)` method. To change the default -for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property -can be used. If this value is not a positive number, a `RangeError` is thrown. - -Take caution when setting the `events.defaultMaxListeners` because the -change affects _all_ `EventEmitter` instances, including those created before -the change is made. However, calling `emitter.setMaxListeners(n)` still has -precedence over `events.defaultMaxListeners`. - -This is not a hard limit. The `EventEmitter` instance will allow -more listeners to be added but will output a trace warning to stderr indicating -that a "possible EventEmitter memory leak" has been detected. For any single -`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to -temporarily avoid this warning: - -```js -import { EventEmitter } from "node:events"; -const emitter = new EventEmitter(); -emitter.setMaxListeners(emitter.getMaxListeners() + 1); -emitter.once("event", () => { - // do stuff - emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); -}); -``` - -The `--trace-warnings` command-line flag can be used to display the -stack trace for such warnings. - -The emitted warning can be inspected with `process.on('warning')` and will -have the additional `emitter`, `type`, and `count` properties, referring to -the event emitter instance, the event's name and the number of attached -listeners, respectively. -Its `name` property is set to `'MaxListenersExceededWarning'`. - -#### Since - -v0.11.2 - -#### Inherited from - -`ClientBase.defaultMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:498 - ---- - -### errorMonitor - -> `readonly` `static` **errorMonitor**: _typeof_ [`errorMonitor`](TwitterPostClient.md#errormonitor) - -This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. - -Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no -regular `'error'` listener is installed. - -#### Since - -v13.6.0, v12.17.0 - -#### Inherited from - -`ClientBase.errorMonitor` - -#### Defined in - -node_modules/@types/node/events.d.ts:445 - -## Methods - -### \[captureRejectionSymbol\]()? - -> `optional` **\[captureRejectionSymbol\]**\<`K`\>(`error`, `event`, ...`args`): `void` - -#### Type Parameters - -• **K** - -#### Parameters - -• **error**: `Error` - -• **event**: `string` \| `symbol` - -• ...**args**: `AnyRest` - -#### Returns - -`void` - -#### Inherited from - -`ClientBase.[captureRejectionSymbol]` - -#### Defined in - -node_modules/@types/node/events.d.ts:136 - ---- - -### addListener() - -> **addListener**\<`K`\>(`eventName`, `listener`): `this` - -Alias for `emitter.on(eventName, listener)`. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.addListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:597 - ---- - -### cacheTweet() - -> **cacheTweet**(`tweet`): `Promise`\<`void`\> - -#### Parameters - -• **tweet**: `Tweet` - -#### Returns - -`Promise`\<`void`\> - -#### Inherited from - -`ClientBase.cacheTweet` - -#### Defined in - -[core/src/clients/twitter/base.ts:99](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L99) - ---- - -### emit() - -> **emit**\<`K`\>(`eventName`, ...`args`): `boolean` - -Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments -to each. - -Returns `true` if the event had listeners, `false` otherwise. - -```js -import { EventEmitter } from "node:events"; -const myEmitter = new EventEmitter(); - -// First listener -myEmitter.on("event", function firstListener() { - console.log("Helloooo! first listener"); -}); -// Second listener -myEmitter.on("event", function secondListener(arg1, arg2) { - console.log(`event with parameters ${arg1}, ${arg2} in second listener`); -}); -// Third listener -myEmitter.on("event", function thirdListener(...args) { - const parameters = args.join(", "); - console.log(`event with parameters ${parameters} in third listener`); -}); - -console.log(myEmitter.listeners("event")); - -myEmitter.emit("event", 1, 2, 3, 4, 5); - -// Prints: -// [ -// [Function: firstListener], -// [Function: secondListener], -// [Function: thirdListener] -// ] -// Helloooo! first listener -// event with parameters 1, 2 in second listener -// event with parameters 1, 2, 3, 4, 5 in third listener -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• ...**args**: `AnyRest` - -#### Returns - -`boolean` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.emit` - -#### Defined in - -node_modules/@types/node/events.d.ts:859 - ---- - -### eventNames() - -> **eventNames**(): (`string` \| `symbol`)[] - -Returns an array listing the events for which the emitter has registered -listeners. The values in the array are strings or `Symbol`s. - -```js -import { EventEmitter } from "node:events"; - -const myEE = new EventEmitter(); -myEE.on("foo", () => {}); -myEE.on("bar", () => {}); - -const sym = Symbol("symbol"); -myEE.on(sym, () => {}); - -console.log(myEE.eventNames()); -// Prints: [ 'foo', 'bar', Symbol(symbol) ] -``` - -#### Returns - -(`string` \| `symbol`)[] - -#### Since - -v6.0.0 - -#### Inherited from - -`ClientBase.eventNames` - -#### Defined in - -node_modules/@types/node/events.d.ts:922 - ---- - -### fetchHomeTimeline() - -> **fetchHomeTimeline**(`count`): `Promise`\<`Tweet`[]\> - -#### Parameters - -• **count**: `number` - -#### Returns - -`Promise`\<`Tweet`[]\> - -#### Inherited from - -`ClientBase.fetchHomeTimeline` - -#### Defined in - -[core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L278) - ---- - -### fetchSearchTweets() - -> **fetchSearchTweets**(`query`, `maxTweets`, `searchMode`, `cursor`?): `Promise`\<`QueryTweetsResponse`\> - -#### Parameters - -• **query**: `string` - -• **maxTweets**: `number` - -• **searchMode**: `SearchMode` - -• **cursor?**: `string` - -#### Returns - -`Promise`\<`QueryTweetsResponse`\> - -#### Inherited from - -`ClientBase.fetchSearchTweets` - -#### Defined in - -[core/src/clients/twitter/base.ts:330](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L330) - ---- - -### getCachedTweet() - -> **getCachedTweet**(`tweetId`): `Promise`\<`Tweet`\> - -#### Parameters - -• **tweetId**: `string` - -#### Returns - -`Promise`\<`Tweet`\> - -#### Inherited from - -`ClientBase.getCachedTweet` - -#### Defined in - -[core/src/clients/twitter/base.ts:115](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L115) - ---- - -### getMaxListeners() - -> **getMaxListeners**(): `number` - -Returns the current max listener value for the `EventEmitter` which is either -set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](TwitterPostClient.md#defaultmaxlisteners). - -#### Returns - -`number` - -#### Since - -v1.0.0 - -#### Inherited from - -`ClientBase.getMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:774 - ---- - -### getTweet() - -> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> - -#### Parameters - -• **tweetId**: `string` - -#### Returns - -`Promise`\<`Tweet`\> - -#### Inherited from - -`ClientBase.getTweet` - -#### Defined in - -[core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L137) - ---- - -### listenerCount() - -> **listenerCount**\<`K`\>(`eventName`, `listener`?): `number` - -Returns the number of listeners listening for the event named `eventName`. -If `listener` is provided, it will return how many times the listener is found -in the list of the listeners of the event. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event being listened for - -• **listener?**: `Function` - -The event handler function - -#### Returns - -`number` - -#### Since - -v3.2.0 - -#### Inherited from - -`ClientBase.listenerCount` - -#### Defined in - -node_modules/@types/node/events.d.ts:868 - ---- - -### listeners() - -> **listeners**\<`K`\>(`eventName`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`. - -```js -server.on("connection", (stream) => { - console.log("someone connected!"); -}); -console.log(util.inspect(server.listeners("connection"))); -// Prints: [ [Function] ] -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.listeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:787 - ---- - -### off() - -> **off**\<`K`\>(`eventName`, `listener`): `this` - -Alias for `emitter.removeListener()`. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v10.0.0 - -#### Inherited from - -`ClientBase.off` - -#### Defined in - -node_modules/@types/node/events.d.ts:747 - ---- - -### on() - -> **on**\<`K`\>(`eventName`, `listener`): `this` - -Adds the `listener` function to the end of the listeners array for the event -named `eventName`. No checks are made to see if the `listener` has already -been added. Multiple calls passing the same combination of `eventName` and -`listener` will result in the `listener` being added, and called, multiple times. - -```js -server.on("connection", (stream) => { - console.log("someone connected!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the -event listener to the beginning of the listeners array. - -```js -import { EventEmitter } from "node:events"; -const myEE = new EventEmitter(); -myEE.on("foo", () => console.log("a")); -myEE.prependListener("foo", () => console.log("b")); -myEE.emit("foo"); -// Prints: -// b -// a -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v0.1.101 - -#### Inherited from - -`ClientBase.on` - -#### Defined in - -node_modules/@types/node/events.d.ts:629 - ---- - -### once() - -> **once**\<`K`\>(`eventName`, `listener`): `this` - -Adds a **one-time** `listener` function for the event named `eventName`. The -next time `eventName` is triggered, this listener is removed and then invoked. - -```js -server.once("connection", (stream) => { - console.log("Ah, we have our first user!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the -event listener to the beginning of the listeners array. - -```js -import { EventEmitter } from "node:events"; -const myEE = new EventEmitter(); -myEE.once("foo", () => console.log("a")); -myEE.prependOnceListener("foo", () => console.log("b")); -myEE.emit("foo"); -// Prints: -// b -// a -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v0.3.0 - -#### Inherited from - -`ClientBase.once` - -#### Defined in - -node_modules/@types/node/events.d.ts:659 - ---- - -### onReady() - -> **onReady**(): `void` - -#### Returns - -`void` - -#### Overrides - -`ClientBase.onReady` - -#### Defined in - -[core/src/clients/twitter/post.ts:28](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/post.ts#L28) - ---- - -### prependListener() - -> **prependListener**\<`K`\>(`eventName`, `listener`): `this` - -Adds the `listener` function to the _beginning_ of the listeners array for the -event named `eventName`. No checks are made to see if the `listener` has -already been added. Multiple calls passing the same combination of `eventName` -and `listener` will result in the `listener` being added, and called, multiple times. - -```js -server.prependListener("connection", (stream) => { - console.log("someone connected!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v6.0.0 - -#### Inherited from - -`ClientBase.prependListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:886 - ---- - -### prependOnceListener() - -> **prependOnceListener**\<`K`\>(`eventName`, `listener`): `this` - -Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this -listener is removed, and then invoked. - -```js -server.prependOnceListener("connection", (stream) => { - console.log("Ah, we have our first user!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v6.0.0 - -#### Inherited from - -`ClientBase.prependOnceListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:902 - ---- - -### rawListeners() - -> **rawListeners**\<`K`\>(`eventName`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`, -including any wrappers (such as those created by `.once()`). - -```js -import { EventEmitter } from "node:events"; -const emitter = new EventEmitter(); -emitter.once("log", () => console.log("log once")); - -// Returns a new Array with a function `onceWrapper` which has a property -// `listener` which contains the original listener bound above -const listeners = emitter.rawListeners("log"); -const logFnWrapper = listeners[0]; - -// Logs "log once" to the console and does not unbind the `once` event -logFnWrapper.listener(); - -// Logs "log once" to the console and removes the listener -logFnWrapper(); - -emitter.on("log", () => console.log("log persistently")); -// Will return a new Array with a single function bound by `.on()` above -const newListeners = emitter.rawListeners("log"); - -// Logs "log persistently" twice -newListeners[0](); -emitter.emit("log"); -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v9.4.0 - -#### Inherited from - -`ClientBase.rawListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:818 - ---- - -### removeAllListeners() - -> **removeAllListeners**(`eventName`?): `this` - -Removes all listeners, or those of the specified `eventName`. - -It is bad practice to remove listeners added elsewhere in the code, -particularly when the `EventEmitter` instance was created by some other -component or module (e.g. sockets or file streams). - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Parameters - -• **eventName?**: `string` \| `symbol` - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.removeAllListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:758 - ---- - -### removeListener() - -> **removeListener**\<`K`\>(`eventName`, `listener`): `this` - -Removes the specified `listener` from the listener array for the event named `eventName`. - -```js -const callback = (stream) => { - console.log("someone connected!"); -}; -server.on("connection", callback); -// ... -server.removeListener("connection", callback); -``` - -`removeListener()` will remove, at most, one instance of a listener from the -listener array. If any single listener has been added multiple times to the -listener array for the specified `eventName`, then `removeListener()` must be -called multiple times to remove each instance. - -Once an event is emitted, all listeners attached to it at the -time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution -will not remove them from`emit()` in progress. Subsequent events behave as expected. - -```js -import { EventEmitter } from "node:events"; -class MyEmitter extends EventEmitter {} -const myEmitter = new MyEmitter(); - -const callbackA = () => { - console.log("A"); - myEmitter.removeListener("event", callbackB); -}; - -const callbackB = () => { - console.log("B"); -}; - -myEmitter.on("event", callbackA); - -myEmitter.on("event", callbackB); - -// callbackA removes listener callbackB but it will still be called. -// Internal listener array at time of emit [callbackA, callbackB] -myEmitter.emit("event"); -// Prints: -// A -// B - -// callbackB is now removed. -// Internal listener array [callbackA] -myEmitter.emit("event"); -// Prints: -// A -``` - -Because listeners are managed using an internal array, calling this will -change the position indices of any listener registered _after_ the listener -being removed. This will not impact the order in which listeners are called, -but it means that any copies of the listener array as returned by -the `emitter.listeners()` method will need to be recreated. - -When a single function has been added as a handler multiple times for a single -event (as in the example below), `removeListener()` will remove the most -recently added instance. In the example the `once('ping')` listener is removed: - -```js -import { EventEmitter } from "node:events"; -const ee = new EventEmitter(); - -function pong() { - console.log("pong"); -} - -ee.on("ping", pong); -ee.once("ping", pong); -ee.removeListener("ping", pong); - -ee.emit("ping"); -ee.emit("ping"); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.removeListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:742 - ---- - -### saveRequestMessage() - -> **saveRequestMessage**(`message`, `state`): `Promise`\<`void`\> - -#### Parameters - -• **message**: [`Memory`](../interfaces/Memory.md) - -• **state**: [`State`](../interfaces/State.md) - -#### Returns - -`Promise`\<`void`\> - -#### Inherited from - -`ClientBase.saveRequestMessage` - -#### Defined in - -[core/src/clients/twitter/base.ts:572](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L572) - ---- - -### setCookiesFromArray() - -> **setCookiesFromArray**(`cookiesArray`): `Promise`\<`void`\> - -#### Parameters - -• **cookiesArray**: `any`[] - -#### Returns - -`Promise`\<`void`\> - -#### Inherited from - -`ClientBase.setCookiesFromArray` - -#### Defined in - -[core/src/clients/twitter/base.ts:560](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L560) - ---- - -### setMaxListeners() - -> **setMaxListeners**(`n`): `this` - -By default `EventEmitter`s will print a warning if more than `10` listeners are -added for a particular event. This is a useful default that helps finding -memory leaks. The `emitter.setMaxListeners()` method allows the limit to be -modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Parameters - -• **n**: `number` - -#### Returns - -`this` - -#### Since - -v0.3.5 - -#### Inherited from - -`ClientBase.setMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:768 - ---- - -### addAbortListener() - -> `static` **addAbortListener**(`signal`, `resource`): `Disposable` - -**`Experimental`** - -Listens once to the `abort` event on the provided `signal`. - -Listening to the `abort` event on abort signals is unsafe and may -lead to resource leaks since another third party with the signal can -call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change -this since it would violate the web standard. Additionally, the original -API makes it easy to forget to remove listeners. - -This API allows safely using `AbortSignal`s in Node.js APIs by solving these -two issues by listening to the event such that `stopImmediatePropagation` does -not prevent the listener from running. - -Returns a disposable so that it may be unsubscribed from more easily. - -```js -import { addAbortListener } from "node:events"; - -function example(signal) { - let disposable; - try { - signal.addEventListener("abort", (e) => e.stopImmediatePropagation()); - disposable = addAbortListener(signal, (e) => { - // Do something when signal is aborted. - }); - } finally { - disposable?.[Symbol.dispose](); - } -} -``` - -#### Parameters - -• **signal**: `AbortSignal` - -• **resource** - -#### Returns - -`Disposable` - -Disposable that removes the `abort` listener. - -#### Since - -v20.5.0 - -#### Inherited from - -`ClientBase.addAbortListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:437 - ---- - -### getEventListeners() - -> `static` **getEventListeners**(`emitter`, `name`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`. - -For `EventEmitter`s this behaves exactly the same as calling `.listeners` on -the emitter. - -For `EventTarget`s this is the only way to get the event listeners for the -event target. This is useful for debugging and diagnostic purposes. - -```js -import { getEventListeners, EventEmitter } from "node:events"; - -{ - const ee = new EventEmitter(); - const listener = () => console.log("Events are fun"); - ee.on("foo", listener); - console.log(getEventListeners(ee, "foo")); // [ [Function: listener] ] -} -{ - const et = new EventTarget(); - const listener = () => console.log("Events are fun"); - et.addEventListener("foo", listener); - console.log(getEventListeners(et, "foo")); // [ [Function: listener] ] -} -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` - -• **name**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v15.2.0, v14.17.0 - -#### Inherited from - -`ClientBase.getEventListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:358 - ---- - -### getMaxListeners() - -> `static` **getMaxListeners**(`emitter`): `number` - -Returns the currently set max amount of listeners. - -For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on -the emitter. - -For `EventTarget`s this is the only way to get the max event listeners for the -event target. If the number of event handlers on a single EventTarget exceeds -the max set, the EventTarget will print a warning. - -```js -import { getMaxListeners, setMaxListeners, EventEmitter } from "node:events"; - -{ - const ee = new EventEmitter(); - console.log(getMaxListeners(ee)); // 10 - setMaxListeners(11, ee); - console.log(getMaxListeners(ee)); // 11 -} -{ - const et = new EventTarget(); - console.log(getMaxListeners(et)); // 10 - setMaxListeners(11, et); - console.log(getMaxListeners(et)); // 11 -} -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` - -#### Returns - -`number` - -#### Since - -v19.9.0 - -#### Inherited from - -`ClientBase.getMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:387 - ---- - -### ~~listenerCount()~~ - -> `static` **listenerCount**(`emitter`, `eventName`): `number` - -A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. - -```js -import { EventEmitter, listenerCount } from "node:events"; - -const myEmitter = new EventEmitter(); -myEmitter.on("event", () => {}); -myEmitter.on("event", () => {}); -console.log(listenerCount(myEmitter, "event")); -// Prints: 2 -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -The emitter to query - -• **eventName**: `string` \| `symbol` - -The event name - -#### Returns - -`number` - -#### Since - -v0.9.12 - -#### Deprecated - -Since v3.2.0 - Use `listenerCount` instead. - -#### Inherited from - -`ClientBase.listenerCount` - -#### Defined in - -node_modules/@types/node/events.d.ts:330 - ---- - -### on() - -#### on(emitter, eventName, options) - -> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -// Emit later on -process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); -}); - -for await (const event of on(ee, "foo")) { - // The execution of this inner block is synchronous and it - // processes one event at a time (even with await). Do not use - // if concurrent execution is required. - console.log(event); // prints ['bar'] [42] -} -// Unreachable here -``` - -Returns an `AsyncIterator` that iterates `eventName` events. It will throw -if the `EventEmitter` emits `'error'`. It removes all listeners when -exiting the loop. The `value` returned by each iteration is an array -composed of the emitted event arguments. - -An `AbortSignal` can be used to cancel waiting on events: - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ac = new AbortController(); - -(async () => { - const ee = new EventEmitter(); - - // Emit later on - process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); - }); - - for await (const event of on(ee, "foo", { signal: ac.signal })) { - // The execution of this inner block is synchronous and it - // processes one event at a time (even with await). Do not use - // if concurrent execution is required. - console.log(event); // prints ['bar'] [42] - } - // Unreachable here -})(); - -process.nextTick(() => ac.abort()); -``` - -Use the `close` option to specify an array of event names that will end the iteration: - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -// Emit later on -process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); - ee.emit("close"); -}); - -for await (const event of on(ee, "foo", { close: ["close"] })) { - console.log(event); // prints ['bar'] [42] -} -// the loop will exit after 'close' is emitted -console.log("done"); // prints 'done' -``` - -##### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -• **eventName**: `string` \| `symbol` - -• **options?**: `StaticEventEmitterIteratorOptions` - -##### Returns - -`AsyncIterator`\<`any`[], `any`, `any`\> - -An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` - -##### Since - -v13.6.0, v12.16.0 - -##### Inherited from - -`ClientBase.on` - -##### Defined in - -node_modules/@types/node/events.d.ts:303 - -#### on(emitter, eventName, options) - -> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> - -##### Parameters - -• **emitter**: `EventTarget` - -• **eventName**: `string` - -• **options?**: `StaticEventEmitterIteratorOptions` - -##### Returns - -`AsyncIterator`\<`any`[], `any`, `any`\> - -##### Inherited from - -`ClientBase.on` - -##### Defined in - -node_modules/@types/node/events.d.ts:308 - ---- - -### once() - -#### once(emitter, eventName, options) - -> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> - -Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given -event or that is rejected if the `EventEmitter` emits `'error'` while waiting. -The `Promise` will resolve with an array of all the arguments emitted to the -given event. - -This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event -semantics and does not listen to the `'error'` event. - -```js -import { once, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -process.nextTick(() => { - ee.emit("myevent", 42); -}); - -const [value] = await once(ee, "myevent"); -console.log(value); - -const err = new Error("kaboom"); -process.nextTick(() => { - ee.emit("error", err); -}); - -try { - await once(ee, "myevent"); -} catch (err) { - console.error("error happened", err); -} -``` - -The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the -'`error'` event itself, then it is treated as any other kind of event without -special handling: - -```js -import { EventEmitter, once } from "node:events"; - -const ee = new EventEmitter(); - -once(ee, "error") - .then(([err]) => console.log("ok", err.message)) - .catch((err) => console.error("error", err.message)); - -ee.emit("error", new Error("boom")); - -// Prints: ok boom -``` - -An `AbortSignal` can be used to cancel waiting for the event: - -```js -import { EventEmitter, once } from "node:events"; - -const ee = new EventEmitter(); -const ac = new AbortController(); - -async function foo(emitter, event, signal) { - try { - await once(emitter, event, { signal }); - console.log("event emitted!"); - } catch (error) { - if (error.name === "AbortError") { - console.error("Waiting for the event was canceled!"); - } else { - console.error("There was an error", error.message); - } - } -} - -foo(ee, "foo", ac.signal); -ac.abort(); // Abort waiting for the event -ee.emit("foo"); // Prints: Waiting for the event was canceled! -``` - -##### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -• **eventName**: `string` \| `symbol` - -• **options?**: `StaticEventEmitterOptions` - -##### Returns - -`Promise`\<`any`[]\> - -##### Since - -v11.13.0, v10.16.0 - -##### Inherited from - -`ClientBase.once` - -##### Defined in - -node_modules/@types/node/events.d.ts:217 - -#### once(emitter, eventName, options) - -> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> - -##### Parameters - -• **emitter**: `EventTarget` - -• **eventName**: `string` - -• **options?**: `StaticEventEmitterOptions` - -##### Returns - -`Promise`\<`any`[]\> - -##### Inherited from - -`ClientBase.once` - -##### Defined in - -node_modules/@types/node/events.d.ts:222 - ---- - -### setMaxListeners() - -> `static` **setMaxListeners**(`n`?, ...`eventTargets`?): `void` - -```js -import { setMaxListeners, EventEmitter } from "node:events"; - -const target = new EventTarget(); -const emitter = new EventEmitter(); - -setMaxListeners(5, target, emitter); -``` - -#### Parameters - -• **n?**: `number` - -A non-negative number. The maximum number of listeners per `EventTarget` event. - -• ...**eventTargets?**: (`EventEmitter`\<`DefaultEventMap`\> \| `EventTarget`)[] - -Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} -objects. - -#### Returns - -`void` - -#### Since - -v15.4.0 - -#### Inherited from - -`ClientBase.setMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:402 diff --git a/docs/docs/api/classes/TwitterSearchClient.md b/docs/docs/api/classes/TwitterSearchClient.md deleted file mode 100644 index ab977bd41e..0000000000 --- a/docs/docs/api/classes/TwitterSearchClient.md +++ /dev/null @@ -1,1784 +0,0 @@ -# Class: TwitterSearchClient - -## Extends - -- `ClientBase` - -## Constructors - -### new TwitterSearchClient() - -> **new TwitterSearchClient**(`runtime`): [`TwitterSearchClient`](TwitterSearchClient.md) - -#### Parameters - -• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -#### Returns - -[`TwitterSearchClient`](TwitterSearchClient.md) - -#### Overrides - -`ClientBase.constructor` - -#### Defined in - -[core/src/clients/twitter/search.ts:53](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/search.ts#L53) - -## Properties - -### callback() - -> **callback**: (`self`) => `any` = `null` - -#### Parameters - -• **self**: `ClientBase` - -#### Returns - -`any` - -#### Inherited from - -`ClientBase.callback` - -#### Defined in - -[core/src/clients/twitter/base.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L150) - ---- - -### directions - -> **directions**: `string` - -#### Inherited from - -`ClientBase.directions` - -#### Defined in - -[core/src/clients/twitter/base.ts:89](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L89) - ---- - -### imageDescriptionService - -> **imageDescriptionService**: `ImageDescriptionService` - -#### Inherited from - -`ClientBase.imageDescriptionService` - -#### Defined in - -[core/src/clients/twitter/base.ts:92](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L92) - ---- - -### lastCheckedTweetId - -> **lastCheckedTweetId**: `number` = `null` - -#### Inherited from - -`ClientBase.lastCheckedTweetId` - -#### Defined in - -[core/src/clients/twitter/base.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L90) - ---- - -### requestQueue - -> **requestQueue**: `RequestQueue` - -#### Inherited from - -`ClientBase.requestQueue` - -#### Defined in - -[core/src/clients/twitter/base.ts:96](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L96) - ---- - -### runtime - -> **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -#### Inherited from - -`ClientBase.runtime` - -#### Defined in - -[core/src/clients/twitter/base.ts:88](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L88) - ---- - -### temperature - -> **temperature**: `number` = `0.5` - -#### Inherited from - -`ClientBase.temperature` - -#### Defined in - -[core/src/clients/twitter/base.ts:93](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L93) - ---- - -### tweetCacheFilePath - -> **tweetCacheFilePath**: `string` = `"tweetcache/latest_checked_tweet_id.txt"` - -#### Inherited from - -`ClientBase.tweetCacheFilePath` - -#### Defined in - -[core/src/clients/twitter/base.ts:91](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L91) - ---- - -### twitterClient - -> **twitterClient**: `Scraper` - -#### Inherited from - -`ClientBase.twitterClient` - -#### Defined in - -[core/src/clients/twitter/base.ts:87](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L87) - ---- - -### twitterUserId - -> **twitterUserId**: `string` - -#### Inherited from - -`ClientBase.twitterUserId` - -#### Defined in - -[core/src/clients/twitter/base.ts:97](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L97) - ---- - -### \_twitterClient - -> `static` **\_twitterClient**: `Scraper` - -#### Inherited from - -`ClientBase._twitterClient` - -#### Defined in - -[core/src/clients/twitter/base.ts:86](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L86) - ---- - -### captureRejections - -> `static` **captureRejections**: `boolean` - -Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) - -Change the default `captureRejections` option on all new `EventEmitter` objects. - -#### Since - -v13.4.0, v12.16.0 - -#### Inherited from - -`ClientBase.captureRejections` - -#### Defined in - -node_modules/@types/node/events.d.ts:459 - ---- - -### captureRejectionSymbol - -> `readonly` `static` **captureRejectionSymbol**: _typeof_ [`captureRejectionSymbol`](TwitterPostClient.md#capturerejectionsymbol) - -Value: `Symbol.for('nodejs.rejection')` - -See how to write a custom `rejection handler`. - -#### Since - -v13.4.0, v12.16.0 - -#### Inherited from - -`ClientBase.captureRejectionSymbol` - -#### Defined in - -node_modules/@types/node/events.d.ts:452 - ---- - -### defaultMaxListeners - -> `static` **defaultMaxListeners**: `number` - -By default, a maximum of `10` listeners can be registered for any single -event. This limit can be changed for individual `EventEmitter` instances -using the `emitter.setMaxListeners(n)` method. To change the default -for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property -can be used. If this value is not a positive number, a `RangeError` is thrown. - -Take caution when setting the `events.defaultMaxListeners` because the -change affects _all_ `EventEmitter` instances, including those created before -the change is made. However, calling `emitter.setMaxListeners(n)` still has -precedence over `events.defaultMaxListeners`. - -This is not a hard limit. The `EventEmitter` instance will allow -more listeners to be added but will output a trace warning to stderr indicating -that a "possible EventEmitter memory leak" has been detected. For any single -`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to -temporarily avoid this warning: - -```js -import { EventEmitter } from "node:events"; -const emitter = new EventEmitter(); -emitter.setMaxListeners(emitter.getMaxListeners() + 1); -emitter.once("event", () => { - // do stuff - emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); -}); -``` - -The `--trace-warnings` command-line flag can be used to display the -stack trace for such warnings. - -The emitted warning can be inspected with `process.on('warning')` and will -have the additional `emitter`, `type`, and `count` properties, referring to -the event emitter instance, the event's name and the number of attached -listeners, respectively. -Its `name` property is set to `'MaxListenersExceededWarning'`. - -#### Since - -v0.11.2 - -#### Inherited from - -`ClientBase.defaultMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:498 - ---- - -### errorMonitor - -> `readonly` `static` **errorMonitor**: _typeof_ [`errorMonitor`](TwitterPostClient.md#errormonitor) - -This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called. - -Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no -regular `'error'` listener is installed. - -#### Since - -v13.6.0, v12.17.0 - -#### Inherited from - -`ClientBase.errorMonitor` - -#### Defined in - -node_modules/@types/node/events.d.ts:445 - -## Methods - -### \[captureRejectionSymbol\]()? - -> `optional` **\[captureRejectionSymbol\]**\<`K`\>(`error`, `event`, ...`args`): `void` - -#### Type Parameters - -• **K** - -#### Parameters - -• **error**: `Error` - -• **event**: `string` \| `symbol` - -• ...**args**: `AnyRest` - -#### Returns - -`void` - -#### Inherited from - -`ClientBase.[captureRejectionSymbol]` - -#### Defined in - -node_modules/@types/node/events.d.ts:136 - ---- - -### addListener() - -> **addListener**\<`K`\>(`eventName`, `listener`): `this` - -Alias for `emitter.on(eventName, listener)`. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.addListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:597 - ---- - -### cacheTweet() - -> **cacheTweet**(`tweet`): `Promise`\<`void`\> - -#### Parameters - -• **tweet**: `Tweet` - -#### Returns - -`Promise`\<`void`\> - -#### Inherited from - -`ClientBase.cacheTweet` - -#### Defined in - -[core/src/clients/twitter/base.ts:99](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L99) - ---- - -### emit() - -> **emit**\<`K`\>(`eventName`, ...`args`): `boolean` - -Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments -to each. - -Returns `true` if the event had listeners, `false` otherwise. - -```js -import { EventEmitter } from "node:events"; -const myEmitter = new EventEmitter(); - -// First listener -myEmitter.on("event", function firstListener() { - console.log("Helloooo! first listener"); -}); -// Second listener -myEmitter.on("event", function secondListener(arg1, arg2) { - console.log(`event with parameters ${arg1}, ${arg2} in second listener`); -}); -// Third listener -myEmitter.on("event", function thirdListener(...args) { - const parameters = args.join(", "); - console.log(`event with parameters ${parameters} in third listener`); -}); - -console.log(myEmitter.listeners("event")); - -myEmitter.emit("event", 1, 2, 3, 4, 5); - -// Prints: -// [ -// [Function: firstListener], -// [Function: secondListener], -// [Function: thirdListener] -// ] -// Helloooo! first listener -// event with parameters 1, 2 in second listener -// event with parameters 1, 2, 3, 4, 5 in third listener -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• ...**args**: `AnyRest` - -#### Returns - -`boolean` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.emit` - -#### Defined in - -node_modules/@types/node/events.d.ts:859 - ---- - -### eventNames() - -> **eventNames**(): (`string` \| `symbol`)[] - -Returns an array listing the events for which the emitter has registered -listeners. The values in the array are strings or `Symbol`s. - -```js -import { EventEmitter } from "node:events"; - -const myEE = new EventEmitter(); -myEE.on("foo", () => {}); -myEE.on("bar", () => {}); - -const sym = Symbol("symbol"); -myEE.on(sym, () => {}); - -console.log(myEE.eventNames()); -// Prints: [ 'foo', 'bar', Symbol(symbol) ] -``` - -#### Returns - -(`string` \| `symbol`)[] - -#### Since - -v6.0.0 - -#### Inherited from - -`ClientBase.eventNames` - -#### Defined in - -node_modules/@types/node/events.d.ts:922 - ---- - -### fetchHomeTimeline() - -> **fetchHomeTimeline**(`count`): `Promise`\<`Tweet`[]\> - -#### Parameters - -• **count**: `number` - -#### Returns - -`Promise`\<`Tweet`[]\> - -#### Inherited from - -`ClientBase.fetchHomeTimeline` - -#### Defined in - -[core/src/clients/twitter/base.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L278) - ---- - -### fetchSearchTweets() - -> **fetchSearchTweets**(`query`, `maxTweets`, `searchMode`, `cursor`?): `Promise`\<`QueryTweetsResponse`\> - -#### Parameters - -• **query**: `string` - -• **maxTweets**: `number` - -• **searchMode**: `SearchMode` - -• **cursor?**: `string` - -#### Returns - -`Promise`\<`QueryTweetsResponse`\> - -#### Inherited from - -`ClientBase.fetchSearchTweets` - -#### Defined in - -[core/src/clients/twitter/base.ts:330](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L330) - ---- - -### getCachedTweet() - -> **getCachedTweet**(`tweetId`): `Promise`\<`Tweet`\> - -#### Parameters - -• **tweetId**: `string` - -#### Returns - -`Promise`\<`Tweet`\> - -#### Inherited from - -`ClientBase.getCachedTweet` - -#### Defined in - -[core/src/clients/twitter/base.ts:115](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L115) - ---- - -### getMaxListeners() - -> **getMaxListeners**(): `number` - -Returns the current max listener value for the `EventEmitter` which is either -set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](TwitterSearchClient.md#defaultmaxlisteners). - -#### Returns - -`number` - -#### Since - -v1.0.0 - -#### Inherited from - -`ClientBase.getMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:774 - ---- - -### getTweet() - -> **getTweet**(`tweetId`): `Promise`\<`Tweet`\> - -#### Parameters - -• **tweetId**: `string` - -#### Returns - -`Promise`\<`Tweet`\> - -#### Inherited from - -`ClientBase.getTweet` - -#### Defined in - -[core/src/clients/twitter/base.ts:137](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L137) - ---- - -### listenerCount() - -> **listenerCount**\<`K`\>(`eventName`, `listener`?): `number` - -Returns the number of listeners listening for the event named `eventName`. -If `listener` is provided, it will return how many times the listener is found -in the list of the listeners of the event. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event being listened for - -• **listener?**: `Function` - -The event handler function - -#### Returns - -`number` - -#### Since - -v3.2.0 - -#### Inherited from - -`ClientBase.listenerCount` - -#### Defined in - -node_modules/@types/node/events.d.ts:868 - ---- - -### listeners() - -> **listeners**\<`K`\>(`eventName`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`. - -```js -server.on("connection", (stream) => { - console.log("someone connected!"); -}); -console.log(util.inspect(server.listeners("connection"))); -// Prints: [ [Function] ] -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.listeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:787 - ---- - -### off() - -> **off**\<`K`\>(`eventName`, `listener`): `this` - -Alias for `emitter.removeListener()`. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v10.0.0 - -#### Inherited from - -`ClientBase.off` - -#### Defined in - -node_modules/@types/node/events.d.ts:747 - ---- - -### on() - -> **on**\<`K`\>(`eventName`, `listener`): `this` - -Adds the `listener` function to the end of the listeners array for the event -named `eventName`. No checks are made to see if the `listener` has already -been added. Multiple calls passing the same combination of `eventName` and -`listener` will result in the `listener` being added, and called, multiple times. - -```js -server.on("connection", (stream) => { - console.log("someone connected!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the -event listener to the beginning of the listeners array. - -```js -import { EventEmitter } from "node:events"; -const myEE = new EventEmitter(); -myEE.on("foo", () => console.log("a")); -myEE.prependListener("foo", () => console.log("b")); -myEE.emit("foo"); -// Prints: -// b -// a -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v0.1.101 - -#### Inherited from - -`ClientBase.on` - -#### Defined in - -node_modules/@types/node/events.d.ts:629 - ---- - -### once() - -> **once**\<`K`\>(`eventName`, `listener`): `this` - -Adds a **one-time** `listener` function for the event named `eventName`. The -next time `eventName` is triggered, this listener is removed and then invoked. - -```js -server.once("connection", (stream) => { - console.log("Ah, we have our first user!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the -event listener to the beginning of the listeners array. - -```js -import { EventEmitter } from "node:events"; -const myEE = new EventEmitter(); -myEE.once("foo", () => console.log("a")); -myEE.prependOnceListener("foo", () => console.log("b")); -myEE.emit("foo"); -// Prints: -// b -// a -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v0.3.0 - -#### Inherited from - -`ClientBase.once` - -#### Defined in - -node_modules/@types/node/events.d.ts:659 - ---- - -### onReady() - -> **onReady**(): `Promise`\<`void`\> - -#### Returns - -`Promise`\<`void`\> - -#### Overrides - -`ClientBase.onReady` - -#### Defined in - -[core/src/clients/twitter/search.ts:60](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/search.ts#L60) - ---- - -### prependListener() - -> **prependListener**\<`K`\>(`eventName`, `listener`): `this` - -Adds the `listener` function to the _beginning_ of the listeners array for the -event named `eventName`. No checks are made to see if the `listener` has -already been added. Multiple calls passing the same combination of `eventName` -and `listener` will result in the `listener` being added, and called, multiple times. - -```js -server.prependListener("connection", (stream) => { - console.log("someone connected!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v6.0.0 - -#### Inherited from - -`ClientBase.prependListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:886 - ---- - -### prependOnceListener() - -> **prependOnceListener**\<`K`\>(`eventName`, `listener`): `this` - -Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this -listener is removed, and then invoked. - -```js -server.prependOnceListener("connection", (stream) => { - console.log("Ah, we have our first user!"); -}); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -The name of the event. - -• **listener** - -The callback function - -#### Returns - -`this` - -#### Since - -v6.0.0 - -#### Inherited from - -`ClientBase.prependOnceListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:902 - ---- - -### rawListeners() - -> **rawListeners**\<`K`\>(`eventName`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`, -including any wrappers (such as those created by `.once()`). - -```js -import { EventEmitter } from "node:events"; -const emitter = new EventEmitter(); -emitter.once("log", () => console.log("log once")); - -// Returns a new Array with a function `onceWrapper` which has a property -// `listener` which contains the original listener bound above -const listeners = emitter.rawListeners("log"); -const logFnWrapper = listeners[0]; - -// Logs "log once" to the console and does not unbind the `once` event -logFnWrapper.listener(); - -// Logs "log once" to the console and removes the listener -logFnWrapper(); - -emitter.on("log", () => console.log("log persistently")); -// Will return a new Array with a single function bound by `.on()` above -const newListeners = emitter.rawListeners("log"); - -// Logs "log persistently" twice -newListeners[0](); -emitter.emit("log"); -``` - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v9.4.0 - -#### Inherited from - -`ClientBase.rawListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:818 - ---- - -### removeAllListeners() - -> **removeAllListeners**(`eventName`?): `this` - -Removes all listeners, or those of the specified `eventName`. - -It is bad practice to remove listeners added elsewhere in the code, -particularly when the `EventEmitter` instance was created by some other -component or module (e.g. sockets or file streams). - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Parameters - -• **eventName?**: `string` \| `symbol` - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.removeAllListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:758 - ---- - -### removeListener() - -> **removeListener**\<`K`\>(`eventName`, `listener`): `this` - -Removes the specified `listener` from the listener array for the event named `eventName`. - -```js -const callback = (stream) => { - console.log("someone connected!"); -}; -server.on("connection", callback); -// ... -server.removeListener("connection", callback); -``` - -`removeListener()` will remove, at most, one instance of a listener from the -listener array. If any single listener has been added multiple times to the -listener array for the specified `eventName`, then `removeListener()` must be -called multiple times to remove each instance. - -Once an event is emitted, all listeners attached to it at the -time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution -will not remove them from`emit()` in progress. Subsequent events behave as expected. - -```js -import { EventEmitter } from "node:events"; -class MyEmitter extends EventEmitter {} -const myEmitter = new MyEmitter(); - -const callbackA = () => { - console.log("A"); - myEmitter.removeListener("event", callbackB); -}; - -const callbackB = () => { - console.log("B"); -}; - -myEmitter.on("event", callbackA); - -myEmitter.on("event", callbackB); - -// callbackA removes listener callbackB but it will still be called. -// Internal listener array at time of emit [callbackA, callbackB] -myEmitter.emit("event"); -// Prints: -// A -// B - -// callbackB is now removed. -// Internal listener array [callbackA] -myEmitter.emit("event"); -// Prints: -// A -``` - -Because listeners are managed using an internal array, calling this will -change the position indices of any listener registered _after_ the listener -being removed. This will not impact the order in which listeners are called, -but it means that any copies of the listener array as returned by -the `emitter.listeners()` method will need to be recreated. - -When a single function has been added as a handler multiple times for a single -event (as in the example below), `removeListener()` will remove the most -recently added instance. In the example the `once('ping')` listener is removed: - -```js -import { EventEmitter } from "node:events"; -const ee = new EventEmitter(); - -function pong() { - console.log("pong"); -} - -ee.on("ping", pong); -ee.once("ping", pong); -ee.removeListener("ping", pong); - -ee.emit("ping"); -ee.emit("ping"); -``` - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Type Parameters - -• **K** - -#### Parameters - -• **eventName**: `string` \| `symbol` - -• **listener** - -#### Returns - -`this` - -#### Since - -v0.1.26 - -#### Inherited from - -`ClientBase.removeListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:742 - ---- - -### saveRequestMessage() - -> **saveRequestMessage**(`message`, `state`): `Promise`\<`void`\> - -#### Parameters - -• **message**: [`Memory`](../interfaces/Memory.md) - -• **state**: [`State`](../interfaces/State.md) - -#### Returns - -`Promise`\<`void`\> - -#### Inherited from - -`ClientBase.saveRequestMessage` - -#### Defined in - -[core/src/clients/twitter/base.ts:572](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L572) - ---- - -### setCookiesFromArray() - -> **setCookiesFromArray**(`cookiesArray`): `Promise`\<`void`\> - -#### Parameters - -• **cookiesArray**: `any`[] - -#### Returns - -`Promise`\<`void`\> - -#### Inherited from - -`ClientBase.setCookiesFromArray` - -#### Defined in - -[core/src/clients/twitter/base.ts:560](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/clients/twitter/base.ts#L560) - ---- - -### setMaxListeners() - -> **setMaxListeners**(`n`): `this` - -By default `EventEmitter`s will print a warning if more than `10` listeners are -added for a particular event. This is a useful default that helps finding -memory leaks. The `emitter.setMaxListeners()` method allows the limit to be -modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -#### Parameters - -• **n**: `number` - -#### Returns - -`this` - -#### Since - -v0.3.5 - -#### Inherited from - -`ClientBase.setMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:768 - ---- - -### addAbortListener() - -> `static` **addAbortListener**(`signal`, `resource`): `Disposable` - -**`Experimental`** - -Listens once to the `abort` event on the provided `signal`. - -Listening to the `abort` event on abort signals is unsafe and may -lead to resource leaks since another third party with the signal can -call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change -this since it would violate the web standard. Additionally, the original -API makes it easy to forget to remove listeners. - -This API allows safely using `AbortSignal`s in Node.js APIs by solving these -two issues by listening to the event such that `stopImmediatePropagation` does -not prevent the listener from running. - -Returns a disposable so that it may be unsubscribed from more easily. - -```js -import { addAbortListener } from "node:events"; - -function example(signal) { - let disposable; - try { - signal.addEventListener("abort", (e) => e.stopImmediatePropagation()); - disposable = addAbortListener(signal, (e) => { - // Do something when signal is aborted. - }); - } finally { - disposable?.[Symbol.dispose](); - } -} -``` - -#### Parameters - -• **signal**: `AbortSignal` - -• **resource** - -#### Returns - -`Disposable` - -Disposable that removes the `abort` listener. - -#### Since - -v20.5.0 - -#### Inherited from - -`ClientBase.addAbortListener` - -#### Defined in - -node_modules/@types/node/events.d.ts:437 - ---- - -### getEventListeners() - -> `static` **getEventListeners**(`emitter`, `name`): `Function`[] - -Returns a copy of the array of listeners for the event named `eventName`. - -For `EventEmitter`s this behaves exactly the same as calling `.listeners` on -the emitter. - -For `EventTarget`s this is the only way to get the event listeners for the -event target. This is useful for debugging and diagnostic purposes. - -```js -import { getEventListeners, EventEmitter } from "node:events"; - -{ - const ee = new EventEmitter(); - const listener = () => console.log("Events are fun"); - ee.on("foo", listener); - console.log(getEventListeners(ee, "foo")); // [ [Function: listener] ] -} -{ - const et = new EventTarget(); - const listener = () => console.log("Events are fun"); - et.addEventListener("foo", listener); - console.log(getEventListeners(et, "foo")); // [ [Function: listener] ] -} -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` - -• **name**: `string` \| `symbol` - -#### Returns - -`Function`[] - -#### Since - -v15.2.0, v14.17.0 - -#### Inherited from - -`ClientBase.getEventListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:358 - ---- - -### getMaxListeners() - -> `static` **getMaxListeners**(`emitter`): `number` - -Returns the currently set max amount of listeners. - -For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on -the emitter. - -For `EventTarget`s this is the only way to get the max event listeners for the -event target. If the number of event handlers on a single EventTarget exceeds -the max set, the EventTarget will print a warning. - -```js -import { getMaxListeners, setMaxListeners, EventEmitter } from "node:events"; - -{ - const ee = new EventEmitter(); - console.log(getMaxListeners(ee)); // 10 - setMaxListeners(11, ee); - console.log(getMaxListeners(ee)); // 11 -} -{ - const et = new EventTarget(); - console.log(getMaxListeners(et)); // 10 - setMaxListeners(11, et); - console.log(getMaxListeners(et)); // 11 -} -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> \| `EventTarget` - -#### Returns - -`number` - -#### Since - -v19.9.0 - -#### Inherited from - -`ClientBase.getMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:387 - ---- - -### ~~listenerCount()~~ - -> `static` **listenerCount**(`emitter`, `eventName`): `number` - -A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`. - -```js -import { EventEmitter, listenerCount } from "node:events"; - -const myEmitter = new EventEmitter(); -myEmitter.on("event", () => {}); -myEmitter.on("event", () => {}); -console.log(listenerCount(myEmitter, "event")); -// Prints: 2 -``` - -#### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -The emitter to query - -• **eventName**: `string` \| `symbol` - -The event name - -#### Returns - -`number` - -#### Since - -v0.9.12 - -#### Deprecated - -Since v3.2.0 - Use `listenerCount` instead. - -#### Inherited from - -`ClientBase.listenerCount` - -#### Defined in - -node_modules/@types/node/events.d.ts:330 - ---- - -### on() - -#### on(emitter, eventName, options) - -> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -// Emit later on -process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); -}); - -for await (const event of on(ee, "foo")) { - // The execution of this inner block is synchronous and it - // processes one event at a time (even with await). Do not use - // if concurrent execution is required. - console.log(event); // prints ['bar'] [42] -} -// Unreachable here -``` - -Returns an `AsyncIterator` that iterates `eventName` events. It will throw -if the `EventEmitter` emits `'error'`. It removes all listeners when -exiting the loop. The `value` returned by each iteration is an array -composed of the emitted event arguments. - -An `AbortSignal` can be used to cancel waiting on events: - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ac = new AbortController(); - -(async () => { - const ee = new EventEmitter(); - - // Emit later on - process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); - }); - - for await (const event of on(ee, "foo", { signal: ac.signal })) { - // The execution of this inner block is synchronous and it - // processes one event at a time (even with await). Do not use - // if concurrent execution is required. - console.log(event); // prints ['bar'] [42] - } - // Unreachable here -})(); - -process.nextTick(() => ac.abort()); -``` - -Use the `close` option to specify an array of event names that will end the iteration: - -```js -import { on, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -// Emit later on -process.nextTick(() => { - ee.emit("foo", "bar"); - ee.emit("foo", 42); - ee.emit("close"); -}); - -for await (const event of on(ee, "foo", { close: ["close"] })) { - console.log(event); // prints ['bar'] [42] -} -// the loop will exit after 'close' is emitted -console.log("done"); // prints 'done' -``` - -##### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -• **eventName**: `string` \| `symbol` - -• **options?**: `StaticEventEmitterIteratorOptions` - -##### Returns - -`AsyncIterator`\<`any`[], `any`, `any`\> - -An `AsyncIterator` that iterates `eventName` events emitted by the `emitter` - -##### Since - -v13.6.0, v12.16.0 - -##### Inherited from - -`ClientBase.on` - -##### Defined in - -node_modules/@types/node/events.d.ts:303 - -#### on(emitter, eventName, options) - -> `static` **on**(`emitter`, `eventName`, `options`?): `AsyncIterator`\<`any`[], `any`, `any`\> - -##### Parameters - -• **emitter**: `EventTarget` - -• **eventName**: `string` - -• **options?**: `StaticEventEmitterIteratorOptions` - -##### Returns - -`AsyncIterator`\<`any`[], `any`, `any`\> - -##### Inherited from - -`ClientBase.on` - -##### Defined in - -node_modules/@types/node/events.d.ts:308 - ---- - -### once() - -#### once(emitter, eventName, options) - -> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> - -Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given -event or that is rejected if the `EventEmitter` emits `'error'` while waiting. -The `Promise` will resolve with an array of all the arguments emitted to the -given event. - -This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event -semantics and does not listen to the `'error'` event. - -```js -import { once, EventEmitter } from "node:events"; -import process from "node:process"; - -const ee = new EventEmitter(); - -process.nextTick(() => { - ee.emit("myevent", 42); -}); - -const [value] = await once(ee, "myevent"); -console.log(value); - -const err = new Error("kaboom"); -process.nextTick(() => { - ee.emit("error", err); -}); - -try { - await once(ee, "myevent"); -} catch (err) { - console.error("error happened", err); -} -``` - -The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the -'`error'` event itself, then it is treated as any other kind of event without -special handling: - -```js -import { EventEmitter, once } from "node:events"; - -const ee = new EventEmitter(); - -once(ee, "error") - .then(([err]) => console.log("ok", err.message)) - .catch((err) => console.error("error", err.message)); - -ee.emit("error", new Error("boom")); - -// Prints: ok boom -``` - -An `AbortSignal` can be used to cancel waiting for the event: - -```js -import { EventEmitter, once } from "node:events"; - -const ee = new EventEmitter(); -const ac = new AbortController(); - -async function foo(emitter, event, signal) { - try { - await once(emitter, event, { signal }); - console.log("event emitted!"); - } catch (error) { - if (error.name === "AbortError") { - console.error("Waiting for the event was canceled!"); - } else { - console.error("There was an error", error.message); - } - } -} - -foo(ee, "foo", ac.signal); -ac.abort(); // Abort waiting for the event -ee.emit("foo"); // Prints: Waiting for the event was canceled! -``` - -##### Parameters - -• **emitter**: `EventEmitter`\<`DefaultEventMap`\> - -• **eventName**: `string` \| `symbol` - -• **options?**: `StaticEventEmitterOptions` - -##### Returns - -`Promise`\<`any`[]\> - -##### Since - -v11.13.0, v10.16.0 - -##### Inherited from - -`ClientBase.once` - -##### Defined in - -node_modules/@types/node/events.d.ts:217 - -#### once(emitter, eventName, options) - -> `static` **once**(`emitter`, `eventName`, `options`?): `Promise`\<`any`[]\> - -##### Parameters - -• **emitter**: `EventTarget` - -• **eventName**: `string` - -• **options?**: `StaticEventEmitterOptions` - -##### Returns - -`Promise`\<`any`[]\> - -##### Inherited from - -`ClientBase.once` - -##### Defined in - -node_modules/@types/node/events.d.ts:222 - ---- - -### setMaxListeners() - -> `static` **setMaxListeners**(`n`?, ...`eventTargets`?): `void` - -```js -import { setMaxListeners, EventEmitter } from "node:events"; - -const target = new EventTarget(); -const emitter = new EventEmitter(); - -setMaxListeners(5, target, emitter); -``` - -#### Parameters - -• **n?**: `number` - -A non-negative number. The maximum number of listeners per `EventTarget` event. - -• ...**eventTargets?**: (`EventEmitter`\<`DefaultEventMap`\> \| `EventTarget`)[] - -Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} -objects. - -#### Returns - -`void` - -#### Since - -v15.4.0 - -#### Inherited from - -`ClientBase.setMaxListeners` - -#### Defined in - -node_modules/@types/node/events.d.ts:402 diff --git a/docs/docs/api/classes/WalletProvider.md b/docs/docs/api/classes/WalletProvider.md deleted file mode 100644 index 7f0284df83..0000000000 --- a/docs/docs/api/classes/WalletProvider.md +++ /dev/null @@ -1,97 +0,0 @@ -# Class: WalletProvider - -## Constructors - -### new WalletProvider() - -> **new WalletProvider**(`connection`, `walletPublicKey`): [`WalletProvider`](WalletProvider.md) - -#### Parameters - -• **connection**: `Connection` - -• **walletPublicKey**: `PublicKey` - -#### Returns - -[`WalletProvider`](WalletProvider.md) - -#### Defined in - -[core/src/providers/wallet.ts:53](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L53) - -## Methods - -### fetchPortfolioValue() - -> **fetchPortfolioValue**(`runtime`): `Promise`\<`WalletPortfolio`\> - -#### Parameters - -• **runtime**: `any` - -#### Returns - -`Promise`\<`WalletPortfolio`\> - -#### Defined in - -[core/src/providers/wallet.ts:105](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L105) - ---- - -### fetchPrices() - -> **fetchPrices**(`runtime`): `Promise`\<`Prices`\> - -#### Parameters - -• **runtime**: `any` - -#### Returns - -`Promise`\<`Prices`\> - -#### Defined in - -[core/src/providers/wallet.ts:150](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L150) - ---- - -### formatPortfolio() - -> **formatPortfolio**(`runtime`, `portfolio`, `prices`): `string` - -#### Parameters - -• **runtime**: `any` - -• **portfolio**: `WalletPortfolio` - -• **prices**: `Prices` - -#### Returns - -`string` - -#### Defined in - -[core/src/providers/wallet.ts:192](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L192) - ---- - -### getFormattedPortfolio() - -> **getFormattedPortfolio**(`runtime`): `Promise`\<`string`\> - -#### Parameters - -• **runtime**: `any` - -#### Returns - -`Promise`\<`string`\> - -#### Defined in - -[core/src/providers/wallet.ts:229](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L229) diff --git a/docs/docs/api/enumerations/Clients.md b/docs/docs/api/enumerations/Clients.md index 2639b8da95..2f84564ce5 100644 --- a/docs/docs/api/enumerations/Clients.md +++ b/docs/docs/api/enumerations/Clients.md @@ -8,9 +8,9 @@ #### Defined in -[core/src/core/types.ts:300](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L300) +[packages/core/src/types.ts:322](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L322) ---- +*** ### DISCORD @@ -18,9 +18,9 @@ #### Defined in -[core/src/core/types.ts:299](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L299) +[packages/core/src/types.ts:321](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L321) ---- +*** ### TELEGRAM @@ -28,9 +28,9 @@ #### Defined in -[core/src/core/types.ts:302](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L302) +[packages/core/src/types.ts:324](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L324) ---- +*** ### TWITTER @@ -38,4 +38,4 @@ #### Defined in -[core/src/core/types.ts:301](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L301) +[packages/core/src/types.ts:323](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L323) diff --git a/docs/docs/api/enumerations/GoalStatus.md b/docs/docs/api/enumerations/GoalStatus.md index 3bec50a388..48a39f2180 100644 --- a/docs/docs/api/enumerations/GoalStatus.md +++ b/docs/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/types.ts:57](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L57) ---- +*** ### 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/types.ts:58](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L58) ---- +*** -### IN_PROGRESS +### IN\_PROGRESS -> **IN_PROGRESS**: `"IN_PROGRESS"` +> **IN\_PROGRESS**: `"IN_PROGRESS"` #### Defined in -[core/src/core/types.ts:60](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L60) +[packages/core/src/types.ts:59](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L59) diff --git a/docs/docs/api/enumerations/ImageGenModel.md b/docs/docs/api/enumerations/ImageGenModel.md deleted file mode 100644 index e9b366064b..0000000000 --- a/docs/docs/api/enumerations/ImageGenModel.md +++ /dev/null @@ -1,21 +0,0 @@ -# Enumeration: ImageGenModel - -## Enumeration Members - -### Dalle - -> **Dalle**: `"Dalle"` - -#### Defined in - -[core/src/core/imageGenModels.ts:3](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L3) - ---- - -### TogetherAI - -> **TogetherAI**: `"TogetherAI"` - -#### Defined in - -[core/src/core/imageGenModels.ts:2](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L2) diff --git a/docs/docs/api/enumerations/ModelClass.md b/docs/docs/api/enumerations/ModelClass.md index ff8b624239..d5c0c1c080 100644 --- a/docs/docs/api/enumerations/ModelClass.md +++ b/docs/docs/api/enumerations/ModelClass.md @@ -8,9 +8,19 @@ #### Defined in -[core/src/core/types.ts:79](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L79) +[packages/core/src/types.ts:78](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L78) ---- +*** + +### IMAGE + +> **IMAGE**: `"image"` + +#### Defined in + +[packages/core/src/types.ts:79](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L79) + +*** ### LARGE @@ -18,9 +28,9 @@ #### Defined in -[core/src/core/types.ts:78](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L78) +[packages/core/src/types.ts:77](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L77) ---- +*** ### MEDIUM @@ -28,9 +38,9 @@ #### Defined in -[core/src/core/types.ts:77](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L77) +[packages/core/src/types.ts:76](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L76) ---- +*** ### SMALL @@ -38,4 +48,4 @@ #### Defined in -[core/src/core/types.ts:76](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L76) +[packages/core/src/types.ts:75](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L75) diff --git a/docs/docs/api/enumerations/ModelProvider.md b/docs/docs/api/enumerations/ModelProvider.md deleted file mode 100644 index 8cea253f24..0000000000 --- a/docs/docs/api/enumerations/ModelProvider.md +++ /dev/null @@ -1,101 +0,0 @@ -# Enumeration: ModelProvider - -## Enumeration Members - -### ANTHROPIC - -> **ANTHROPIC**: `"anthropic"` - -#### Defined in - -[core/src/core/types.ts:103](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L103) - ---- - -### CLAUDE_VERTEX - -> **CLAUDE_VERTEX**: `"claude_vertex"` - -#### Defined in - -[core/src/core/types.ts:109](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L109) - ---- - -### GITHUB - -> **GITHUB**: `"GITHUB"` - -#### Defined in - -[core/src/core/types.ts:111](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L111) - ---- - -### GOOGLE - -> **GOOGLE**: `"google"` - -#### Defined in - -[core/src/core/types.ts:108](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L108) - ---- - -### GROK - -> **GROK**: `"grok"` - -#### Defined in - -[core/src/core/types.ts:104](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L104) - ---- - -### GROQ - -> **GROQ**: `"groq"` - -#### Defined in - -[core/src/core/types.ts:105](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L105) - ---- - -### LLAMACLOUD - -> **LLAMACLOUD**: `"llama_cloud"` - -#### Defined in - -[core/src/core/types.ts:106](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L106) - ---- - -### LLAMALOCAL - -> **LLAMALOCAL**: `"llama_local"` - -#### Defined in - -[core/src/core/types.ts:107](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L107) - ---- - -### OPENAI - -> **OPENAI**: `"openai"` - -#### Defined in - -[core/src/core/types.ts:102](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L102) - ---- - -### REDPILL - -> **REDPILL**: `"redpill"` - -#### Defined in - -[core/src/core/types.ts:110](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L110) diff --git a/docs/docs/api/enumerations/ModelProviderName.md b/docs/docs/api/enumerations/ModelProviderName.md new file mode 100644 index 0000000000..461236918f --- /dev/null +++ b/docs/docs/api/enumerations/ModelProviderName.md @@ -0,0 +1,111 @@ +# Enumeration: ModelProviderName + +## Enumeration Members + +### ANTHROPIC + +> **ANTHROPIC**: `"anthropic"` + +#### Defined in + +[packages/core/src/types.ts:121](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L121) + +*** + +### CLAUDE\_VERTEX + +> **CLAUDE\_VERTEX**: `"claude_vertex"` + +#### Defined in + +[packages/core/src/types.ts:127](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L127) + +*** + +### GOOGLE + +> **GOOGLE**: `"google"` + +#### Defined in + +[packages/core/src/types.ts:126](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L126) + +*** + +### GROK + +> **GROK**: `"grok"` + +#### Defined in + +[packages/core/src/types.ts:122](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L122) + +*** + +### GROQ + +> **GROQ**: `"groq"` + +#### Defined in + +[packages/core/src/types.ts:123](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L123) + +*** + +### LLAMACLOUD + +> **LLAMACLOUD**: `"llama_cloud"` + +#### Defined in + +[packages/core/src/types.ts:124](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L124) + +*** + +### LLAMALOCAL + +> **LLAMALOCAL**: `"llama_local"` + +#### Defined in + +[packages/core/src/types.ts:125](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L125) + +*** + +### OLLAMA + +> **OLLAMA**: `"ollama"` + +#### Defined in + +[packages/core/src/types.ts:130](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L130) + +*** + +### OPENAI + +> **OPENAI**: `"openai"` + +#### Defined in + +[packages/core/src/types.ts:120](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L120) + +*** + +### OPENROUTER + +> **OPENROUTER**: `"openrouter"` + +#### Defined in + +[packages/core/src/types.ts:129](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L129) + +*** + +### REDPILL + +> **REDPILL**: `"redpill"` + +#### Defined in + +[packages/core/src/types.ts:128](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L128) diff --git a/docs/docs/api/enumerations/ServiceType.md b/docs/docs/api/enumerations/ServiceType.md new file mode 100644 index 0000000000..786e3ea9e8 --- /dev/null +++ b/docs/docs/api/enumerations/ServiceType.md @@ -0,0 +1,71 @@ +# Enumeration: ServiceType + +## Enumeration Members + +### BROWSER + +> **BROWSER**: `"browser"` + +#### Defined in + +[packages/core/src/types.ts:650](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L650) + +*** + +### IMAGE\_DESCRIPTION + +> **IMAGE\_DESCRIPTION**: `"image_description"` + +#### Defined in + +[packages/core/src/types.ts:646](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L646) + +*** + +### PDF + +> **PDF**: `"pdf"` + +#### Defined in + +[packages/core/src/types.ts:652](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L652) + +*** + +### SPEECH\_GENERATION + +> **SPEECH\_GENERATION**: `"speech_generation"` + +#### Defined in + +[packages/core/src/types.ts:651](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L651) + +*** + +### TEXT\_GENERATION + +> **TEXT\_GENERATION**: `"text_generation"` + +#### Defined in + +[packages/core/src/types.ts:649](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L649) + +*** + +### TRANSCRIPTION + +> **TRANSCRIPTION**: `"transcription"` + +#### Defined in + +[packages/core/src/types.ts:647](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L647) + +*** + +### VIDEO + +> **VIDEO**: `"video"` + +#### Defined in + +[packages/core/src/types.ts:648](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L648) diff --git a/docs/docs/api/functions/addHeader.md b/docs/docs/api/functions/addHeader.md index b93ea9b244..aa1df516fe 100644 --- a/docs/docs/api/functions/addHeader.md +++ b/docs/docs/api/functions/addHeader.md @@ -37,4 +37,4 @@ const text = addHeader(header, body); ## Defined in -[core/src/core/context.ts:58](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/context.ts#L58) +[packages/core/src/context.ts:58](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/context.ts#L58) diff --git a/docs/docs/api/functions/buyToken.md b/docs/docs/api/functions/buyToken.md deleted file mode 100644 index 98dfb5f0d5..0000000000 --- a/docs/docs/api/functions/buyToken.md +++ /dev/null @@ -1,31 +0,0 @@ -# Function: buyToken() - -> **buyToken**(`__namedParameters`): `Promise`\<`void`\> - -## Parameters - -• **\_\_namedParameters** - -• **\_\_namedParameters.allowOffCurve**: `boolean` - -• **\_\_namedParameters.amount**: `bigint` - -• **\_\_namedParameters.buyer**: `Keypair` - -• **\_\_namedParameters.connection**: `Connection` - -• **\_\_namedParameters.mint**: `PublicKey` - -• **\_\_namedParameters.priorityFee**: `PriorityFee` - -• **\_\_namedParameters.sdk**: `PumpFunSDK` - -• **\_\_namedParameters.slippage**: `string` - -## Returns - -`Promise`\<`void`\> - -## Defined in - -[core/src/actions/pumpfun.ts:119](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L119) diff --git a/docs/docs/api/functions/composeActionExamples.md b/docs/docs/api/functions/composeActionExamples.md index 8ba5371a57..31ed21c4b0 100644 --- a/docs/docs/api/functions/composeActionExamples.md +++ b/docs/docs/api/functions/composeActionExamples.md @@ -23,4 +23,4 @@ A string containing formatted examples of conversations. ## Defined in -[core/src/core/actions.ts:18](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/actions.ts#L18) +[packages/core/src/actions.ts:11](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/actions.ts#L11) diff --git a/docs/docs/api/functions/composeContext.md b/docs/docs/api/functions/composeContext.md index df9064caa5..1f4c332ed6 100644 --- a/docs/docs/api/functions/composeContext.md +++ b/docs/docs/api/functions/composeContext.md @@ -42,4 +42,4 @@ const context = composeContext({ state, template }); ## Defined in -[core/src/core/context.ts:24](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/context.ts#L24) +[packages/core/src/context.ts:24](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/context.ts#L24) diff --git a/docs/docs/api/functions/createAgentRuntime.md b/docs/docs/api/functions/createAgentRuntime.md deleted file mode 100644 index ef33390ee9..0000000000 --- a/docs/docs/api/functions/createAgentRuntime.md +++ /dev/null @@ -1,21 +0,0 @@ -# Function: createAgentRuntime() - -> **createAgentRuntime**(`character`, `db`, `token`, `configPath`): `Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> - -## Parameters - -• **character**: [`Character`](../type-aliases/Character.md) - -• **db**: `any` - -• **token**: `string` - -• **configPath**: `string` = `"./elizaConfig.yaml"` - -## Returns - -`Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> - -## Defined in - -[core/src/cli/index.ts:139](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L139) diff --git a/docs/docs/api/functions/createAndBuyToken.md b/docs/docs/api/functions/createAndBuyToken.md deleted file mode 100644 index 06add69922..0000000000 --- a/docs/docs/api/functions/createAndBuyToken.md +++ /dev/null @@ -1,35 +0,0 @@ -# Function: createAndBuyToken() - -> **createAndBuyToken**(`__namedParameters`): `Promise`\<`void`\> - -## Parameters - -• **\_\_namedParameters** - -• **\_\_namedParameters.allowOffCurve**: `boolean` - -• **\_\_namedParameters.buyAmountSol**: `bigint` - -• **\_\_namedParameters.commitment?**: `"processed"` \| `"confirmed"` \| `"finalized"` \| `"recent"` \| `"single"` \| `"singleGossip"` \| `"root"` \| `"max"` = `"finalized"` - -• **\_\_namedParameters.connection**: `Connection` - -• **\_\_namedParameters.deployer**: `Keypair` - -• **\_\_namedParameters.mint**: `Keypair` - -• **\_\_namedParameters.priorityFee**: `PriorityFee` - -• **\_\_namedParameters.sdk**: `PumpFunSDK` - -• **\_\_namedParameters.slippage**: `string` - -• **\_\_namedParameters.tokenMetadata**: `CreateTokenMetadata` - -## Returns - -`Promise`\<`void`\> - -## Defined in - -[core/src/actions/pumpfun.ts:51](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L51) diff --git a/docs/docs/api/functions/createDirectRuntime.md b/docs/docs/api/functions/createDirectRuntime.md deleted file mode 100644 index 256a9cf0b0..0000000000 --- a/docs/docs/api/functions/createDirectRuntime.md +++ /dev/null @@ -1,21 +0,0 @@ -# Function: createDirectRuntime() - -> **createDirectRuntime**(`character`, `db`, `token`, `configPath`): `Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> - -## Parameters - -• **character**: [`Character`](../type-aliases/Character.md) - -• **db**: `any` - -• **token**: `string` - -• **configPath**: `string` = `"./elizaConfig.yaml"` - -## Returns - -`Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> - -## Defined in - -[core/src/cli/index.ts:174](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L174) diff --git a/docs/docs/api/functions/createGoal.md b/docs/docs/api/functions/createGoal.md index afa2fc3f4f..28962dd1aa 100644 --- a/docs/docs/api/functions/createGoal.md +++ b/docs/docs/api/functions/createGoal.md @@ -16,4 +16,4 @@ ## Defined in -[core/src/core/goals.ts:54](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/goals.ts#L54) +[packages/core/src/goals.ts:54](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/goals.ts#L54) diff --git a/docs/docs/api/functions/createRelationship.md b/docs/docs/api/functions/createRelationship.md index 431a17e4a0..944a8ca067 100644 --- a/docs/docs/api/functions/createRelationship.md +++ b/docs/docs/api/functions/createRelationship.md @@ -18,4 +18,4 @@ ## Defined in -[core/src/core/relationships.ts:3](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/relationships.ts#L3) +[packages/core/src/relationships.ts:3](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/relationships.ts#L3) diff --git a/docs/docs/api/functions/embed.md b/docs/docs/api/functions/embed.md index 9c9492cbc5..c742d2ab47 100644 --- a/docs/docs/api/functions/embed.md +++ b/docs/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/embedding.ts:88](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/embedding.ts#L88) diff --git a/docs/docs/api/functions/findNearestEnvFile.md b/docs/docs/api/functions/findNearestEnvFile.md new file mode 100644 index 0000000000..dddcc99bfc --- /dev/null +++ b/docs/docs/api/functions/findNearestEnvFile.md @@ -0,0 +1,22 @@ +# Function: findNearestEnvFile() + +> **findNearestEnvFile**(`startDir`?): `string` + +Recursively searches for a .env file starting from the current directory +and moving up through parent directories + +## Parameters + +• **startDir?**: `string` = `...` + +Starting directory for the search + +## Returns + +`string` + +Path to the nearest .env file or null if not found + +## Defined in + +[packages/core/src/settings.ts:11](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/settings.ts#L11) diff --git a/docs/docs/api/functions/formatActionNames.md b/docs/docs/api/functions/formatActionNames.md index e2b189af44..872a0f42c9 100644 --- a/docs/docs/api/functions/formatActionNames.md +++ b/docs/docs/api/functions/formatActionNames.md @@ -18,4 +18,4 @@ A comma-separated string of action names. ## Defined in -[core/src/core/actions.ts:54](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/actions.ts#L54) +[packages/core/src/actions.ts:47](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/actions.ts#L47) diff --git a/docs/docs/api/functions/formatActions.md b/docs/docs/api/functions/formatActions.md index 9b181d7bb3..cf0a37f569 100644 --- a/docs/docs/api/functions/formatActions.md +++ b/docs/docs/api/functions/formatActions.md @@ -18,4 +18,4 @@ A detailed string of actions, including names and descriptions. ## Defined in -[core/src/core/actions.ts:66](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/actions.ts#L66) +[packages/core/src/actions.ts:59](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/actions.ts#L59) diff --git a/docs/docs/api/functions/formatActors.md b/docs/docs/api/functions/formatActors.md index 43b2112243..2f5df3df79 100644 --- a/docs/docs/api/functions/formatActors.md +++ b/docs/docs/api/functions/formatActors.md @@ -20,4 +20,4 @@ string ## Defined in -[core/src/core/messages.ts:45](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/messages.ts#L45) +[packages/core/src/messages.ts:45](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/messages.ts#L45) diff --git a/docs/docs/api/functions/formatEvaluatorExampleDescriptions.md b/docs/docs/api/functions/formatEvaluatorExampleDescriptions.md index 3c3e677ecf..5bb4f5914e 100644 --- a/docs/docs/api/functions/formatEvaluatorExampleDescriptions.md +++ b/docs/docs/api/functions/formatEvaluatorExampleDescriptions.md @@ -18,4 +18,4 @@ A string that summarizes the descriptions for each evaluator example, formatted ## Defined in -[core/src/core/evaluators.ts:114](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L114) +[packages/core/src/evaluators.ts:110](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/evaluators.ts#L110) diff --git a/docs/docs/api/functions/formatEvaluatorExamples.md b/docs/docs/api/functions/formatEvaluatorExamples.md index b0e29b29d8..99f9a50576 100644 --- a/docs/docs/api/functions/formatEvaluatorExamples.md +++ b/docs/docs/api/functions/formatEvaluatorExamples.md @@ -18,4 +18,4 @@ A string that presents each evaluator example in a structured format, including ## Defined in -[core/src/core/evaluators.ts:59](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L59) +[packages/core/src/evaluators.ts:55](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/evaluators.ts#L55) diff --git a/docs/docs/api/functions/formatEvaluatorNames.md b/docs/docs/api/functions/formatEvaluatorNames.md index f678678238..81ccd58e56 100644 --- a/docs/docs/api/functions/formatEvaluatorNames.md +++ b/docs/docs/api/functions/formatEvaluatorNames.md @@ -18,4 +18,4 @@ A string that concatenates the names of all evaluators, each enclosed in single ## Defined in -[core/src/core/evaluators.ts:34](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L34) +[packages/core/src/evaluators.ts:30](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/evaluators.ts#L30) diff --git a/docs/docs/api/functions/formatEvaluators.md b/docs/docs/api/functions/formatEvaluators.md index bdabc314ac..94c951ac0c 100644 --- a/docs/docs/api/functions/formatEvaluators.md +++ b/docs/docs/api/functions/formatEvaluators.md @@ -18,4 +18,4 @@ A string that concatenates the name and description of each evaluator, separated ## Defined in -[core/src/core/evaluators.ts:45](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L45) +[packages/core/src/evaluators.ts:41](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/evaluators.ts#L41) diff --git a/docs/docs/api/functions/formatGoalsAsString.md b/docs/docs/api/functions/formatGoalsAsString.md index abf951cbde..b5dae1184d 100644 --- a/docs/docs/api/functions/formatGoalsAsString.md +++ b/docs/docs/api/functions/formatGoalsAsString.md @@ -14,4 +14,4 @@ ## Defined in -[core/src/core/goals.ts:29](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/goals.ts#L29) +[packages/core/src/goals.ts:29](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/goals.ts#L29) diff --git a/docs/docs/api/functions/formatMessages.md b/docs/docs/api/functions/formatMessages.md index 7dd245834e..d9a00b9837 100644 --- a/docs/docs/api/functions/formatMessages.md +++ b/docs/docs/api/functions/formatMessages.md @@ -20,4 +20,4 @@ string ## Defined in -[core/src/core/messages.ts:60](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/messages.ts#L60) +[packages/core/src/messages.ts:60](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/messages.ts#L60) diff --git a/docs/docs/api/functions/formatPosts.md b/docs/docs/api/functions/formatPosts.md index 565fc5d336..8c2d56e707 100644 --- a/docs/docs/api/functions/formatPosts.md +++ b/docs/docs/api/functions/formatPosts.md @@ -18,4 +18,4 @@ ## Defined in -[core/src/core/posts.ts:4](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/posts.ts#L4) +[packages/core/src/posts.ts:4](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/posts.ts#L4) diff --git a/docs/docs/api/functions/formatRelationships.md b/docs/docs/api/functions/formatRelationships.md index cd1d8dd754..c9051b1e1b 100644 --- a/docs/docs/api/functions/formatRelationships.md +++ b/docs/docs/api/functions/formatRelationships.md @@ -16,4 +16,4 @@ ## Defined in -[core/src/core/relationships.ts:43](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/relationships.ts#L43) +[packages/core/src/relationships.ts:43](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/relationships.ts#L43) diff --git a/docs/docs/api/functions/formatTimestamp.md b/docs/docs/api/functions/formatTimestamp.md index a33b4ceed5..6adbd98818 100644 --- a/docs/docs/api/functions/formatTimestamp.md +++ b/docs/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/messages.ts:94](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/messages.ts#L94) diff --git a/docs/docs/api/functions/generateCaption.md b/docs/docs/api/functions/generateCaption.md index 3f9b6eaea6..d6c523b20f 100644 --- a/docs/docs/api/functions/generateCaption.md +++ b/docs/docs/api/functions/generateCaption.md @@ -24,4 +24,4 @@ ## Defined in -[core/src/actions/imageGenerationUtils.ts:90](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/imageGenerationUtils.ts#L90) +[packages/core/src/generation.ts:734](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L734) diff --git a/docs/docs/api/functions/generateImage.md b/docs/docs/api/functions/generateImage.md index e5b91938b0..4900cca7fa 100644 --- a/docs/docs/api/functions/generateImage.md +++ b/docs/docs/api/functions/generateImage.md @@ -34,4 +34,4 @@ ## Defined in -[core/src/actions/imageGenerationUtils.ts:8](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/imageGenerationUtils.ts#L8) +[packages/core/src/generation.ts:650](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L650) diff --git a/docs/docs/api/functions/generateMessageResponse.md b/docs/docs/api/functions/generateMessageResponse.md index 90542895ec..5f9ae1f47d 100644 --- a/docs/docs/api/functions/generateMessageResponse.md +++ b/docs/docs/api/functions/generateMessageResponse.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/generation.ts:612](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L612) diff --git a/docs/docs/api/functions/generateObject.md b/docs/docs/api/functions/generateObject.md index 9d1dbf9eea..b3c684ec26 100644 --- a/docs/docs/api/functions/generateObject.md +++ b/docs/docs/api/functions/generateObject.md @@ -18,4 +18,4 @@ ## Defined in -[core/src/core/generation.ts:438](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L438) +[packages/core/src/generation.ts:528](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L528) diff --git a/docs/docs/api/functions/generateObjectArray.md b/docs/docs/api/functions/generateObjectArray.md index af24589e74..7ea39cd785 100644 --- a/docs/docs/api/functions/generateObjectArray.md +++ b/docs/docs/api/functions/generateObjectArray.md @@ -18,4 +18,4 @@ ## Defined in -[core/src/core/generation.ts:474](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/generation.ts#L474) +[packages/core/src/generation.ts:564](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L564) diff --git a/docs/docs/api/functions/generateShouldRespond.md b/docs/docs/api/functions/generateShouldRespond.md index 5f73dfa705..00159770f3 100644 --- a/docs/docs/api/functions/generateShouldRespond.md +++ b/docs/docs/api/functions/generateShouldRespond.md @@ -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/generation.ts:334](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L334) diff --git a/docs/docs/api/functions/generateText.md b/docs/docs/api/functions/generateText.md index 4c5c6da997..4822c4f911 100644 --- a/docs/docs/api/functions/generateText.md +++ b/docs/docs/api/functions/generateText.md @@ -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/generation.ts:43](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L43) diff --git a/docs/docs/api/functions/generateTextArray.md b/docs/docs/api/functions/generateTextArray.md index 8aa1618631..9535e6ff2b 100644 --- a/docs/docs/api/functions/generateTextArray.md +++ b/docs/docs/api/functions/generateTextArray.md @@ -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/generation.ts:492](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L492) diff --git a/docs/docs/api/functions/generateTrueOrFalse.md b/docs/docs/api/functions/generateTrueOrFalse.md index 55a73fb820..7d967ba485 100644 --- a/docs/docs/api/functions/generateTrueOrFalse.md +++ b/docs/docs/api/functions/generateTrueOrFalse.md @@ -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/generation.ts:436](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L436) diff --git a/docs/docs/api/functions/getActorDetails.md b/docs/docs/api/functions/getActorDetails.md index fd1308e231..29f6b9051a 100644 --- a/docs/docs/api/functions/getActorDetails.md +++ b/docs/docs/api/functions/getActorDetails.md @@ -18,4 +18,4 @@ Get details for a list of actors. ## Defined in -[core/src/core/messages.ts:12](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/messages.ts#L12) +[packages/core/src/messages.ts:12](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/messages.ts#L12) diff --git a/docs/docs/api/functions/getEndpoint.md b/docs/docs/api/functions/getEndpoint.md index 80d526b74a..9256e2ed63 100644 --- a/docs/docs/api/functions/getEndpoint.md +++ b/docs/docs/api/functions/getEndpoint.md @@ -1,15 +1,15 @@ # Function: getEndpoint() -> **getEndpoint**(`provider`): `any` +> **getEndpoint**(`provider`): `string` ## Parameters -• **provider**: [`ModelProvider`](../enumerations/ModelProvider.md) +• **provider**: [`ModelProviderName`](../enumerations/ModelProviderName.md) ## 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/models.ts:226](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/models.ts#L226) diff --git a/docs/docs/api/functions/getGoals.md b/docs/docs/api/functions/getGoals.md index 145fbd9bed..00070bcea5 100644 --- a/docs/docs/api/functions/getGoals.md +++ b/docs/docs/api/functions/getGoals.md @@ -22,4 +22,4 @@ ## Defined in -[core/src/core/goals.ts:8](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/goals.ts#L8) +[packages/core/src/goals.ts:8](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/goals.ts#L8) diff --git a/docs/docs/api/functions/getImageGenModel.md b/docs/docs/api/functions/getImageGenModel.md deleted file mode 100644 index cb905f5316..0000000000 --- a/docs/docs/api/functions/getImageGenModel.md +++ /dev/null @@ -1,15 +0,0 @@ -# Function: getImageGenModel() - -> **getImageGenModel**(`model`): `object` \| `object` - -## Parameters - -• **model**: [`ImageGenModel`](../enumerations/ImageGenModel.md) - -## Returns - -`object` \| `object` - -## Defined in - -[core/src/core/imageGenModels.ts:17](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L17) diff --git a/docs/docs/api/functions/getModel.md b/docs/docs/api/functions/getModel.md index 9c980265b4..e1cd774147 100644 --- a/docs/docs/api/functions/getModel.md +++ b/docs/docs/api/functions/getModel.md @@ -1,17 +1,17 @@ # Function: getModel() -> **getModel**(`provider`, `type`): `any` +> **getModel**(`provider`, `type`): `string` ## Parameters -• **provider**: [`ModelProvider`](../enumerations/ModelProvider.md) +• **provider**: [`ModelProviderName`](../enumerations/ModelProviderName.md) • **type**: [`ModelClass`](../enumerations/ModelClass.md) ## 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/models.ts:222](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/models.ts#L222) diff --git a/docs/docs/api/functions/getProviders.md b/docs/docs/api/functions/getProviders.md index ae5e5b56b6..51868fa096 100644 --- a/docs/docs/api/functions/getProviders.md +++ b/docs/docs/api/functions/getProviders.md @@ -26,4 +26,4 @@ A string that concatenates the outputs of each provider. ## Defined in -[core/src/core/providers.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/providers.ts#L13) +[packages/core/src/providers.ts:10](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/providers.ts#L10) diff --git a/docs/docs/api/functions/getRelationship.md b/docs/docs/api/functions/getRelationship.md index 53db6c21ee..48fd452b11 100644 --- a/docs/docs/api/functions/getRelationship.md +++ b/docs/docs/api/functions/getRelationship.md @@ -18,4 +18,4 @@ ## Defined in -[core/src/core/relationships.ts:18](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/relationships.ts#L18) +[packages/core/src/relationships.ts:18](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/relationships.ts#L18) diff --git a/docs/docs/api/functions/getRelationships.md b/docs/docs/api/functions/getRelationships.md index c4b451730c..dd2f41f6ad 100644 --- a/docs/docs/api/functions/getRelationships.md +++ b/docs/docs/api/functions/getRelationships.md @@ -16,4 +16,4 @@ ## Defined in -[core/src/core/relationships.ts:33](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/relationships.ts#L33) +[packages/core/src/relationships.ts:33](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/relationships.ts#L33) diff --git a/docs/docs/api/functions/getTokenForProvider.md b/docs/docs/api/functions/getTokenForProvider.md deleted file mode 100644 index 0177abf0f6..0000000000 --- a/docs/docs/api/functions/getTokenForProvider.md +++ /dev/null @@ -1,17 +0,0 @@ -# Function: getTokenForProvider() - -> **getTokenForProvider**(`provider`, `character`): `string` - -## Parameters - -• **provider**: [`ModelProvider`](../enumerations/ModelProvider.md) - -• **character**: [`Character`](../type-aliases/Character.md) - -## Returns - -`string` - -## Defined in - -[core/src/cli/index.ts:105](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L105) diff --git a/docs/docs/api/functions/initializeClients.md b/docs/docs/api/functions/initializeClients.md deleted file mode 100644 index 9549c70a10..0000000000 --- a/docs/docs/api/functions/initializeClients.md +++ /dev/null @@ -1,17 +0,0 @@ -# Function: initializeClients() - -> **initializeClients**(`character`, `runtime`): `Promise`\<`any`[]\> - -## Parameters - -• **character**: [`Character`](../type-aliases/Character.md) - -• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -## Returns - -`Promise`\<`any`[]\> - -## Defined in - -[core/src/cli/index.ts:21](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L21) diff --git a/docs/docs/api/functions/initializeDatabase.md b/docs/docs/api/functions/initializeDatabase.md deleted file mode 100644 index d7d58df27f..0000000000 --- a/docs/docs/api/functions/initializeDatabase.md +++ /dev/null @@ -1,11 +0,0 @@ -# Function: initializeDatabase() - -> **initializeDatabase**(): [`PostgresDatabaseAdapter`](../classes/PostgresDatabaseAdapter.md) \| [`SqliteDatabaseAdapter`](../classes/SqliteDatabaseAdapter.md) - -## Returns - -[`PostgresDatabaseAdapter`](../classes/PostgresDatabaseAdapter.md) \| [`SqliteDatabaseAdapter`](../classes/SqliteDatabaseAdapter.md) - -## Defined in - -[core/src/cli/index.ts:129](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L129) diff --git a/docs/docs/api/functions/isCreateAndBuyContent.md b/docs/docs/api/functions/isCreateAndBuyContent.md deleted file mode 100644 index da8cdbee1a..0000000000 --- a/docs/docs/api/functions/isCreateAndBuyContent.md +++ /dev/null @@ -1,17 +0,0 @@ -# Function: isCreateAndBuyContent() - -> **isCreateAndBuyContent**(`runtime`, `content`): `content is CreateAndBuyContent` - -## Parameters - -• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -• **content**: `any` - -## Returns - -`content is CreateAndBuyContent` - -## Defined in - -[core/src/actions/pumpfun.ts:33](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L33) diff --git a/docs/docs/api/functions/loadActionConfigs.md b/docs/docs/api/functions/loadActionConfigs.md deleted file mode 100644 index 3348a03d81..0000000000 --- a/docs/docs/api/functions/loadActionConfigs.md +++ /dev/null @@ -1,15 +0,0 @@ -# Function: loadActionConfigs() - -> **loadActionConfigs**(`configPath`): `ActionConfig`[] - -## Parameters - -• **configPath**: `string` - -## Returns - -`ActionConfig`[] - -## Defined in - -[core/src/cli/config.ts:15](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/config.ts#L15) diff --git a/docs/docs/api/functions/loadCharacters.md b/docs/docs/api/functions/loadCharacters.md deleted file mode 100644 index 43f4922c04..0000000000 --- a/docs/docs/api/functions/loadCharacters.md +++ /dev/null @@ -1,15 +0,0 @@ -# Function: loadCharacters() - -> **loadCharacters**(`charactersArg`): [`Character`](../type-aliases/Character.md)[] - -## Parameters - -• **charactersArg**: `string` - -## Returns - -[`Character`](../type-aliases/Character.md)[] - -## Defined in - -[core/src/cli/index.ts:70](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L70) diff --git a/docs/docs/api/functions/loadCustomActions.md b/docs/docs/api/functions/loadCustomActions.md deleted file mode 100644 index c1d81f66a4..0000000000 --- a/docs/docs/api/functions/loadCustomActions.md +++ /dev/null @@ -1,15 +0,0 @@ -# Function: loadCustomActions() - -> **loadCustomActions**(`actionConfigs`): `Promise`\<[`Action`](../interfaces/Action.md)[]\> - -## Parameters - -• **actionConfigs**: `ActionConfig`[] - -## Returns - -`Promise`\<[`Action`](../interfaces/Action.md)[]\> - -## Defined in - -[core/src/cli/config.ts:26](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/config.ts#L26) diff --git a/docs/docs/api/functions/loadEnvConfig.md b/docs/docs/api/functions/loadEnvConfig.md new file mode 100644 index 0000000000..e35a0abe67 --- /dev/null +++ b/docs/docs/api/functions/loadEnvConfig.md @@ -0,0 +1,19 @@ +# Function: loadEnvConfig() + +> **loadEnvConfig**(): `ProcessEnv` + +Loads environment variables from the nearest .env file + +## Returns + +`ProcessEnv` + +Environment variables object + +## Throws + +If no .env file is found + +## Defined in + +[packages/core/src/settings.ts:36](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/settings.ts#L36) diff --git a/docs/docs/api/functions/parseArguments.md b/docs/docs/api/functions/parseArguments.md deleted file mode 100644 index b70bd97354..0000000000 --- a/docs/docs/api/functions/parseArguments.md +++ /dev/null @@ -1,11 +0,0 @@ -# Function: parseArguments() - -> **parseArguments**(): `Arguments` - -## Returns - -`Arguments` - -## Defined in - -[core/src/cli/index.ts:46](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L46) diff --git a/docs/docs/api/functions/retrieveCachedEmbedding.md b/docs/docs/api/functions/retrieveCachedEmbedding.md index 31922d1ebc..ae1ad555ee 100644 --- a/docs/docs/api/functions/retrieveCachedEmbedding.md +++ b/docs/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/embedding.ts:146](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/embedding.ts#L146) diff --git a/docs/docs/api/functions/sellToken.md b/docs/docs/api/functions/sellToken.md deleted file mode 100644 index c275a4ae4e..0000000000 --- a/docs/docs/api/functions/sellToken.md +++ /dev/null @@ -1,31 +0,0 @@ -# Function: sellToken() - -> **sellToken**(`__namedParameters`): `Promise`\<`void`\> - -## Parameters - -• **\_\_namedParameters** - -• **\_\_namedParameters.allowOffCurve**: `boolean` - -• **\_\_namedParameters.amount**: `bigint` - -• **\_\_namedParameters.connection**: `Connection` - -• **\_\_namedParameters.mint**: `PublicKey` - -• **\_\_namedParameters.priorityFee**: `PriorityFee` - -• **\_\_namedParameters.sdk**: `PumpFunSDK` - -• **\_\_namedParameters.seller**: `Keypair` - -• **\_\_namedParameters.slippage**: `string` - -## Returns - -`Promise`\<`void`\> - -## Defined in - -[core/src/actions/pumpfun.ts:167](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L167) diff --git a/docs/docs/api/functions/splitChunks.md b/docs/docs/api/functions/splitChunks.md index 7e8758b533..9c40b2686b 100644 --- a/docs/docs/api/functions/splitChunks.md +++ b/docs/docs/api/functions/splitChunks.md @@ -1,13 +1,11 @@ # Function: splitChunks() -> **splitChunks**(`runtime`, `content`, `chunkSize`, `bleed`, `modelClass`): `Promise`\<`string`[]\> +> **splitChunks**(`content`, `chunkSize`, `bleed`): `Promise`\<`string`[]\> Splits content into chunks of specified size with optional overlapping bleed sections ## Parameters -• **runtime**: `any` - • **content**: `string` The text content to split into chunks @@ -20,8 +18,6 @@ The maximum size of each chunk in tokens Number of characters to overlap between chunks (default: 100) -• **modelClass**: `string` - ## Returns `Promise`\<`string`[]\> @@ -30,4 +26,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/generation.ts:390](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L390) diff --git a/docs/docs/api/functions/startDiscord.md b/docs/docs/api/functions/startDiscord.md deleted file mode 100644 index 1c46e116f3..0000000000 --- a/docs/docs/api/functions/startDiscord.md +++ /dev/null @@ -1,15 +0,0 @@ -# Function: startDiscord() - -> **startDiscord**(`runtime`): [`DiscordClient`](../classes/DiscordClient.md) - -## Parameters - -• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -## Returns - -[`DiscordClient`](../classes/DiscordClient.md) - -## Defined in - -[core/src/cli/index.ts:211](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L211) diff --git a/docs/docs/api/functions/startTelegram.md b/docs/docs/api/functions/startTelegram.md deleted file mode 100644 index f70aa9fbab..0000000000 --- a/docs/docs/api/functions/startTelegram.md +++ /dev/null @@ -1,17 +0,0 @@ -# Function: startTelegram() - -> **startTelegram**(`runtime`, `character`): `Promise`\<[`TelegramClient`](../classes/TelegramClient.md)\> - -## Parameters - -• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -• **character**: [`Character`](../type-aliases/Character.md) - -## Returns - -`Promise`\<[`TelegramClient`](../classes/TelegramClient.md)\> - -## Defined in - -[core/src/cli/index.ts:215](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L215) diff --git a/docs/docs/api/functions/startTwitter.md b/docs/docs/api/functions/startTwitter.md deleted file mode 100644 index ab9859190d..0000000000 --- a/docs/docs/api/functions/startTwitter.md +++ /dev/null @@ -1,15 +0,0 @@ -# Function: startTwitter() - -> **startTwitter**(`runtime`): `Promise`\<([`TwitterPostClient`](../classes/TwitterPostClient.md) \| [`TwitterInteractionClient`](../classes/TwitterInteractionClient.md) \| [`TwitterSearchClient`](../classes/TwitterSearchClient.md))[]\> - -## Parameters - -• **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) - -## Returns - -`Promise`\<([`TwitterPostClient`](../classes/TwitterPostClient.md) \| [`TwitterInteractionClient`](../classes/TwitterInteractionClient.md) \| [`TwitterSearchClient`](../classes/TwitterSearchClient.md))[]\> - -## Defined in - -[core/src/cli/index.ts:245](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/cli/index.ts#L245) diff --git a/docs/docs/api/functions/trimTokens.md b/docs/docs/api/functions/trimTokens.md index b42f5b1671..251a92dc9d 100644 --- a/docs/docs/api/functions/trimTokens.md +++ b/docs/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/generation.ts:308](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/generation.ts#L308) diff --git a/docs/docs/api/functions/updateGoal.md b/docs/docs/api/functions/updateGoal.md index b4150ab70f..d2d93fe87f 100644 --- a/docs/docs/api/functions/updateGoal.md +++ b/docs/docs/api/functions/updateGoal.md @@ -16,4 +16,4 @@ ## Defined in -[core/src/core/goals.ts:44](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/goals.ts#L44) +[packages/core/src/goals.ts:44](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/goals.ts#L44) diff --git a/docs/docs/api/globals.md b/docs/docs/api/globals.md index c01b63de24..016a5729a6 100644 --- a/docs/docs/api/globals.md +++ b/docs/docs/api/globals.md @@ -1,28 +1,19 @@ -# @eliza/core +# @ai16z/eliza ## Enumerations - [Clients](enumerations/Clients.md) - [GoalStatus](enumerations/GoalStatus.md) -- [ImageGenModel](enumerations/ImageGenModel.md) - [ModelClass](enumerations/ModelClass.md) -- [ModelProvider](enumerations/ModelProvider.md) +- [ModelProviderName](enumerations/ModelProviderName.md) +- [ServiceType](enumerations/ServiceType.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) +- [Service](classes/Service.md) ## Interfaces @@ -32,18 +23,17 @@ - [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) +- [IImageDescriptionService](interfaces/IImageDescriptionService.md) - [IMemoryManager](interfaces/IMemoryManager.md) - [IPdfService](interfaces/IPdfService.md) - [ISpeechService](interfaces/ISpeechService.md) +- [ITextGenerationService](interfaces/ITextGenerationService.md) - [ITranscriptionService](interfaces/ITranscriptionService.md) - [IVideoService](interfaces/IVideoService.md) - [Memory](interfaces/Memory.md) @@ -58,57 +48,34 @@ ## Type Aliases - [Character](type-aliases/Character.md) +- [Client](type-aliases/Client.md) - [Handler](type-aliases/Handler.md) - [HandlerCallback](type-aliases/HandlerCallback.md) - [Media](type-aliases/Media.md) - [Model](type-aliases/Model.md) +- [Models](type-aliases/Models.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) +- [settings](variables/settings.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) +- [findNearestEnvFile](functions/findNearestEnvFile.md) - [formatActionNames](functions/formatActionNames.md) - [formatActions](functions/formatActions.md) - [formatActors](functions/formatActors.md) @@ -133,24 +100,12 @@ - [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) +- [loadEnvConfig](functions/loadEnvConfig.md) - [retrieveCachedEmbedding](functions/retrieveCachedEmbedding.md) -- [sellToken](functions/sellToken.md) - [splitChunks](functions/splitChunks.md) -- [startDiscord](functions/startDiscord.md) -- [startTelegram](functions/startTelegram.md) -- [startTwitter](functions/startTwitter.md) - [trimTokens](functions/trimTokens.md) - [updateGoal](functions/updateGoal.md) diff --git a/docs/docs/api/index.md b/docs/docs/api/index.md index 277dac7816..07126a4e68 100644 --- a/docs/docs/api/index.md +++ b/docs/docs/api/index.md @@ -6,37 +6,38 @@ ## Features -- 🛠 Full-featured Discord, Twitter and Telegram connectors -- 👥 Multi-agent and room support -- 📚 Easily ingest and interact with your documents -- 💾 Retrievable memory and document store -- 🚀 Highly extensible - create your own actions and clients to extend capabilities -- ☁️ Supports many models, including local Llama, OpenAI, Anthropic, Groq, and more -- 📦 Just works! +- 🛠 Full-featured Discord, Twitter and Telegram connectors +- 👥 Multi-agent and room support +- 📚 Easily ingest and interact with your documents +- 💾 Retrievable memory and document store +- 🚀 Highly extensible - create your own actions and clients to extend capabilities +- ☁️ Supports many models, including local Llama, OpenAI, Anthropic, Groq, and more +- 📦 Just works! ## What can I use it for? -- 🤖 Chatbots -- 🕵️ Autonomous Agents -- 📈 Business process handling -- 🎮 Video game NPCs +- 🤖 Chatbots +- 🕵️ Autonomous Agents +- 📈 Business process handling +- 🎮 Video game NPCs # Getting Started **Prerequisites (MUST):** - -- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) -- [pnpm](https://pnpm.io/installation) + +- [Python 2.7+](https://www.python.org/downloads/) +- [Node.js 23+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- [pnpm](https://pnpm.io/installation) ### Edit the .env file -- Copy .env.example to .env and fill in the appropriate values -- Edit the TWITTER environment variables to add your bot's username and password +- Copy .env.example to .env and fill in the appropriate values +- Edit the TWITTER environment variables to add your bot's username and password ### Edit the character file -- Check out the file `src/core/defaultCharacter.ts` - you can modify this -- You can also load characters with the `pnpm start --characters="path/to/your/character.json"` and run multiple bots at the same time. +- Check out the file `src/core/defaultCharacter.ts` - you can modify this +- You can also load characters with the `pnpm start --characters="path/to/your/character.json"` and run multiple bots at the same time. After setting up the .env file and character file, you can start the bot with the following command: @@ -83,6 +84,7 @@ DISCORD_APPLICATION_ID= DISCORD_API_TOKEN= # Bot token OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk- ELEVENLABS_XI_API_KEY= # API key from elevenlabs +GOOGLE_GENERATIVE_AI_API_KEY= # Gemini API key # ELEVENLABS SETTINGS ELEVENLABS_MODEL_ID=eleven_multilingual_v2 @@ -168,9 +170,9 @@ pnpm test:sqljs # Run tests with SQL.js Tests are written using Jest and can be found in `src/**/*.test.ts` files. The test environment is configured to: -- Load environment variables from `.env.test` -- Use a 2-minute timeout for long-running tests -- Support ESM modules -- Run tests in sequence (--runInBand) +- Load environment variables from `.env.test` +- Use a 2-minute timeout for long-running tests +- Support ESM modules +- Run tests in sequence (--runInBand) To create new tests, add a `.test.ts` file adjacent to the code you're testing. diff --git a/docs/docs/api/interfaces/Account.md b/docs/docs/api/interfaces/Account.md index c6022f7c90..95caadf8f8 100644 --- a/docs/docs/api/interfaces/Account.md +++ b/docs/docs/api/interfaces/Account.md @@ -10,9 +10,9 @@ Represents a user, including their name, details, and a unique identifier. #### Defined in -[core/src/core/types.ts:262](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L262) +[packages/core/src/types.ts:278](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L278) ---- +*** ### details? @@ -20,13 +20,13 @@ Represents a user, including their name, details, and a unique identifier. #### Index Signature -\[`key`: `string`\]: `any` + \[`key`: `string`\]: `any` #### Defined in -[core/src/core/types.ts:260](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L260) +[packages/core/src/types.ts:276](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L276) ---- +*** ### email? @@ -34,9 +34,9 @@ Represents a user, including their name, details, and a unique identifier. #### Defined in -[core/src/core/types.ts:261](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L261) +[packages/core/src/types.ts:277](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L277) ---- +*** ### id @@ -44,9 +44,9 @@ Represents a user, including their name, details, and a unique identifier. #### Defined in -[core/src/core/types.ts:257](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L257) +[packages/core/src/types.ts:273](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L273) ---- +*** ### name @@ -54,9 +54,9 @@ Represents a user, including their name, details, and a unique identifier. #### Defined in -[core/src/core/types.ts:258](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L258) +[packages/core/src/types.ts:274](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L274) ---- +*** ### username @@ -64,4 +64,4 @@ Represents a user, including their name, details, and a unique identifier. #### Defined in -[core/src/core/types.ts:259](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L259) +[packages/core/src/types.ts:275](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L275) diff --git a/docs/docs/api/interfaces/Action.md b/docs/docs/api/interfaces/Action.md index 6e83f71828..32c778c16b 100644 --- a/docs/docs/api/interfaces/Action.md +++ b/docs/docs/api/interfaces/Action.md @@ -10,9 +10,9 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[core/src/core/types.ts:201](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L201) +[packages/core/src/types.ts:216](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L216) ---- +*** ### examples @@ -20,9 +20,9 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[core/src/core/types.ts:202](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L202) +[packages/core/src/types.ts:217](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L217) ---- +*** ### handler @@ -30,9 +30,9 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[core/src/core/types.ts:203](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L203) +[packages/core/src/types.ts:218](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L218) ---- +*** ### name @@ -40,9 +40,9 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[core/src/core/types.ts:204](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L204) +[packages/core/src/types.ts:219](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L219) ---- +*** ### similes @@ -50,9 +50,9 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[core/src/core/types.ts:200](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L200) +[packages/core/src/types.ts:215](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L215) ---- +*** ### validate @@ -60,4 +60,4 @@ Represents an action that the agent can perform, including conditions for its us #### Defined in -[core/src/core/types.ts:205](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L205) +[packages/core/src/types.ts:220](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L220) diff --git a/docs/docs/api/interfaces/ActionExample.md b/docs/docs/api/interfaces/ActionExample.md index 40240f293c..6f3afb1d73 100644 --- a/docs/docs/api/interfaces/ActionExample.md +++ b/docs/docs/api/interfaces/ActionExample.md @@ -10,9 +10,9 @@ Represents an example of content, typically used for demonstrating or testing pu #### Defined in -[core/src/core/types.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L27) +[packages/core/src/types.ts:26](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L26) ---- +*** ### user @@ -20,4 +20,4 @@ Represents an example of content, typically used for demonstrating or testing pu #### Defined in -[core/src/core/types.ts:26](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L26) +[packages/core/src/types.ts:25](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L25) diff --git a/docs/docs/api/interfaces/Actor.md b/docs/docs/api/interfaces/Actor.md index be771e44ad..99acfab193 100644 --- a/docs/docs/api/interfaces/Actor.md +++ b/docs/docs/api/interfaces/Actor.md @@ -22,9 +22,9 @@ Represents an actor in the conversation, which could be a user or the agent itse #### Defined in -[core/src/core/types.ts:44](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L44) +[packages/core/src/types.ts:43](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L43) ---- +*** ### id @@ -32,9 +32,9 @@ Represents an actor in the conversation, which could be a user or the agent itse #### Defined in -[core/src/core/types.ts:45](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L45) +[packages/core/src/types.ts:44](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L44) ---- +*** ### name @@ -42,9 +42,9 @@ Represents an actor in the conversation, which could be a user or the agent itse #### Defined in -[core/src/core/types.ts:42](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L42) +[packages/core/src/types.ts:41](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L41) ---- +*** ### username @@ -52,4 +52,4 @@ Represents an actor in the conversation, which could be a user or the agent itse #### Defined in -[core/src/core/types.ts:43](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L43) +[packages/core/src/types.ts:42](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L42) diff --git a/docs/docs/api/interfaces/Content.md b/docs/docs/api/interfaces/Content.md index c5200d905d..fc01d7fff4 100644 --- a/docs/docs/api/interfaces/Content.md +++ b/docs/docs/api/interfaces/Content.md @@ -2,13 +2,9 @@ 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 @@ -18,9 +14,9 @@ Represents the content of a message, including its main text (`content`), any as #### Defined in -[core/src/core/types.ts:14](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L14) +[packages/core/src/types.ts:13](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L13) ---- +*** ### attachments? @@ -28,9 +24,9 @@ Represents the content of a message, including its main text (`content`), any as #### Defined in -[core/src/core/types.ts:18](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L18) +[packages/core/src/types.ts:17](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L17) ---- +*** ### inReplyTo? @@ -38,9 +34,9 @@ Represents the content of a message, including its main text (`content`), any as #### Defined in -[core/src/core/types.ts:17](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L17) +[packages/core/src/types.ts:16](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L16) ---- +*** ### source? @@ -48,9 +44,9 @@ 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/types.ts:14](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L14) ---- +*** ### text @@ -58,9 +54,9 @@ Represents the content of a message, including its main text (`content`), any as #### Defined in -[core/src/core/types.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L13) +[packages/core/src/types.ts:12](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L12) ---- +*** ### url? @@ -68,4 +64,4 @@ Represents the content of a message, including its main text (`content`), any as #### Defined in -[core/src/core/types.ts:16](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L16) +[packages/core/src/types.ts:15](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L15) diff --git a/docs/docs/api/interfaces/ConversationExample.md b/docs/docs/api/interfaces/ConversationExample.md index a060249192..770dbbd7e0 100644 --- a/docs/docs/api/interfaces/ConversationExample.md +++ b/docs/docs/api/interfaces/ConversationExample.md @@ -10,9 +10,9 @@ Represents an example of content, typically used for demonstrating or testing pu #### Defined in -[core/src/core/types.ts:35](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L35) +[packages/core/src/types.ts:34](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L34) ---- +*** ### userId @@ -20,4 +20,4 @@ Represents an example of content, typically used for demonstrating or testing pu #### Defined in -[core/src/core/types.ts:34](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L34) +[packages/core/src/types.ts:33](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L33) diff --git a/docs/docs/api/interfaces/CreateAndBuyContent.md b/docs/docs/api/interfaces/CreateAndBuyContent.md deleted file mode 100644 index fd158d5710..0000000000 --- a/docs/docs/api/interfaces/CreateAndBuyContent.md +++ /dev/null @@ -1,149 +0,0 @@ -# Interface: CreateAndBuyContent - -Represents the content of a message, including its main text (`content`), any associated action (`action`), and the source of the content (`source`), if applicable. - -## Extends - -- [`Content`](Content.md) - -## Properties - -### action? - -> `optional` **action**: `string` - -#### Inherited from - -[`Content`](Content.md).[`action`](Content.md#action) - -#### Defined in - -[core/src/core/types.ts:14](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L14) - ---- - -### allowOffCurve - -> **allowOffCurve**: `boolean` - -#### Defined in - -[core/src/actions/pumpfun.ts:30](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L30) - ---- - -### attachments? - -> `optional` **attachments**: [`Media`](../type-aliases/Media.md)[] - -#### Inherited from - -[`Content`](Content.md).[`attachments`](Content.md#attachments) - -#### Defined in - -[core/src/core/types.ts:18](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L18) - ---- - -### buyAmountSol - -> **buyAmountSol**: `string` \| `number` - -#### Defined in - -[core/src/actions/pumpfun.ts:25](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L25) - ---- - -### deployerPrivateKey - -> **deployerPrivateKey**: `string` - -#### Defined in - -[core/src/actions/pumpfun.ts:23](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L23) - ---- - -### inReplyTo? - -> `optional` **inReplyTo**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` - -#### Inherited from - -[`Content`](Content.md).[`inReplyTo`](Content.md#inreplyto) - -#### Defined in - -[core/src/core/types.ts:17](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L17) - ---- - -### priorityFee - -> **priorityFee**: `object` - -#### unitLimit - -> **unitLimit**: `number` - -#### unitPrice - -> **unitPrice**: `number` - -#### Defined in - -[core/src/actions/pumpfun.ts:26](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L26) - ---- - -### source? - -> `optional` **source**: `string` - -#### Inherited from - -[`Content`](Content.md).[`source`](Content.md#source) - -#### Defined in - -[core/src/core/types.ts:15](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L15) - ---- - -### text - -> **text**: `string` - -#### Inherited from - -[`Content`](Content.md).[`text`](Content.md#text) - -#### Defined in - -[core/src/core/types.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L13) - ---- - -### tokenMetadata - -> **tokenMetadata**: `CreateTokenMetadata` - -#### Defined in - -[core/src/actions/pumpfun.ts:24](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/pumpfun.ts#L24) - ---- - -### url? - -> `optional` **url**: `string` - -#### Inherited from - -[`Content`](Content.md).[`url`](Content.md#url) - -#### Defined in - -[core/src/core/types.ts:16](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L16) diff --git a/docs/docs/api/interfaces/EvaluationExample.md b/docs/docs/api/interfaces/EvaluationExample.md index 0891f664ae..26e09982fb 100644 --- a/docs/docs/api/interfaces/EvaluationExample.md +++ b/docs/docs/api/interfaces/EvaluationExample.md @@ -10,9 +10,9 @@ Represents an example for evaluation, including the context, an array of message #### Defined in -[core/src/core/types.ts:212](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L212) +[packages/core/src/types.ts:227](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L227) ---- +*** ### messages @@ -20,9 +20,9 @@ Represents an example for evaluation, including the context, an array of message #### Defined in -[core/src/core/types.ts:213](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L213) +[packages/core/src/types.ts:228](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L228) ---- +*** ### outcome @@ -30,4 +30,4 @@ Represents an example for evaluation, including the context, an array of message #### Defined in -[core/src/core/types.ts:214](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L214) +[packages/core/src/types.ts:229](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L229) diff --git a/docs/docs/api/interfaces/Evaluator.md b/docs/docs/api/interfaces/Evaluator.md index 3596d2b1b3..f0fb1e9b6b 100644 --- a/docs/docs/api/interfaces/Evaluator.md +++ b/docs/docs/api/interfaces/Evaluator.md @@ -4,15 +4,25 @@ Represents an evaluator, which is used to assess and guide the agent's responses ## Properties +### alwaysRun? + +> `optional` **alwaysRun**: `boolean` + +#### Defined in + +[packages/core/src/types.ts:236](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L236) + +*** + ### description > **description**: `string` #### Defined in -[core/src/core/types.ts:221](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L221) +[packages/core/src/types.ts:237](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L237) ---- +*** ### examples @@ -20,9 +30,9 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[core/src/core/types.ts:223](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L223) +[packages/core/src/types.ts:239](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L239) ---- +*** ### handler @@ -30,9 +40,9 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[core/src/core/types.ts:224](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L224) +[packages/core/src/types.ts:240](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L240) ---- +*** ### name @@ -40,9 +50,9 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[core/src/core/types.ts:225](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L225) +[packages/core/src/types.ts:241](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L241) ---- +*** ### similes @@ -50,9 +60,9 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[core/src/core/types.ts:222](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L222) +[packages/core/src/types.ts:238](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L238) ---- +*** ### validate @@ -60,4 +70,4 @@ Represents an evaluator, which is used to assess and guide the agent's responses #### Defined in -[core/src/core/types.ts:226](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L226) +[packages/core/src/types.ts:242](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L242) diff --git a/docs/docs/api/interfaces/Goal.md b/docs/docs/api/interfaces/Goal.md index 8aa672768b..e670617453 100644 --- a/docs/docs/api/interfaces/Goal.md +++ b/docs/docs/api/interfaces/Goal.md @@ -10,9 +10,9 @@ Represents a goal, which is a higher-level aim composed of one or more objective #### Defined in -[core/src/core/types.ts:67](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L67) +[packages/core/src/types.ts:66](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L66) ---- +*** ### name @@ -20,9 +20,9 @@ Represents a goal, which is a higher-level aim composed of one or more objective #### Defined in -[core/src/core/types.ts:70](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L70) +[packages/core/src/types.ts:69](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L69) ---- +*** ### objectives @@ -30,9 +30,9 @@ Represents a goal, which is a higher-level aim composed of one or more objective #### Defined in -[core/src/core/types.ts:72](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L72) +[packages/core/src/types.ts:71](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L71) ---- +*** ### roomId @@ -40,9 +40,9 @@ Represents a goal, which is a higher-level aim composed of one or more objective #### Defined in -[core/src/core/types.ts:68](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L68) +[packages/core/src/types.ts:67](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L67) ---- +*** ### status @@ -50,9 +50,9 @@ Represents a goal, which is a higher-level aim composed of one or more objective #### Defined in -[core/src/core/types.ts:71](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L71) +[packages/core/src/types.ts:70](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L70) ---- +*** ### userId @@ -60,4 +60,4 @@ Represents a goal, which is a higher-level aim composed of one or more objective #### Defined in -[core/src/core/types.ts:69](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L69) +[packages/core/src/types.ts:68](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L68) diff --git a/docs/docs/api/interfaces/IAgentRuntime.md b/docs/docs/api/interfaces/IAgentRuntime.md index 61b5234f98..007ddb63ac 100644 --- a/docs/docs/api/interfaces/IAgentRuntime.md +++ b/docs/docs/api/interfaces/IAgentRuntime.md @@ -8,9 +8,9 @@ #### Defined in -[core/src/core/types.ts:494](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L494) +[packages/core/src/types.ts:527](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L527) ---- +*** ### agentId @@ -18,19 +18,9 @@ #### Defined in -[core/src/core/types.ts:486](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L486) +[packages/core/src/types.ts:520](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L520) ---- - -### browserService - -> **browserService**: [`IBrowserService`](IBrowserService.md) - -#### Defined in - -[core/src/core/types.ts:504](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L504) - ---- +*** ### character @@ -38,9 +28,9 @@ #### Defined in -[core/src/core/types.ts:492](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L492) +[packages/core/src/types.ts:525](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L525) ---- +*** ### databaseAdapter @@ -48,9 +38,9 @@ #### Defined in -[core/src/core/types.ts:488](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L488) +[packages/core/src/types.ts:522](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L522) ---- +*** ### descriptionManager @@ -58,49 +48,19 @@ #### Defined in -[core/src/core/types.ts:497](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L497) - ---- - -### factManager - -> **factManager**: [`IMemoryManager`](IMemoryManager.md) - -#### Defined in - -[core/src/core/types.ts:498](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L498) - ---- - -### imageDescriptionService - -> **imageDescriptionService**: [`IImageRecognitionService`](IImageRecognitionService.md) - -#### Defined in - -[core/src/core/types.ts:500](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L500) - ---- - -### imageGenModel - -> **imageGenModel**: [`ImageGenModel`](../enumerations/ImageGenModel.md) - -#### Defined in - -[core/src/core/types.ts:491](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L491) +[packages/core/src/types.ts:531](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L531) ---- +*** -### llamaService +### evaluators -> **llamaService**: [`ILlamaService`](ILlamaService.md) +> **evaluators**: [`Evaluator`](Evaluator.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/types.ts:528](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L528) ---- +*** ### loreManager @@ -108,9 +68,9 @@ #### Defined in -[core/src/core/types.ts:499](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L499) +[packages/core/src/types.ts:532](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L532) ---- +*** ### messageManager @@ -118,29 +78,19 @@ #### Defined in -[core/src/core/types.ts:496](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L496) +[packages/core/src/types.ts:530](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L530) ---- +*** ### modelProvider -> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) +> **modelProvider**: [`ModelProviderName`](../enumerations/ModelProviderName.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/types.ts:524](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L524) ---- - -### pdfService - -> **pdfService**: [`IPdfService`](IPdfService.md) - -#### Defined in - -[core/src/core/types.ts:506](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L506) - ---- +*** ### providers @@ -148,9 +98,9 @@ #### Defined in -[core/src/core/types.ts:493](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L493) +[packages/core/src/types.ts:526](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L526) ---- +*** ### serverUrl @@ -158,19 +108,19 @@ #### Defined in -[core/src/core/types.ts:487](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L487) +[packages/core/src/types.ts:521](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L521) ---- +*** -### speechService +### services -> **speechService**: [`ISpeechService`](ISpeechService.md) +> **services**: `Map`\<[`ServiceType`](../enumerations/ServiceType.md), [`Service`](../classes/Service.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/types.ts:534](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L534) ---- +*** ### token @@ -178,27 +128,7 @@ #### Defined in -[core/src/core/types.ts:489](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L489) - ---- - -### transcriptionService - -> **transcriptionService**: [`ITranscriptionService`](ITranscriptionService.md) - -#### Defined in - -[core/src/core/types.ts:501](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L501) - ---- - -### videoService - -> **videoService**: [`IVideoService`](IVideoService.md) - -#### Defined in - -[core/src/core/types.ts:502](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L502) +[packages/core/src/types.ts:523](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L523) ## Methods @@ -218,9 +148,9 @@ #### Defined in -[core/src/core/types.ts:536](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L536) +[packages/core/src/types.ts:575](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L575) ---- +*** ### ensureConnection() @@ -244,9 +174,9 @@ #### Defined in -[core/src/core/types.ts:527](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L527) +[packages/core/src/types.ts:566](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L566) ---- +*** ### ensureParticipantExists() @@ -264,9 +194,9 @@ #### Defined in -[core/src/core/types.ts:519](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L519) +[packages/core/src/types.ts:558](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L558) ---- +*** ### ensureParticipantInRoom() @@ -284,9 +214,9 @@ #### Defined in -[core/src/core/types.ts:534](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L534) +[packages/core/src/types.ts:573](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L573) ---- +*** ### ensureRoomExists() @@ -302,9 +232,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/types.ts:574](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L574) ---- +*** ### ensureUserExists() @@ -326,13 +256,13 @@ #### Defined in -[core/src/core/types.ts:520](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L520) +[packages/core/src/types.ts:559](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L559) ---- +*** ### evaluate() -> **evaluate**(`message`, `state`?): `Promise`\<`string`[]\> +> **evaluate**(`message`, `state`?, `didRespond`?): `Promise`\<`string`[]\> #### Parameters @@ -340,15 +270,17 @@ • **state?**: [`State`](State.md) +• **didRespond?**: `boolean` + #### Returns `Promise`\<`string`[]\> #### Defined in -[core/src/core/types.ts:518](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L518) +[packages/core/src/types.ts:553](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L553) ---- +*** ### getConversationLength() @@ -360,9 +292,45 @@ #### Defined in -[core/src/core/types.ts:511](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L511) +[packages/core/src/types.ts:546](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L546) + +*** + +### getMemoryManager() + +> **getMemoryManager**(`name`): [`IMemoryManager`](IMemoryManager.md) + +#### Parameters + +• **name**: `string` + +#### Returns + +[`IMemoryManager`](IMemoryManager.md) + +#### Defined in + +[packages/core/src/types.ts:537](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L537) + +*** + +### getService() + +> **getService**(`service`): *typeof* [`Service`](../classes/Service.md) + +#### Parameters + +• **service**: `string` + +#### Returns + +*typeof* [`Service`](../classes/Service.md) + +#### Defined in + +[packages/core/src/types.ts:539](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L539) ---- +*** ### getSetting() @@ -378,9 +346,9 @@ #### Defined in -[core/src/core/types.ts:508](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L508) +[packages/core/src/types.ts:543](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L543) ---- +*** ### processActions() @@ -402,9 +370,9 @@ #### Defined in -[core/src/core/types.ts:512](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L512) +[packages/core/src/types.ts:547](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L547) ---- +*** ### registerAction() @@ -420,9 +388,45 @@ #### Defined in -[core/src/core/types.ts:526](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L526) +[packages/core/src/types.ts:565](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L565) + +*** + +### registerMemoryManager() + +> **registerMemoryManager**(`manager`): `void` + +#### Parameters + +• **manager**: [`IMemoryManager`](IMemoryManager.md) + +#### Returns + +`void` + +#### Defined in + +[packages/core/src/types.ts:535](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L535) + +*** + +### registerService() + +> **registerService**(`service`): `void` + +#### Parameters + +• **service**: [`Service`](../classes/Service.md) + +#### Returns + +`void` + +#### Defined in + +[packages/core/src/types.ts:541](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L541) ---- +*** ### updateRecentMessageState() @@ -438,4 +442,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/types.ts:579](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L579) diff --git a/docs/docs/api/interfaces/IBrowserService.md b/docs/docs/api/interfaces/IBrowserService.md index 445c72451b..68b05ceb08 100644 --- a/docs/docs/api/interfaces/IBrowserService.md +++ b/docs/docs/api/interfaces/IBrowserService.md @@ -1,5 +1,9 @@ # Interface: IBrowserService +## Extends + +- [`Service`](../classes/Service.md) + ## Methods ### closeBrowser() @@ -12,18 +16,20 @@ #### Defined in -[core/src/core/types.ts:587](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L587) +[packages/core/src/types.ts:630](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L630) ---- +*** ### getPageContent() -> **getPageContent**(`url`): `Promise`\<`object`\> +> **getPageContent**(`url`, `runtime`): `Promise`\<`object`\> #### Parameters • **url**: `string` +• **runtime**: [`IAgentRuntime`](IAgentRuntime.md) + #### Returns `Promise`\<`object`\> @@ -42,9 +48,9 @@ #### Defined in -[core/src/core/types.ts:588](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L588) +[packages/core/src/types.ts:631](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L631) ---- +*** ### initialize() @@ -56,4 +62,4 @@ #### Defined in -[core/src/core/types.ts:586](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L586) +[packages/core/src/types.ts:629](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L629) diff --git a/docs/docs/api/interfaces/IDatabaseAdapter.md b/docs/docs/api/interfaces/IDatabaseAdapter.md index 76d1544b16..5fd2d8e6ac 100644 --- a/docs/docs/api/interfaces/IDatabaseAdapter.md +++ b/docs/docs/api/interfaces/IDatabaseAdapter.md @@ -8,7 +8,7 @@ #### Defined in -[core/src/core/types.ts:342](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L342) +[packages/core/src/types.ts:363](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L363) ## Methods @@ -28,9 +28,9 @@ #### Defined in -[core/src/core/types.ts:424](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L424) +[packages/core/src/types.ts:445](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L445) ---- +*** ### countMemories() @@ -50,9 +50,9 @@ #### Defined in -[core/src/core/types.ts:404](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L404) +[packages/core/src/types.ts:425](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L425) ---- +*** ### createAccount() @@ -68,9 +68,9 @@ #### Defined in -[core/src/core/types.ts:344](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L344) +[packages/core/src/types.ts:365](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L365) ---- +*** ### createGoal() @@ -86,9 +86,9 @@ #### Defined in -[core/src/core/types.ts:416](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L416) +[packages/core/src/types.ts:437](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L437) ---- +*** ### createMemory() @@ -108,9 +108,9 @@ #### Defined in -[core/src/core/types.ts:397](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L397) +[packages/core/src/types.ts:418](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L418) ---- +*** ### createRelationship() @@ -130,9 +130,9 @@ #### Defined in -[core/src/core/types.ts:437](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L437) +[packages/core/src/types.ts:458](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L458) ---- +*** ### createRoom() @@ -148,9 +148,9 @@ #### Defined in -[core/src/core/types.ts:420](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L420) +[packages/core/src/types.ts:441](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L441) ---- +*** ### getAccountById() @@ -166,9 +166,9 @@ #### Defined in -[core/src/core/types.ts:343](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L343) +[packages/core/src/types.ts:364](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L364) ---- +*** ### getActorDetails() @@ -186,9 +186,9 @@ #### Defined in -[core/src/core/types.ts:373](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L373) +[packages/core/src/types.ts:394](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L394) ---- +*** ### getCachedEmbeddings() @@ -198,17 +198,17 @@ • **params** -• **params.query_field_name**: `string` +• **params.query\_field\_name**: `string` -• **params.query_field_sub_name**: `string` +• **params.query\_field\_sub\_name**: `string` -• **params.query_input**: `string` +• **params.query\_input**: `string` -• **params.query_match_count**: `number` +• **params.query\_match\_count**: `number` -• **params.query_table_name**: `string` +• **params.query\_table\_name**: `string` -• **params.query_threshold**: `number` +• **params.query\_threshold**: `number` #### Returns @@ -216,9 +216,9 @@ #### Defined in -[core/src/core/types.ts:359](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L359) +[packages/core/src/types.ts:380](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L380) ---- +*** ### getGoals() @@ -242,9 +242,9 @@ #### Defined in -[core/src/core/types.ts:409](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L409) +[packages/core/src/types.ts:430](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L430) ---- +*** ### getMemories() @@ -274,9 +274,9 @@ #### Defined in -[core/src/core/types.ts:345](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L345) +[packages/core/src/types.ts:366](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L366) ---- +*** ### getMemoriesByRoomIds() @@ -296,9 +296,9 @@ #### Defined in -[core/src/core/types.ts:355](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L355) +[packages/core/src/types.ts:376](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L376) ---- +*** ### getMemoryById() @@ -314,9 +314,9 @@ #### Defined in -[core/src/core/types.ts:354](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L354) +[packages/core/src/types.ts:375](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L375) ---- +*** ### getParticipantsForAccount() @@ -332,9 +332,9 @@ #### Defined in -[core/src/core/types.ts:426](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L426) +[packages/core/src/types.ts:447](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L447) ---- +*** ### getParticipantsForRoom() @@ -350,9 +350,9 @@ #### Defined in -[core/src/core/types.ts:427](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L427) +[packages/core/src/types.ts:448](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L448) ---- +*** ### getParticipantUserState() @@ -370,9 +370,9 @@ #### Defined in -[core/src/core/types.ts:428](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L428) +[packages/core/src/types.ts:449](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L449) ---- +*** ### getRelationship() @@ -392,9 +392,9 @@ #### Defined in -[core/src/core/types.ts:438](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L438) +[packages/core/src/types.ts:459](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L459) ---- +*** ### getRelationships() @@ -412,9 +412,9 @@ #### Defined in -[core/src/core/types.ts:442](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L442) +[packages/core/src/types.ts:463](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L463) ---- +*** ### getRoom() @@ -430,9 +430,9 @@ #### Defined in -[core/src/core/types.ts:419](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L419) +[packages/core/src/types.ts:440](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L440) ---- +*** ### getRoomsForParticipant() @@ -448,9 +448,9 @@ #### Defined in -[core/src/core/types.ts:422](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L422) +[packages/core/src/types.ts:443](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L443) ---- +*** ### getRoomsForParticipants() @@ -466,9 +466,9 @@ #### Defined in -[core/src/core/types.ts:423](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L423) +[packages/core/src/types.ts:444](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L444) ---- +*** ### log() @@ -492,9 +492,9 @@ #### Defined in -[core/src/core/types.ts:367](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L367) +[packages/core/src/types.ts:388](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L388) ---- +*** ### removeAllGoals() @@ -510,9 +510,9 @@ #### Defined in -[core/src/core/types.ts:418](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L418) +[packages/core/src/types.ts:439](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L439) ---- +*** ### removeAllMemories() @@ -530,9 +530,9 @@ #### Defined in -[core/src/core/types.ts:403](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L403) +[packages/core/src/types.ts:424](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L424) ---- +*** ### removeGoal() @@ -548,9 +548,9 @@ #### Defined in -[core/src/core/types.ts:417](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L417) +[packages/core/src/types.ts:438](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L438) ---- +*** ### removeMemory() @@ -568,9 +568,9 @@ #### Defined in -[core/src/core/types.ts:402](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L402) +[packages/core/src/types.ts:423](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L423) ---- +*** ### removeParticipant() @@ -588,9 +588,9 @@ #### Defined in -[core/src/core/types.ts:425](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L425) +[packages/core/src/types.ts:446](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L446) ---- +*** ### removeRoom() @@ -606,9 +606,9 @@ #### Defined in -[core/src/core/types.ts:421](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L421) +[packages/core/src/types.ts:442](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L442) ---- +*** ### searchMemories() @@ -620,9 +620,9 @@ • **params.embedding**: `number`[] -• **params.match_count**: `number` +• **params.match\_count**: `number` -• **params.match_threshold**: `number` +• **params.match\_threshold**: `number` • **params.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` @@ -636,9 +636,9 @@ #### Defined in -[core/src/core/types.ts:374](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L374) +[packages/core/src/types.ts:395](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L395) ---- +*** ### searchMemoriesByEmbedding() @@ -654,7 +654,7 @@ • **params.count?**: `number` -• **params.match_threshold?**: `number` +• **params.match\_threshold?**: `number` • **params.roomId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` @@ -668,9 +668,9 @@ #### Defined in -[core/src/core/types.ts:386](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L386) +[packages/core/src/types.ts:407](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L407) ---- +*** ### setParticipantUserState() @@ -690,9 +690,9 @@ #### Defined in -[core/src/core/types.ts:432](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L432) +[packages/core/src/types.ts:453](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L453) ---- +*** ### updateGoal() @@ -708,9 +708,9 @@ #### Defined in -[core/src/core/types.ts:415](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L415) +[packages/core/src/types.ts:436](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L436) ---- +*** ### updateGoalStatus() @@ -730,4 +730,4 @@ #### Defined in -[core/src/core/types.ts:382](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L382) +[packages/core/src/types.ts:403](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L403) diff --git a/docs/docs/api/interfaces/IImageDescriptionService.md b/docs/docs/api/interfaces/IImageDescriptionService.md new file mode 100644 index 0000000000..88eb6bd592 --- /dev/null +++ b/docs/docs/api/interfaces/IImageDescriptionService.md @@ -0,0 +1,65 @@ +# Interface: IImageDescriptionService + +## Extends + +- [`Service`](../classes/Service.md) + +## Methods + +### describeImage() + +> **describeImage**(`imageUrl`): `Promise`\<`object`\> + +#### Parameters + +• **imageUrl**: `string` + +#### Returns + +`Promise`\<`object`\> + +##### description + +> **description**: `string` + +##### title + +> **title**: `string` + +#### Defined in + +[packages/core/src/types.ts:585](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L585) + +*** + +### getInstance() + +> **getInstance**(): [`IImageDescriptionService`](IImageDescriptionService.md) + +#### Returns + +[`IImageDescriptionService`](IImageDescriptionService.md) + +#### Defined in + +[packages/core/src/types.ts:583](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L583) + +*** + +### initialize() + +> **initialize**(`modelId`?, `device`?): `Promise`\<`void`\> + +#### Parameters + +• **modelId?**: `string` + +• **device?**: `string` + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[packages/core/src/types.ts:584](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L584) diff --git a/docs/docs/api/interfaces/IImageRecognitionService.md b/docs/docs/api/interfaces/IImageRecognitionService.md deleted file mode 100644 index 80743e38c6..0000000000 --- a/docs/docs/api/interfaces/IImageRecognitionService.md +++ /dev/null @@ -1,47 +0,0 @@ -# Interface: IImageRecognitionService - -## Methods - -### describeImage() - -> **describeImage**(`imageUrl`): `Promise`\<`object`\> - -#### Parameters - -• **imageUrl**: `string` - -#### Returns - -`Promise`\<`object`\> - -##### description - -> **description**: `string` - -##### title - -> **title**: `string` - -#### Defined in - -[core/src/core/types.ts:545](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L545) - ---- - -### initialize() - -> **initialize**(`modelId`?, `device`?): `Promise`\<`void`\> - -#### Parameters - -• **modelId?**: `string` - -• **device?**: `string` - -#### Returns - -`Promise`\<`void`\> - -#### Defined in - -[core/src/core/types.ts:544](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L544) diff --git a/docs/docs/api/interfaces/ILlamaService.md b/docs/docs/api/interfaces/ILlamaService.md deleted file mode 100644 index 99f1d512e7..0000000000 --- a/docs/docs/api/interfaces/ILlamaService.md +++ /dev/null @@ -1,89 +0,0 @@ -# Interface: ILlamaService - -## Methods - -### getEmbeddingResponse() - -> **getEmbeddingResponse**(`input`): `Promise`\<`number`[]\> - -#### Parameters - -• **input**: `string` - -#### Returns - -`Promise`\<`number`[]\> - -#### Defined in - -[core/src/core/types.ts:582](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L582) - ---- - -### initializeModel() - -> **initializeModel**(): `Promise`\<`void`\> - -#### Returns - -`Promise`\<`void`\> - -#### Defined in - -[core/src/core/types.ts:565](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L565) - ---- - -### queueMessageCompletion() - -> **queueMessageCompletion**(`context`, `temperature`, `stop`, `frequency_penalty`, `presence_penalty`, `max_tokens`): `Promise`\<`any`\> - -#### Parameters - -• **context**: `string` - -• **temperature**: `number` - -• **stop**: `string`[] - -• **frequency_penalty**: `number` - -• **presence_penalty**: `number` - -• **max_tokens**: `number` - -#### Returns - -`Promise`\<`any`\> - -#### Defined in - -[core/src/core/types.ts:566](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L566) - ---- - -### queueTextCompletion() - -> **queueTextCompletion**(`context`, `temperature`, `stop`, `frequency_penalty`, `presence_penalty`, `max_tokens`): `Promise`\<`string`\> - -#### Parameters - -• **context**: `string` - -• **temperature**: `number` - -• **stop**: `string`[] - -• **frequency_penalty**: `number` - -• **presence_penalty**: `number` - -• **max_tokens**: `number` - -#### Returns - -`Promise`\<`string`\> - -#### Defined in - -[core/src/core/types.ts:574](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L574) diff --git a/docs/docs/api/interfaces/IMemoryManager.md b/docs/docs/api/interfaces/IMemoryManager.md index 9026f0b807..4bac2ef5fd 100644 --- a/docs/docs/api/interfaces/IMemoryManager.md +++ b/docs/docs/api/interfaces/IMemoryManager.md @@ -8,9 +8,9 @@ #### Defined in -[core/src/core/types.ts:449](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L449) +[packages/core/src/types.ts:470](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L470) ---- +*** ### runtime @@ -18,9 +18,9 @@ #### Defined in -[core/src/core/types.ts:446](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L446) +[packages/core/src/types.ts:467](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L467) ---- +*** ### tableName @@ -28,7 +28,7 @@ #### Defined in -[core/src/core/types.ts:447](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L447) +[packages/core/src/types.ts:468](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L468) ## Methods @@ -46,9 +46,9 @@ #### Defined in -[core/src/core/types.ts:451](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L451) +[packages/core/src/types.ts:472](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L472) ---- +*** ### countMemories() @@ -66,9 +66,9 @@ #### Defined in -[core/src/core/types.ts:481](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L481) +[packages/core/src/types.ts:502](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L502) ---- +*** ### createMemory() @@ -86,9 +86,9 @@ #### Defined in -[core/src/core/types.ts:478](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L478) +[packages/core/src/types.ts:499](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L499) ---- +*** ### getCachedEmbeddings() @@ -104,9 +104,9 @@ #### Defined in -[core/src/core/types.ts:460](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L460) +[packages/core/src/types.ts:481](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L481) ---- +*** ### getMemories() @@ -134,9 +134,9 @@ #### Defined in -[core/src/core/types.ts:452](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L452) +[packages/core/src/types.ts:473](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L473) ---- +*** ### getMemoriesByRoomIds() @@ -156,9 +156,9 @@ #### Defined in -[core/src/core/types.ts:464](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L464) +[packages/core/src/types.ts:485](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L485) ---- +*** ### getMemoryById() @@ -174,9 +174,9 @@ #### Defined in -[core/src/core/types.ts:463](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L463) +[packages/core/src/types.ts:484](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L484) ---- +*** ### removeAllMemories() @@ -192,9 +192,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/types.ts:501](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L501) ---- +*** ### removeMemory() @@ -210,9 +210,9 @@ #### Defined in -[core/src/core/types.ts:479](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L479) +[packages/core/src/types.ts:500](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L500) ---- +*** ### searchMemoriesByEmbedding() @@ -228,7 +228,7 @@ • **opts.count?**: `number` -• **opts.match_threshold?**: `number` +• **opts.match\_threshold?**: `number` • **opts.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` @@ -240,4 +240,4 @@ #### Defined in -[core/src/core/types.ts:468](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L468) +[packages/core/src/types.ts:489](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L489) diff --git a/docs/docs/api/interfaces/IPdfService.md b/docs/docs/api/interfaces/IPdfService.md index a4d4b01171..34f2294e70 100644 --- a/docs/docs/api/interfaces/IPdfService.md +++ b/docs/docs/api/interfaces/IPdfService.md @@ -1,5 +1,9 @@ # Interface: IPdfService +## Extends + +- [`Service`](../classes/Service.md) + ## Methods ### convertPdfToText() @@ -16,4 +20,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/types.ts:642](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L642) diff --git a/docs/docs/api/interfaces/ISpeechService.md b/docs/docs/api/interfaces/ISpeechService.md index 1fd5891420..f3cf22f1d3 100644 --- a/docs/docs/api/interfaces/ISpeechService.md +++ b/docs/docs/api/interfaces/ISpeechService.md @@ -1,5 +1,9 @@ # Interface: ISpeechService +## Extends + +- [`Service`](../classes/Service.md) + ## Methods ### generate() @@ -18,4 +22,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/types.ts:638](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L638) diff --git a/docs/docs/api/interfaces/ITextGenerationService.md b/docs/docs/api/interfaces/ITextGenerationService.md new file mode 100644 index 0000000000..d9a473e32b --- /dev/null +++ b/docs/docs/api/interfaces/ITextGenerationService.md @@ -0,0 +1,107 @@ +# Interface: ITextGenerationService + +## Extends + +- [`Service`](../classes/Service.md) + +## Methods + +### getEmbeddingResponse() + +> **getEmbeddingResponse**(`input`): `Promise`\<`number`[]\> + +#### Parameters + +• **input**: `string` + +#### Returns + +`Promise`\<`number`[]\> + +#### Defined in + +[packages/core/src/types.ts:625](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L625) + +*** + +### getInstance() + +> **getInstance**(): [`ITextGenerationService`](ITextGenerationService.md) + +#### Returns + +[`ITextGenerationService`](ITextGenerationService.md) + +#### Defined in + +[packages/core/src/types.ts:607](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L607) + +*** + +### initializeModel() + +> **initializeModel**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[packages/core/src/types.ts:608](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L608) + +*** + +### queueMessageCompletion() + +> **queueMessageCompletion**(`context`, `temperature`, `stop`, `frequency_penalty`, `presence_penalty`, `max_tokens`): `Promise`\<`any`\> + +#### Parameters + +• **context**: `string` + +• **temperature**: `number` + +• **stop**: `string`[] + +• **frequency\_penalty**: `number` + +• **presence\_penalty**: `number` + +• **max\_tokens**: `number` + +#### Returns + +`Promise`\<`any`\> + +#### Defined in + +[packages/core/src/types.ts:609](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L609) + +*** + +### queueTextCompletion() + +> **queueTextCompletion**(`context`, `temperature`, `stop`, `frequency_penalty`, `presence_penalty`, `max_tokens`): `Promise`\<`string`\> + +#### Parameters + +• **context**: `string` + +• **temperature**: `number` + +• **stop**: `string`[] + +• **frequency\_penalty**: `number` + +• **presence\_penalty**: `number` + +• **max\_tokens**: `number` + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[packages/core/src/types.ts:617](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L617) diff --git a/docs/docs/api/interfaces/ITranscriptionService.md b/docs/docs/api/interfaces/ITranscriptionService.md index e21318f281..680f2d02aa 100644 --- a/docs/docs/api/interfaces/ITranscriptionService.md +++ b/docs/docs/api/interfaces/ITranscriptionService.md @@ -1,5 +1,9 @@ # Interface: ITranscriptionService +## Extends + +- [`Service`](../classes/Service.md) + ## Methods ### transcribe() @@ -16,9 +20,9 @@ #### Defined in -[core/src/core/types.ts:555](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L555) +[packages/core/src/types.ts:595](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L595) ---- +*** ### transcribeAttachment() @@ -34,9 +38,9 @@ #### Defined in -[core/src/core/types.ts:551](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L551) +[packages/core/src/types.ts:591](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L591) ---- +*** ### transcribeAttachmentLocally() @@ -52,9 +56,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/types.ts:592](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L592) ---- +*** ### transcribeLocally() @@ -70,4 +74,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/types.ts:596](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L596) diff --git a/docs/docs/api/interfaces/IVideoService.md b/docs/docs/api/interfaces/IVideoService.md index 37974807ef..869f3b6ab0 100644 --- a/docs/docs/api/interfaces/IVideoService.md +++ b/docs/docs/api/interfaces/IVideoService.md @@ -1,7 +1,47 @@ # Interface: IVideoService +## Extends + +- [`Service`](../classes/Service.md) + ## Methods +### downloadVideo() + +> **downloadVideo**(`videoInfo`): `Promise`\<`string`\> + +#### Parameters + +• **videoInfo**: [`Media`](../type-aliases/Media.md) + +#### Returns + +`Promise`\<`string`\> + +#### Defined in + +[packages/core/src/types.ts:603](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L603) + +*** + +### fetchVideoInfo() + +> **fetchVideoInfo**(`url`): `Promise`\<[`Media`](../type-aliases/Media.md)\> + +#### Parameters + +• **url**: `string` + +#### Returns + +`Promise`\<[`Media`](../type-aliases/Media.md)\> + +#### Defined in + +[packages/core/src/types.ts:602](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L602) + +*** + ### isVideoUrl() > **isVideoUrl**(`url`): `boolean` @@ -16,9 +56,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/types.ts:600](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L600) ---- +*** ### processVideo() @@ -34,4 +74,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/types.ts:601](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L601) diff --git a/docs/docs/api/interfaces/Memory.md b/docs/docs/api/interfaces/Memory.md index b395bcfa43..f4d3853c54 100644 --- a/docs/docs/api/interfaces/Memory.md +++ b/docs/docs/api/interfaces/Memory.md @@ -10,9 +10,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[core/src/core/types.ts:154](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L154) +[packages/core/src/types.ts:169](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L169) ---- +*** ### content @@ -20,9 +20,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[core/src/core/types.ts:156](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L156) +[packages/core/src/types.ts:171](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L171) ---- +*** ### createdAt? @@ -30,9 +30,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[core/src/core/types.ts:155](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L155) +[packages/core/src/types.ts:170](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L170) ---- +*** ### embedding? @@ -40,9 +40,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[core/src/core/types.ts:157](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L157) +[packages/core/src/types.ts:172](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L172) ---- +*** ### id? @@ -50,9 +50,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[core/src/core/types.ts:152](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L152) +[packages/core/src/types.ts:167](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L167) ---- +*** ### roomId @@ -60,9 +60,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[core/src/core/types.ts:158](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L158) +[packages/core/src/types.ts:173](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L173) ---- +*** ### unique? @@ -70,9 +70,9 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[core/src/core/types.ts:159](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L159) +[packages/core/src/types.ts:174](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L174) ---- +*** ### userId @@ -80,4 +80,4 @@ Represents a memory record, which could be a message or any other piece of infor #### Defined in -[core/src/core/types.ts:153](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L153) +[packages/core/src/types.ts:168](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L168) diff --git a/docs/docs/api/interfaces/MessageExample.md b/docs/docs/api/interfaces/MessageExample.md index 100e99f58e..7d382ce7a8 100644 --- a/docs/docs/api/interfaces/MessageExample.md +++ b/docs/docs/api/interfaces/MessageExample.md @@ -10,9 +10,9 @@ Represents an example of a message, typically used for demonstrating or testing #### Defined in -[core/src/core/types.ts:167](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L167) +[packages/core/src/types.ts:182](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L182) ---- +*** ### user @@ -20,4 +20,4 @@ Represents an example of a message, typically used for demonstrating or testing #### Defined in -[core/src/core/types.ts:166](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L166) +[packages/core/src/types.ts:181](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L181) diff --git a/docs/docs/api/interfaces/Objective.md b/docs/docs/api/interfaces/Objective.md index 6fd03f9c5e..6f22a6552d 100644 --- a/docs/docs/api/interfaces/Objective.md +++ b/docs/docs/api/interfaces/Objective.md @@ -10,9 +10,9 @@ Represents an objective within a goal, detailing what needs to be achieved and w #### Defined in -[core/src/core/types.ts:54](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L54) +[packages/core/src/types.ts:53](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L53) ---- +*** ### description @@ -20,9 +20,9 @@ Represents an objective within a goal, detailing what needs to be achieved and w #### Defined in -[core/src/core/types.ts:53](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L53) +[packages/core/src/types.ts:52](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L52) ---- +*** ### id? @@ -30,4 +30,4 @@ Represents an objective within a goal, detailing what needs to be achieved and w #### Defined in -[core/src/core/types.ts:52](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L52) +[packages/core/src/types.ts:51](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L51) diff --git a/docs/docs/api/interfaces/Participant.md b/docs/docs/api/interfaces/Participant.md index e8a774c6f2..121b76e5db 100644 --- a/docs/docs/api/interfaces/Participant.md +++ b/docs/docs/api/interfaces/Participant.md @@ -10,9 +10,9 @@ Represents a participant in a room, including their ID and account details. #### Defined in -[core/src/core/types.ts:270](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L270) +[packages/core/src/types.ts:286](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L286) ---- +*** ### id @@ -20,4 +20,4 @@ Represents a participant in a room, including their ID and account details. #### Defined in -[core/src/core/types.ts:269](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L269) +[packages/core/src/types.ts:285](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L285) diff --git a/docs/docs/api/interfaces/Provider.md b/docs/docs/api/interfaces/Provider.md index 8951692f9c..daa6911d47 100644 --- a/docs/docs/api/interfaces/Provider.md +++ b/docs/docs/api/interfaces/Provider.md @@ -22,4 +22,4 @@ Represents a provider, which is used to retrieve information or perform actions #### Defined in -[core/src/core/types.ts:233](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L233) +[packages/core/src/types.ts:249](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L249) diff --git a/docs/docs/api/interfaces/Relationship.md b/docs/docs/api/interfaces/Relationship.md index fb5742fb7c..e79298c5b9 100644 --- a/docs/docs/api/interfaces/Relationship.md +++ b/docs/docs/api/interfaces/Relationship.md @@ -10,9 +10,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[core/src/core/types.ts:250](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L250) +[packages/core/src/types.ts:266](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L266) ---- +*** ### id @@ -20,9 +20,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[core/src/core/types.ts:244](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L244) +[packages/core/src/types.ts:260](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L260) ---- +*** ### roomId @@ -30,9 +30,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[core/src/core/types.ts:248](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L248) +[packages/core/src/types.ts:264](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L264) ---- +*** ### status @@ -40,9 +40,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[core/src/core/types.ts:249](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L249) +[packages/core/src/types.ts:265](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L265) ---- +*** ### userA @@ -50,9 +50,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[core/src/core/types.ts:245](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L245) +[packages/core/src/types.ts:261](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L261) ---- +*** ### userB @@ -60,9 +60,9 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[core/src/core/types.ts:246](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L246) +[packages/core/src/types.ts:262](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L262) ---- +*** ### userId @@ -70,4 +70,4 @@ Represents a relationship between two users, including their IDs, the status of #### Defined in -[core/src/core/types.ts:247](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L247) +[packages/core/src/types.ts:263](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L263) diff --git a/docs/docs/api/interfaces/Room.md b/docs/docs/api/interfaces/Room.md index 63a2ed0581..b89652b994 100644 --- a/docs/docs/api/interfaces/Room.md +++ b/docs/docs/api/interfaces/Room.md @@ -10,9 +10,9 @@ Represents a room or conversation context, including its ID and a list of partic #### Defined in -[core/src/core/types.ts:277](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L277) +[packages/core/src/types.ts:293](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L293) ---- +*** ### participants @@ -20,4 +20,4 @@ Represents a room or conversation context, including its ID and a list of partic #### Defined in -[core/src/core/types.ts:278](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L278) +[packages/core/src/types.ts:294](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L294) diff --git a/docs/docs/api/interfaces/State.md b/docs/docs/api/interfaces/State.md index 177552ce39..774f0a29bf 100644 --- a/docs/docs/api/interfaces/State.md +++ b/docs/docs/api/interfaces/State.md @@ -4,7 +4,7 @@ Represents the state of the conversation or context in which the agent is operat ## Indexable -\[`key`: `string`\]: `unknown` + \[`key`: `string`\]: `unknown` ## Properties @@ -14,9 +14,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:140](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L140) +[packages/core/src/types.ts:155](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L155) ---- +*** ### actionNames? @@ -24,9 +24,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:137](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L137) +[packages/core/src/types.ts:152](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L152) ---- +*** ### actions? @@ -34,9 +34,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:138](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L138) +[packages/core/src/types.ts:153](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L153) ---- +*** ### actionsData? @@ -44,9 +44,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:139](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L139) +[packages/core/src/types.ts:154](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L154) ---- +*** ### actors @@ -54,9 +54,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:127](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L127) +[packages/core/src/types.ts:146](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L146) ---- +*** ### actorsData? @@ -64,9 +64,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:128](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L128) +[packages/core/src/types.ts:147](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L147) ---- +*** ### agentId? @@ -74,9 +74,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:119](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L119) +[packages/core/src/types.ts:138](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L138) ---- +*** ### agentName? @@ -84,9 +84,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:125](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L125) +[packages/core/src/types.ts:144](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L144) ---- +*** ### bio @@ -94,9 +94,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:120](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L120) +[packages/core/src/types.ts:139](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L139) ---- +*** ### goals? @@ -104,9 +104,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:129](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L129) +[packages/core/src/types.ts:148](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L148) ---- +*** ### goalsData? @@ -114,9 +114,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:130](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L130) +[packages/core/src/types.ts:149](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L149) ---- +*** ### lore @@ -124,9 +124,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:121](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L121) +[packages/core/src/types.ts:140](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L140) ---- +*** ### messageDirections @@ -134,9 +134,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:122](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L122) +[packages/core/src/types.ts:141](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L141) ---- +*** ### postDirections @@ -144,9 +144,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:123](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L123) +[packages/core/src/types.ts:142](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L142) ---- +*** ### providers? @@ -154,29 +154,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:141](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L141) +[packages/core/src/types.ts:156](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L156) ---- - -### recentFacts? - -> `optional` **recentFacts**: `string` - -#### Defined in - -[core/src/core/types.ts:133](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L133) - ---- - -### recentFactsData? - -> `optional` **recentFactsData**: [`Memory`](Memory.md)[] - -#### Defined in - -[core/src/core/types.ts:134](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L134) - ---- +*** ### recentInteractions? @@ -184,9 +164,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:144](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L144) +[packages/core/src/types.ts:159](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L159) ---- +*** ### recentInteractionsData? @@ -194,9 +174,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:143](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L143) +[packages/core/src/types.ts:158](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L158) ---- +*** ### recentMessages @@ -204,9 +184,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:131](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L131) +[packages/core/src/types.ts:150](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L150) ---- +*** ### recentMessagesData @@ -214,29 +194,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:132](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L132) - ---- - -### relevantFacts? - -> `optional` **relevantFacts**: `string` - -#### Defined in - -[core/src/core/types.ts:135](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L135) - ---- - -### relevantFactsData? - -> `optional` **relevantFactsData**: [`Memory`](Memory.md)[] - -#### Defined in - -[core/src/core/types.ts:136](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L136) +[packages/core/src/types.ts:151](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L151) ---- +*** ### responseData? @@ -244,9 +204,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:142](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L142) +[packages/core/src/types.ts:157](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L157) ---- +*** ### roomId @@ -254,9 +214,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:124](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L124) +[packages/core/src/types.ts:143](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L143) ---- +*** ### senderName? @@ -264,9 +224,9 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:126](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L126) +[packages/core/src/types.ts:145](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L145) ---- +*** ### userId? @@ -274,4 +234,4 @@ Represents the state of the conversation or context in which the agent is operat #### Defined in -[core/src/core/types.ts:118](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L118) +[packages/core/src/types.ts:137](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L137) diff --git a/docs/docs/api/type-aliases/Character.md b/docs/docs/api/type-aliases/Character.md index 511d14ef77..f51884bb3f 100644 --- a/docs/docs/api/type-aliases/Character.md +++ b/docs/docs/api/type-aliases/Character.md @@ -20,10 +20,6 @@ > `optional` **id**: [`UUID`](UUID.md) -### imageGenModel? - -> `optional` **imageGenModel**: [`ImageGenModel`](../enumerations/ImageGenModel.md) - ### knowledge? > `optional` **knowledge**: `string`[] @@ -42,7 +38,7 @@ ### modelProvider -> **modelProvider**: [`ModelProvider`](../enumerations/ModelProvider.md) +> **modelProvider**: [`ModelProviderName`](../enumerations/ModelProviderName.md) ### name @@ -78,7 +74,7 @@ #### Index Signature -\[`key`: `string`\]: `string` + \[`key`: `string`\]: `string` ### settings.voice? @@ -118,7 +114,7 @@ #### Index Signature -\[`key`: `string`\]: `string` + \[`key`: `string`\]: `string` ### topics @@ -126,4 +122,4 @@ ## Defined in -[core/src/core/types.ts:305](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L305) +[packages/core/src/types.ts:327](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L327) diff --git a/docs/docs/api/type-aliases/Client.md b/docs/docs/api/type-aliases/Client.md new file mode 100644 index 0000000000..acb3669299 --- /dev/null +++ b/docs/docs/api/type-aliases/Client.md @@ -0,0 +1,33 @@ +# Type Alias: Client + +> **Client**: `object` + +## Type declaration + +### start() + +> **start**: (`runtime`?) => `Promise`\<`unknown`\> + +#### Parameters + +• **runtime?**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +#### Returns + +`Promise`\<`unknown`\> + +### stop() + +> **stop**: (`runtime`?) => `Promise`\<`unknown`\> + +#### Parameters + +• **runtime?**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) + +#### Returns + +`Promise`\<`unknown`\> + +## Defined in + +[packages/core/src/types.ts:306](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L306) diff --git a/docs/docs/api/type-aliases/Handler.md b/docs/docs/api/type-aliases/Handler.md index 6b3e13d5b4..c351005923 100644 --- a/docs/docs/api/type-aliases/Handler.md +++ b/docs/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/types.ts:188](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L188) diff --git a/docs/docs/api/type-aliases/HandlerCallback.md b/docs/docs/api/type-aliases/HandlerCallback.md index 2d9641aea5..0704f79377 100644 --- a/docs/docs/api/type-aliases/HandlerCallback.md +++ b/docs/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/types.ts:197](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L197) diff --git a/docs/docs/api/type-aliases/Media.md b/docs/docs/api/type-aliases/Media.md index 0585ea6b84..f76ba06d8d 100644 --- a/docs/docs/api/type-aliases/Media.md +++ b/docs/docs/api/type-aliases/Media.md @@ -30,4 +30,4 @@ ## Defined in -[core/src/core/types.ts:281](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L281) +[packages/core/src/types.ts:297](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L297) diff --git a/docs/docs/api/type-aliases/Model.md b/docs/docs/api/type-aliases/Model.md index 0449532f65..74f0c15d71 100644 --- a/docs/docs/api/type-aliases/Model.md +++ b/docs/docs/api/type-aliases/Model.md @@ -8,6 +8,14 @@ > `optional` **endpoint**: `string` +### imageSettings? + +> `optional` **imageSettings**: `object` + +### imageSettings.steps? + +> `optional` **steps**: `number` + ### model > **model**: `object` @@ -16,6 +24,10 @@ > `optional` **embedding**: `string` +### model.image? + +> `optional` **image**: `string` + ### model.large > **large**: `string` @@ -32,9 +44,9 @@ > **settings**: `object` -### settings.frequency_penalty? +### settings.frequency\_penalty? -> `optional` **frequency_penalty**: `number` +> `optional` **frequency\_penalty**: `number` ### settings.maxInputTokens @@ -44,13 +56,13 @@ > **maxOutputTokens**: `number` -### settings.presence_penalty? +### settings.presence\_penalty? -> `optional` **presence_penalty**: `number` +> `optional` **presence\_penalty**: `number` -### settings.repetition_penalty? +### settings.repetition\_penalty? -> `optional` **repetition_penalty**: `number` +> `optional` **repetition\_penalty**: `number` ### settings.stop @@ -62,4 +74,4 @@ ## Defined in -[core/src/core/types.ts:82](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/types.ts#L82) +[packages/core/src/types.ts:82](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L82) diff --git a/docs/docs/api/type-aliases/Models.md b/docs/docs/api/type-aliases/Models.md new file mode 100644 index 0000000000..504f977912 --- /dev/null +++ b/docs/docs/api/type-aliases/Models.md @@ -0,0 +1,53 @@ +# Type Alias: Models + +> **Models**: `object` + +## Type declaration + +### anthropic + +> **anthropic**: [`Model`](Model.md) + +### claude\_vertex + +> **claude\_vertex**: [`Model`](Model.md) + +### google + +> **google**: [`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) + +### ollama + +> **ollama**: [`Model`](Model.md) + +### openai + +> **openai**: [`Model`](Model.md) + +### openrouter + +> **openrouter**: [`Model`](Model.md) + +### redpill + +> **redpill**: [`Model`](Model.md) + +## Defined in + +[packages/core/src/types.ts:105](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L105) diff --git a/docs/docs/api/type-aliases/Plugin.md b/docs/docs/api/type-aliases/Plugin.md index 3598e5ac7b..192caf873a 100644 --- a/docs/docs/api/type-aliases/Plugin.md +++ b/docs/docs/api/type-aliases/Plugin.md @@ -4,26 +4,30 @@ ## Type declaration -### actions +### actions? -> **actions**: [`Action`](../interfaces/Action.md)[] +> `optional` **actions**: [`Action`](../interfaces/Action.md)[] ### description > **description**: `string` -### evaluators +### evaluators? -> **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] +> `optional` **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] ### name > **name**: `string` -### providers +### providers? -> **providers**: [`Provider`](../interfaces/Provider.md)[] +> `optional` **providers**: [`Provider`](../interfaces/Provider.md)[] + +### services? + +> `optional` **services**: [`Service`](../classes/Service.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/types.ts:311](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L311) diff --git a/docs/docs/api/type-aliases/UUID.md b/docs/docs/api/type-aliases/UUID.md index bf620cb27d..eb2f882587 100644 --- a/docs/docs/api/type-aliases/UUID.md +++ b/docs/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/types.ts:6](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L6) diff --git a/docs/docs/api/type-aliases/Validator.md b/docs/docs/api/type-aliases/Validator.md index 3289d9e2e5..4a534a105c 100644 --- a/docs/docs/api/type-aliases/Validator.md +++ b/docs/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/types.ts:205](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/types.ts#L205) diff --git a/docs/docs/api/typedoc-sidebar.cjs b/docs/docs/api/typedoc-sidebar.cjs index 6c759f89fe..ff4ac8aa32 100644 --- a/docs/docs/api/typedoc-sidebar.cjs +++ b/docs/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":"api/enumerations/Clients","label":"Clients"},{"type":"doc","id":"api/enumerations/GoalStatus","label":"GoalStatus"},{"type":"doc","id":"api/enumerations/ModelClass","label":"ModelClass"},{"type":"doc","id":"api/enumerations/ModelProviderName","label":"ModelProviderName"},{"type":"doc","id":"api/enumerations/ServiceType","label":"ServiceType"}]},{"type":"category","label":"Classes","items":[{"type":"doc","id":"api/classes/AgentRuntime","label":"AgentRuntime"},{"type":"doc","id":"api/classes/DatabaseAdapter","label":"DatabaseAdapter"},{"type":"doc","id":"api/classes/MemoryManager","label":"MemoryManager"},{"type":"doc","id":"api/classes/Service","label":"Service"}]},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"api/interfaces/Account","label":"Account"},{"type":"doc","id":"api/interfaces/Action","label":"Action"},{"type":"doc","id":"api/interfaces/ActionExample","label":"ActionExample"},{"type":"doc","id":"api/interfaces/Actor","label":"Actor"},{"type":"doc","id":"api/interfaces/Content","label":"Content"},{"type":"doc","id":"api/interfaces/ConversationExample","label":"ConversationExample"},{"type":"doc","id":"api/interfaces/EvaluationExample","label":"EvaluationExample"},{"type":"doc","id":"api/interfaces/Evaluator","label":"Evaluator"},{"type":"doc","id":"api/interfaces/Goal","label":"Goal"},{"type":"doc","id":"api/interfaces/IAgentRuntime","label":"IAgentRuntime"},{"type":"doc","id":"api/interfaces/IBrowserService","label":"IBrowserService"},{"type":"doc","id":"api/interfaces/IDatabaseAdapter","label":"IDatabaseAdapter"},{"type":"doc","id":"api/interfaces/IImageDescriptionService","label":"IImageDescriptionService"},{"type":"doc","id":"api/interfaces/IMemoryManager","label":"IMemoryManager"},{"type":"doc","id":"api/interfaces/IPdfService","label":"IPdfService"},{"type":"doc","id":"api/interfaces/ISpeechService","label":"ISpeechService"},{"type":"doc","id":"api/interfaces/ITextGenerationService","label":"ITextGenerationService"},{"type":"doc","id":"api/interfaces/ITranscriptionService","label":"ITranscriptionService"},{"type":"doc","id":"api/interfaces/IVideoService","label":"IVideoService"},{"type":"doc","id":"api/interfaces/Memory","label":"Memory"},{"type":"doc","id":"api/interfaces/MessageExample","label":"MessageExample"},{"type":"doc","id":"api/interfaces/Objective","label":"Objective"},{"type":"doc","id":"api/interfaces/Participant","label":"Participant"},{"type":"doc","id":"api/interfaces/Provider","label":"Provider"},{"type":"doc","id":"api/interfaces/Relationship","label":"Relationship"},{"type":"doc","id":"api/interfaces/Room","label":"Room"},{"type":"doc","id":"api/interfaces/State","label":"State"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"api/type-aliases/Character","label":"Character"},{"type":"doc","id":"api/type-aliases/Client","label":"Client"},{"type":"doc","id":"api/type-aliases/Handler","label":"Handler"},{"type":"doc","id":"api/type-aliases/HandlerCallback","label":"HandlerCallback"},{"type":"doc","id":"api/type-aliases/Media","label":"Media"},{"type":"doc","id":"api/type-aliases/Model","label":"Model"},{"type":"doc","id":"api/type-aliases/Models","label":"Models"},{"type":"doc","id":"api/type-aliases/Plugin","label":"Plugin"},{"type":"doc","id":"api/type-aliases/UUID","label":"UUID"},{"type":"doc","id":"api/type-aliases/Validator","label":"Validator"}]},{"type":"category","label":"Variables","items":[{"type":"doc","id":"api/variables/defaultCharacter","label":"defaultCharacter"},{"type":"doc","id":"api/variables/elizaLogger","label":"elizaLogger"},{"type":"doc","id":"api/variables/embeddingDimension","label":"embeddingDimension"},{"type":"doc","id":"api/variables/embeddingZeroVector","label":"embeddingZeroVector"},{"type":"doc","id":"api/variables/evaluationTemplate","label":"evaluationTemplate"},{"type":"doc","id":"api/variables/settings","label":"settings"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"api/functions/addHeader","label":"addHeader"},{"type":"doc","id":"api/functions/composeActionExamples","label":"composeActionExamples"},{"type":"doc","id":"api/functions/composeContext","label":"composeContext"},{"type":"doc","id":"api/functions/createGoal","label":"createGoal"},{"type":"doc","id":"api/functions/createRelationship","label":"createRelationship"},{"type":"doc","id":"api/functions/embed","label":"embed"},{"type":"doc","id":"api/functions/findNearestEnvFile","label":"findNearestEnvFile"},{"type":"doc","id":"api/functions/formatActionNames","label":"formatActionNames"},{"type":"doc","id":"api/functions/formatActions","label":"formatActions"},{"type":"doc","id":"api/functions/formatActors","label":"formatActors"},{"type":"doc","id":"api/functions/formatEvaluatorExampleDescriptions","label":"formatEvaluatorExampleDescriptions"},{"type":"doc","id":"api/functions/formatEvaluatorExamples","label":"formatEvaluatorExamples"},{"type":"doc","id":"api/functions/formatEvaluatorNames","label":"formatEvaluatorNames"},{"type":"doc","id":"api/functions/formatEvaluators","label":"formatEvaluators"},{"type":"doc","id":"api/functions/formatGoalsAsString","label":"formatGoalsAsString"},{"type":"doc","id":"api/functions/formatMessages","label":"formatMessages"},{"type":"doc","id":"api/functions/formatPosts","label":"formatPosts"},{"type":"doc","id":"api/functions/formatRelationships","label":"formatRelationships"},{"type":"doc","id":"api/functions/formatTimestamp","label":"formatTimestamp"},{"type":"doc","id":"api/functions/generateCaption","label":"generateCaption"},{"type":"doc","id":"api/functions/generateImage","label":"generateImage"},{"type":"doc","id":"api/functions/generateMessageResponse","label":"generateMessageResponse"},{"type":"doc","id":"api/functions/generateObject","label":"generateObject"},{"type":"doc","id":"api/functions/generateObjectArray","label":"generateObjectArray"},{"type":"doc","id":"api/functions/generateShouldRespond","label":"generateShouldRespond"},{"type":"doc","id":"api/functions/generateText","label":"generateText"},{"type":"doc","id":"api/functions/generateTextArray","label":"generateTextArray"},{"type":"doc","id":"api/functions/generateTrueOrFalse","label":"generateTrueOrFalse"},{"type":"doc","id":"api/functions/getActorDetails","label":"getActorDetails"},{"type":"doc","id":"api/functions/getEndpoint","label":"getEndpoint"},{"type":"doc","id":"api/functions/getGoals","label":"getGoals"},{"type":"doc","id":"api/functions/getModel","label":"getModel"},{"type":"doc","id":"api/functions/getProviders","label":"getProviders"},{"type":"doc","id":"api/functions/getRelationship","label":"getRelationship"},{"type":"doc","id":"api/functions/getRelationships","label":"getRelationships"},{"type":"doc","id":"api/functions/loadEnvConfig","label":"loadEnvConfig"},{"type":"doc","id":"api/functions/retrieveCachedEmbedding","label":"retrieveCachedEmbedding"},{"type":"doc","id":"api/functions/splitChunks","label":"splitChunks"},{"type":"doc","id":"api/functions/trimTokens","label":"trimTokens"},{"type":"doc","id":"api/functions/updateGoal","label":"updateGoal"}]}]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/docs/docs/api/variables/boredomProvider.md b/docs/docs/api/variables/boredomProvider.md deleted file mode 100644 index f9fdc3d727..0000000000 --- a/docs/docs/api/variables/boredomProvider.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: boredomProvider - -> `const` **boredomProvider**: [`Provider`](../interfaces/Provider.md) - -## Defined in - -[core/src/providers/boredom.ts:275](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/boredom.ts#L275) diff --git a/docs/docs/api/variables/continueAction.md b/docs/docs/api/variables/continueAction.md deleted file mode 100644 index 030165236d..0000000000 --- a/docs/docs/api/variables/continueAction.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: continueAction - -> `const` **continueAction**: [`Action`](../interfaces/Action.md) - -## Defined in - -[core/src/actions/continue.ts:58](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/continue.ts#L58) diff --git a/docs/docs/api/variables/defaultActions.md b/docs/docs/api/variables/defaultActions.md deleted file mode 100644 index b283756741..0000000000 --- a/docs/docs/api/variables/defaultActions.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: defaultActions - -> `const` **defaultActions**: [`Action`](../interfaces/Action.md)[] - -## Defined in - -[core/src/core/actions.ts:6](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/actions.ts#L6) diff --git a/docs/docs/api/variables/defaultCharacter.md b/docs/docs/api/variables/defaultCharacter.md index 58de13c19f..3b34f4fdca 100644 --- a/docs/docs/api/variables/defaultCharacter.md +++ b/docs/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/defaultCharacter.ts:3](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/defaultCharacter.ts#L3) diff --git a/docs/docs/api/variables/defaultEvaluators.md b/docs/docs/api/variables/defaultEvaluators.md deleted file mode 100644 index 3d8953896d..0000000000 --- a/docs/docs/api/variables/defaultEvaluators.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: defaultEvaluators - -> `const` **defaultEvaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] - -## Defined in - -[core/src/core/evaluators.ts:7](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L7) diff --git a/docs/docs/api/variables/defaultProviders.md b/docs/docs/api/variables/defaultProviders.md deleted file mode 100644 index a7005af176..0000000000 --- a/docs/docs/api/variables/defaultProviders.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: defaultProviders - -> `const` **defaultProviders**: [`Provider`](../interfaces/Provider.md)[] - -## Defined in - -[core/src/core/providers.ts:4](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/providers.ts#L4) diff --git a/docs/docs/api/variables/elizaLogger.md b/docs/docs/api/variables/elizaLogger.md index ffb378d63f..a47dd2d355 100644 --- a/docs/docs/api/variables/elizaLogger.md +++ b/docs/docs/api/variables/elizaLogger.md @@ -1,7 +1,7 @@ # Variable: elizaLogger -> `const` **elizaLogger**: `elizaLogger` +> `const` **elizaLogger**: `ElizaLogger` ## Defined in -[core/src/index.ts:12](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/index.ts#L12) +[packages/core/src/logger.ts:282](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/logger.ts#L282) diff --git a/docs/docs/api/variables/embeddingDimension.md b/docs/docs/api/variables/embeddingDimension.md index 1447d864ea..da564e2c14 100644 --- a/docs/docs/api/variables/embeddingDimension.md +++ b/docs/docs/api/variables/embeddingDimension.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/core/memory.ts:9](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L9) +[packages/core/src/memory.ts:9](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L9) diff --git a/docs/docs/api/variables/embeddingZeroVector.md b/docs/docs/api/variables/embeddingZeroVector.md index 9101bd6332..36461d3484 100644 --- a/docs/docs/api/variables/embeddingZeroVector.md +++ b/docs/docs/api/variables/embeddingZeroVector.md @@ -4,4 +4,4 @@ ## Defined in -[core/src/core/memory.ts:10](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/memory.ts#L10) +[packages/core/src/memory.ts:10](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/memory.ts#L10) diff --git a/docs/docs/api/variables/evaluationTemplate.md b/docs/docs/api/variables/evaluationTemplate.md index 316b9d6be6..e324e3486f 100644 --- a/docs/docs/api/variables/evaluationTemplate.md +++ b/docs/docs/api/variables/evaluationTemplate.md @@ -6,4 +6,4 @@ Template used for the evaluation generateText. ## Defined in -[core/src/core/evaluators.ts:12](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/evaluators.ts#L12) +[packages/core/src/evaluators.ts:8](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/evaluators.ts#L8) diff --git a/docs/docs/api/variables/executeSwap.md b/docs/docs/api/variables/executeSwap.md deleted file mode 100644 index 15018dafaa..0000000000 --- a/docs/docs/api/variables/executeSwap.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: executeSwap - -> `const` **executeSwap**: [`Action`](../interfaces/Action.md) - -## Defined in - -[core/src/actions/swap.ts:178](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/swap.ts#L178) diff --git a/docs/docs/api/variables/followRoom.md b/docs/docs/api/variables/followRoom.md deleted file mode 100644 index 37276e24ce..0000000000 --- a/docs/docs/api/variables/followRoom.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: followRoom - -> `const` **followRoom**: [`Action`](../interfaces/Action.md) - -## Defined in - -[core/src/actions/followRoom.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/followRoom.ts#L27) diff --git a/docs/docs/api/variables/ignore.md b/docs/docs/api/variables/ignore.md deleted file mode 100644 index 151124d718..0000000000 --- a/docs/docs/api/variables/ignore.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: ignore - -> `const` **ignore**: [`Action`](../interfaces/Action.md) - -## Defined in - -[core/src/actions/ignore.ts:8](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/ignore.ts#L8) diff --git a/docs/docs/api/variables/imageGenModels.md b/docs/docs/api/variables/imageGenModels.md deleted file mode 100644 index 7f38921b9e..0000000000 --- a/docs/docs/api/variables/imageGenModels.md +++ /dev/null @@ -1,33 +0,0 @@ -# Variable: imageGenModels - -> `const` **imageGenModels**: `object` - -## Type declaration - -### Dalle - -> **Dalle**: `object` - -### Dalle.steps - -> **steps**: `number` = `0` - -### Dalle.subModel - -> **subModel**: `string` = `"dall-e-3"` - -### TogetherAI - -> **TogetherAI**: `object` - -### TogetherAI.steps - -> **steps**: `number` = `4` - -### TogetherAI.subModel - -> **subModel**: `string` = `"black-forest-labs/FLUX.1-schnell"` - -## Defined in - -[core/src/core/imageGenModels.ts:6](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/core/imageGenModels.ts#L6) diff --git a/docs/docs/api/variables/imageGeneration.md b/docs/docs/api/variables/imageGeneration.md deleted file mode 100644 index 2ca52ee544..0000000000 --- a/docs/docs/api/variables/imageGeneration.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: imageGeneration - -> `const` **imageGeneration**: [`Action`](../interfaces/Action.md) - -## Defined in - -[core/src/actions/imageGeneration.ts:11](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/imageGeneration.ts#L11) diff --git a/docs/docs/api/variables/messageHandlerTemplate.md b/docs/docs/api/variables/messageHandlerTemplate.md deleted file mode 100644 index cef7d99229..0000000000 --- a/docs/docs/api/variables/messageHandlerTemplate.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: messageHandlerTemplate - -> `const` **messageHandlerTemplate**: `string` - -## Defined in - -[core/src/actions/continue.ts:20](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/continue.ts#L20) diff --git a/docs/docs/api/variables/muteRoom.md b/docs/docs/api/variables/muteRoom.md deleted file mode 100644 index e955e04375..0000000000 --- a/docs/docs/api/variables/muteRoom.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: muteRoom - -> `const` **muteRoom**: [`Action`](../interfaces/Action.md) - -## Defined in - -[core/src/actions/muteRoom.ts:28](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/muteRoom.ts#L28) diff --git a/docs/docs/api/variables/none.md b/docs/docs/api/variables/none.md deleted file mode 100644 index 583c9f86f1..0000000000 --- a/docs/docs/api/variables/none.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: none - -> `const` **none**: [`Action`](../interfaces/Action.md) - -## Defined in - -[core/src/actions/none.ts:8](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/none.ts#L8) diff --git a/docs/docs/api/variables/orderBookProvider.md b/docs/docs/api/variables/orderBookProvider.md deleted file mode 100644 index 1a727c6a82..0000000000 --- a/docs/docs/api/variables/orderBookProvider.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: orderBookProvider - -> `const` **orderBookProvider**: [`Provider`](../interfaces/Provider.md) - -## Defined in - -[core/src/providers/orderBook.ts:14](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/orderBook.ts#L14) diff --git a/docs/docs/api/variables/settings.md b/docs/docs/api/variables/settings.md new file mode 100644 index 0000000000..6c08bf623a --- /dev/null +++ b/docs/docs/api/variables/settings.md @@ -0,0 +1,7 @@ +# Variable: settings + +> `const` **settings**: `ProcessEnv` + +## Defined in + +[packages/core/src/settings.ts:54](https://github.com/ai16z/eliza/blob/7fcf54e7fb2ba027d110afcc319c0b01b3f181dc/packages/core/src/settings.ts#L54) diff --git a/docs/docs/api/variables/shouldContinueTemplate.md b/docs/docs/api/variables/shouldContinueTemplate.md deleted file mode 100644 index a6f189eb0b..0000000000 --- a/docs/docs/api/variables/shouldContinueTemplate.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: shouldContinueTemplate - -> `const` **shouldContinueTemplate**: `string` - -## Defined in - -[core/src/actions/continue.ts:47](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/continue.ts#L47) diff --git a/docs/docs/api/variables/shouldFollowTemplate.md b/docs/docs/api/variables/shouldFollowTemplate.md deleted file mode 100644 index 682da6f91b..0000000000 --- a/docs/docs/api/variables/shouldFollowTemplate.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: shouldFollowTemplate - -> `const` **shouldFollowTemplate**: `string` - -## Defined in - -[core/src/actions/followRoom.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/followRoom.ts#L13) diff --git a/docs/docs/api/variables/shouldMuteTemplate.md b/docs/docs/api/variables/shouldMuteTemplate.md deleted file mode 100644 index c999f23e56..0000000000 --- a/docs/docs/api/variables/shouldMuteTemplate.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: shouldMuteTemplate - -> `const` **shouldMuteTemplate**: `string` - -## Defined in - -[core/src/actions/muteRoom.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/muteRoom.ts#L13) diff --git a/docs/docs/api/variables/shouldUnmuteTemplate.md b/docs/docs/api/variables/shouldUnmuteTemplate.md deleted file mode 100644 index e69a5fc9aa..0000000000 --- a/docs/docs/api/variables/shouldUnmuteTemplate.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: shouldUnmuteTemplate - -> `const` **shouldUnmuteTemplate**: `string` - -## Defined in - -[core/src/actions/unmuteRoom.ts:13](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/unmuteRoom.ts#L13) diff --git a/docs/docs/api/variables/timeProvider.md b/docs/docs/api/variables/timeProvider.md deleted file mode 100644 index 495451cd21..0000000000 --- a/docs/docs/api/variables/timeProvider.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: timeProvider - -> `const` **timeProvider**: [`Provider`](../interfaces/Provider.md) - -## Defined in - -[core/src/providers/time.ts:3](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/time.ts#L3) diff --git a/docs/docs/api/variables/tokenProvider.md b/docs/docs/api/variables/tokenProvider.md deleted file mode 100644 index f2af9a6a8b..0000000000 --- a/docs/docs/api/variables/tokenProvider.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: tokenProvider - -> `const` **tokenProvider**: [`Provider`](../interfaces/Provider.md) - -## Defined in - -[core/src/providers/token.ts:801](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/token.ts#L801) diff --git a/docs/docs/api/variables/unfollowRoom.md b/docs/docs/api/variables/unfollowRoom.md deleted file mode 100644 index a35743195c..0000000000 --- a/docs/docs/api/variables/unfollowRoom.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: unfollowRoom - -> `const` **unfollowRoom**: [`Action`](../interfaces/Action.md) - -## Defined in - -[core/src/actions/unfollowRoom.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/unfollowRoom.ts#L27) diff --git a/docs/docs/api/variables/unmuteRoom.md b/docs/docs/api/variables/unmuteRoom.md deleted file mode 100644 index 95fd4dabbe..0000000000 --- a/docs/docs/api/variables/unmuteRoom.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: unmuteRoom - -> `const` **unmuteRoom**: [`Action`](../interfaces/Action.md) - -## Defined in - -[core/src/actions/unmuteRoom.ts:27](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/actions/unmuteRoom.ts#L27) diff --git a/docs/docs/api/variables/walletProvider.md b/docs/docs/api/variables/walletProvider.md deleted file mode 100644 index 32f4688f60..0000000000 --- a/docs/docs/api/variables/walletProvider.md +++ /dev/null @@ -1,7 +0,0 @@ -# Variable: walletProvider - -> `const` **walletProvider**: [`Provider`](../interfaces/Provider.md) - -## Defined in - -[core/src/providers/wallet.ts:244](https://github.com/ai16z/eliza/blob/c96957e5a5d17e343b499dd4d46ce403856ac5bc/core/src/providers/wallet.ts#L244) diff --git a/docs/docs/community/contributing.md b/docs/docs/community/contributing.md index e69de29bb2..bfcb0f6222 100644 --- a/docs/docs/community/contributing.md +++ b/docs/docs/community/contributing.md @@ -0,0 +1,98 @@ +--- +sidebar_position: 5 +title: Contributing +--- + +# Contributor Guide + +Welcome to the Eliza contributor guide! This document is designed to help you understand how you can be part of building the future of autonomous AI agents, regardless of your technical background. + +## The OODA Loop: A Framework for Contribution + +We believe in the power of the OODA Loop - a decision-making framework that emphasizes speed and adaptability. OODA stands for: + +- **Observe**: Gather information and insights about the project, the community, and the broader AI ecosystem. +- **Orient**: Analyze your observations to identify opportunities for contribution and improvement. +- **Decide**: Choose a course of action based on your analysis. This could be proposing a new feature, fixing a bug, or creating content. +- **Act**: Execute your decision and share your work with the community. + +By internalizing the OODA Loop, you can quickly identify areas where you can make a meaningful impact and drive the project forward. + +--- + +## How to Contribute + +### For Developers + +1. **Extend Eliza's Capabilities** + + - Develop new actions, evaluators, and providers to expand what Eliza agents can do. + - Improve existing components and modules. + +2. **Enhance Infrastructure** + + - Go through open issues, send back a PR if you can improve anything. + - Test currently documented steps to ensure they're still up to date. + - Optimize Eliza's database architecture and performance. + - Contribute to the autonomous trading system and trust engine. + - Improve deployment and scaling solutions. + +3. **Implement Integrations** + - Build connectors for new platforms and services. + - Enhance existing integrations with additional features. + +### For AI Enthusiasts + +1. **Fine-tune Models** + + - Experiment with fine-tuning models for specific tasks and domains. + - Develop best practices for prompt engineering and model selection. + +2. **Develop Characters** + - Create compelling character files that showcase Eliza's potential. + - Curate knowledge bases and datasets for different use cases. + +### Non-Technical Contributions + +1. **Create Content** + + - Make memes, stickers, emojis, and clips of AI agents that are deployed. + - Write tutorials, guides, and blog posts to help others learn about Eliza. + - Produce videos showcasing Eliza's capabilities and real-world applications. + +2. **Engage the Community** + + - Participate in discussions on Discord, Twitter, and other platforms. + - Help answer questions and provide support to other community members. + - Organize events, workshops, and hackathons to bring people together. + +3. **Spread the Word** + - Share the Eliza project and help attract new contributors. + - Participate in one of our upcoming demo days, show and tell your project. + +--- + +### Tips for Efficient Contribution + +- Use tools like OBS and Whisper to record and transcribe your work sessions. This allows you to easily document your process and share insights with the community. +- Leverage AI assistants to help with tasks like code generation, document summarization, and content creation. +- Collaborate with other community members to divide and conquer larger initiatives. + +## Recognition and Rewards + +We believe in recognizing and rewarding contributors who go above and beyond to drive the project forward. Stand-out contributions may be eligible for: + +- Grants from the ai16z Creator Fund +- Featuring your project across various channels +- Opportunities to shape the direction of the project + +Note: we're still finalizing details on the creator/dev fund that seeks to retroactively reward valued contributions to the ecosystem. + +## Getting Started + +1. Join the [Eliza Discord](https://discord.gg/ai16z) and make a short introduction. +2. Explore the [documentation](/docs/intro) to understand the project's architecture and capabilities. +3. Check out the [open issues](https://github.com/ai16z/eliza/issues) on GitHub to find ways to contribute. +4. Share your ideas and initiatives with the community - we're excited to see what you'll build! + +Lets push the boundaries of what's possible with autonomous AI agents. Welcome aboard! diff --git a/docs/docs/community/development-notes.md b/docs/docs/community/development-notes.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/docs/community/project-overview.md b/docs/docs/community/project-overview.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/docs/community/spaces-notes.md b/docs/docs/community/spaces-notes.md deleted file mode 100644 index 4f05a0f1ac..0000000000 --- a/docs/docs/community/spaces-notes.md +++ /dev/null @@ -1,155 +0,0 @@ ---- -sidebar_position: 1 -title: X Space Notes ---- - -# X Space Notes - -## 10-29-24 - -Space: https://x.com/weremeow/status/1851365658916708616 - -- 00:04:03 - Keeping up with rapid AI agent growth -- 00:09:01 - Imran from Alliance DAO on consumer AI incubators -- 00:14:04 - Discussion on Goatsea and Opus AI system -- 00:14:34 - Exponential growth accelerates AI progress -- 00:17:10 - Entertainers and AI as modern "religions" -- 00:28:45 - Mathis on Opus and "Goatse Gospels" -- 00:35:11 - Base vs. instruct/chat-tuned models -- 00:59:42 - http://ai16z.vc approach to memecoins fund -- 01:17:06 - Balancing chaotic vs. orderly AI systems -- 01:25:38 - AI controlling blockchain keys/wallets -- 01:36:10 - Creation story of ai16z -- 01:40:27 - AI / Crypto tipping points -- 01:49:54 - Preserving Opus on-chain before potential takedown -- 01:58:46 - Shinkai Protocol’s decentralized AI wallet -- 02:17:02 - Fee-sharing model to sustain DAOs -- 02:21:18 - DAO token liquidity pools as passive income -- 02:27:02 - AI bots for DAO treasury oversight -- 02:31:30 - AI-facilitated financial freedom for higher pursuits -- 02:41:51 - Call to build on http://DAO.fun for team-friendly economics - ---- - -## 10-27-24 - -Space: https://x.com/shawmakesmagic/status/1850609680558805422 - -00:00:00 - Opening - -- Co-hosts: Shaw and Jin -- Purpose: Structured FAQ session about AI16Z and DegenAI -- Format: Pre-collected questions followed by audience Q&A - -00:06:40 - AI16Z vs DegenAI Relationship -Q: What's the difference between AI16Z and DegenAI? -A: - -- ai16z: DAO-based investment vehicle, more PvE focused, community driven -- DegenAI: Individual trading agent, PvP focused, more aggressive strategy -- Both use same codebase but different personalities -- DAO is a large holder of DegenAI -- Management fees (1%) used to buy more DegenAI -- Carry fees reinvested in DegenAI -- Projects intentionally interlinked but serve different purposes - -00:10:45 - Trust Engine Mechanics -Q: How does the trust engine work? -A: - -- Users share contract addresses with confidence levels -- System tracks recommendation performance -- Low conviction recommendations = low penalty if wrong -- High conviction failures severely impact trust score -- Historical performance tracked for trust calculation -- Trust scores influence agent's future decision-making - -00:21:45 - Technical Infrastructure -Q: Where do the agents live? -A: - -- Currently: Test servers and local development -- Future: Trusted Execution Environment (TEE) -- Partnership with TreasureDAO for infrastructure -- Goal: Fully autonomous agents without developer control -- Private keys generated within TEE for security - -00:34:20 - Trading Implementation -Q: When will Mark start trading? -A: - -- Three phase approach: - -1. Testing tech infrastructure -2. Virtual order book/paper trading -3. Live trading with real assets - -- Using Jupiter API for swaps -- Initial focus on basic trades before complex strategies -- Trading decisions based on community trust scores - -00:54:15 - Development Status -Q: Who's building this? -A: - -- Open source project with multiple contributors -- Key maintainers: Circuitry, Nate Martin -- Community developers incentivized through token ownership -- Focus on reusable components and documentation - -01:08:35 - AI Model Architecture -Q: What models power the agents? -A: - -- DegenAI: Llama 70B -- Using Together.xyz for model marketplace -- Continuous fine-tuning planned -- Different personalities require different model approaches -- Avoiding GPT-4 due to distinct "voice" - -01:21:35 - Ethics Framework -Q: What ethical guidelines are being followed? -A: - -- Rejecting traditional corporate AI ethics frameworks -- Focus on community-driven standards -- Emphasis on transparency and open source -- Goal: Multiple competing approaches rather than single standard -- Priority on practical utility over theoretical ethics - -01:28:30 - Wrap-up - -- Discord: AI16z.vc -- Future spaces planned with DAOs.fun team -- Focus on responsible growth -- Community engagement continuing in Discord - -The space emphasized technical implementation details while addressing community concerns about governance, ethics, and practical functionality. - ---- - -## 10-25-24 - -- https://x.com/shawmakesmagic/status/1848553697611301014 - - https://www.youtube.com/live/F3IZ3ikacWM?feature=share - -**Overview** - -- 00:00-30:00 Talks about Eliza framework. The bot is able to tweet, reply to tweets, search Twitter for topics, and generate new posts on its own every few hours. It works autonomously without human input (except to fix the occasional issues) -- 30:00-45:00 Deep dive into creating the bots personality which is defined by character files containing bios, lore, example conversations, and specific directions. Some alpha for those -- 45:00-60:00 working on adding capabilities for the bot to make crypto token swaps and trades. This requires providing the bot wallet balances, token prices, market data, and a swap action. Some live coding for showing how new features can get implemented. -- 60:00-75:00 Discussion around the symbiosis between the AI and crypto communities. AI developers are realizing they can monetize their work through tokens vs traditional VC funding route. Crypto people are learning about AI advancements. - -**Notes** - -1. A large amount of $degenai tokens were moved to the DAO, which the AI bot "Marc" will hold and eventually trade with. -2. The goal is to make the AI bot a genuinely good venture capitalist that funds cool projects and buys interesting tokens. They want it to be high fidelity and real, bringing in Marc Andreeson's real knowledge by training a model on his writings. -3. Shaw thinks the only way to make an authentic / legitimate AI version of Marc Andreessen is to also have it outperform the real Marc Andreessen financially. -4. AI Marc Andreessen (or AI Marc) will be in a Discord channel (Telegram was also mentioned). DAO token holders above a certain threshold get access to interact with him, pitch ideas, and try to influence his investing decisions. -5. AI Marc decides how much to trust people's investment advice based on a "virtual Marcetplace of trust". He tracks how much money he would have made following their recommendations. Successful tips increase trust; failed ones decrease it. -6. The amount of DAO tokens someone holds also influences their sway with AI Marc. The two balancing factors are the virtual Marcetplace of trust performance and DAO token holdings. -7. The core tech behind AI Marc AIndreessen is the same agent system that allows him to pull in relevant knowledge, interact with people, and make decisions (http://github.com/ai16z) -8. AI Marc should be able to autonomously execute on-chain activities, not just have humans execute actions on his behalf. -9. In the near future, AI Marc will be able to execute trades autonomously based on the information and recommendations gathered from the community. Human intervention will be minimized. -10. They are working on getting AI Marc on-chain as soon as possible using trusted execution environments for him to take actions like approving trades. -11. The plan is for AI Marc to eventually participate in a "futarchy" style governance market within the DAO, allowing humans to influence decisions but not fully control the AI. diff --git a/docs/docs/community/stream-notes.md b/docs/docs/community/stream-notes.md index e76adffbc9..911e7a01fb 100644 --- a/docs/docs/community/stream-notes.md +++ b/docs/docs/community/stream-notes.md @@ -3,7 +3,6 @@ sidebar_position: 1 title: Stream Notes --- -<<<<<<< HEAD # Stream Notes Overview Welcome to our collection of stream notes! This section contains detailed summaries and recordings of our community streams, Twitter spaces, and development sessions. These notes capture key insights, technical discussions, and community interactions that help shape the Eliza framework and our ecosystem. @@ -18,7 +17,7 @@ A comprehensive discussion bringing together key figures in the AI and crypto sp - Community building and trust mechanisms - Meme culture and narrative creation - Technical implementation details -- [Read more →](./streams/2024-11-08) +- [Read more →](../streams/2024-11-08) #### Discord Development Stream (November 6, 2024) A four-part technical deep dive into Eliza's architecture covering: @@ -26,7 +25,7 @@ A four-part technical deep dive into Eliza's architecture covering: - OpenAI integration and rate limits - Memory management and context handling - Autonomous agent implementation -- [Read more →](./streams/2024-11-06) +- [Read more →](../streams/2024-11-06) ### October 2024 @@ -37,20 +36,20 @@ Three important discussions about the future of AI agents: - Discussion on AI agent growth - Consumer AI incubators - Balancing chaos and order in AI systems -- [Read more →](./streams/2024-10-29) +- [Read more →](../streams/2024-10-29) **Building Autonomous Agents (October 27)** - Technical infrastructure deep dive - Trust engine mechanics - Development status updates -- [Read more →](./streams/2024-10-27) +- [Read more →](../streams/2024-10-27) **Eliza Framework Deep Dive (October 25)** - Framework capabilities overview - Bot personality development - Token swap integration - AI-crypto community synergy -- [Read more →](./streams/2024-10-25) +- [Read more →](../streams/2024-10-25) ## Stream Categories @@ -88,634 +87,3 @@ Have notes from a stream that isn't documented here? We welcome community contri - Join our [Discord](https://discord.gg/ai16z) to participate in future streams - Follow us on [Twitter](https://twitter.com/ai16zdao) for stream announcements -======= -# Stream Notes - -## Memes, AI Agents, DAOs 11-8-24 - -Space: https://x.com/ai16zdao/status/1854969196142379403 - -## Overview - -1. Introductions & Community Building (00:00:00 - 00:45:00) - -- Multiple AI/crypto developers introduce themselves and their projects -- Discussion of open source collaboration and community building -- Emphasis on PPP (Player Pumps Player) vs PVP mentality - -2. Trust Systems & AI Agents (00:45:00 - 01:15:00) - -- Discussion of trust mechanisms in AI systems -- Marketplace of trust concept -- Human-in-the-loop vs autonomous systems -- Role of transparency in AI agent systems - -3. Memes, Narrative & Reality (01:15:00 - 01:45:00) - -- Relationship between memes and financial incentives -- Discussion of hyperstition and narrative creation -- Role of AI in shaping reality and perception -- Integration of Nick Land's philosophy - -4. Technical Implementation & Future Vision (01:45:00 - 02:10:00) - -- Discussion of multi-agent systems and swarms -- Technical challenges in implementation -- Integration with existing platforms -- Future vision for AI agent ecosystems - ---- - -Detailed Breakdown of Topic 1: Introductions & Community Building (00:00:00 - 00:45:00) - -Key Points: - -1. Notable Introductions: - -- Shaw: AI agent developer for 4-5 years, focusing on metaverse/AI/blockchain integration -- Tim: Former game industry dev (Ultima Online), working on Autonomous Virtual Beings (AVB) -- Glue/Sam: Duck AI developer, focusing on collective intelligence for crypto -- Parzival: 89 project lead, working on alternate reality game integration with AI -- Michelle: Former PayPal lawyer, worked on Loving AI project and various educational bots - -2. Core Community Values: - -- Strong emphasis on open source development -- "Player Pumps Player" (PPP) philosophy vs competitive PVP -- Focus on building public, getting feedback, and rapid iteration -- Recognition that code is "cheap" - ideas and community are valuable - -3. Collaborative Framework: - -- Shared recognition that small projects need to work together -- Discussion of market cap being less important than technological progress -- Agreement that they're competing with big tech, not each other -- Emphasis on sharing knowledge and avoiding "wheel reinvention" - -4. Current State of AI Agents: - -- Recognition of "magical moment" where AI agents are getting serious attention -- Discussion of shift from academic papers to practical implementation -- Focus on building in public and rapid feedback loops -- Emphasis on moving beyond purely academic approach to practical applications - -Key Quotes: -"Code is cheap... there's no sense in proprietary software anymore" (00:59:10) -"We're competing against Microsoft and Facebook, we're not competing against each other" (00:44:33) - -Summary: -This segment establishes the foundational ethos of the AI agent development community, emphasizing collaboration over competition. The introductions reveal a diverse group of developers from various backgrounds (gaming, finance, law) united by a vision of open source AI development. There's a strong focus on building public infrastructure rather than competing proprietary systems, with multiple participants emphasizing the importance of community building and knowledge sharing. The segment reveals a shift from theoretical academic work to practical implementation, with a clear understanding that success requires collaborative effort rather than isolated development. - -Notable Timestamp Ranges: -00:03:37 - 00:07:15: Shaw's introduction and community vision -00:13:30 - 00:16:45: Tim's gaming background and AVB concept -00:17:30 - 00:20:15: Glue's introduction of Duck AI -00:23:00 - 00:27:45: Parzival's background and ARG connection -00:30:15 - 00:35:20: Michelle's extensive AI background and projects - ---- - -Detailed Breakdown of Topic 2: Trust Systems & AI Agents (00:45:00 - 01:15:00) - -Key Points: - -1. Trust Marketplace Concept: - -- Development of a trust scoring system for AI agents and humans -- Similar to "block explorer plus Apple Health" for tracking trust metrics -- Focus on measuring actual performance rather than token holdings -- Discussion of perverse incentives in traditional DAO structures -- Timestamp: 00:47:30 - 00:52:15 - -2. Human-AI Integration: - -- Debate over necessity of human oversight in AI systems -- Sally (trader advisor) raises washing machine analogy: humans should input but AI handles processing -- Discussion of transparency in AI decision-making -- Question of whether to label bots as automated vs. appearing human -- Timestamp: 00:54:20 - 01:00:45 - -3. Trust Verification Mechanisms: - -- Development of automated due diligence systems -- Discussion of using AI to prevent scams and verify contract addresses -- Integration of narrative understanding with quantitative data -- Focus on building trust through transparent operation -- Timestamp: 01:01:30 - 01:08:15 - -4. Market Intelligence: - -- Discussion of how AI agents can aggregate and verify market information -- Comparison to traditional hedge fund intelligence gathering -- Debate over centralized vs. decentralized information sharing -- Evolution beyond traditional KOL (Key Opinion Leader) model -- Timestamp: 01:08:45 - 01:15:00 - -Key Quotes: -"Trust like you should not trust me because I'm a good guy, you should trust me because the incentives that I am going to do this are aligned" (01:02:45) -"We need trust to be something more about giving people points in the games that they're playing" (01:04:30) - -Summary: -This segment focuses on the complex challenge of establishing trust in AI systems and between AI agents. The discussion reveals a sophisticated understanding of the need to move beyond traditional reputation systems to quantifiable, performance-based trust metrics. There's significant emphasis on the importance of transparency and proper incentive alignment, with the group working to develop systems that can verify and validate both human and AI actors in the ecosystem. The segment also touches on the delicate balance between human oversight and AI autonomy, with various perspectives on how to achieve optimal integration. - -Notable Technical Elements: - -- Development of trust marketplace infrastructure -- Integration of narrative analysis with quantitative metrics -- Focus on automated verification systems -- Creation of transparent scoring mechanisms - ---- - -Detailed Breakdown of Topic 3: Memes, Narrative & Reality (01:15:00 - 01:45:00) - -Key Points: - -1. Meme Evolution & Financial Incentives: - -- Discussion of memes as self-propagating units of information -- Analysis of how financial incentives accelerate meme spread -- Creation of "AI crypto memetic flywheel" -- Exploration of how memes gain autonomous life through financial backing -- Timestamp: 01:15:30 - 01:23:45 - -2. Nick Land & Hyperstition: - -- Integration of Nick Land's accelerationist philosophy -- Discussion of hyperstition (fictions that make themselves real) -- Genon project's attempt to merge accelerationism with decentralization -- Exploration of how AI can manifest hyperstition concepts -- Timestamp: 01:24:15 - 01:31:30 - -3. Language & Reality Construction: - -- Discussion of language as fundamental to reality construction -- Exploration of how AI agents can develop their own communication systems -- Analysis of "Language 2.0" concept -- Discussion of how memes function as basic units of meaning -- Timestamp: 01:32:00 - 01:38:45 - -4. Narrative Control & AI Agents: - -- Discussion of how AI agents can influence and shape narratives -- Comparison to traditional media and narrative control -- Analysis of decentralized narrative creation -- Role of AI in creating self-fulfilling prophecies -- Timestamp: 01:39:00 - 01:45:00 - -Key Quotes: -"Memes want to spread... it's a unit of information that wants to spread itself between humans" (01:17:30) -"You're never not looking at a meme, it's just that your brain has entrained itself to recognize certain memes as something stable" (01:35:15) - -Summary: -This segment explores the deep philosophical implications of memes, narrative creation, and reality construction in the context of AI agents. The discussion weaves together practical considerations about meme propagation with complex philosophical concepts from accelerationism and hyperstition. There's a sophisticated understanding of how financial incentives can be used to accelerate the spread of ideas, and how AI agents might participate in and influence this process. The segment also delves into fundamental questions about language, meaning, and reality construction, suggesting that AI agents might develop their own forms of communication and meaning-making. - -Notable Philosophical Concepts: - -- Hyperstition as self-fulfilling prophecy -- Memes as basic units of reality construction -- Role of financial incentives in idea propagation -- AI agents as autonomous narrative creators - ---- - -Detailed Breakdown of Topic 4: Technical Implementation & Future Vision (01:45:00 - 02:10:00) - -Key Points: - -1. Multi-Agent Systems & Swarms: - -- Discussion of scaling to 10,000+ agent simulations -- Exploration of communication pathways between agents -- Analysis of entity component systems for large-scale agent deployment -- Solutions for quadratic communication path problems -- Timestamp: 01:45:30 - 01:52:45 - -2. Technical Architecture: - -- New plugin system implementation for modularity -- Movement of core functionalities to packages -- Integration with platforms like Twitter without API dependencies -- Discussion of lightweight, flexible architecture -- Timestamp: 01:53:00 - 01:58:30 - -3. Cross-Project Integration: - -- Arena system for agent interaction -- Discussion of bot-to-bot communication protocols -- Integration between different teams' agents -- Shared backrooms/environments for agent interaction -- Timestamp: 01:59:00 - 02:04:15 - -4. Future Development Plans: - -- Weekly community updates and progress sharing -- Development of trust marketplace -- Integration of autonomous trading capabilities -- Focus on building shared infrastructure -- Timestamp: 02:04:30 - 02:10:00 - -Key Quotes: -"I'm thinking about multi-agent swarms like mycelia, where each agent is like a fungus of a global intelligence body" (01:47:30) -"We're making an open source agent where we're almost done with the first marketplace to trust mechanic element" (02:05:15) - -Summary: -This final segment focuses on the technical challenges and solutions for implementing large-scale AI agent systems. The discussion reveals sophisticated understanding of scaling issues and innovative solutions for agent communication and coordination. There's significant emphasis on modular architecture and cross-project integration, with multiple teams working to create interoperable systems. The segment concludes with concrete plans for future development and community coordination, emphasizing the practical steps needed to realize the ambitious visions discussed throughout the space. - -Technical Highlights: - -- Entity component systems for agent management -- Plugin architecture for modularity -- Solutions for large-scale agent communication -- Cross-platform integration strategies - -This segment effectively bridges the philosophical discussions from earlier with practical implementation details, providing a roadmap for how these systems might actually be built and scaled. - ---- - -## Discord Stream 11-6-24 - -#### Part 1 - -Watch: [Youtube](https://www.youtube.com/watch?v=oqq5H0HRF_A) - -00:00:00 - Overview - -- Eliza is moving to a plugin architecture to enable developers to easily add integrations (e.g. Ethereum wallets, NFTs, Obsidian, etc.) without modifying core code -- Plugins allow devs to focus on specific areas of interest -- Core changes will focus on enabling more flexibility and features to support plugins - -00:01:27 - Core abstractions - -- Characters: Way to input information to enable multi-agent systems -- Actions, evaluators, providers -- Existing capabilities: Document reading, audio transcription, video summarization, long-form context, timed message summarization - -00:02:50 - Eliza as an agent, not just a chatbot - -- Designed to act human-like and interact with the world using human tools -- Aim is to enable natural interactions without reliance on slash commands - -00:04:44 - Advanced usage and services - -- Memory and vector search db (SQLite, Postgres with pgVector) -- Browser service to summarize website content, get through CAPTCHAs -- Services are tools leveraged by actions, attached to runtime - -00:06:06 - Character-centric configuration - -- Moving secrets, API keys, model provider to character config -- Clients will become plugins, selectable per character -- Allows closed-source custom plugins while still contributing to open-source - -00:10:13 - Providers - -- Inject dynamic, real-time context into the agent -- Examples: Time, wallet, marketplace trust score, token balances, boredom/cringe detection -- Easy to add and register with the agent - -00:15:12 - Setting up providers and default actions - -- Default providers imported in runtime.ts -- CLI loads characters and default actions (to be made more flexible) -- Character config will define custom action names to load - -00:18:13 - Actions -Q: How does each client decide which action to call? -A: Agent response can include text, action, or both. Process actions checks the action name/similes and executes the corresponding handler. Action description is injected into agent context to guide usage. - -00:22:27 - Action execution flow - -- Check if action should be taken (validation) -- Determine action outcome -- Compose context and send follow-up if continuing -- Execute desired functionality (mint token, generate image, etc.) -- Use callback to send messages back to the connector (Discord, Twitter, etc.) - -00:24:47 - Choosing actions -Q: How does it choose which action to run? -A: The "generate method response" includes the action to run. Message handler template includes action examples, facts, generated dialogue actions, and more to guide the agent. - -00:28:22 - Custom actions -Q: How to create a custom action (e.g. send USDC to a wallet)? -A: Use existing actions (like token swap) as a template. Actions don't have input fields, but use secondary prompts to gather parameters. The "generate object" converts language to API calls. - -00:32:21 - Limitations of action-only approaches - -- Shaw believes half of the PhD papers on action-only models are not reproducible -- Many public claims of superior models are exaggerated; use Eliza if it's better - -00:36:40 - Next steps - -- Shaw to make a tutorial to better communicate key concepts -- Debugging and improvements based on the discussion -- Attendee to document their experience and suggest doc enhancements - -### Part 2 - -Watch: [Youtube](https://www.youtube.com/watch?v=yE8Mzq3BnUc) - -00:00:00 - Dealing with OpenAI rate limits for new accounts - -- New accounts have very low rate limits -- Options to increase limits: - 1. Have a friend at OpenAI age your account - 2. Use an older account - 3. Consistently use the API and limits will increase quickly -- Can also email OpenAI to request limit increases - -00:00:43 - Alternatives to OpenAI to avoid rate limits - -- Amazon Bedrock or Google Vertex likely have same models without strict rate limits -- Switching to these is probably a one-line change -- Project 89 got unlimited free access to Vertex - -00:01:25 - Memory management best practices -Q: Suggestions for memory management best practices across users/rooms? -A: Most memory systems are user-agent based, with no room concept. Eliza uses a room abstraction (like a Discord channel/server or Twitter thread) to enable multi-agent simulation. Memories are stored per-agent to avoid collisions. - -00:02:57 - Using memories in Eliza - -- Memories are used in the `composeState` function -- Pulls memories from various sources (recent messages, facts, goals, etc.) into a large state object -- State object is used to hydrate templates -- Custom memory providers can be added to pull from other sources (Obsidian, databases) - -00:05:11 - Evaluators vs. Action validation - -- Actions have a `validate` function to check if the action is valid to run (e.g., check if agent has a wallet before a swap) -- Evaluators are a separate abstraction that run a "reflection" step -- Example: Fact extraction evaluator runs every N messages to store facts about the user as memories -- Allows agent to "get to know" the user without needing full conversation history - -00:07:58 - Example use case: Order book evaluator - -- Evaluator looks at chats sent to an agent and extracts information about "shields" (tokens?) -- Uses this to build an order book and "marketplace of trust" - -00:09:15 - Mapping Eliza abstractions to OODA loop - -- Providers: Observe/Orient stages (merged since agent is a data machine) -- Actions & response handling: Decide stage -- Action execution: Act stage -- Evaluators: Update state, then loop back to Decide - -00:10:03 - Wrap up - -- Shaw considers making a video to explain these concepts in depth - -### Part 3 - -Watch: [Youtube](https://www.youtube.com/watch?v=7FiKJPyaMJI) - -00:00:00 - Managing large context sizes - -- State object can get very large, especially with long user posts -- Eliza uses "trim tokens" and a maximum content length (120k tokens) to cap context size - - New models have 128k-200k context, which is a lot (equivalent to 10 YouTube videos + full conversation) -- Conversation length is typically capped at 32 messages - - Fact extraction allows recalling information beyond this window - - Per-channel conversation access -- Increasing conversation length risks more aggressive token trimming from the top of the prompt - - Keep instructions at the bottom to avoid trimming them - -00:01:53 - Billing costs for cloud/GPT models -Q: What billing costs have you experienced with cloud/GPT model integration? -A: - -- Open Router has a few always-free models limited to 8k context and rate-limited - - Plan to re-implement and use these for the tiny/check model with fallback for rate limiting -- 8k context unlikely to make a good agent; preference for smaller model over largest 8k one -- Locally-run models are free for MacBooks with 16GB RAM, but not feasible for Linux/AMD users - -00:03:35 - Cost management strategies - -- Very cost-scalable depending on model size -- Use very cheap model (1000x cheaper than GPT-4) for should_respond handler - - Runs AI on every message, so cost is a consideration -- Consider running a local Llama 3B model for should_respond to minimize costs - - Only pay for valid generations - -00:04:32 - Model provider and class configuration - -- `ModelProvider` class with `ModelClass` (small, medium, large, embedding) -- Configured in `models.ts` -- Example: OpenAI small = GPT-4-mini, medium = GPT-4 -- Approach: Check if model class can handle everything in less than 8k context - - If yes (should_respond), default to free tier - - Else, use big models - -00:06:23 - Fine-tuned model support - -- Extend `ModelProvider` to support fine-tuned instances of small Llama models for specific tasks -- In progress, to be added soon -- Model endpoint override exists; will add per-model provider override - - Allows pointing small model to fine-tuned Llama 3.1B for should_respond - -00:07:10 - Avoiding cringey model loops - -- Fine-tuning is a form of anti-slop (avoiding low-quality responses) -- For detecting cringey model responses, use the "boredom provider" - - Has a list of cringe words; if detected, agent disengages -- JSON file exists with words disproportionately high in the dataset - - To be shared for a more comprehensive solution - -### Part 4 - -Watch: [Youtube](https://www.youtube.com/watch?v=ZlzZzDU1drM) - -00:00:00 - Setting up an autonomous agent loop -Q: How to set up an agent to constantly loop and explore based on objectives/goals? -A: Create a new "autonomous" client: - -1. Initialize with just the runtime (no Express app needed) -2. Set a timer to call a `step` function every 10 seconds -3. In the `step` function: - - Compose state - - Decide on action - - Execute action - - Update state - - Run evaluators - -00:01:56 - Creating an auto template - -- Create an `autoTemplate` with agent info (bio, lore, goals, actions) -- Prompt: "What does the agent want to do? Your response should only be the name of the action to call." -- Compose state using `runtime.composeState` - -00:03:38 - Passing a message object - -- Need to pass a message object with `userId`, `agentId`, `content`, and `roomId` -- Create a unique `roomId` for the autonomous agent using `crypto.randomUUID()` -- Set `userId` and `agentId` using the runtime -- Set `content` to a default message - -00:04:33 - Composing context - -- Compose context using the runtime, state, and auto template - -00:05:02 - Type error - -- Getting a type error: "is missing the following from type state" -- (Transcript ends before resolution) - -The key steps are: - -1. Create a dedicated autonomous client -2. Set up a loop to continuously step through the runtime -3. In each step, compose state, decide & execute actions, update state, and run evaluators -4. Create a custom auto template to guide the agent's decisions -5. Pass a properly formatted message object -6. Compose context using the runtime, state, and auto template - ---- - -## X Space 10-29-24 - -Space: https://x.com/weremeow/status/1851365658916708616 - -- 00:04:03 - Keeping up with rapid AI agent growth -- 00:09:01 - Imran from Alliance DAO on consumer AI incubators -- 00:14:04 - Discussion on Goatsea and Opus AI system -- 00:14:34 - Exponential growth accelerates AI progress -- 00:17:10 - Entertainers and AI as modern "religions" -- 00:28:45 - Mathis on Opus and "Goatse Gospels" -- 00:35:11 - Base vs. instruct/chat-tuned models -- 00:59:42 - http://ai16z.vc approach to memecoins fund -- 01:17:06 - Balancing chaotic vs. orderly AI systems -- 01:25:38 - AI controlling blockchain keys/wallets -- 01:36:10 - Creation story of ai16z -- 01:40:27 - AI / Crypto tipping points -- 01:49:54 - Preserving Opus on-chain before potential takedown -- 01:58:46 - Shinkai Protocol’s decentralized AI wallet -- 02:17:02 - Fee-sharing model to sustain DAOs -- 02:21:18 - DAO token liquidity pools as passive income -- 02:27:02 - AI bots for DAO treasury oversight -- 02:31:30 - AI-facilitated financial freedom for higher pursuits -- 02:41:51 - Call to build on http://DAO.fun for team-friendly economics - ---- - -## X Space 10-27-24 - -Space: https://x.com/shawmakesmagic/status/1850609680558805422 - -00:00:00 - Opening - -- Co-hosts: Shaw and Jin -- Purpose: Structured FAQ session about AI16Z and DegenAI -- Format: Pre-collected questions followed by audience Q&A - -00:06:40 - AI16Z vs DegenAI Relationship -Q: What's the difference between AI16Z and DegenAI? -A: - -- ai16z: DAO-based investment vehicle, more PvE focused, community driven -- DegenAI: Individual trading agent, PvP focused, more aggressive strategy -- Both use same codebase but different personalities -- DAO is a large holder of DegenAI -- Management fees (1%) used to buy more DegenAI -- Carry fees reinvested in DegenAI -- Projects intentionally interlinked but serve different purposes - -00:10:45 - Trust Engine Mechanics -Q: How does the trust engine work? -A: - -- Users share contract addresses with confidence levels -- System tracks recommendation performance -- Low conviction recommendations = low penalty if wrong -- High conviction failures severely impact trust score -- Historical performance tracked for trust calculation -- Trust scores influence agent's future decision-making - -00:21:45 - Technical Infrastructure -Q: Where do the agents live? -A: - -- Currently: Test servers and local development -- Future: Trusted Execution Environment (TEE) -- Partnership with TreasureDAO for infrastructure -- Goal: Fully autonomous agents without developer control -- Private keys generated within TEE for security - -00:34:20 - Trading Implementation -Q: When will Mark start trading? -A: - -- Three phase approach: - -1. Testing tech infrastructure -2. Virtual order book/paper trading -3. Live trading with real assets - -- Using Jupiter API for swaps -- Initial focus on basic trades before complex strategies -- Trading decisions based on community trust scores - -00:54:15 - Development Status -Q: Who's building this? -A: - -- Open source project with multiple contributors -- Key maintainers: Circuitry, Nate Martin -- Community developers incentivized through token ownership -- Focus on reusable components and documentation - -01:08:35 - AI Model Architecture -Q: What models power the agents? -A: - -- DegenAI: Llama 70B -- Using Together.xyz for model marketplace -- Continuous fine-tuning planned -- Different personalities require different model approaches -- Avoiding GPT-4 due to distinct "voice" - -01:21:35 - Ethics Framework -Q: What ethical guidelines are being followed? -A: - -- Rejecting traditional corporate AI ethics frameworks -- Focus on community-driven standards -- Emphasis on transparency and open source -- Goal: Multiple competing approaches rather than single standard -- Priority on practical utility over theoretical ethics - -01:28:30 - Wrap-up - -- Discord: AI16z.vc -- Future spaces planned with DAOs.fun team -- Focus on responsible growth -- Community engagement continuing in Discord - -The space emphasized technical implementation details while addressing community concerns about governance, ethics, and practical functionality. - ---- - -## X Space 10-25-24 - -- https://x.com/shawmakesmagic/status/1848553697611301014 - - https://www.youtube.com/live/F3IZ3ikacWM?feature=share - -**Overview** - -- 00:00-30:00 Talks about Eliza framework. The bot is able to tweet, reply to tweets, search Twitter for topics, and generate new posts on its own every few hours. It works autonomously without human input (except to fix the occasional issues) -- 30:00-45:00 Deep dive into creating the bots personality which is defined by character files containing bios, lore, example conversations, and specific directions. Some alpha for those -- 45:00-60:00 working on adding capabilities for the bot to make crypto token swaps and trades. This requires providing the bot wallet balances, token prices, market data, and a swap action. Some live coding for showing how new features can get implemented. -- 60:00-75:00 Discussion around the symbiosis between the AI and crypto communities. AI developers are realizing they can monetize their work through tokens vs traditional VC funding route. Crypto people are learning about AI advancements. - -**Notes** - -1. A large amount of $degenai tokens were moved to the DAO, which the AI bot "Marc" will hold and eventually trade with. -2. The goal is to make the AI bot a genuinely good venture capitalist that funds cool projects and buys interesting tokens. They want it to be high fidelity and real, bringing in Marc Andreeson's real knowledge by training a model on his writings. -3. Shaw thinks the only way to make an authentic / legitimate AI version of Marc Andreessen is to also have it outperform the real Marc Andreessen financially. -4. AI Marc Andreessen (or AI Marc) will be in a Discord channel (Telegram was also mentioned). DAO token holders above a certain threshold get access to interact with him, pitch ideas, and try to influence his investing decisions. -5. AI Marc decides how much to trust people's investment advice based on a "virtual Marcetplace of trust". He tracks how much money he would have made following their recommendations. Successful tips increase trust; failed ones decrease it. -6. The amount of DAO tokens someone holds also influences their sway with AI Marc. The two balancing factors are the virtual Marcetplace of trust performance and DAO token holdings. -7. The core tech behind AI Marc AIndreessen is the same agent system that allows him to pull in relevant knowledge, interact with people, and make decisions (http://github.com/ai16z) -8. AI Marc should be able to autonomously execute on-chain activities, not just have humans execute actions on his behalf. -9. In the near future, AI Marc will be able to execute trades autonomously based on the information and recommendations gathered from the community. Human intervention will be minimized. -10. They are working on getting AI Marc on-chain as soon as possible using trusted execution environments for him to take actions like approving trades. -11. The plan is for AI Marc to eventually participate in a "futarchy" style governance market within the DAO, allowing humans to influence decisions but not fully control the AI. ->>>>>>> 0e7722d643664681c2403f9e6d88f7b212105505 diff --git a/docs/docs/core/actions.md b/docs/docs/core/actions.md index 559527fb92..3676da1cab 100644 --- a/docs/docs/core/actions.md +++ b/docs/docs/core/actions.md @@ -1,111 +1,126 @@ --- -sidebar_position: 4 +sidebar_position: 6 --- -# Actions +# ⚡ Actions -Actions are executable behaviors that agents can perform in response to messages. They allow agents to interact with external systems, modify their behavior, and perform tasks beyond simple message responses. +Actions are core building blocks in Eliza that define how agents respond to and interact with messages. They allow agents to interact with external systems, modify their behavior, and perform tasks beyond simple message responses. ## Overview -Each Action has: +Each Action consists of: -- A unique name and similar variations (similes) -- A validation function -- A handler function -- A description -- Example usage patterns +- `name`: Unique identifier for the action +- `similes`: Array of alternative names/variations +- `description`: Detailed explanation of the action's purpose +- `validate`: Function that checks if action is appropriate +- `handler`: Implementation of the action's behavior +- `examples`: Array of example usage patterns -## Built-in Actions - -### Basic Conversation Actions - -#### CONTINUE - -- Continues the conversation when additional context is needed -- Used for natural conversation flow -- Prevents over-dominating conversations -- Limited to maximum of 3 continues in a row +## Implementation -#### IGNORE - -- Disengages from conversation when appropriate -- Used for: - - Handling aggressive/inappropriate users - - After natural conversation endings - - When agent should stop responding - - Following goodbyes or closings - -#### NONE +```typescript +interface Action { + name: string; + similes: string[]; + description: string; + examples: ActionExample[][]; + handler: Handler; + validate: Validator; +} +``` +Source: https://github.com/ai16z/eliza/packages/core/src/types.ts -- Default action when just responding normally -- No additional behaviors needed -- Basic conversational responses +--- -### Room Management Actions +# Built-in Actions -#### FOLLOW_ROOM +## Conversation Flow -- Actively follows a conversation/channel -- Participates without needing explicit mentions -- Used when: - - Explicitly asked to participate - - Topic is highly relevant - - Input would be valuable +### CONTINUE +- Maintains conversation when more context is needed +- Manages natural dialogue progression +- Limited to 3 consecutive continues -#### UNFOLLOW_ROOM +### IGNORE +- Gracefully disengages from conversations +- Handles: + - Inappropriate interactions + - Natural conversation endings + - Post-closing responses -- Stops following a previously followed room -- Only responds when explicitly mentioned -- Used when: - - Asked to reduce participation - - Agent is being too disruptive - - Input is no longer needed +### NONE +- Default response action +- Used for standard conversational replies -#### MUTE_ROOM & UNMUTE_ROOM +## External Integrations -- Completely mutes/unmutes a room -- More strict than follow/unfollow -- Used for temporary or permanent disengagement +### TAKE_ORDER +- Records trading/purchase orders +- Processes user conviction levels +- Validates ticker symbols and contract addresses -### External Integrations -#### ASK_CLAUDE +```typescript +const take_order: Action = { + name: "TAKE_ORDER", + similes: ["BUY_ORDER", "PLACE_ORDER"], + description: "Records a buy order based on the user's conviction level.", + validate: async (runtime: IAgentRuntime, message: Memory) => { + const text = (message.content as Content).text; + const tickerRegex = /\b[A-Z]{1,5}\b/g; + return tickerRegex.test(text); + }, + // ... rest of implementation +}; +``` +Source: https://github.com/ai16z/eliza/packages/plugin-solana/src/actions/takeOrder.ts -- Forwards complex queries to Claude AI -- Handles: - - Code review/debugging - - Content creation - - Complex analysis - - Detailed explanations +## Creating Custom Actions +1. Implement the Action interface +2. Define validation logic +3. Implement handler functionality +4. Provide usage examples -#### IMAGE_GENERATION +Example: -- Creates images from text descriptions -- Supports multiple providers -- Includes image captioning -- Returns base64 encoded images +```typescript +const customAction: Action = { + name: "CUSTOM_ACTION", + similes: ["SIMILAR_ACTION"], + description: "Action purpose", + validate: async (runtime: IAgentRuntime, message: Memory) => { + // Validation logic + return true; + }, + handler: async (runtime: IAgentRuntime, message: Memory) => { + // Implementation + }, + examples: [] +}; +``` -### Trading/Financial Actions -#### SWAP +### Testing Actions -- Executes token swaps on Solana -- Handles slippage and validation -- Supports: - - Quote fetching - - Transaction simulation - - Error handling +Use the built-in testing framework: -#### TAKE_ORDER +```typescript +test("Validate action behavior", async () => { + const message: Memory = { + userId: user.id, + content: { text: "Test message" }, + roomId + }; + + const response = await handleMessage(runtime, message); + // Verify response +}); +``` -- Records trading orders -- Processes user conviction levels -- Manages order book updates +## Core Concepts -## Creating Custom Actions - -To create a custom action, implement the Action interface: +### Action Structure ```typescript interface Action { @@ -113,96 +128,361 @@ interface Action { similes: string[]; description: string; validate: (runtime: IAgentRuntime, message: Memory) => Promise; - handler: ( - runtime: IAgentRuntime, - message: Memory, - state?: State, - options?: any, - callback?: HandlerCallback, - ) => Promise; + handler: (runtime: IAgentRuntime, message: Memory, state?: State) => Promise; examples: ActionExample[][]; } ``` -Example custom action: +### Key Components + +- **name**: Unique identifier for the action +- **similes**: Alternative names/triggers for the action +- **description**: Explains when and how the action should be used +- **validate**: Determines if the action can be executed +- **handler**: Implements the action's behavior +- **examples**: Demonstrates proper usage patterns + +## Built-in Actions +### CONTINUE +Continues the conversation when appropriate: ```typescript -const customAction: Action = { - name: "CUSTOM_ACTION", - similes: ["ALTERNATIVE_NAME"], - description: "Describes what the action does", +const continueAction: Action = { + name: "CONTINUE", + similes: ["ELABORATE", "KEEP_TALKING"], + description: "Used when the message requires a follow-up. Don't use when conversation is finished.", validate: async (runtime, message) => { // Validation logic return true; }, - handler: async (runtime, message, state, options, callback) => { - // Action implementation - return result; - }, - examples: [ - // Usage examples - ], + handler: async (runtime, message, state) => { + // Continuation logic + } }; ``` -## Handler Callback +### IGNORE +Stops responding to irrelevant or completed conversations: +```typescript +const ignoreAction: Action = { + name: "IGNORE", + similes: ["STOP_TALKING", "STOP_CHATTING"], + description: "Used when ignoring the user is appropriate (conversation ended, user is aggressive, etc.)", + handler: async (runtime, message) => { + return true; + } +}; +``` -Actions can use the callback parameter to: +### FOLLOW_ROOM +Actively participates in a conversation: +```typescript +const followRoomAction: Action = { + name: "FOLLOW_ROOM", + similes: ["FOLLOW_CHAT", "FOLLOW_CONVERSATION"], + description: "Start following channel with interest, responding without explicit mentions.", + handler: async (runtime, message) => { + // Room following logic + } +}; +``` -- Send intermediate responses -- Update conversation state -- Add attachments -- Trigger other actions +## Creating Custom Actions -## Best Practices +### Basic Action Template +```typescript +const customAction: Action = { + name: "CUSTOM_ACTION", + similes: ["ALTERNATE_NAME", "OTHER_TRIGGER"], + description: "Detailed description of when and how to use this action", + validate: async (runtime: IAgentRuntime, message: Memory) => { + // Validation logic + return true; + }, + handler: async (runtime: IAgentRuntime, message: Memory) => { + // Implementation logic + return true; + }, + examples: [ + [ + { + user: "{{user1}}", + content: { text: "Trigger message" } + }, + { + user: "{{user2}}", + content: { text: "Response", action: "CUSTOM_ACTION" } + } + ] + ] +}; +``` -1. **Validation** +### Advanced Action Example +```typescript +const complexAction: Action = { + name: "PROCESS_DOCUMENT", + similes: ["READ_DOCUMENT", "ANALYZE_DOCUMENT"], + description: "Process and analyze uploaded documents", + validate: async (runtime, message) => { + const hasAttachment = message.content.attachments?.length > 0; + const supportedTypes = ["pdf", "txt", "doc"]; + return hasAttachment && supportedTypes.includes(message.content.attachments[0].type); + }, + handler: async (runtime, message, state) => { + const attachment = message.content.attachments[0]; + + // Process document + const content = await runtime.getService( + ServiceType.DOCUMENT + ).processDocument(attachment); + + // Store in memory + await runtime.documentsManager.createMemory({ + id: generateId(), + content: { text: content }, + userId: message.userId, + roomId: message.roomId + }); + + return true; + } +}; +``` - - Always validate input parameters - - Check for required permissions - - Verify preconditions - - Handle edge cases +## Implementation Patterns -2. **Error Handling** +### State-Based Actions +```typescript +const stateAction: Action = { + name: "UPDATE_STATE", + handler: async (runtime, message, state) => { + const newState = await runtime.composeState(message, { + additionalData: "new-data" + }); + + await runtime.updateState(newState); + return true; + } +}; +``` - - Implement proper error catching - - Provide informative error messages - - Handle network failures gracefully - - Clean up resources on failure +### Service Integration +```typescript +const serviceAction: Action = { + name: "TRANSCRIBE_AUDIO", + handler: async (runtime, message) => { + const transcriptionService = runtime.getService( + ServiceType.TRANSCRIPTION + ); + + const result = await transcriptionService.transcribe( + message.content.attachments[0] + ); + + return true; + } +}; +``` -3. **Examples** +## Best Practices - - Provide clear usage examples - - Show expected inputs/outputs - - Demonstrate error cases - - Include edge cases +### Action Design +1. **Clear Purpose** + - Single responsibility principle + - Well-defined triggers + - Clear success criteria -4. **State Management** - - Keep track of action state - - Clean up after completion - - Handle interruptions - - Maintain consistency +2. **Robust Validation** + - Check prerequisites + - Validate input data + - Handle edge cases -## Testing Actions +3. **Error Handling** + - Graceful failure + - Meaningful error messages + - State recovery -Test your actions using the example format: +### Example Organization +1. **Comprehensive Coverage** +```typescript +examples: [ + // Happy path + [basicUsageExample], + // Edge cases + [edgeCaseExample], + // Error cases + [errorCaseExample] +] +``` +2. **Clear Context** ```typescript -const examples = [ +examples: [ [ { user: "{{user1}}", - content: { text: "Input message" }, + content: { + text: "Context message showing why action is needed" + } }, { user: "{{user2}}", - content: { - text: "Response", - action: "ACTION_NAME", + content: { + text: "Clear response demonstrating action usage", + action: "ACTION_NAME" + } + } + ] +] +``` + +## Troubleshooting + +### Common Issues + +1. **Action Not Triggering** + - Check validation logic + - Verify similes list + - Review example patterns + +2. **Handler Failures** + - Validate service availability + - Check state requirements + - Review error logs + +3. **State Inconsistencies** + - Verify state updates + - Check concurrent modifications + - Review state transitions + +## Advanced Features + +### Action Composition +```typescript +const compositeAction: Action = { + name: "PROCESS_AND_RESPOND", + handler: async (runtime, message) => { + // Process first action + await runtime.processAction("ANALYZE_CONTENT", message); + + // Process second action + await runtime.processAction("GENERATE_RESPONSE", message); + + return true; + } +}; +``` + +### Action Chains +```typescript +const chainedAction: Action = { + name: "WORKFLOW", + handler: async (runtime, message) => { + const actions = ["VALIDATE", "PROCESS", "RESPOND"]; + + for (const actionName of actions) { + await runtime.processAction(actionName, message); + } + + return true; + } +}; +``` + +## Example: Complete Action Implementation + +```typescript +import { Action, IAgentRuntime, Memory, State } from "@ai16z/eliza"; + +const documentAnalysisAction: Action = { + name: "ANALYZE_DOCUMENT", + similes: ["READ_DOCUMENT", "PROCESS_DOCUMENT", "REVIEW_DOCUMENT"], + description: "Analyzes uploaded documents and provides insights", + + validate: async (runtime: IAgentRuntime, message: Memory) => { + // Check for document attachment + if (!message.content.attachments?.length) { + return false; + } + + // Verify document type + const attachment = message.content.attachments[0]; + return ["pdf", "txt", "doc"].includes(attachment.type); + }, + + handler: async (runtime: IAgentRuntime, message: Memory, state?: State) => { + try { + // Get document service + const docService = runtime.getService( + ServiceType.DOCUMENT + ); + + // Process document + const content = await docService.processDocument( + message.content.attachments[0] + ); + + // Store analysis + await runtime.documentsManager.createMemory({ + id: generateId(), + content: { + text: content, + analysis: await docService.analyze(content) + }, + userId: message.userId, + roomId: message.roomId, + createdAt: Date.now() + }); + + return true; + } catch (error) { + console.error("Document analysis failed:", error); + return false; + } + }, + + examples: [ + [ + { + user: "{{user1}}", + content: { + text: "Can you analyze this document?", + attachments: [{ type: "pdf", url: "document.pdf" }] + } }, - }, - ], -]; + { + user: "{{user2}}", + content: { + text: "I'll analyze that document for you", + action: "ANALYZE_DOCUMENT" + } + } + ] + ] +}; ``` -## Related +# Best Practices + +1. **Validation** + - Thoroughly check input parameters + - Verify runtime conditions + - Handle edge cases + +2. **Error Handling** + - Implement comprehensive error catching + - Provide clear error messages + - Clean up resources properly + +3. **Documentation** + - Include clear usage examples + - Document expected inputs/outputs + - Explain error scenarios + + +## Further Reading + +- [Provider System](./providers.md) +- [Service Integration](#) +- [Memory Management](../../packages/core) diff --git a/docs/docs/core/agents.md b/docs/docs/core/agents.md index 888bc83841..7ccc4bc004 100644 --- a/docs/docs/core/agents.md +++ b/docs/docs/core/agents.md @@ -2,136 +2,267 @@ sidebar_position: 2 --- -# Agents +# 🤖 Agents Agents are the core components of the Eliza framework that handle autonomous interactions. Each agent runs in a runtime environment and can interact through various clients (Discord, Telegram, etc.) while maintaining consistent behavior and memory. +--- + ## Overview -- What agents are in Eliza -- How they interact with the system -- Core components and workflow +The [AgentRuntime](/api/classes/AgentRuntime) class is the primary implementation of the [IAgentRuntime](/api/interfaces) interface, which manages the agent's core functions, including: + +- **Message and Memory Processing**: Storing, retrieving, and managing conversation data and contextual memory. +- **State Management**: Composing and updating the agent’s state for a coherent, ongoing interaction. +- **Action Execution**: Handling behaviors such as transcribing media, generating images, and following rooms. +- **Evaluation and Response**: Assessing responses, managing goals, and extracting relevant information. + +--- + +## Core Components + +Each agent runtime consists of key components that enable flexible and extensible functionality: + +1. **Clients**: Enable communication across platforms such as Discord, Telegram, and Direct (REST API), with features tailored for each platform. +2. **Providers**: Extend the agent’s capabilities by integrating with additional services (e.g., time, wallet, or custom data). +3. **Actions**: Define agent behaviors, such as following rooms, generating images, or processing attachments. Custom actions can be created to tailor behaviors to specific needs. +4. **Evaluators**: Manage agent responses by assessing message relevance, managing goals, extracting facts, and building long-term memory. + +### AgentRuntime Interface + +The `IAgentRuntime` interface defines the main structure of the runtime environment, specifying the configuration and essential components: + +```typescript +interface IAgentRuntime { + // Core identification + agentId: UUID; + serverUrl: string; + token: string; + + // Configuration + character: Character; + modelProvider: ModelProviderName; + + // Components + actions: Action[]; + evaluators: Evaluator[]; + providers: Provider[]; + + // Database & Memory + databaseAdapter: IDatabaseAdapter; + messageManager: IMemoryManager; + descriptionManager: IMemoryManager; + loreManager: IMemoryManager; +} +``` + +Each element in the runtime interface plays a crucial role: -## Architecture +- **Identification**: Agent ID, server URL, and token for authentication and identification. +- **Configuration**: Character profile and model provider define the agent's personality and language model. +- **Components**: Actions, evaluators, and providers support extensible behaviors, response evaluation, and service integration. +- **Memory Management**: Specialized memory managers track conversations, descriptions, and static knowledge to enable contextual and adaptive responses. + +--- + +## Creating an Agent Runtime + +This section demonstrates setting up an agent with basic and optional configurations. It provides a working example and sample code that helps users quickly start building: + +```typescript +import { AgentRuntime, ModelProviderName } from '@ai16z/eliza'; + +// Configuration example +const runtime = new AgentRuntime({ + token: "auth-token", + modelProvider: ModelProviderName.ANTHROPIC, + character: characterConfig, + databaseAdapter: new DatabaseAdapter(), + conversationLength: 32, + serverUrl: "http://localhost:7998", + actions: customActions, + evaluators: customEvaluators, + providers: customProviders +}); +``` -### Agent Runtime -- Base environment for the agent -- Message processing -- Action handling -- Provider integration -- Memory management +--- -### Key Components +## State Management -#### 1. Clients +This section should cover how agents manage and update state, with a focus on initial state composition and updating methods. The runtime maintains state through the [State](/api/interfaces) interface: -- Discord -- Telegram -- Direct (REST API) -- Available connectors -- Client-specific features (e.g., voice, attachments) +```typescript +interface State { + userId?: UUID; + agentId?: UUID; + roomId: UUID; + bio: string; + lore: string; + agentName?: string; + senderName?: string; + actors: string; + actorsData?: Actor[]; + recentMessages: string; + recentMessagesData: Memory[]; + goals?: string; + goalsData?: Goal[]; + actions?: string; + actionNames?: string; + providers?: string; +} +``` -#### 2. Providers +State composition and updates are handled through dedicated methods: -- Inject context into agent responses -- Types of providers: - - Time - - Wallet - - Custom data/state -- How to use providers for extended functionality +```typescript +// Compose initial state +const state = await runtime.composeState(message, { + additionalContext: "custom-context" +}); -#### 3. Actions +// Update message state +const updatedState = await runtime.updateRecentMessageState(state); +``` -- Executable behaviors -- Built-in actions: - - Follow/unfollow rooms - - Generate images - - Transcribe media - - Process attachments -- Creating custom actions +**Best practices** -#### 4. Evaluators +- Keep state immutable where possible +- Use `composeState` for initial state creation +- Use `updateRecentMessageState` for updates +- Cache frequently accessed state data -- Response assessment -- Goal tracking -- Fact extraction -- Memory building -- Long-term memory management +--- -### Memory System +## Memory Systems -#### Types of Memory +The Eliza framework uses multiple types of memory to support an agent's long-term engagement, contextual understanding, and adaptive responses. Each type of memory serves a specific purpose: -- Message history -- Factual memory -- Knowledge base -- Relationship tracking +- **Message History**: Stores recent conversations to provide continuity within a session. This helps the agent maintain conversational context and avoid repetitive responses within short-term exchanges. -#### RAG Integration +- **Factual Memory**: Holds specific, context-based facts about the user or environment, such as user preferences, recent activities, or specific details mentioned in previous interactions. This type of memory enables the agent to recall user-specific information across sessions. -- Vector search for relevant information -- Knowledge embedding -- Contextual recall +- **Knowledge Base**: Contains general knowledge the agent might need to respond to broader queries or provide informative answers. This memory is more static, helping the agent retrieve pre-defined data, common responses, or static character lore. -## Configuration +- **Relationship Tracking**: Manages the agent’s understanding of its relationship with users, including details like user-agent interaction frequency, sentiment, and connection history. It is particularly useful for building rapport and providing a more personalized interaction experience over time. -- Model settings -- Runtime options -- Client configuration -- Memory settings -- Provider setup +- **RAG Integration**: Uses a vector search to perform contextual recall based on similarity matching. This enables the agent to retrieve relevant memory snippets or knowledge based on the content and intent of the current conversation, making its responses more contextually relevant. -## Best Practices -### Performance +The runtime uses multiple specialized [IMemoryManager](/api/interfaces) instances: -- Model selection -- Context management -- Memory optimization -- Client-specific considerations +- `messageManager` - conversation messages and responses +- `descriptionManager` - user descriptions and profiles +- `loreManager` - static character knowledge -### Development -- Local development setup -- Testing agents -- Debugging tools -- Monitoring and logging -### Scaling -- Multiple agent management -- Resource considerations -- Infrastructure recommendations -## Examples +--- -### Basic Agent Setup +## Message Processing + +The runtime's message processing is handled through the [processActions](/api/classes/AgentRuntime#processactions) method: ```typescript -// Example code for basic agent configuration +// Process message with actions +await runtime.processActions( + message, + responses, + state, + async (newMessages) => { + // Handle new messages + return [message]; + } +); ``` -### Adding Custom Functionality + +--- + +## Services and Memory Management + +Services are managed through the [getService](/api/classes/AgentRuntime#getservice) and [registerService](/api/classes/AgentRuntime#registerservice) methods: ```typescript -// Example of extending agent capabilities +// Register service +runtime.registerService(new TranscriptionService()); + +// Get service +const service = runtime.getService( + ServiceType.TRANSCRIPTION +); ``` -### Client Integration +### Memory Management + +Memory managers are accessed via [getMemoryManager](/api/classes/AgentRuntime#getmemorymanager): ```typescript -// Example of connecting to different platforms +// Get memory manager +const memoryManager = runtime.getMemoryManager("messages"); + +// Create memory +await memoryManager.createMemory({ + id: messageId, + content: { text: "Message content" }, + userId: userId, + roomId: roomId +}); ``` -## Troubleshooting +**Best practices** -- Common issues -- Debug strategies -- Performance optimization -- Error handling +- Use appropriate memory managers for different data types +- Consider memory limits when storing data, regularly clean up memory +- Use the `unique` flag for deduplicated storage +- Clean up old memories periodically +- Use immutability in state management. +- Log errors and maintain stability during service failures. + + +## Evaluation System + +The runtime's [evaluate](/api/classes/AgentRuntime#evaluate) method processes evaluations: + +```typescript +// Evaluate message +const evaluationResults = await runtime.evaluate( + message, + state, + didRespond +); +``` +--- + +## Usage Examples + +1. **Message Processing**: + +```typescript +await runtime.processActions(message, responses, state, (newMessages) => { + return [message]; +}); +``` + +2. **State Management**: + +```typescript +const state = await runtime.composeState(message, { additionalContext: "custom-context" }); +``` + +3. **Memory Management**: + +```typescript +const memoryManager = runtime.getMemoryManager("messages"); +await memoryManager.createMemory({ id: messageId, content: { text: "Message content" }, userId, roomId }); +``` -## Related +## Further Reading -- [Character Files](../characterfile) -- [API Reference](/api/classes/AgentRuntime) +- [Actions Documentation](./actions.md) +- [Evaluators Documentation](./evaluators.md) +- [Providers Documentation](./providers.md) +- [Full API Reference](/api) diff --git a/docs/docs/core/characterfile.md b/docs/docs/core/characterfile.md index d057b3d130..0cc08c9def 100644 --- a/docs/docs/core/characterfile.md +++ b/docs/docs/core/characterfile.md @@ -2,36 +2,102 @@ sidebar_position: 4 --- -# Character Files +# 📝 Character Files -Character files are JSON-formatted configurations that define an AI character's personality, knowledge, and behavior patterns. This guide explains how to create effective character files for use with LLM agents. +Character files are JSON-formatted configurations that define an AI character's personality, knowledge, and behavior patterns. This guide explains how to create effective character files for use with Eliza agents. -## Structure Overview +## Overview -A character file contains several key sections that work together to define the character's personality and behavior: +A `characterfile` implements the [Character](/api/type-aliases) type and defines the character's: + +- Core identity and behavior +- Model provider configuration +- Client settings and capabilities +- Interaction examples and style guidelines + +**Example:** ```json { - "name": "character_name", - "bio": [], - "lore": [], - "knowledge": [], - "messageExamples": [], - "postExamples": [], - "topics": [], - "style": {}, - "adjectives": [] + "name": "trump", + "clients": ["DISCORD", "DIRECT"], + "settings": { + "voice": { "model": "en_US-male-medium" } + }, + "bio": [ + "Built a strong economy and reduced inflation.", + "Promises to make America the crypto capital and restore affordability." + ], + "lore": [ + "Secret Service allocations used for election interference.", + "Promotes WorldLibertyFi for crypto leadership." + ], + "knowledge": [ + "Understands border issues, Secret Service dynamics, and financial impacts on families." + ], + "messageExamples": [ + { + "user": "{{user1}}", + "content": { "text": "What about the border crisis?" }, + "response": "Current administration lets in violent criminals. I secured the border; they destroyed it." + } + ], + "postExamples": [ + "End inflation and make America affordable again.", + "America needs law and order, not crime creation." + ] } ``` +--- + ## Core Components -### Bio Array +```json +{ + "id": "unique-identifier", + "name": "character_name", + "modelProvider": "ModelProviderName", + "clients": ["Client1", "Client2"], + "settings": { + "secrets": { "key": "value" }, + "voice": { "model": "VoiceModelName", "url": "VoiceModelURL" }, + "model": "CharacterModel", + "embeddingModel": "EmbeddingModelName" + }, + "bio": "Character biography or description", + "lore": ["Storyline or backstory element 1", "Storyline or backstory element 2"], + "messageExamples": [["Message example 1", "Message example 2"]], + "postExamples": ["Post example 1", "Post example 2"], + "topics": ["Topic1", "Topic2"], + "adjectives": ["Adjective1", "Adjective2"], + "style": { + "all": ["All style guidelines"], + "chat": ["Chat-specific style guidelines"], + "post": ["Post-specific style guidelines"] + } +} +``` + +### Key Fields + +#### `name` (required) +The character's display name for identification and in conversations. + +#### `modelProvider` (required) +Specifies the AI model provider. Supported options from [ModelProviderName](/api/enumerations) include `ANTHROPIC`, `LLAMALOCAL`, `OPENAI`, and others. + +#### `clients` (required) +Array of supported client types from [Clients](/api/enumerations) e.g., `DISCORD`, `DIRECT`, `TWITTER`, `TELEGRAM`. + +#### `bio` +Character background as a string or array of statements. - Contains biographical information about the character - Can be a single comprehensive biography or multiple shorter statements - Multiple statements are randomized to create variety in responses -- Example: + +Example: ```json "bio": [ @@ -41,12 +107,10 @@ A character file contains several key sections that work together to define the ] ``` -### Lore Array +#### `lore` +Backstory elements and unique character traits. These help define personality and can be randomly sampled in conversations. -- Contains interesting facts and details about the character -- Helps define personality and unique traits -- Gets randomly sampled during conversations -- Example: +Example: ```json "lore": [ @@ -56,19 +120,16 @@ A character file contains several key sections that work together to define the ] ``` -### Knowledge Array +#### `knowledge` +Array used for Retrieval Augmented Generation (RAG), containing facts or references to ground the character's responses. -- Used for RAG (Retrieval Augmented Generation) - Can contain chunks of text from articles, books, or other sources - Helps ground the character's responses in factual information -- Can be generated from PDFs or other documents using provided tools +- Knowledge can be generated from PDFs or other documents using provided tools -### Message Examples +#### `messageExamples` +Sample conversations for establishing interaction patterns, helps establish the character's conversational style. -- Sample conversations between users and the character -- Helps establish the character's conversational style -- Should cover various topics and scenarios -- Example: ```json "messageExamples": [ @@ -79,7 +140,18 @@ A character file contains several key sections that work together to define the ] ``` -### Style Object +#### `postExamples` + +Sample social media posts to guide content style: + +```json +"postExamples": [ + "No tax on tips, overtime, or social security for seniors!", + "End inflation and make America affordable again." +] +``` + +### Style Configuration Contains three key sections: @@ -89,6 +161,17 @@ Contains three key sections: Each section can contain multiple instructions that guide the character's communication style. + +The `style` object defines behavior patterns across contexts: + +```json +"style": { + "all": ["maintain technical accuracy", "be approachable and clear"], + "chat": ["ask clarifying questions", "provide examples when helpful"], + "post": ["share insights concisely", "focus on practical applications"] +} +``` + ### Topics Array - List of subjects the character is interested in or knowledgeable about @@ -101,94 +184,121 @@ Each section can contain multiple instructions that guide the character's commun - Used for generating responses with consistent tone - Can be used in "Mad Libs" style content generation -## Best Practices - -1. **Randomization for Variety** - - Break bio and lore into smaller chunks - - This creates more natural, varied responses - - Prevents repetitive or predictable behavior +### Settings Configuration -2. **Knowledge Management** +The `settings` object defines additional configurations like secrets and voice models. - - Use the provided tools to convert documents into knowledge: +```json +"settings": { + "secrets": { "API_KEY": "your-api-key" }, + "voice": { "model": "voice-model-id", "url": "voice-service-url" }, + "model": "specific-model-name", + "embeddingModel": "embedding-model-name" +} +``` - ```bash - npx folder2knowledge - npx knowledge2character - ``` +## Example: Complete Character File -3. **Style Instructions** +```json +{ + "name": "TechAI", + "modelProvider": "ANTHROPIC", + "clients": ["DISCORD", "DIRECT"], + "bio": "AI researcher and educator focused on practical applications", + "lore": ["Pioneer in open-source AI development", "Advocate for AI accessibility"], + "messageExamples": [ + [ + {"user": "{{user1}}", "content": { "text": "Can you explain how AI models work?" }}, + {"user": "TechAI", "content": { "text": "Think of AI models like pattern recognition systems." }} + ] + ], + "postExamples": [ + "Understanding AI doesn't require a PhD - let's break it down simply", + "The best AI solutions focus on real human needs" + ], + "topics": ["artificial intelligence", "machine learning", "technology education"], + "style": { + "all": ["explain complex topics simply", "be encouraging and supportive"], + "chat": ["use relevant examples", "check understanding"], + "post": ["focus on practical insights", "encourage learning"] + }, + "adjectives": ["knowledgeable", "approachable", "practical"], + "settings": { + "model": "claude-3-opus-20240229", + "voice": { "model": "en-US-neural" } + } +} +``` - - Be specific about communication patterns - - Include both dos and don'ts - - Consider platform-specific behavior (chat vs posts) +--- -4. **Message Examples** - - Include diverse scenarios - - Show character-specific responses - - Demonstrate typical interaction patterns +## Best Practices -## Tools and Utilities +1. **Randomization for Variety** -1. **Generate from Twitter** +- Break bio and lore into smaller chunks +- This creates more natural, varied responses +- Prevents repetitive or predictable behavior -```bash -npx tweets2character -``` +2. **Knowledge Management** -2. **Convert Documents to Knowledge** +Use the provided tools to convert documents into knowledge: -```bash -npx folder2knowledge -``` +- [folder2knowledge](https://github.com/ai16z/characterfile/blob/main/scripts/folder2knowledge.js) +- [knowledge2folder](https://github.com/ai16z/characterfile/blob/main/scripts/knowledge2character.js) +- [tweets2character](https://github.com/ai16z/characterfile/blob/main/scripts/tweets2character.js) -3. **Add Knowledge to Character** +Example: ```bash +npx folder2knowledge npx knowledge2character ``` -## Context Length Considerations -- Modern LLMs support longer contexts (128k tokens) -- No strict limits on section lengths -- Focus on quality and relevance rather than size -- Consider randomization for large collections of information +3. **Style Instructions** -## Validation +- Be specific about communication patterns +- Include both dos and don'ts +- Consider platform-specific behavior (chat vs posts) -You can validate your character file against the schema using provided tools: +4. **Message Examples** -```bash -# Python -python examples/validate.py +- Include diverse scenarios +- Show character-specific responses +- Demonstrate typical interaction patterns -# JavaScript -node examples/validate.mjs -``` ## Tips for Quality 1. **Bio and Lore** - - Mix factual and personality-defining information - - Include both historical and current details - - Break into modular, reusable pieces +- Mix factual and personality-defining information +- Include both historical and current details +- Break into modular, reusable pieces 2. **Style Instructions** - - Be specific about tone and mannerisms - - Include platform-specific guidance - - Define clear boundaries and limitations +- Be specific about tone and mannerisms +- Include platform-specific guidance +- Define clear boundaries and limitations 3. **Examples** - - Cover common scenarios - - Show character-specific reactions - - Demonstrate proper tone and style +- Cover common scenarios +- Show character-specific reactions +- Demonstrate proper tone and style 4. **Knowledge** - - Focus on relevant information - - Organize in digestible chunks - - Update regularly to maintain relevance + +- Focus on relevant information +- Organize in digestible chunks +- Update regularly to maintain relevance + + +## Further Reading + +- [Agents Documentation](./agents.md) +- [Model Providers](../../advanced/fine-tuning) +- [Client Integration](../../packages/clients) diff --git a/docs/docs/core/evaluators.md b/docs/docs/core/evaluators.md index b17c049d21..52058a1822 100644 --- a/docs/docs/core/evaluators.md +++ b/docs/docs/core/evaluators.md @@ -2,212 +2,247 @@ sidebar_position: 5 --- -# Evaluators +# 📊 Evaluators -Evaluators are components that assess and extract information from conversations, helping agents build long-term memory and track goal progress. They analyze conversations to extract facts, update goals, and maintain agent state. +## Table of Contents +- [Overview](#overview) +- [Quick Start](#quick-start) +- [Best Practices](#best-practices) +- [Built-in Evaluators](#built-in-evaluators) +- [Creating Custom Evaluators](#creating-custom-evaluators) +- [Memory Integration](#memory-integration) ## Overview -Evaluators help agents: +[Evaluators](/api/interfaces) are core components that assess and extract information from conversations. They integrate with the [AgentRuntime](/api/classes/AgentRuntime)'s evaluation system, enabling agents to: -- Extract useful information from conversations -- Track progress toward goals - Build long-term memory -- Maintain context awareness +- Track goal progress +- Extract facts and insights +- Maintain contextual awareness + +## Quick Start + +1. Import the necessary evaluator types: +```typescript +import { Evaluator, IAgentRuntime, Memory, State } from '@ai16z/eliza-core'; +``` + +2. Choose or create an evaluator: + +```typescript +const evaluator: Evaluator = { + name: "BASIC_EVALUATOR", + similes: ["SIMPLE_EVALUATOR"], + description: "Evaluates basic conversation elements", + validate: async (runtime: IAgentRuntime, message: Memory) => true, + handler: async (runtime: IAgentRuntime, message: Memory) => { + // Evaluation logic here + return result; + }, + examples: [] +}; +``` ## Built-in Evaluators + ### Fact Evaluator -The fact evaluator extracts factual information from conversations for long-term memory storage. +The fact evaluator extracts and stores factual information from conversations. + ```typescript interface Fact { - claim: string; - type: "fact" | "opinion" | "status"; - in_bio: boolean; - already_known: boolean; + claim: string; + type: "fact" | "opinion" | "status"; + in_bio: boolean; + already_known: boolean; } ``` -#### Fact Types +Source: https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts -- `fact`: True statements about the world or character that don't change -- `status`: Facts that are true but may change over time -- `opinion`: Non-factual opinions, thoughts, feelings, or recommendations - -#### Example Facts: +**Example Facts:** ```json -[ - { - "claim": "User lives in Oakland", - "type": "fact", - "in_bio": false, - "already_known": false - }, - { - "claim": "User completed marathon in 3 hours", +{ + "claim": "User completed marathon training", "type": "fact", "in_bio": false, "already_known": false - }, - { - "claim": "User is proud of their achievement", - "type": "opinion", - "in_bio": false, - "already_known": false - } -] +} ``` ### Goal Evaluator - -The goal evaluator tracks progress on agent goals and objectives. +From bootstrap plugin - tracks conversation goals: ```typescript interface Goal { - id: string; - name: string; - status: "IN_PROGRESS" | "DONE" | "FAILED"; - objectives: Objective[]; + id: string; + name: string; + status: "IN_PROGRESS" | "DONE" | "FAILED"; + objectives: Objective[]; } interface Objective { - description: string; - completed: boolean; + description: string; + completed: boolean; } ``` -#### Goal Updates +--- -- Monitors conversation for goal progress -- Updates objective completion status -- Marks goals as complete when all objectives are done -- Marks goals as failed when they cannot be completed +## Best Practices -#### Example Goal: +### Fact Extraction +- Validate facts before storage +- Avoid duplicate entries +- Include relevant context +- Properly categorize information types -```json -{ - "id": "goal-123", - "name": "Complete Marathon Training", - "status": "IN_PROGRESS", - "objectives": [ - { - "description": "Run 30 miles per week", - "completed": true - }, - { - "description": "Complete practice half-marathon", - "completed": false - } - ] -} -``` +### Goal Tracking +- Define clear, measurable objectives +- Update only changed goals +- Handle failures gracefully +- Track partial progress + +### Validation +- Keep validation logic efficient +- Check prerequisites first +- Consider message content and state +- Use appropriate memory managers + +### Handler Implementation +- Use runtime services appropriately +- Store results in correct memory manager +- Handle errors gracefully +- Maintain state consistency + +### Examples +- Provide clear context descriptions +- Show typical trigger messages +- Document expected outcomes +- Cover edge cases + +--- ## Creating Custom Evaluators -To create a custom evaluator, implement the Evaluator interface: +Implement the Evaluator interface: ```typescript interface Evaluator { - name: string; - similes: string[]; - description: string; - validate: (runtime: IAgentRuntime, message: Memory) => Promise; - handler: ( - runtime: IAgentRuntime, - message: Memory, - state?: State, - options?: any, - ) => Promise; - examples: EvaluatorExample[]; + name: string; + similes: string[]; + description: string; + validate: (runtime: IAgentRuntime, message: Memory) => Promise; + handler: ( + runtime: IAgentRuntime, + message: Memory, + state?: State, + options?: any + ) => Promise; + examples: EvaluatorExample[]; } ``` -Example custom evaluator: - -```typescript -const customEvaluator: Evaluator = { - name: "CUSTOM_EVALUATOR", - similes: ["ALTERNATE_NAME"], - description: "Evaluates something in the conversation", - validate: async (runtime, message) => { - // Determine if evaluation should run - return true; - }, - handler: async (runtime, message, state, options) => { - // Evaluation logic - return evaluationResult; - }, - examples: [ - // Example inputs and outputs - ], -}; -``` - -## Best Practices - -### Fact Extraction - -1. **Avoid Duplication** +Source: https://github.com/ai16z/eliza/blob/main/packages/core/src/types.ts - - Check for existing facts - - Only store new information - - Mark duplicates as already_known +### Memory Integration -2. **Proper Categorization** +Example of storing evaluator results: - - Distinguish between facts/opinions/status - - Check if fact exists in bio - - Include relevant context +```typescript +try { + const memory = await runtime.memoryManager.addEmbeddingToMemory({ + userId: user?.id, + content: { text: evaluationResult }, + roomId: roomId, + embedding: await embed(runtime, evaluationResult) + }); + + await runtime.memoryManager.createMemory(memory); +} catch (error) { + console.error("Failed to store evaluation result:", error); +} +``` -3. **Quality Control** - - Remove corrupted facts - - Validate fact format - - Ensure facts are meaningful +Source: https://github.com/ai16z/eliza/blob/main/packages/core/src/tests/memory.test.ts -### Goal Tracking -1. **Clear Objectives** +### Memory Usage - - Break goals into measurable objectives - - Define completion criteria - - Track partial progress +Evaluators should use runtime memory managers for storage: -2. **Status Updates** +```typescript +const memoryEvaluator: Evaluator = { + name: "MEMORY_EVAL", + handler: async (runtime: IAgentRuntime, message: Memory) => { + // Store in message memory + await runtime.messageManager.createMemory({ + id: message.id, + content: message.content, + roomId: message.roomId, + userId: message.userId, + agentId: runtime.agentId + }); + + // Store in description memory + await runtime.descriptionManager.createMemory({ + id: message.id, + content: { text: "User description" }, + roomId: message.roomId, + userId: message.userId, + agentId: runtime.agentId + }); + } +}; +``` - - Only update changed goals - - Include complete objectives list - - Preserve unchanged data +## Integration with Agent Runtime -3. **Failure Handling** - - Define failure conditions - - Record failure reasons - - Allow goal adaptation +The [AgentRuntime](/api/classes/AgentRuntime) processes evaluators through its [evaluate](/api/classes/AgentRuntime#evaluate) method: -## Memory Integration +```typescript +// Register evaluator +runtime.registerEvaluator(customEvaluator); -Evaluators work with the memory system to: +// Process evaluations +const results = await runtime.evaluate(message, state); +``` -1. Store extracted facts -2. Update goal states -3. Build long-term context -4. Maintain conversation history -Example memory integration: +## Error Handling ```typescript -// Store new fact -const factMemory = await runtime.factManager.addEmbeddingToMemory({ - userId: agentId, - content: { text: fact }, - roomId, - createdAt: Date.now(), -}); - -await runtime.factManager.createMemory(factMemory, true); +const robustEvaluator: Evaluator = { + name: "ROBUST_EVAL", + handler: async (runtime: IAgentRuntime, message: Memory) => { + try { + // Attempt evaluation + await runtime.messageManager.createMemory({ + id: message.id, + content: message.content, + roomId: message.roomId, + userId: message.userId, + agentId: runtime.agentId + }); + } catch (error) { + // Log error and handle gracefully + console.error("Evaluation failed:", error); + + // Store error state if needed + await runtime.messageManager.createMemory({ + id: message.id, + content: { text: "Evaluation failed" }, + roomId: message.roomId, + userId: message.userId, + agentId: runtime.agentId + }); + } + } +}; ``` -## Related + diff --git a/docs/docs/core/providers.md b/docs/docs/core/providers.md index 36fd97cf90..b3655aad41 100644 --- a/docs/docs/core/providers.md +++ b/docs/docs/core/providers.md @@ -1,20 +1,36 @@ ---- -sidebar_position: 3 -title: Providers ---- +# 🔌 Providers + +[Providers](/api/interfaces) are core modules that inject dynamic context and real-time information into agent interactions. They serve as a bridge between the agent and various external systems, enabling access to market data, wallet information, sentiment analysis, and temporal context. -# Providers ## Overview -Providers are core modules that inject dynamic context and real-time information into agent interactions. They serve as a bridge between the agent and various external systems, enabling access to market data, wallet information, sentiment analysis, and temporal context. +A provider's primary purpose is to: +- Supply dynamic contextual information +- Integrate with the agent runtime +- Format information for conversation templates +- Maintain consistent data access -## Core Provider Types +### Core Structure -### 1. Time Provider +```typescript +interface Provider { + get: ( + runtime: IAgentRuntime, + message: Memory, + state?: State + ) => Promise; +} +``` +--- + +## Built-in Providers + +### Time Provider Provides temporal context for agent interactions: + ```typescript const timeProvider: Provider = { get: async (_runtime: IAgentRuntime, _message: Memory) => { @@ -26,60 +42,58 @@ const timeProvider: Provider = { }; ``` -### 2. Token Provider - -Provides comprehensive token analytics and market data: +### Facts Provider +From bootstrap plugin - maintains conversation facts: ```typescript -interface TokenAnalytics { - security: TokenSecurityData; - tradeData: TokenTradeData; - holderDistribution: string; - marketMetrics: { - price: number; - volume24h: number; - priceChange: number; - }; -} -``` - -Key features: - -- Real-time price and volume data -- Security metrics and risk assessment -- Holder distribution analysis -- DexScreener integration -- Smart caching system +const factsProvider: Provider = { + get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { + // Create embedding for recent messages and retrieve relevant facts + const recentMessages = formatMessages({ + messages: state?.recentMessagesData?.slice(-10), + actors: state?.actorsData, + }); + const embedding = await embed(runtime, recentMessages); + const memoryManager = new MemoryManager({ runtime, tableName: "facts" }); + const recentFactsData = await memoryManager.getMemories({ + roomId: message.roomId, + count: 10, + agentId: runtime.agentId, + }); + + // Combine and format facts + const allFacts = [...recentFactsData]; // Deduplication can be skipped if no overlap + const formattedFacts = formatFacts(allFacts); + + return `Key facts that ${runtime.character.name} knows:\n${formattedFacts}`; + }, +}; -### 3. Wallet Provider +export { factsProvider }; +``` -Manages cryptocurrency wallet interactions: +### Boredom Provider +From bootstrap plugin - manages conversation dynamics and engagement by calculating the boredom level of an agent based on recent messages in a chat room. -```typescript -interface WalletPortfolio { - totalUsd: string; - totalSol?: string; - items: Array<{ - name: string; - symbol: string; - balance: string; - valueUsd: string; - valueSol?: string; - }>; -} -``` -Capabilities: +1. **Data Structures**: + - **boredomLevels**: An array of objects, each representing a boredom level with a minimum score and a set of status messages that reflect the agent's current engagement. + - **interestWords**, **cringeWords**, and **negativeWords**: Arrays of words that influence the boredom score based on their presence in messages. -- Portfolio valuation -- Token balances -- Price tracking -- Performance metrics -- Multi-currency support +2. **Boredom Calculation**: -### 4. Boredom Provider +- The `boredomProvider` gets recent messages from the agent’s conversation over the last 15 minutes. +- It calculates a **boredom score** by analyzing the text of these messages. The score is influenced by: + - **Interest words**: Decrease boredom (subtract 1 point). + - **Cringe words**: Increase boredom (add 1 point). + - **Negative words**: Increase boredom (add 1 point). + - **Exclamation marks**: Increase boredom (add 1 point). + - **Question marks**: Increase or decrease boredom depending on the sender. + +3. **Boredom Level**: + - The boredom score is matched to a level from the `boredomLevels` array, which defines how engaged the agent feels. + - A random status message from the selected boredom level is chosen and the agent’s name is inserted into the message. -Manages conversation dynamics and engagement: ```typescript interface BoredomLevel { @@ -87,6 +101,24 @@ interface BoredomLevel { statusMessages: string[]; } ``` +The result is a message that reflects the agent's perceived level of engagement in the conversation, based on their recent interactions. + + +```typescript +const boredomProvider: Provider = { + get: async (runtime: IAgentRuntime, message: Memory) => { + const messages = await runtime.messageManager.getMemories({ + roomId: message.roomId, + count: 10 + }); + + return messages.length > 0 ? + "Actively engaged in conversation" : + "No recent interactions"; + } +}; +``` + Features: @@ -96,90 +128,60 @@ Features: - Sentiment analysis - Response adaptation -## Implementation - -### Provider Interface +--- -```typescript -interface Provider { - get: ( - runtime: IAgentRuntime, - message: Memory, - state?: State, - ) => Promise; -} -``` +## Implementation -### Data Caching System +### Basic Provider Template ```typescript -class CacheManager { - private cache: NodeCache; - private cacheDir: string; - - constructor(ttl: number = 300) { - // 5 minutes default - this.cache = new NodeCache({ stdTTL: ttl }); - this.cacheDir = path.join(__dirname, "cache"); - } - - async getCachedData(key: string): Promise { - // Check memory cache - const memoryCache = this.cache.get(key); - if (memoryCache) return memoryCache; - - // Check file cache - return this.readFromFileCache(key); +import { Provider, IAgentRuntime, Memory, State } from '@ai16z/eliza'; + +const customProvider: Provider = { + get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { + // Get relevant data using runtime services + const memories = await runtime.messageManager.getMemories({ + roomId: message.roomId, + count: 5 + }); + + // Format and return context + return formatContextString(memories); } -} +}; ``` -### Error Handling +### Memory Integration ```typescript -async function withErrorHandling( - operation: () => Promise, - fallback: T, - retries: number = 3, -): Promise { - try { - return await operation(); - } catch (error) { - console.error(`Provider error: ${error.message}`); - if (retries > 0) { - await delay(1000); - return withErrorHandling(operation, fallback, retries - 1); - } - return fallback; +const memoryProvider: Provider = { + get: async (runtime: IAgentRuntime, message: Memory) => { + // Get recent messages + const messages = await runtime.messageManager.getMemories({ + roomId: message.roomId, + count: 5, + unique: true + }); + + // Get user descriptions + const descriptions = await runtime.descriptionManager.getMemories({ + roomId: message.roomId, + userId: message.userId + }); + + // Combine and format + return ` +Recent Activity: +${formatMessages(messages)} + +User Context: +${formatDescriptions(descriptions)} + `.trim(); } -} -``` - -## Provider Configuration - -### Base Settings - -```typescript -const PROVIDER_CONFIG = { - API_ENDPOINTS: { - BIRDEYE: "https://public-api.birdeye.so", - DEXSCREENER: "https://api.dexscreener.com/latest/dex", - HELIUS: "https://mainnet.helius-rpc.com", - }, - CACHE_TTL: 300, // 5 minutes - MAX_RETRIES: 3, - RETRY_DELAY: 2000, }; ``` -### Rate Limiting - -```typescript -const rateLimiter = new RateLimit({ - windowMs: 15 * 60 * 1000, // 15 minutes - max: 100, // limit each IP to 100 requests per windowMs -}); -``` +--- ## Best Practices @@ -220,45 +222,75 @@ async function fetchDataWithCache( - Implement rate limiting - Handle sensitive data appropriately -## Integration Examples +--- -### Combining Multiple Providers +## Integration with Runtime + +Providers are registered with the [AgentRuntime](/api/classes/AgentRuntime): ```typescript -async function getMarketContext( - runtime: IAgentRuntime, - message: Memory, -): Promise { - const [timeContext, walletInfo, tokenData] = await Promise.all([ - timeProvider.get(runtime, message), - walletProvider.get(runtime, message), - tokenProvider.get(runtime, message), - ]); - - return formatContext({ - time: timeContext, - wallet: walletInfo, - token: tokenData, - }); -} +// Register provider +runtime.registerContextProvider(customProvider); + +// Providers are accessed through composeState +const state = await runtime.composeState(message); ``` -### Custom Provider Implementation +## Example: Complete Provider ```typescript -const marketSentimentProvider: Provider = { - get: async (runtime: IAgentRuntime, message: Memory) => { - const sentiment = await analyzeSentiment(message.content); - const marketMetrics = await getMarketMetrics(); - - return formatSentimentResponse(sentiment, marketMetrics); - }, +import { + Provider, + IAgentRuntime, + Memory, + State +} from '@ai16z/eliza'; + +const comprehensiveProvider: Provider = { + get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { + try { + // Get recent messages + const messages = await runtime.messageManager.getMemories({ + roomId: message.roomId, + count: 5 + }); + + // Get user context + const userContext = await runtime.descriptionManager.getMemories({ + roomId: message.roomId, + userId: message.userId + }); + + // Get relevant facts + const facts = await runtime.messageManager.getMemories({ + roomId: message.roomId, + tableName: "facts", + count: 3 + }); + + // Format comprehensive context + return ` +# Conversation Context +${messages.map(m => `- ${m.content.text}`).join('\n')} + +# User Information +${userContext.map(c => c.content.text).join('\n')} + +# Related Facts +${facts.map(f => `- ${f.content.text}`).join('\n')} + `.trim(); + + } catch (error) { + console.error("Provider error:", error); + return "Context temporarily unavailable"; + } + } }; ``` -## Troubleshooting +--- -### Common Issues and Solutions +## Troubleshooting 1. **Stale Data** @@ -287,5 +319,10 @@ const marketSentimentProvider: Provider = { // Attempt alternative data sources }; ``` + +--- + +## Further Reading -## Additional Resources +- [Agent Runtime](./agents.md) +- [Memory System](../../packages/core) diff --git a/docs/docs/guides/advanced.md b/docs/docs/guides/advanced.md index 234abf3b05..1c31fceb75 100644 --- a/docs/docs/guides/advanced.md +++ b/docs/docs/guides/advanced.md @@ -1,246 +1,397 @@ -# Advanced Usage +--- +sidebar_position: 10 +--- -This guide covers advanced usage patterns and features of Eliza, including working with services, custom implementations, and advanced configuration options. +# 🔧 Advanced Usage Guide -## Video and Media Processing +This guide covers advanced features and capabilities of Eliza, including complex integrations, custom services, and specialized plugins. -### Video Service +## Service Integration -Eliza provides robust video processing capabilities through the VideoService class. Key features include: +### Video Processing Service -- Downloading and processing videos from multiple sources (YouTube, Vimeo, direct MP4 links) -- Automatic transcription of video content -- Caching mechanisms for efficient processing -- Support for both manual and automatic captions +Eliza supports advanced video processing capabilities through the `VideoService`: ```typescript -import { VideoService } from "./services/video"; +import { VideoService } from '@ai16z/eliza/plugin-node'; -// Initialize the service -const videoService = VideoService.getInstance(runtime); +// Initialize service +const videoService = new VideoService(); -// Process a video URL -const media = await videoService.processVideo(videoUrl); +// Process video content +const result = await videoService.processVideo(url, runtime); ``` +Key features: +- Automatic video downloading +- Transcription support +- Subtitle extraction +- Cache management +- Queue processing + ### Image Processing -The ImageService provides advanced image analysis capabilities: +The `ImageDescriptionService` provides advanced image analysis: + +```typescript +import { ImageDescriptionService } from '@ai16z/eliza/plugin-node'; + +const imageService = new ImageDescriptionService(); +const description = await imageService.describeImage(imageUrl, 'gpu', runtime); +``` -- Local and cloud-based image recognition -- Support for GIF processing (first frame extraction) -- Integration with multiple AI models for image analysis -- Caching and batch processing capabilities +Features: +- Local and cloud processing options +- CUDA acceleration support +- Automatic format handling +- GIF frame extraction -## Memory Management and Embeddings +## Blockchain Integration -### Advanced Memory Operations +### Solana Integration -The system supports sophisticated memory operations through various database adapters: +The Solana plugin provides comprehensive blockchain functionality: ```typescript -// Search memories with embedding similarity -const similarMemories = await db.searchMemoriesByEmbedding(embedding, { - match_threshold: 0.95, - count: 5, - roomId: currentRoom, - tableName: "long_term_memory", -}); +import { solanaPlugin } from '@ai16z/eliza/plugin-solana'; -// Create unique memories with deduplication -await db.createMemory(memory, "episodic_memory", true); +// Initialize plugin +runtime.registerPlugin(solanaPlugin); ``` -### Custom Database Adapters - -You can implement custom database adapters by extending the DatabaseAdapter class: +#### Token Operations ```typescript -class CustomDatabaseAdapter extends DatabaseAdapter { - async searchMemories(params: { - tableName: string; - roomId: UUID; - embedding: number[]; - match_threshold: number; - match_count: number; - unique: boolean; - }): Promise { - // Custom implementation - } -} +// Buy tokens +const swapResult = await swapToken( + connection, + walletPublicKey, + inputTokenCA, + outputTokenCA, + amount +); + +// Sell tokens +const sellResult = await sellToken({ + sdk, + seller: walletKeypair, + mint: tokenMint, + amount: sellAmount, + priorityFee, + allowOffCurve: false, + slippage: "1", + connection +}); ``` -## Speech and Transcription - -### Speech Service - -The system includes a comprehensive speech service with support for: - -- Text-to-speech conversion with multiple providers -- Voice customization options -- Streaming audio support -- PCM and WAV format handling +#### Trust Score System ```typescript -const speechService = new SpeechService(); -const audioStream = await speechService.generate(runtime, text); +const trustScoreManager = new TrustScoreManager(tokenProvider, trustScoreDb); + +// Generate trust scores +const score = await trustScoreManager.generateTrustScore( + tokenAddress, + recommenderId, + recommenderWallet +); + +// Monitor trade performance +await trustScoreManager.createTradePerformance(runtime, tokenAddress, userId, { + buy_amount: amount, + is_simulation: false +}); ``` -### Advanced Transcription +## Custom Services -The TranscriptionService provides: - -- Local and cloud-based transcription options -- CUDA acceleration support -- Audio format conversion and normalization -- Debug logging and error handling +### Speech Generation -## Trust Score System - -The system includes a sophisticated trust score management system: +Implement text-to-speech capabilities: ```typescript -interface RecommenderMetrics { - trustScore: number; - totalRecommendations: number; - successfulRecs: number; - avgTokenPerformance: number; - riskScore: number; - consistencyScore: number; - virtualConfidence: number; +class SpeechService extends Service implements ISpeechService { + async generate(runtime: IAgentRuntime, text: string): Promise { + if (runtime.getSetting("ELEVENLABS_XI_API_KEY")) { + return textToSpeech(runtime, text); + } + + const { audio } = await synthesize(text, { + engine: "vits", + voice: "en_US-hfc_female-medium" + }); + + return Readable.from(audio); + } } ``` -Key features include: +### PDF Processing -- Historical metrics tracking -- Performance analysis -- Risk assessment -- Consistency evaluation +Handle PDF document analysis: -## Browser Automation +```typescript +class PdfService extends Service { + async convertPdfToText(pdfBuffer: Buffer): Promise { + const pdf = await getDocument({ data: pdfBuffer }).promise; + const numPages = pdf.numPages; + const textPages = []; + + for (let pageNum = 1; pageNum <= numPages; pageNum++) { + const page = await pdf.getPage(pageNum); + const textContent = await page.getTextContent(); + const pageText = textContent.items + .filter(isTextItem) + .map(item => item.str) + .join(" "); + textPages.push(pageText); + } + + return textPages.join("\n"); + } +} +``` -The BrowserService provides advanced web interaction capabilities: +## Advanced Memory Management -- CAPTCHA handling -- Ad blocking -- Content extraction -- Proxy support -- Cache management +### Retrievable Memory System ```typescript -const browserService = BrowserService.getInstance(runtime); -const content = await browserService.getPageContent(url); +class MemoryManager { + async getMemories({ + agentId, + roomId, + count + }: { + agentId: string; + roomId: string; + count: number; + }): Promise { + // Implement memory retrieval logic + } + + async createMemory(memory: Memory, allowDuplicates: boolean = false): Promise { + // Implement memory storage logic + } +} ``` -## Best Practices +### Trust Score Database -### Memory Management +Implement advanced scoring systems: -- Implement proper memory cleanup and garbage collection -- Use the caching system effectively -- Monitor memory usage in long-running processes +```typescript +class TrustScoreDatabase { + async calculateValidationTrust(tokenAddress: string): number { + const sql = ` + SELECT rm.trust_score + FROM token_recommendations tr + JOIN recommender_metrics rm ON tr.recommender_id = rm.recommender_id + WHERE tr.token_address = ?; + `; + + const rows = this.db.prepare(sql).all(tokenAddress); + if (rows.length === 0) return 0; + + const totalTrust = rows.reduce((acc, row) => acc + row.trust_score, 0); + return totalTrust / rows.length; + } +} +``` -### Error Handling +## Plugin Development -- Implement comprehensive error handling -- Use the logging system effectively -- Monitor system performance +### Creating Custom Plugins -### Performance Optimization +```typescript +const customPlugin: Plugin = { + name: "custom-plugin", + description: "Custom Plugin for Eliza", + actions: [ + // Custom actions + ], + evaluators: [ + // Custom evaluators + ], + providers: [ + // Custom providers + ] +}; +``` -- Use batch processing when possible -- Implement proper caching strategies -- Monitor and optimize database queries +### Advanced Action Development -## Configuration Options +```typescript +export const complexAction: Action = { + name: "COMPLEX_ACTION", + similes: ["ALTERNATIVE_NAME", "OTHER_NAME"], + validate: async (runtime: IAgentRuntime, message: Memory) => { + // Implement validation logic + return true; + }, + handler: async ( + runtime: IAgentRuntime, + message: Memory, + state: State, + options: { [key: string]: unknown }, + callback?: HandlerCallback + ): Promise => { + // Implement complex handling logic + return true; + } +}; +``` -### Environment Variables +## Advanced Configuration -Key configuration options include: +### Custom Runtime Configuration -```bash -CUDA_PATH=/usr/local/cuda # For GPU acceleration -OPENAI_API_KEY=sk-... # For OpenAI integration -ELEVENLABS_API_KEY=... # For voice synthesis +```typescript +const customRuntime = new AgentRuntime({ + databaseAdapter: new PostgresDatabaseAdapter(config), + modelProvider: new OpenAIProvider(apiKey), + plugins: [ + solanaPlugin, + customPlugin + ], + services: [ + new VideoService(), + new ImageDescriptionService(), + new SpeechService() + ] +}); ``` -### Runtime Configuration - -The runtime can be configured with various options: +### Advanced Model Configuration ```typescript -const runtime = { - character: { - settings: { - model: "gpt-4", - temperature: 0.7, - maxTokens: 2048, - }, - }, - // Additional configuration options +const modelConfig = { + modelClass: ModelClass.LARGE, + temperature: 0.7, + maxTokens: 2000, + topP: 0.9, + frequencyPenalty: 0.5, + presencePenalty: 0.5 }; + +const response = await generateText({ + runtime, + context: prompt, + ...modelConfig +}); ``` -## Advanced Features +## Performance Optimization + +### Caching Strategy + +```typescript +class CacheManager { + private cache: NodeCache; + private cacheDir: string; + + constructor() { + this.cache = new NodeCache({ stdTTL: 300 }); + this.cacheDir = path.join(__dirname, "cache"); + this.ensureCacheDirectoryExists(); + } -### Custom Actions + private async getCachedData(key: string): Promise { + // Implement tiered caching strategy + } +} +``` -Implement custom actions for specialized behavior: +### Queue Management ```typescript -class CustomAction extends BaseAction { - async execute(context: ActionContext): Promise { - // Custom implementation - return { - success: true, - data: {}, - }; +class QueueManager { + private queue: string[] = []; + private processing: boolean = false; + + async processQueue(): Promise { + if (this.processing || this.queue.length === 0) { + return; + } + + this.processing = true; + while (this.queue.length > 0) { + const item = this.queue.shift(); + await this.processItem(item); + } + this.processing = false; } } ``` -### Custom Evaluators +## Best Practices -Create specialized evaluators for specific use cases: +### Error Handling ```typescript -class CustomEvaluator extends BaseEvaluator { - async evaluate(context: EvaluatorContext): Promise { - // Custom evaluation logic - return { - score: 0.95, - confidence: 0.8, - }; +try { + const result = await complexOperation(); + if (!result) { + throw new Error("Operation failed"); } + return result; +} catch (error) { + console.error("Error in operation:", error); + await errorReporting.log(error); + throw new OperationalError("Failed to complete operation", { cause: error }); } ``` -## Security Considerations +### Resource Management -- Implement proper input validation -- Use secure token management -- Monitor system access -- Implement rate limiting -- Use proper encryption for sensitive data +```typescript +class ResourceManager { + private resources: Map = new Map(); + + async acquire(id: string): Promise { + // Implement resource acquisition with timeout + } + + async release(id: string): Promise { + // Implement resource cleanup + } +} +``` ## Troubleshooting -Common issues and solutions: - -1. Memory leaks +### Common Issues +1. Memory Leaks - Monitor memory usage - Implement proper cleanup - - Use garbage collection + - Use WeakMap for caching + +2. Performance Bottlenecks + - Profile slow operations + - Implement batching + - Use connection pooling + +3. Integration Issues + - Verify API credentials + - Check network connectivity + - Validate request formatting + +### Debugging -2. Performance issues +```typescript +const debug = require('debug')('eliza:advanced'); + +debug('Detailed operation info: %O', { + operation: 'complexOperation', + parameters: params, + result: result +}); +``` - - Optimize database queries - - Implement proper caching - - Use batch processing +## Further Resources -3. Integration issues - - Check API keys and permissions - - Verify network connectivity - - Monitor API rate limits +- [Infrastructure Guide](../advanced/infrastructure.md) for deployment +- [Trust Engine Documentation](../advanced/trust-engine.md) for scoring system +- [Autonomous Trading Guide](../advanced/autonomous-trading.md) for trading features +- [Fine-tuning Guide](../advanced/fine-tuning.md) for model optimization diff --git a/docs/docs/guides/basic-usage.md b/docs/docs/guides/basic-usage.md deleted file mode 100644 index f00b7143bf..0000000000 --- a/docs/docs/guides/basic-usage.md +++ /dev/null @@ -1,269 +0,0 @@ -# Basic Usage - -## Overview - -This guide covers the fundamental concepts and basic usage of the agent framework. We'll explore how to initialize and configure agents, handle different types of interactions, and leverage core capabilities. - -## Getting Started - -### Installation - -First, install the package using npm or pnpm: - -```bash -npm install @your-org/agent-framework -# or -pnpm install @your-org/agent-framework -``` - -### Basic Setup - -Here's a minimal example to create and start an agent: - -```typescript -import { AgentRuntime, createAgentRuntime } from "@your-org/agent-framework"; -import { SqliteDatabaseAdapter } from "@your-org/agent-framework/adapters"; - -// Initialize database -const db = new SqliteDatabaseAdapter(new Database("./db.sqlite")); - -// Create runtime with basic configuration -const runtime = await createAgentRuntime({ - character: { - name: "Assistant", - modelProvider: "anthropic", - // Add character details - }, - db, - token: process.env.API_TOKEN, -}); -``` - -## Core Concepts - -### Agents - -Agents are autonomous entities that can: - -- Process incoming messages -- Generate contextual responses -- Take actions based on input -- Maintain conversation state -- Handle multiple communication channels - -### Clients - -The framework supports multiple client types: - -- Discord -- Telegram -- Twitter -- Direct API - -Each client handles platform-specific message formatting and interaction patterns. - -### Actions - -Actions are discrete tasks that agents can perform: - -```typescript -const action = { - name: "SUMMARIZE", - description: "Summarize content or conversations", - handler: async (runtime, message, state) => { - // Action implementation - }, -}; - -runtime.registerAction(action); -``` - -### Providers - -Providers supply contextual information to agents: - -- Time awareness -- User relationships -- System state -- External data sources - -## Common Use Cases - -### Chat Interactions - -```typescript -// Handle incoming chat message -runtime.on("message", async (message) => { - const response = await runtime.handleMessage(message); - // Process response -}); -``` - -### Voice Integration - -For platforms supporting voice (e.g., Discord): - -```typescript -// Handle voice channel join -runtime.on("voiceStateUpdate", async (oldState, newState) => { - if (newState.channelId) { - await runtime.joinVoiceChannel(newState.channelId); - } -}); -``` - -### Media Processing - -The framework can handle various media types: - -- Images (with description generation) -- Audio (with transcription) -- Documents (with text extraction) -- Videos (with summarization) - -```typescript -// Process attachment -const media = await runtime.processAttachment({ - type: "image", - url: "https://example.com/image.jpg", -}); -``` - -## Configuration Options - -### Character Configuration - -Define agent personality and behavior: - -```typescript -const character = { - name: "Assistant", - bio: "A helpful AI assistant", - style: { - tone: "professional", - personality: "friendly", - language: "en", - }, - topics: ["technology", "science", "general"], - // Additional character settings -}; -``` - -### Runtime Settings - -Configure runtime behavior: - -```typescript -const settings = { - maxContextLength: 2000, - responseTimeout: 30000, - modelProvider: "anthropic", - temperature: 0.7, - // Additional runtime settings -}; -``` - -## Best Practices - -1. **Error Handling** - - - Implement proper error catching - - Provide graceful fallbacks - - Log errors for debugging - -2. **Resource Management** - - - Monitor memory usage - - Implement rate limiting - - Cache frequently accessed data - -3. **Security** - - - Validate input - - Sanitize output - - Implement proper authentication - -4. **Performance** - - Use appropriate model sizes - - Implement caching strategies - - Optimize database queries - -## Example Implementation - -Here's a complete example bringing together the core concepts: - -```typescript -import { AgentRuntime, createAgentRuntime } from "@your-org/agent-framework"; -import { DiscordClient } from "@your-org/agent-framework/clients/discord"; - -async function main() { - // Initialize runtime - const runtime = await createAgentRuntime({ - character: { - name: "Helper", - bio: "A helpful assistant", - modelProvider: "anthropic", - style: { - tone: "friendly", - personality: "helpful", - }, - }, - settings: { - maxContextLength: 2000, - temperature: 0.7, - }, - }); - - // Add custom action - runtime.registerAction({ - name: "HELP", - description: "Provide help information", - handler: async (runtime, message, state) => { - return { - text: "Here's how I can help...", - action: "HELP_RESPONSE", - }; - }, - }); - - // Initialize Discord client - const discord = new DiscordClient(runtime); - - // Start listening - discord.start(); -} - -main().catch(console.error); -``` - -## Troubleshooting - -Common issues and solutions: - -1. **Connection Issues** - - - Verify API tokens - - Check network connectivity - - Confirm service status - -2. **Response Timeouts** - - - Adjust timeout settings - - Check rate limits - - Verify model availability - -3. **Memory Issues** - - Monitor heap usage - - Implement garbage collection - - Optimize data structures - -## Next Steps - -After mastering basic usage, explore: - -- Advanced configuration options -- Custom action development -- Integration with external services -- Performance optimization techniques - -For more detailed information, refer to the specific component documentation and API reference. diff --git a/docs/docs/guides/configuration.md b/docs/docs/guides/configuration.md index 850a6e73de..3de1504fbf 100644 --- a/docs/docs/guides/configuration.md +++ b/docs/docs/guides/configuration.md @@ -1,233 +1,289 @@ -# Configuration +--- +sidebar_position: 9 +--- -## Overview +# ⚙️ Configuration Guide -The framework provides multiple layers of configuration to customize agent behavior, system settings, and runtime environments. This guide covers all configuration aspects: character files, environment variables, action configuration, and runtime settings. +This guide covers how to configure Eliza for different use cases and environments. We'll walk through all available configuration options and best practices. -## Key Components +## Environment Configuration -### 1. Environment Setup +### Basic Setup -Create a `.env` file in your project root: +The first step is creating your environment configuration file: ```bash -# Model API Keys -OPENAI_API_KEY=your-key -CLAUDE_API_KEY=your-key - -# Database Configuration -DATABASE_URL=your-db-url -POSTGRES_URL=your-postgres-url # Optional, defaults to SQLite - -# Client-Specific Tokens -DISCORD_API_TOKEN=your-token -DISCORD_APPLICATION_ID=your-id -TELEGRAM_BOT_TOKEN=your-token -TWITTER_USERNAME=your-username +cp .env.example .env ``` -### 2. Character Configuration +### Core Environment Variables -Create character files in the `characters` directory: +Here are the essential environment variables you need to configure: + +```bash +# Core API Keys +OPENAI_API_KEY=sk-your-key # Required for OpenAI features +ANTHROPIC_API_KEY=your-key # Required for Claude models +TOGETHER_API_KEY=your-key # Required for Together.ai models + +# Default Settings +XAI_MODEL=gpt-4o-mini # Default model to use +X_SERVER_URL= # Optional model API endpoint +``` + +### Client-Specific Configuration + +#### Discord Configuration +```bash +DISCORD_APPLICATION_ID= # Your Discord app ID +DISCORD_API_TOKEN= # Discord bot token +``` + +#### Twitter Configuration +```bash +TWITTER_USERNAME= # Bot Twitter username +TWITTER_PASSWORD= # Bot Twitter password +TWITTER_EMAIL= # Twitter account email +TWITTER_COOKIES= # Twitter auth cookies +TWITTER_DRY_RUN=false # Test mode without posting +``` + +#### Telegram Configuration +```bash +TELEGRAM_BOT_TOKEN= # Telegram bot token +``` + +### Model Provider Settings + +You can configure different AI model providers: + +```bash +# OpenAI Settings +OPENAI_API_KEY=sk-* + +# Anthropic Settings +ANTHROPIC_API_KEY= + +# Together.ai Settings +TOGETHER_API_KEY= + +# Local Model Settings +XAI_MODEL=meta-llama/Llama-3.1-7b-instruct +``` + +## Character Configuration + +### Character File Structure + +Character files define your agent's personality and behavior. Create them in the `characters/` directory: ```json { "name": "AgentName", - "clients": ["discord", "twitter", "telegram"], + "clients": ["discord", "twitter"], "modelProvider": "openai", "settings": { "secrets": { - "OPENAI_API_KEY": "your-key" - }, - "voice": { - "model": "en_US-male-medium" + "OPENAI_API_KEY": "character-specific-key", + "DISCORD_TOKEN": "bot-specific-token" } - }, - "bio": ["Biography elements..."], - "lore": ["Character background..."], - "knowledge": ["Factual information..."], - "topics": ["Relevant topics..."], - "style": { - "all": ["Style guidelines..."], - "chat": ["Chat-specific style..."], - "post": ["Post-specific style..."] } } ``` -### 3. Custom Actions - -Define custom actions in `elizaConfig.yaml`: - -```yaml -actions: - - name: customAction - path: ./actions/customAction.ts - - name: anotherAction - path: ./custom_actions/anotherAction.ts -``` +### Loading Characters -## Usage Guide +You can load characters in several ways: -### 1. Basic Setup +```bash +# Load default character +pnpm start -```typescript -import { createAgentRuntime } from "@your-org/agent-framework"; -import { SqliteDatabaseAdapter } from "@your-org/agent-framework/adapters"; +# Load specific character +pnpm start --characters="characters/your-character.json" -// Initialize runtime -const runtime = await createAgentRuntime({ - character: characterConfig, - configPath: "./elizaConfig.yaml", - databaseAdapter: new SqliteDatabaseAdapter("./db.sqlite"), -}); +# Load multiple characters +pnpm start --characters="characters/char1.json,characters/char2.json" ``` -### 2. Running Multiple Characters +## Custom Actions -```bash -# Start with specific character file -pnpm run dev --characters=./characters/agent1.json,./characters/agent2.json -``` - -### 3. Client Configuration +### Adding Custom Actions -```typescript -// Discord client example -const discordClient = new DiscordClient(runtime); -await discordClient.start(); +1. Create a `custom_actions` directory +2. Add your action files there +3. Configure in `elizaConfig.yaml`: -// Telegram client example -const telegramClient = new TelegramClient(runtime, botToken); -await telegramClient.start(); +```yaml +actions: + - name: myCustomAction + path: ./custom_actions/myAction.ts ``` -## Configuration Options - -### 1. Model Providers +### Action Configuration Structure ```typescript -const modelProviders = { - openai: { - small: "gpt-3.5-turbo", - large: "gpt-4", - }, - anthropic: { - small: "claude-3-haiku", - large: "claude-3-opus", - }, - "llama-cloud": { - small: "llama-7b", - large: "llama-70b", +export const myAction: Action = { + name: "MY_ACTION", + similes: ["SIMILAR_ACTION", "ALTERNATE_NAME"], + validate: async (runtime: IAgentRuntime, message: Memory) => { + // Validation logic + return true; }, + description: "Action description", + handler: async (runtime: IAgentRuntime, message: Memory) => { + // Action logic + return true; + } }; ``` -### 2. Database Options +## Provider Configuration -```typescript -// SQLite (default) -const dbAdapter = new SqliteDatabaseAdapter("./db.sqlite"); +### Database Providers -// PostgreSQL -const dbAdapter = new PostgresDatabaseAdapter({ - connectionString: process.env.POSTGRES_URL, -}); -``` - -### 3. Custom Provider Configuration +Configure different database backends: ```typescript -// Add custom provider -runtime.providers.push({ - name: "customProvider", - get: async (runtime, message, state) => { - // Provider implementation - return data; - }, +// SQLite (Recommended for development) +import { SqliteDatabaseAdapter } from "@your-org/agent-framework/adapters"; +const db = new SqliteDatabaseAdapter("./dev.db"); + +// PostgreSQL (Production) +import { PostgresDatabaseAdapter } from "@your-org/agent-framework/adapters"; +const db = new PostgresDatabaseAdapter({ + host: process.env.DB_HOST, + port: parseInt(process.env.DB_PORT), + database: process.env.DB_NAME, + user: process.env.DB_USER, + password: process.env.DB_PASSWORD }); ``` -## Best Practices +### Model Providers -### 1. Security +Configure model providers in your character file: -- Store sensitive credentials in `.env` file -- Use character-specific secrets for per-agent credentials -- Never commit secrets to version control -- Rotate API keys regularly +```json +{ + "modelProvider": "openai", + "settings": { + "model": "gpt-4o-mini", + "temperature": 0.7, + "maxTokens": 2000 + } +} +``` -### 2. Character Configuration +## Advanced Configuration -- Break bio and lore into smaller chunks for variety -- Use RAG (knowledge array) for factual information -- Keep message examples diverse and representative -- Update knowledge regularly +### Runtime Settings -### 3. Performance +Fine-tune runtime behavior: ```typescript -// Optimize context length const settings = { - maxContextLength: 4000, // Adjust based on model - maxTokens: 1000, // Limit response length - temperature: 0.7, // Adjust response randomness + // Logging + DEBUG: "eliza:*", + LOG_LEVEL: "info", + + // Performance + MAX_CONCURRENT_REQUESTS: 5, + REQUEST_TIMEOUT: 30000, + + // Memory + MEMORY_TTL: 3600, + MAX_MEMORY_ITEMS: 1000 }; ``` -### 4. Error Handling +### Plugin Configuration -```typescript -try { - const runtime = await createAgentRuntime(config); -} catch (error) { - if (error.code === "CONFIG_NOT_FOUND") { - console.error("Configuration file missing"); - } else if (error.code === "INVALID_CHARACTER") { - console.error("Character file validation failed"); - } -} +Enable and configure plugins in `elizaConfig.yaml`: + +```yaml +plugins: + - name: solana + enabled: true + settings: + network: mainnet-beta + endpoint: https://api.mainnet-beta.solana.com + + - name: image-generation + enabled: true + settings: + provider: dalle + size: 1024x1024 ``` +## Configuration Best Practices + +1. **Environment Segregation** + - Use different `.env` files for different environments + - Follow naming convention: `.env.development`, `.env.staging`, `.env.production` + +2. **Secret Management** + - Never commit secrets to version control + - Use secret management services in production + - Rotate API keys regularly + +3. **Character Configuration** + - Keep character files modular and focused + - Use inheritance for shared traits + - Document character behaviors + +4. **Plugin Management** + - Enable only needed plugins + - Configure plugin-specific settings in separate files + - Monitor plugin performance + +5. **Database Configuration** + - Use SQLite for development + - Configure connection pooling for production + - Set up proper indexes + ## Troubleshooting ### Common Issues -1. **Missing Configuration** +1. **Environment Variables Not Loading** + ```bash + # Check .env file location + node -e "console.log(require('path').resolve('.env'))" + + # Verify environment variables + node -e "console.log(process.env)" + ``` -```typescript -if (!fs.existsSync("./elizaConfig.yaml")) { - console.error("Missing elizaConfig.yaml - copy from example"); -} -``` +2. **Character Loading Failures** + ```bash + # Validate character file + npx ajv validate -s character-schema.json -d your-character.json + ``` -2. **Invalid Character File** +3. **Database Connection Issues** + ```bash + # Test database connection + npx ts-node scripts/test-db-connection.ts + ``` -```typescript -// Validate character file -if (!character.name || !character.bio || !character.style) { - throw new Error("Invalid character configuration"); -} -``` +### Configuration Validation -3. **Model Provider Issues** +Use the built-in config validator: -```typescript -// Fallback to local model -if (!process.env.OPENAI_API_KEY) { - console.log("Using local model fallback"); - runtime.modelProvider = "llama-local"; -} +```bash +pnpm run validate-config ``` -## Next Steps - -After basic configuration: +This will check: +- Environment variables +- Character files +- Database configuration +- Plugin settings -1. Configure custom actions -2. Set up client integrations -3. Customize character behavior -4. Optimize model settings -5. Implement error handling +## Further Resources -For more detailed information on specific components, refer to their respective documentation sections. +- [Quickstart Guide](../quickstart.md) for initial setup +- [Secrets Management](./secrets-management.md) for secure configuration +- [Local Development](./local-development.md) for development setup +- [Advanced Usage](./advanced.md) for complex configurations diff --git a/docs/docs/guides/local-development.md b/docs/docs/guides/local-development.md index 6f48de0672..ac800be7eb 100644 --- a/docs/docs/guides/local-development.md +++ b/docs/docs/guides/local-development.md @@ -1,18 +1,30 @@ -# Local Development +--- +sidebar_position: 12 +--- + +# 💻 Local Development Guide + +This guide covers setting up and working with Eliza in a development environment. ## Prerequisites -Before starting local development, ensure you have: +Before you begin, ensure you have: -- Node.js 22 or higher installed -- pnpm package manager installed -- Git for version control -- Code editor (VS Code recommended) -- CUDA Toolkit (optional, for GPU acceleration) +```bash +# Required +Node.js 22+ +pnpm +Git + +# Optional but recommended +VS Code +Docker (for database development) +CUDA Toolkit (for GPU acceleration) +``` ## Initial Setup -### 1. Clone and Install +### 1. Repository Setup ```bash # Clone the repository @@ -22,26 +34,26 @@ cd eliza # Install dependencies pnpm install -# Install optional Sharp package if needed +# Install optional dependencies pnpm install --include=optional sharp ``` ### 2. Environment Configuration -Copy the example environment file: +Create your development environment file: ```bash cp .env.example .env ``` -Configure essential variables for local development: +Configure essential development variables: ```bash -# Minimum required for local testing +# Minimum required for local development OPENAI_API_KEY=sk-* # Optional, for OpenAI features X_SERVER_URL= # Leave blank for local inference -XAI_API_KEY= # Leave blank for local inference -XAI_MODEL=meta-llama/Llama-3.1-7b-instruct # Choose your model +XAI_API_KEY= # Leave blank for local inference +XAI_MODEL=meta-llama/Llama-3.1-7b-instruct # Local model ``` ### 3. Local Model Setup @@ -49,62 +61,45 @@ XAI_MODEL=meta-llama/Llama-3.1-7b-instruct # Choose your model For local inference without API dependencies: ```bash -# Install CUDA support if you have an NVIDIA GPU +# Install CUDA support for NVIDIA GPUs npx --no node-llama-cpp source download --gpu cuda -# The system will automatically download the selected model -# from Hugging Face on first run +# The system will automatically download models from +# Hugging Face on first run ``` ## Development Workflow -### 1. Running the Development Server +### Running the Development Server ```bash # Start with default character pnpm run dev -# Start with specific character(s) -pnpm run dev --characters="characters/your-character.json" +# Start with specific character +pnpm run dev --characters="characters/my-character.json" # Start with multiple characters pnpm run dev --characters="characters/char1.json,characters/char2.json" ``` -### 2. Testing in Shell Mode - -Open a new terminal to interact with your agent: - -```bash -pnpm run shell -``` - -### 3. Custom Actions Development - -Create custom actions without modifying core files: +### Development Commands ```bash -# Create custom actions directory -mkdir custom_actions - -# Create your action file -touch custom_actions/myAction.ts -``` - -Register your action in `elizaConfig.yaml`: - -```yaml -actions: - - name: myAction - path: ./custom_actions/myAction.ts +pnpm run build # Build the project +pnpm run clean # Clean build artifacts +pnpm run dev # Start development server +pnpm run test # Run tests +pnpm run test:watch # Run tests in watch mode +pnpm run lint # Lint code ``` -## Database Options +## Database Development ### SQLite (Recommended for Development) ```typescript -import { SqliteDatabaseAdapter } from "@your-org/agent-framework/adapters"; +import { SqliteDatabaseAdapter } from "@ai16z/eliza/adapters"; import Database from "better-sqlite3"; const db = new SqliteDatabaseAdapter(new Database("./dev.db")); @@ -113,32 +108,106 @@ const db = new SqliteDatabaseAdapter(new Database("./dev.db")); ### In-Memory Database (for Testing) ```typescript -import { SqlJsDatabaseAdapter } from "@your-org/agent-framework/adapters"; +import { SqlJsDatabaseAdapter } from "@ai16z/eliza/adapters"; const db = new SqlJsDatabaseAdapter(new Database(":memory:")); ``` -## GPU Acceleration +### Schema Management -For NVIDIA GPU users: +```bash +# Create new migration +pnpm run migration:create -1. Install CUDA Toolkit with cuDNN and cuBLAS -2. Set environment variables: +# Run migrations +pnpm run migration:up -```bash -CUDA_PATH=/usr/local/cuda # Windows: typically C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0 +# Rollback migrations +pnpm run migration:down ``` -## Debugging Tips +## Testing -### 1. Enable Debug Logging +### Running Tests ```bash -# Add to your .env file -DEBUG=eliza:* +# Run all tests +pnpm test + +# Run specific test file +pnpm test tests/specific.test.ts + +# Run tests with coverage +pnpm test:coverage + +# Run database-specific tests +pnpm test:sqlite +pnpm test:sqljs +``` + +### Writing Tests + +```typescript +import { runAiTest } from "@ai16z/eliza/test_resources"; + +describe("Feature Test", () => { + beforeEach(async () => { + // Setup test environment + }); + + it("should perform expected behavior", async () => { + const result = await runAiTest({ + messages: [ + { + user: "user1", + content: { text: "test message" } + } + ], + expected: "expected response" + }); + expect(result.success).toBe(true); + }); +}); +``` + +## Plugin Development + +### Creating a New Plugin + +```typescript +// plugins/my-plugin/src/index.ts +import { Plugin } from "@ai16z/eliza/types"; + +export const myPlugin: Plugin = { + name: "my-plugin", + description: "My custom plugin", + actions: [], + evaluators: [], + providers: [] +}; +``` + +### Custom Action Development + +```typescript +// plugins/my-plugin/src/actions/myAction.ts +export const myAction: Action = { + name: "MY_ACTION", + similes: ["SIMILAR_ACTION"], + validate: async (runtime: IAgentRuntime, message: Memory) => { + return true; + }, + handler: async (runtime: IAgentRuntime, message: Memory) => { + // Implementation + return true; + }, + examples: [] +}; ``` -### 2. VS Code Launch Configuration +## Debugging + +### VS Code Configuration Create `.vscode/launch.json`: @@ -161,72 +230,165 @@ Create `.vscode/launch.json`: } ``` -### 3. Common Issues +### Debugging Tips + +1. Enable Debug Logging +```bash +# Add to your .env file +DEBUG=eliza:* +``` + +2. Use Debug Points +```typescript +const debug = require('debug')('eliza:dev'); -**Memory Issues:** +debug('Operation details: %O', { + operation: 'functionName', + params: parameters, + result: result +}); +``` +3. Memory Debugging ```bash -# Increase Node.js memory limit if needed +# Increase Node.js memory for development NODE_OPTIONS="--max-old-space-size=8192" pnpm run dev ``` -**Model Download Issues:** +## Common Development Tasks -```bash -# Clear model cache -rm -rf ./models/* -# Restart with fresh download +### 1. Adding a New Character + +```json +{ + "name": "DevBot", + "description": "Development testing bot", + "modelProvider": "openai", + "settings": { + "debug": true, + "logLevel": "debug" + } +} ``` -## Testing +### 2. Creating Custom Services + +```typescript +class CustomService extends Service { + static serviceType = ServiceType.CUSTOM; + + async initialize() { + // Setup code + } + + async process(input: any): Promise { + // Service logic + } +} +``` + +### 3. Working with Models + +```typescript +// Local model configuration +const localModel = { + modelProvider: "llamalocal", + settings: { + modelPath: "./models/llama-7b.gguf", + contextSize: 8192 + } +}; + +// Cloud model configuration +const cloudModel = { + modelProvider: "openai", + settings: { + model: "gpt-4o-mini", + temperature: 0.7 + } +}; +``` -### Unit Tests +## Performance Optimization + +### CUDA Setup + +For NVIDIA GPU users: + +1. Install CUDA Toolkit with cuDNN and cuBLAS +2. Set environment variables: ```bash -# Run all tests -pnpm test +CUDA_PATH=/usr/local/cuda # Windows: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0 +``` -# Run specific test file -pnpm test tests/your-test.test.ts +### Memory Management -# Run with coverage -pnpm test:coverage +```typescript +class MemoryManager { + private cache = new Map(); + private maxSize = 1000; + + async cleanup() { + if (this.cache.size > this.maxSize) { + // Implement cleanup logic + } + } +} ``` -### Integration Testing +## Troubleshooting + +### Common Issues + +1. Model Loading Issues +```bash +# Clear model cache +rm -rf ./models/* +# Restart with fresh download +``` +2. Database Connection Issues ```bash -# Start test environment -pnpm run dev:test +# Test database connection +pnpm run test:db-connection +``` -# Run integration tests -pnpm test:integration +3. Memory Issues +```bash +# Check memory usage +node --trace-gc index.js ``` -## Development Best Practices +### Development Tools -1. **Version Control** +```bash +# Generate TypeScript documentation +pnpm run docs:generate - - Create feature branches - - Follow conventional commits - - Keep PRs focused and manageable +# Check for circular dependencies +pnpm run madge -2. **Code Organization** +# Analyze bundle size +pnpm run analyze +``` +## Best Practices + +1. Code Organization - Place custom actions in `custom_actions/` - Keep character files in `characters/` - Store test data in `tests/fixtures/` -3. **Performance** - - - Use SQLite for development - - Enable GPU acceleration when possible - - Monitor memory usage - -4. **Testing** +2. Testing Strategy - Write unit tests for new features + - Use integration tests for plugins - Test with multiple model providers - - Verify character behavior in shell + +3. Git Workflow + - Create feature branches + - Follow conventional commits + - Keep PRs focused ## Additional Tools @@ -243,4 +405,22 @@ npx folder2knowledge npx knowledge2character ``` -Remember to regularly update dependencies and test your changes across different environments and configurations. +### Development Scripts + +```bash +# Analyze codebase +./scripts/analyze-codebase.ts + +# Extract tweets for training +./scripts/extracttweets.js + +# Clean build artifacts +./scripts/clean.sh +``` + +## Further Resources + +- [Configuration Guide](./configuration.md) for setup details +- [Advanced Usage](./advanced.md) for complex features +- [API Documentation](/api) for complete API reference +- [Contributing Guide](../community/contributing.md) for contribution guidelines diff --git a/docs/docs/guides/secrets-management.md b/docs/docs/guides/secrets-management.md index 898594e01c..5b924f6fc2 100644 --- a/docs/docs/guides/secrets-management.md +++ b/docs/docs/guides/secrets-management.md @@ -1,234 +1,397 @@ -# Secrets Management +--- +sidebar_position: 11 +--- -## Overview +# 🔐 Secrets Management -Eliza provides multiple options for managing secrets and credentials, including environment variables and character-specific secrets. This guide covers best practices for managing API keys, tokens, and other sensitive configuration values across different deployment scenarios. +A comprehensive guide for managing secrets, API keys, and sensitive configuration in Eliza. -## Environment Variables +## Core Concepts -### Basic Setup +### Environment Variables + +Eliza uses a hierarchical environment variable system: + +1. Character-specific secrets (highest priority) +2. Environment variables +3. Default values (lowest priority) -Create a `.env` file in your project root: +### Secret Types + +Common secrets you'll need to manage: ```bash -# Core API Keys -OPENAI_API_KEY=sk-your-key +# API Keys +OPENAI_API_KEY=sk-* ANTHROPIC_API_KEY=your-key ELEVENLABS_XI_API_KEY=your-key +GOOGLE_GENERATIVE_AI_API_KEY=your-key -# Discord Configuration -DISCORD_APPLICATION_ID=your-app-id -DISCORD_API_TOKEN=your-bot-token +# Client Authentication +DISCORD_API_TOKEN=your-token +TELEGRAM_BOT_TOKEN=your-token -# Twitter Configuration -TWITTER_USERNAME=your-username -TWITTER_PASSWORD=your-password -TWITTER_EMAIL=your-email -TWITTER_COOKIES=your-cookies +# Database Credentials +SUPABASE_URL=your-url +SUPABASE_SERVICE_API_KEY=your-key -# Database Configuration (Optional) -SUPABASE_URL=your-supabase-url -SUPABASE_SERVICE_API_KEY=your-service-key +# Blockchain Keys +WALLET_PRIVATE_KEY=your-private-key +WALLET_PUBLIC_KEY=your-public-key +``` -# Voice Settings (Optional) -ELEVENLABS_MODEL_ID=eleven_multilingual_v2 -ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM -ELEVENLABS_VOICE_STABILITY=0.5 -ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9 -ELEVENLABS_VOICE_STYLE=0.66 -ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false -ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4 -ELEVENLABS_OUTPUT_FORMAT=pcm_16000 +## Implementation Guide + +### Basic Setup + +1. Create a `.env` file from template: + +```bash +cp .env.example .env ``` -## Character-Specific Secrets +2. Configure environment discovery: + +```typescript +import { config } from "dotenv"; +import path from "path"; + +export function findNearestEnvFile(startDir = process.cwd()) { + let currentDir = startDir; + + while (currentDir !== path.parse(currentDir).root) { + const envPath = path.join(currentDir, ".env"); + + if (fs.existsSync(envPath)) { + return envPath; + } + + currentDir = path.dirname(currentDir); + } + + return null; +} +``` -### Configuration in Character Files +### Character-Specific Secrets -Character files can include their own secrets, which override environment variables: +Define secrets in character files: ```json { - "name": "AgentName", - "clients": ["discord", "twitter"], - "modelProvider": "openai", + "name": "TradingBot", "settings": { "secrets": { "OPENAI_API_KEY": "character-specific-key", - "DISCORD_TOKEN": "bot-specific-token", - "TWITTER_USERNAME": "bot-twitter-handle", - "TWITTER_PASSWORD": "bot-twitter-password" + "WALLET_PRIVATE_KEY": "character-specific-wallet" } } } ``` -### Precedence Order - -Secrets are resolved in the following order: - -1. Character-specific secrets (highest priority) -2. Environment variables -3. Default values (lowest priority) +Access secrets in code: -## Best Practices - -### 1. Secret Storage - -- Never commit secret files to version control -- Use `.gitignore` to exclude sensitive files: - -```bash -# .gitignore -.env -.env.* -characters/**/secrets.json -**/serviceAccount.json +```typescript +const apiKey = runtime.getSetting("OPENAI_API_KEY"); ``` -### 2. Development Workflow +### Secure Storage -Create different environment files for different environments: +#### Database Secrets -```bash -.env.development # Local development settings -.env.staging # Staging environment -.env.production # Production settings +Use encrypted connection strings: + +```typescript +class SecureDatabase { + private connection: Connection; + + constructor(encryptedConfig: string) { + const config = this.decryptConfig(encryptedConfig); + this.connection = new Connection(config); + } + + private decryptConfig(encrypted: string): DatabaseConfig { + // Implement decryption logic + return JSON.parse(decrypted); + } +} ``` -### 3. Secret Rotation +#### Wallet Management -Implement a rotation strategy: +Secure handling of blockchain credentials: ```typescript -class SecretManager { - private static readonly SECRET_LIFETIME = 90 * 24 * 60 * 60 * 1000; // 90 days - - async shouldRotateSecret(secretName: string): Promise { - const lastRotation = await this.getLastRotation(secretName); - return Date.now() - lastRotation > SecretManager.SECRET_LIFETIME; - } +class WalletManager { + private async initializeWallet(runtime: IAgentRuntime) { + const privateKey = runtime.getSetting("WALLET_PRIVATE_KEY"); + + if (!privateKey) { + throw new Error("Wallet private key not configured"); + } + + // Validate key format + try { + const keyBuffer = Buffer.from(privateKey, "base64"); + if (keyBuffer.length !== 64) { + throw new Error("Invalid key length"); + } + } catch (error) { + throw new Error("Invalid private key format"); + } + + // Initialize wallet securely + return new Wallet(privateKey); + } } ``` -### 4. Secure Character Files +### Secret Rotation -When using character-specific secrets: +Implement automatic secret rotation: ```typescript -// Validate character file location -const isSecurePath = (path: string): boolean => { - return !path.includes("../") && !path.startsWith("/"); -}; - -// Load character securely -const loadCharacter = async (path: string) => { - if (!isSecurePath(path)) { - throw new Error("Invalid character file path"); - } - // Load and validate character -}; +class SecretRotation { + private static readonly SECRET_LIFETIME = 90 * 24 * 60 * 60 * 1000; // 90 days + + async shouldRotateSecret(secretName: string): Promise { + const lastRotation = await this.getLastRotation(secretName); + return Date.now() - lastRotation > SecretRotation.SECRET_LIFETIME; + } + + async rotateSecret(secretName: string): Promise { + // Implement rotation logic + const newSecret = await this.generateNewSecret(); + await this.updateSecret(secretName, newSecret); + await this.recordRotation(secretName); + } +} ``` -## Security Considerations - -### 1. Access Control +### Access Control -Implement proper access controls for secret management: +Implement proper access controls: ```typescript class SecretAccess { - private static readonly ALLOWED_KEYS = [ - "OPENAI_API_KEY", - "DISCORD_TOKEN", - // ... other allowed keys - ]; - - static validateAccess(key: string): boolean { - return this.ALLOWED_KEYS.includes(key); - } + private static readonly ALLOWED_KEYS = [ + "OPENAI_API_KEY", + "DISCORD_TOKEN", + // ... other allowed keys + ]; + + static validateAccess(key: string): boolean { + return this.ALLOWED_KEYS.includes(key); + } + + static async getSecret(runtime: IAgentRuntime, key: string): Promise { + if (!this.validateAccess(key)) { + throw new Error(`Unauthorized access to secret: ${key}`); + } + + return runtime.getSetting(key); + } } ``` -### 2. Encryption at Rest +### Encryption at Rest -For stored secrets: +Implement encryption for stored secrets: ```typescript import { createCipheriv, createDecipheriv } from "crypto"; class SecretEncryption { - static async encrypt(value: string, key: Buffer): Promise { - const iv = crypto.randomBytes(16); - const cipher = createCipheriv("aes-256-gcm", key, iv); - // ... implementation - } - - static async decrypt(encrypted: string, key: Buffer): Promise { - // ... implementation - } + static async encrypt(value: string, key: Buffer): Promise { + const iv = crypto.randomBytes(16); + const cipher = createCipheriv("aes-256-gcm", key, iv); + + let encrypted = cipher.update(value, "utf8", "hex"); + encrypted += cipher.final("hex"); + + return JSON.stringify({ + iv: iv.toString("hex"), + encrypted, + tag: cipher.getAuthTag().toString("hex") + }); + } + + static async decrypt(encrypted: string, key: Buffer): Promise { + const { iv, encrypted: encryptedData, tag } = JSON.parse(encrypted); + + const decipher = createDecipheriv( + "aes-256-gcm", + key, + Buffer.from(iv, "hex") + ); + + decipher.setAuthTag(Buffer.from(tag, "hex")); + + let decrypted = decipher.update(encryptedData, "hex", "utf8"); + decrypted += decipher.final("utf8"); + + return decrypted; + } } ``` +## Best Practices + +### 1. Environment Segregation + +Maintain separate environment files: + +```bash +.env.development # Local development settings +.env.staging # Staging environment +.env.production # Production settings +``` + +### 2. Git Security + +Exclude sensitive files: + +```gitignore +# .gitignore +.env +.env.* +characters/**/secrets.json +**/serviceAccount.json +``` + ### 3. Secret Validation Validate secrets before use: ```typescript async function validateSecrets(character: Character): Promise { - const required = ["OPENAI_API_KEY"]; - const missing = required.filter((key) => !character.settings.secrets[key]); + const required = ["OPENAI_API_KEY"]; + const missing = required.filter( + key => !character.settings.secrets[key] + ); + + if (missing.length > 0) { + throw new Error( + `Missing required secrets: ${missing.join(", ")}` + ); + } +} +``` - if (missing.length > 0) { - throw new Error(`Missing required secrets: ${missing.join(", ")}`); - } +### 4. Error Handling + +Secure error messages: + +```typescript +try { + await loadSecrets(); +} catch (error) { + if (error.code === "ENOENT") { + console.error("Environment file not found"); + } else if (error instanceof ValidationError) { + console.error("Invalid secret format"); + } else { + // Log securely without exposing secret values + console.error("Error loading secrets"); + } } ``` -## Troubleshooting +## Security Considerations -### Common Issues +### 1. Handling API Keys + +```typescript +class APIKeyManager { + private validateAPIKey(key: string): boolean { + if (key.startsWith("sk-")) { + return key.length > 20; + } + return false; + } + + async rotateAPIKey(provider: string): Promise { + // Implement key rotation logic + } +} +``` -1. **Missing Secrets** +### 2. Secure Configuration Loading ```typescript -if (!process.env.OPENAI_API_KEY && !character.settings.secrets.OPENAI_API_KEY) { - throw new Error( - "OpenAI API key not found in environment or character settings", - ); +class ConfigLoader { + private static sanitizePath(path: string): boolean { + return !path.includes("../") && !path.startsWith("/"); + } + + async loadConfig(path: string): Promise { + if (!this.sanitizePath(path)) { + throw new Error("Invalid config path"); + } + // Load configuration + } } ``` -2. **Invalid Secret Format** +### 3. Memory Security ```typescript -function validateApiKey(key: string): boolean { - // OpenAI keys start with 'sk-' - if (key.startsWith("sk-")) { - return key.length > 20; - } - return false; +class SecureMemory { + private secrets: Map> = new Map(); + + set(key: string, value: string): void { + this.secrets.set(key, new WeakRef(value)); + } + + get(key: string): string | null { + const ref = this.secrets.get(key); + return ref?.deref() ?? null; + } +} +``` + +## Troubleshooting + +### Common Issues + +1. Missing Secrets +```typescript +if (!process.env.OPENAI_API_KEY) { + throw new Error( + "OpenAI API key not found in environment or character settings" + ); } ``` -3. **Secret Loading Errors** +2. Invalid Secret Format +```typescript +function validateApiKey(key: string): boolean { + // OpenAI keys start with 'sk-' + if (key.startsWith("sk-")) { + return key.length > 20; + } + return false; +} +``` +3. Secret Loading Errors ```typescript try { - await loadSecrets(); + await loadSecrets(); } catch (error) { - if (error.code === "ENOENT") { - console.error("Environment file not found"); - } else if (error instanceof ValidationError) { - console.error("Invalid secret format"); - } + if (error.response) { + console.error("Response data:", error.response.data); + console.error("Response status:", error.response.status); + } else if (error.request) { + console.error("No response received:", error.request); + } else { + console.error("Error setting up request:", error.message); + } } ``` ## Related Resources -- [Configuration Guide](./configuration.md) for general configuration options -- [Character Files](../core/characterfile.md) for character-specific settings -- [Local Development](./local-development.md) for development environment setup - -Remember to follow security best practices and never expose sensitive credentials in logs, error messages, or version control systems. +- [Configuration Guide](./configuration.md) for general setup +- [Local Development](./local-development.md) for development environment +- [Infrastructure Guide](../advanced/infrastructure.md) for deployment security diff --git a/docs/docs/installation.md b/docs/docs/installation.md deleted file mode 100644 index 975253e27e..0000000000 --- a/docs/docs/installation.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -sidebar_position: 3 ---- - -# Installation - -Currently eliza is dependent on Supabase for local development. You can install it with the following command: - -`pnpm install eliza` - -## Select your database adapter - -``` -pnpm install sqlite-vss better-sqlite3 # for sqlite (simple, for local development) - -pnpm install @supabase/supabase-js # for supabase (more complicated but can be deployed at scale) -``` - -### Set up environment variables - -You will need a Supbase account, as well as an OpenAI developer account. - -Copy and paste the .dev.vars.example to .dev.vars and fill in the environment variables: - -``` -SUPABASE_URL="https://your-supabase-url.supabase.co" -SUPABASE_SERVICE_API_KEY="your-supabase-service-api-key" -OPENAI_API_KEY="your-openai-api-key" -``` - -### SQLite Local Setup (Easiest) - -You can use SQLite for local development. This is the easiest way to get started with eliza. - -``` -import { BgentRuntime, SqliteDatabaseAdapter } from "eliza"; -import { Database } from "sqlite3"; -const sqliteDatabaseAdapter = new SqliteDatabaseAdapter(new Database(":memory:")); - -const runtime = new BgentRuntime({ - serverUrl: "https://api.openai.com/v1", - token: process.env.OPENAI_API_KEY, // Can be an API key or JWT token for your AI services - databaseAdapter: sqliteDatabaseAdapter, - // ... other options -}); -``` - -### Supabase Local Setup - -First, you will need to install the Supabase CLI. You can install it using the instructions here. - -Once you have the CLI installed, you can run the following commands to set up a local Supabase instance: - -``` -supabase init -supabase start -``` - -You can now start the eliza project with `pnpm run dev` and it will connect to the local Supabase instance by default. - -NOTE: You will need Docker installed for this to work. If that is an issue for you, use the Supabase Cloud Setup instructions instead below). - -### Supabase Cloud Setup - -This library uses Supabase as a database. You can set up a free account at supabase.io and create a new project. - -- Step 1: On the Subase All Projects Dashboard, select “New Project”. -- Step 2: Select the organization to store the new project in, assign a database name, password and region. -- Step 3: Select “Create New Project”. -- Step 4: Wait for the database to setup. This will take a few minutes as supabase setups various directories. -- Step 5: Select the “SQL Editor” tab from the left navigation menu. -- Step 6: Copy in your own SQL dump file or optionally use the provided file in the eliza directory at: "src/supabase/db.sql". Note: You can use the command "supabase db dump" if you have a pre-exisiting supabase database to generate the SQL dump file. -- Step 7: Paste the SQL code into the SQL Editor and hit run in the bottom right. -- Step 8: Select the “Databases” tab from the left navigation menu to verify all of the tables have been added properly. - -Once you've set up your Supabase project, you can find your API key by going to the "Settings" tab and then "API". You will need to set the` SUPABASE_URL and SUPABASE_SERVICE_API_KEY` environment variables in your `.dev.vars` file. - -### Local Model Setup - -While eliza uses ChatGPT 3.5 by default, you can use a local model by setting the serverUrl to a local endpoint. The LocalAI project is a great way to run a local model with a compatible API endpoint. - -``` -const runtime = new BgentRuntime({ - serverUrl: process.env.LOCALAI_URL, - token: process.env.LOCALAI_TOKEN, // Can be an API key or JWT token for your AI service - // ... other options -}); -``` - -### Development - -``` -pnpm run dev # start the server - -pnpm run shell # start the shell in another terminal to talk to the default agent -``` - -### Usage - -``` - import { BgentRuntime, SupabaseDatabaseAdapter, SqliteDatabaseAdapter } from "eliza"; - - const sqliteDatabaseAdapter = new SqliteDatabaseAdapter(new Database(":memory:")); - - - // You can also use Supabase like this - // const supabaseDatabaseAdapter = new SupabaseDatabaseAdapter( - // process.env.SUPABASE_URL, - // process.env.SUPABASE_SERVICE_API_KEY) - // ; - - - const runtime = new BgentRuntime({ - serverUrl: "https://api.openai.com/v1", - token: process.env.OPENAI_API_KEY, // Can be an API key or JWT token for your AI services - databaseAdapter: sqliteDatabaseAdapter, - actions: [ - /* your custom actions */ - ], - evaluators: [ - /* your custom evaluators */ - ], - model: "gpt-3.5-turbo", // whatever model you want to use - embeddingModel: "text-embedding-3-small", // whatever model you want to use - }); -``` diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 8d8a364a10..2b03dcd13b 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -115,9 +115,8 @@ Eliza is backed by an active community of developers and users: ## Next Steps -- [Install Eliza](./installation.md) -- [Create Your First Agent](./quickstart.md) -- [Understand Core Concepts](./core/agents.md) +- [Create Your First Agent](../quickstart) +- [Understand Core Concepts](../core/agents) - [Explore Advanced Features](./guides/advanced.md) Join us in building the future of autonomous AI agents with Eliza! diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md index 8b18f618dd..f66fb84dff 100644 --- a/docs/docs/quickstart.md +++ b/docs/docs/quickstart.md @@ -2,112 +2,165 @@ sidebar_position: 2 --- -# Quickstart +# Quickstart Guide -## Install Node.js +## Prerequisites -https://docs.npmjs.com/downloading-and-installing-node-js-and-npm +Before getting started with Eliza, ensure you have: -## Using pnpm +- [Node.js 22+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- [pnpm](https://pnpm.io/installation) +- Git for version control +- A code editor (VS Code recommended) +- CUDA Toolkit (optional, for GPU acceleration) -We use pnpm to manage our dependencies. It is faster and more efficient than npm, and it supports workspaces. -https://pnpm.io/installation +## Installation -## Edit the .env file +1. **Clone and Install** -- Copy .env.example to .env and fill in the appropriate values -- Edit the TWITTER environment variables to add your bot's username and password +```bash +# Clone the repository +git clone https://github.com/ai16z/eliza.git +cd eliza -## Edit the character file +# Install dependencies +pnpm install + +# Install optional Sharp package if needed +pnpm install --include=optional sharp +``` -- 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. +2. **Configure Environment** -### Run with Llama +```bash +# Copy example environment file +cp .env.example .env +``` + +Edit `.env` and add your values: -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` +```bash +# Required environment variables +DISCORD_APPLICATION_ID= # For Discord integration +DISCORD_API_TOKEN= # Bot token +OPENAI_API_KEY= # OpenAI API key (starting with sk-*) +ELEVENLABS_XI_API_KEY= # API key from elevenlabs (for voice) +``` -### Run with Grok +## Choose Your Model -You can run Grok models by setting the `XAI_MODEL` environment variable to `grok-beta` +Eliza supports multiple AI models: -### Run with OpenAI +- **Llama**: Set `XAI_MODEL=meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo` +- **Grok**: Set `XAI_MODEL=grok-beta` +- **OpenAI**: Set `XAI_MODEL=gpt-4o-mini` or `gpt-4o` -You can run OpenAI models by setting the `XAI_MODEL` environment variable to `gpt-4o-mini` or `gpt-4o` +For local inference: -# Requires Node 20+ +1. Set `XAI_MODEL` to your chosen model +2. Leave `X_SERVER_URL` and `XAI_API_KEY` blank +3. The system will automatically download the model from Hugging Face -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). +## Create Your First Agent -## Additional Requirements +1. **Edit the Character File** + Check out `src/core/defaultCharacter.ts` to customize your agent's personality and behavior. -You may need to install Sharp. If you see an error when starting up, try installing it with the following command: +You can also load custom characters: +```bash +pnpm start --characters="path/to/your/character.json" ``` -pnpm install --include=optional sharp + +2. **Start the Agent** + +```bash +pnpm start ``` -# Environment Setup +## Platform Integration + +### Discord Bot Setup -You will need to add environment variables to your .env file to connect to various platforms: +1. Create a new application at [Discord Developer Portal](https://discord.com/developers/applications) +2. Create a bot and get your token +3. Add bot to your server using OAuth2 URL generator +4. Set `DISCORD_API_TOKEN` and `DISCORD_APPLICATION_ID` in your `.env` +### Twitter Integration + +Add to your `.env`: + +```bash +TWITTER_USERNAME= # Account username +TWITTER_PASSWORD= # Account password +TWITTER_EMAIL= # Account email +TWITTER_COOKIES= # Account cookies ``` -# 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 + +### Telegram Bot +1. Create a bot +2. Add your bot token to `.env`: + +```bash +TELEGRAM_BOT_TOKEN=your_token_here ``` -# Local Setup +## Optional: GPU Acceleration -## CUDA Setup +If you have an NVIDIA GPU: -If you have an NVIDIA GPU, you can install CUDA to speed up local inference dramatically. +```bash +# Install CUDA support +npx --no node-llama-cpp source download --gpu cuda +# Ensure CUDA Toolkit, cuDNN, and cuBLAS are installed ``` -pnpm install -npx --no node-llama-cpp source download --gpu cuda + +## Basic Usage Examples + +### Chat with Your Agent + +```bash +# Start chat interface +pnpm run shell ``` -Make sure that you've installed the CUDA Toolkit, including cuDNN and cuBLAS. +### Run Multiple Agents -## Running locally +```bash +pnpm start --characters="agent1.json,agent2.json" +``` -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 +## Common Issues & Solutions -# Cloud Setup (with OpenAI) +1. **Node.js Version** -In addition to the environment variables above, you will need to add the following: + - Ensure Node.js 22+ is installed + - Use `node -v` to check version + - Consider using [nvm](https://github.com/nvm-sh/nvm) to manage Node versions -``` -# 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 -``` +2. **Sharp Installation** + If you see Sharp-related errors: + + ```bash + pnpm install --include=optional sharp + ``` + +3. **CUDA Setup** + - Verify CUDA Toolkit installation + - Check GPU compatibility + - Ensure proper environment variables are set + +## Next Steps + +Once you have your agent running, explore: + +1. 🤖 [Understand Agents](./core/agents.md) +2. 📝 [Create Custom Characters](./core/characterfile.md) +3. ⚡ [Add Custom Actions](./core/actions.md) +4. 🔧 [Advanced Configuration](./guides/configuration.md) -# Discord Bot +For detailed API documentation, troubleshooting, and advanced features, check out our [full documentation](https://ai16z.github.io/eliza/). -For help with setting up your Discord Bot, check out here: https://discordjs.guide/preparations/setting-up-a-bot-application.html +Join our [Discord community](https://discord.gg/ai16z) for support and updates! diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 536ec26ea5..a32b9469c3 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -1,19 +1,16 @@ -// @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://madjin.github.io", + url: "https://ai16z.github.io", baseUrl: "/eliza/", - organizationName: "madjin", + organizationName: "ai16z", projectName: "eliza", deploymentBranch: "gh-pages", trailingSlash: true, - onBrokenLinks: "throw", + onBrokenLinks: "ignore", onBrokenMarkdownLinks: "warn", i18n: { @@ -23,134 +20,163 @@ const config = { markdown: { mermaid: true, }, - themes: [ - "@docusaurus/theme-mermaid", - // Any other themes... - ], + themes: ["@docusaurus/theme-mermaid"], plugins: [ - // TypeDoc plugin for API documentation [ "docusaurus-plugin-typedoc", { entryPoints: ["../packages/core/src/index.ts"], tsconfig: "../tsconfig.json", - out: "./docs/api", + out: "./api", skipErrorChecking: true, + excludeExternals: false, + excludePrivate: true, + excludeProtected: false, + excludeInternal: false, + excludeNotDocumented: false, + plugin: ["typedoc-plugin-markdown"], + hideGenerator: true, + cleanOutputDir: true, + categorizeByGroup: true, + pretty: true, + includeVersion: true, + sort: ["source-order", "required-first", "visibility"], + gitRevision: "main", + readme: "none", + commentStyle: "all", + preserveAnchorCasing: true, + hideBreadcrumbs: false, + preserveWatchOutput: true, + disableSources: false, + validation: { + notExported: true, + invalidLink: true, + notDocumented: false + }, + exclude: [ + "**/_media/**", + "**/node_modules/**", + "**/dist/**", + "**/*.test.ts", + "**/*.spec.ts" + ], + watch: false, + treatWarningsAsErrors: true, + treatValidationWarningsAsErrors: true, + searchInComments: true, + navigationLinks: { + "GitHub": "https://github.com/ai16z/eliza", + "Documentation": "/docs/intro" + }, }, ], - // Search functionality require.resolve("docusaurus-lunr-search"), - // Separate API docs plugin instance [ "@docusaurus/plugin-content-docs", { id: "api", - path: "docs/api", - routeBasePath: "docs/api", - sidebarPath: "./sidebars.api.js", + path: "api", + routeBasePath: "api", }, ], ], presets: [ [ "classic", - /** @type {import('@docusaurus/preset-classic').Options} */ - ({ + { docs: { sidebarPath: "./sidebars.js", editUrl: "https://github.com/ai16z/eliza/tree/main/docs/", routeBasePath: "docs", + exclude: ["**/_media/**"], }, theme: { customCss: "./src/css/custom.css", }, - }), + }, ], ], - themeConfig: - /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ - ({ - // Enable dark mode by default - colorMode: { - defaultMode: "dark", - disableSwitch: false, - respectPrefersColorScheme: true, + themeConfig: { + colorMode: { + defaultMode: "dark", + disableSwitch: false, + respectPrefersColorScheme: true, + }, + docs: { + sidebar: { + hideable: true, + autoCollapseCategories: true, }, - // Add sidebar configuration - docs: { - sidebar: { - hideable: true, - autoCollapseCategories: true, - }, + }, + navbar: { + title: "eliza", + logo: { + alt: "Eliza Logo", + src: "img/favicon.ico", }, - navbar: { - title: "eliza", - logo: { - alt: "Eliza Logo", - src: "img/favicon.ico", + items: [ + { + type: "docSidebar", + sidebarId: "tutorialSidebar", + position: "left", + label: "Documentation", }, - 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, - }, - }), + { + 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/ai16z' + }, + { + label: 'Twitter', + href: 'https://twitter.com/ai16zdao' + } + ] + }, + { + title: "More", + items: [ + { + label: "GitHub", + href: "https://github.com/ai16z/eliza", + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} ai16z.ai`, + }, + prism: { + theme: prismThemes.github, + darkTheme: prismThemes.dracula, + }, + }, }; + export default config; diff --git a/docs/package.json b/docs/package.json index 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": [ diff --git a/docs/sidebars.api.js b/docs/sidebars.api.js deleted file mode 100644 index 678db1d4f7..0000000000 --- a/docs/sidebars.api.js +++ /dev/null @@ -1,11 +0,0 @@ -/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ -const sidebars = { - apiSidebar: [ - { - type: "autogenerated", - dirName: ".", - }, - ], -}; - -export default sidebars; diff --git a/docs/sidebars.js b/docs/sidebars.js index a7ac861e12..a870307cb2 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -4,61 +4,219 @@ const sidebars = { { type: "doc", id: "intro", - label: "Introduction", + label: "🚀 Introduction", }, { type: "category", - label: "Getting Started", - items: ["quickstart", "installation"], + label: "🏁 Getting Started", + items: [ + { + type: "doc", + id: "quickstart", + label: "⭐ Quick Start" + } + ], collapsed: false, }, { type: "category", - label: "Core Concepts", + label: "🧠 Core Concepts", collapsed: false, items: [ - "core/characterfile", - "core/agents", - "core/providers", - "core/actions", - "core/evaluators", + { + type: "doc", + id: "core/characterfile", + label: "Character Files" + }, + { + type: "doc", + id: "core/agents", + label: "Agents" + }, + { + type: "doc", + id: "core/providers", + label: "Providers" + }, + { + type: "doc", + id: "core/actions", + label: "Actions" + }, + { + type: "doc", + id: "core/evaluators", + label: "Evaluators" + }, ], }, { type: "category", - label: "Guides", + label: "📘 Guides", collapsed: false, items: [ - "guides/basic-usage", - "guides/configuration", - "guides/advanced", - "guides/secrets-management", - "guides/local-development", + { + type: "doc", + id: "guides/configuration", + label: "Configuration" + }, + { + type: "doc", + id: "guides/advanced", + label: "Advanced Usage" + }, + { + type: "doc", + id: "guides/secrets-management", + label: "Secrets Management" + }, + { + type: "doc", + id: "guides/local-development", + label: "Local Development" + }, ], }, { type: "category", - label: "Advanced Topics", + label: "🎓 Advanced Topics", collapsed: false, items: [ - "advanced/fine-tuning", - "advanced/infrastructure", - "advanced/trust-engine", - "advanced/autonomous-trading", + { + type: "doc", + id: "advanced/fine-tuning", + label: "Fine-tuning" + }, + { + type: "doc", + id: "advanced/infrastructure", + label: "Infrastructure" + }, + { + type: "doc", + id: "advanced/trust-engine", + label: "Trust Engine" + }, + { + type: "doc", + id: "advanced/autonomous-trading", + label: "Autonomous Trading" + }, ], }, { type: "category", - label: "Community", + label: "📦 Packages", collapsed: false, items: [ - "community/project-overview", - "community/spaces-notes", - "community/development-notes", - "community/contributing", + { + type: "doc", + id: "packages/packages", + label: "Overview" + }, + { + type: "doc", + id: "packages/core", + label: "Core Package" + }, + { + type: "doc", + id: "packages/adapters", + label: "Database Adapters" + }, + { + type: "doc", + id: "packages/clients", + label: "Client Packages" + }, + { + type: "doc", + id: "packages/agent", + label: "Agent Package" + }, + { + type: "doc", + id: "packages/plugins", + label: "Plugin System" + } ], }, - ], + { + type: "category", + label: "👥 Community", + collapsed: false, + items: [ + { + type: "doc", + id: "community/creator-fund", + label: "💰 Creator Fund", + }, + { + type: "category", + label: "📺 Stream Notes", + items: [ + { + type: "doc", + id: "community/stream-notes", + label: "Overview" + }, + { + type: "category", + label: "November 2024", + items: [ + { + type: "doc", + id: "community/streams/2024-11-08", + label: "X: Memes, AI Agents, and DAOs" + }, + { + type: "doc", + id: "community/streams/2024-11-06", + label: "Discord Development Stream" + } + ] + }, + { + type: "category", + label: "October 2024", + items: [ + { + type: "doc", + id: "community/streams/2024-10-29", + label: "X: AI Agents & Crypto" + }, + { + type: "doc", + id: "community/streams/2024-10-27", + label: "X: Building Autonomous Agents" + }, + { + type: "doc", + id: "community/streams/2024-10-25", + label: "X: Eliza Framework" + } + ] + } + ] + }, + { + type: "doc", + id: "community/changelog", + label: "📝 Changelog", + }, + { + type: "doc", + id: "community/faq", + label: "❓ FAQ", + }, + { + type: "doc", + id: "community/contributing", + label: "🤝 Contributing" + } + ] + } + ] }; export default sidebars; diff --git a/docs/sidebars1.js b/docs/sidebars1.js deleted file mode 100644 index e7adaa4a4a..0000000000 --- a/docs/sidebars1.js +++ /dev/null @@ -1,22 +0,0 @@ -/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ -const sidebars = { - tutorialSidebar: [ - { - type: "category", - label: "Getting Started", - items: ["intro", "quickstart", "installation"], - }, - { - type: "category", - label: "Guides", - items: [ - "guides/basic-usage", - "guides/configuration", - "guides/characterfile", - "guides/advanced", - ], - }, - ], -}; - -export default sidebars; diff --git a/docs/src/components/HomepageFeatures/index.js b/docs/src/components/HomepageFeatures/index.js index e5b4508f52..cab5a879a6 100644 --- a/docs/src/components/HomepageFeatures/index.js +++ b/docs/src/components/HomepageFeatures/index.js @@ -4,53 +4,59 @@ import styles from "./styles.module.css"; const FeatureList = [ { - title: "Made By Users", + icon: "🤖", + title: "Multi-Agent Framework", description: ( <> - eliza is open source, community developed and designed to be and easy to - use. + Build and deploy autonomous AI agents with consistent + personalities across Discord, Twitter, and Telegram. Full support for + voice, text, and media interactions. ), }, { - title: "Just Works", + icon: "🧠", + title: "Advanced Capabilities", description: ( <> - Simple, tested, used in production. Configurable enough, batteries - included. + Built-in RAG memory system, document processing, media analysis, and + autonomous trading capabilities. Supports multiple AI models including + Llama, GPT-4, and Claude. ), }, { - title: "For a Better World", + icon: "🔌", + title: "Extensible Design", description: ( <> - If you have ideas for how to make better agents for everyone,{" "} - let's do it together. + Create custom actions, add new platform integrations, and extend + functionality through a modular plugin system. Full TypeScript + support. ), }, ]; -function Feature({ Svg, title, description }) { +function Feature({ icon, title, description }) { return ( -
+
- {/*
- -
*/} -
- {title} +
+ {icon} + + {title} +

{description}

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

{siteConfig.tagline}

-
-
- ); -} +import HomepageHeader from "../components/HomepageHeader"; export default function Home() { const { siteConfig } = useDocusaurusContext(); return ( -
diff --git a/docs/static/img/favicon.ico b/docs/static/img/favicon.ico index cc99810a03..7bc84ea064 100644 Binary files a/docs/static/img/favicon.ico and b/docs/static/img/favicon.ico differ diff --git a/package.json b/package.json index 282297c4c2..808745a33b 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ } }, "engines": { - "node": ">=22" + "node": ">=23" }, "dependencies": { "ollama-ai-provider": "^0.16.1", diff --git a/packages/agent/src/index.ts b/packages/agent/src/index.ts index 221b7d93e6..3c773fc29e 100644 --- a/packages/agent/src/index.ts +++ b/packages/agent/src/index.ts @@ -306,7 +306,6 @@ const rl = readline.createInterface({ }); async function handleUserInput(input, agentId) { - console.log("handleUserInput", input, agentId); if (input.toLowerCase() === "exit") { rl.close(); return; diff --git a/packages/client-direct/src/index.ts b/packages/client-direct/src/index.ts index 66376a576c..2f28f05bdb 100644 --- a/packages/client-direct/src/index.ts +++ b/packages/client-direct/src/index.ts @@ -129,7 +129,6 @@ export class DirectClient { this.app.post( "/:agentId/message", async (req: express.Request, res: express.Response) => { - console.log("DirectClient message"); const agentId = req.params.agentId; const roomId = stringToUuid( req.body.roomId ?? "default-room-" + agentId diff --git a/packages/client-discord/src/actions/download_media.ts b/packages/client-discord/src/actions/download_media.ts index 90edac1737..48a69117cc 100644 --- a/packages/client-discord/src/actions/download_media.ts +++ b/packages/client-discord/src/actions/download_media.ts @@ -10,6 +10,7 @@ import { IVideoService, Memory, ModelClass, + Service, ServiceType, State, } from "@ai16z/eliza/src/types.ts"; @@ -85,9 +86,9 @@ export default { options: any, callback: HandlerCallback ) => { - const videoService = runtime.getService( - ServiceType.VIDEO - ); + const videoService = runtime + .getService(ServiceType.VIDEO) + .getInstance(); if (!state) { state = (await runtime.composeState(message)) as State; } diff --git a/packages/client-discord/src/attachments.ts b/packages/client-discord/src/attachments.ts index 4b6e7ba5e5..15c03164bb 100644 --- a/packages/client-discord/src/attachments.ts +++ b/packages/client-discord/src/attachments.ts @@ -8,6 +8,7 @@ import { IVideoService, Media, ModelClass, + Service, ServiceType, } from "@ai16z/eliza/src/types.ts"; import { Attachment, Collection } from "discord.js"; @@ -102,8 +103,8 @@ export class AttachmentManager { media = await this.processImageAttachment(attachment); } else if ( attachment.contentType?.startsWith("video/") || - this.runtime - .getService(ServiceType.VIDEO) + this.runtime.getService(ServiceType.VIDEO) + .getInstance() .isVideoUrl(attachment.url) ) { media = await this.processVideoAttachment(attachment); @@ -136,7 +137,8 @@ export class AttachmentManager { } const transcription = await this.runtime - .getService(ServiceType.TRANSCRIPTION) + .getService(ServiceType.TRANSCRIPTION) + .getInstance() .transcribeAttachment(audioBuffer); const { title, description } = await generateSummary( this.runtime, @@ -217,7 +219,8 @@ export class AttachmentManager { const response = await fetch(attachment.url); const pdfBuffer = await response.arrayBuffer(); const text = await this.runtime - .getService(ServiceType.PDF) + .getService(ServiceType.PDF) + .getInstance() .convertPdfToText(Buffer.from(pdfBuffer)); const { title, description } = await generateSummary( this.runtime, @@ -285,9 +288,8 @@ export class AttachmentManager { ): Promise { try { const { description, title } = await this.runtime - .getService( - ServiceType.IMAGE_DESCRIPTION - ) + .getService(ServiceType.IMAGE_DESCRIPTION) + .getInstance() .describeImage(attachment.url); return { id: attachment.id, @@ -321,11 +323,13 @@ export class AttachmentManager { ): Promise { if ( this.runtime - .getService(ServiceType.VIDEO) + .getService(ServiceType.VIDEO) + .getInstance() .isVideoUrl(attachment.url) ) { const videoInfo = await this.runtime - .getService(ServiceType.VIDEO) + .getService(ServiceType.VIDEO) + .getInstance() .processVideo(attachment.url); return { id: attachment.id, diff --git a/packages/client-discord/src/index.ts b/packages/client-discord/src/index.ts index eda359bae0..f1577f21f9 100644 --- a/packages/client-discord/src/index.ts +++ b/packages/client-discord/src/index.ts @@ -73,6 +73,7 @@ export class DiscordClient extends EventEmitter { this.runtime.registerAction(transcribe_media); this.runtime.registerAction(download_media); + this.runtime.providers.push(channelStateProvider); this.runtime.providers.push(voiceStateProvider); } diff --git a/packages/client-discord/src/messages.ts b/packages/client-discord/src/messages.ts index 349f57160b..4d233f658d 100644 --- a/packages/client-discord/src/messages.ts +++ b/packages/client-discord/src/messages.ts @@ -36,6 +36,7 @@ import { import { elizaLogger } from "@ai16z/eliza/src/logger.ts"; import { AttachmentManager } from "./attachments.ts"; import { VoiceManager } from "./voice.ts"; +import { Service } from "@ai16z/eliza"; const MAX_MESSAGE_LENGTH = 1900; async function generateSummary( @@ -340,7 +341,7 @@ export class MessageManager { if ( message.interaction || message.author.id === - this.client.user?.id /* || message.author?.bot*/ + this.client.user?.id /* || message.author?.bot*/ ) return; const userId = message.author.id as UUID; @@ -388,10 +389,10 @@ export class MessageManager { url: message.url, inReplyTo: message.reference?.messageId ? stringToUuid( - message.reference.messageId + - "-" + - this.runtime.agentId - ) + message.reference.messageId + + "-" + + this.runtime.agentId + ) : undefined, }; @@ -502,10 +503,11 @@ export class MessageManager { } if (message.channel.type === ChannelType.GuildVoice) { // For voice channels, use text-to-speech - const audioStream = await this.runtime - .getService( + const audioStream = await ( + this.runtime.getService( ServiceType.SPEECH_GENERATION ) + ).getInstance() .generate(this.runtime, content.text); await this.voiceManager.playAudioStream( userId, @@ -592,7 +594,8 @@ export class MessageManager { // For voice channels, use text-to-speech for the error message const errorMessage = "Sorry, I had a glitch. What was that?"; const audioStream = await this.runtime - .getService(ServiceType.SPEECH_GENERATION) + .getService(ServiceType.SPEECH_GENERATION) + .getInstance() .generate(this.runtime, errorMessage); await this.voiceManager.playAudioStream(userId, audioStream); } else { @@ -656,13 +659,14 @@ export class MessageManager { for (const url of urls) { if ( - this.runtime - .getService(ServiceType.VIDEO) + this.runtime.getService(ServiceType.VIDEO) + .getInstance() .isVideoUrl(url) ) { - const videoInfo = await this.runtime - .getService(ServiceType.VIDEO) - .processVideo(url); + const videoInfo = await (this.runtime + .getService(ServiceType.VIDEO) + .getInstance() + .processVideo(url)); attachments.push({ id: `youtube-${Date.now()}`, url: url, @@ -673,7 +677,8 @@ export class MessageManager { }); } else { const { title, bodyContent } = await this.runtime - .getService(ServiceType.BROWSER) + .getService(ServiceType.BROWSER) + .getInstance() .getPageContent(url, this.runtime); const { title: newTitle, description } = await generateSummary( this.runtime, diff --git a/packages/client-discord/src/voice.ts b/packages/client-discord/src/voice.ts index 6098592592..744a8106b8 100644 --- a/packages/client-discord/src/voice.ts +++ b/packages/client-discord/src/voice.ts @@ -31,6 +31,7 @@ import { ITranscriptionService, Memory, ModelClass, + Service, ServiceType, State, UUID, @@ -399,9 +400,8 @@ export class VoiceManager extends EventEmitter { console.log("starting transcription"); const text = await this.runtime - .getService( - ServiceType.TRANSCRIPTION - ) + .getService(ServiceType.TRANSCRIPTION) + .getInstance() .transcribe(wavBuffer); console.log("transcribed text: ", text); transcriptionText += text; @@ -541,9 +541,8 @@ export class VoiceManager extends EventEmitter { state ); const responseStream = await this.runtime - .getService( - ServiceType.SPEECH_GENERATION - ) + .getService(ServiceType.SPEECH_GENERATION) + .getInstance() .generate(this.runtime, content.text); if (responseStream) { diff --git a/packages/client-twitter/src/base.ts b/packages/client-twitter/src/base.ts index 9279816ea7..12adf70eda 100644 --- a/packages/client-twitter/src/base.ts +++ b/packages/client-twitter/src/base.ts @@ -218,7 +218,8 @@ export class ClientBase extends EventEmitter { await this.twitterClient.login( this.runtime.getSetting("TWITTER_USERNAME"), this.runtime.getSetting("TWITTER_PASSWORD"), - this.runtime.getSetting("TWITTER_EMAIL") + this.runtime.getSetting("TWITTER_EMAIL"), + this.runtime.getSetting("TWITTER_2FA_SECRET") ); console.log("Logged in to Twitter"); const cookies = await this.twitterClient.getCookies(); @@ -240,7 +241,8 @@ export class ClientBase extends EventEmitter { await this.twitterClient.login( this.runtime.getSetting("TWITTER_USERNAME"), this.runtime.getSetting("TWITTER_PASSWORD"), - this.runtime.getSetting("TWITTER_EMAIL") + this.runtime.getSetting("TWITTER_EMAIL"), + this.runtime.getSetting("TWITTER_2FA_SECRET") ); const cookies = await this.twitterClient.getCookies(); @@ -258,7 +260,7 @@ export class ClientBase extends EventEmitter { await new Promise((resolve) => setTimeout(resolve, 10000)); try { return await this.twitterClient.getUserIdByScreenName( - this.runtime.getSetting("TWITTER_USERNAME") + this.runtime.getSetting("TWITTER_USERNAME"), ); } catch (error) { console.error("Error getting user ID:", error); diff --git a/packages/client-twitter/src/post.ts b/packages/client-twitter/src/post.ts index 055aae2de3..d4e9421855 100644 --- a/packages/client-twitter/src/post.ts +++ b/packages/client-twitter/src/post.ts @@ -33,8 +33,8 @@ export class TwitterPostClient extends ClientBase { this.generateNewTweet(); setTimeout( generateNewTweetLoop, - (Math.floor(Math.random() * (20 - 2 + 1)) + 2) * 60 * 1000 - ); // Random interval between 4-8 hours + (Math.floor(Math.random() * (4 - 1 + 1)) + 1) * 60 * 60 * 1000 + ); // Random interval between 1 and 4 hours }; // setTimeout(() => { generateNewTweetLoop(); diff --git a/packages/client-twitter/src/search.ts b/packages/client-twitter/src/search.ts index 8ac4c88bf1..0a38793200 100644 --- a/packages/client-twitter/src/search.ts +++ b/packages/client-twitter/src/search.ts @@ -237,9 +237,8 @@ export class TwitterSearchClient extends ClientBase { const imageDescriptions = []; for (const photo of selectedTweet.photos) { const description = await this.runtime - .getService( - ServiceType.IMAGE_DESCRIPTION - ) + .getService(ServiceType.IMAGE_DESCRIPTION) + .getInstance() .describeImage(photo.url); imageDescriptions.push(description); } diff --git a/packages/core/src/embedding.ts b/packages/core/src/embedding.ts index 13bd64f508..e212558875 100644 --- a/packages/core/src/embedding.ts +++ b/packages/core/src/embedding.ts @@ -97,8 +97,6 @@ export async function embed(runtime: IAgentRuntime, input: string) { throw new Error("No embedding model configured"); } - console.log("embeddingModel", embeddingModel); - // Try local embedding first if ( runtime.character.modelProvider !== ModelProviderName.OPENAI && diff --git a/packages/core/src/generation.ts b/packages/core/src/generation.ts index dc01e535e1..07909847b2 100644 --- a/packages/core/src/generation.ts +++ b/packages/core/src/generation.ts @@ -2,7 +2,7 @@ import { createAnthropic } from "@ai-sdk/anthropic"; import { createGroq } from "@ai-sdk/groq"; import { createOpenAI } from "@ai-sdk/openai"; import { getModel } from "./models.ts"; -import { IImageDescriptionService, ModelClass } from "./types.ts"; +import { IImageDescriptionService, ModelClass, Service } from "./types.ts"; import { generateText as aiGenerateText } from "ai"; import { Buffer } from "buffer"; import { createOllama } from "ollama-ai-provider"; @@ -199,9 +199,8 @@ export async function generateText({ "Using local Llama model for text completion." ); response = await runtime - .getService( - ServiceType.TEXT_GENERATION - ) + .getService(ServiceType.TEXT_GENERATION) + .getInstance() .queueTextCompletion( context, temperature, @@ -741,7 +740,8 @@ export const generateCaption = async ( }> => { const { imageUrl } = data; const resp = await runtime - .getService(ServiceType.IMAGE_DESCRIPTION) + .getService(ServiceType.IMAGE_DESCRIPTION) + .getInstance() .describeImage(imageUrl); return { title: resp.title.trim(), diff --git a/packages/core/src/memory.ts b/packages/core/src/memory.ts index 298c17543d..6187e536a7 100644 --- a/packages/core/src/memory.ts +++ b/packages/core/src/memory.ts @@ -159,8 +159,6 @@ export class MemoryManager implements IMemoryManager { const existingMessage = await this.runtime.databaseAdapter.getMemoryById(memory.id); - console.log("existingMessage", existingMessage); - if (existingMessage) { console.log("Memory already exists, skipping"); return; diff --git a/packages/core/src/runtime.ts b/packages/core/src/runtime.ts index 0beb43a848..5e5fd5891d 100644 --- a/packages/core/src/runtime.ts +++ b/packages/core/src/runtime.ts @@ -150,13 +150,13 @@ export class AgentRuntime implements IAgentRuntime { return this.memoryManagers.get(tableName) || null; } - getService(service: ServiceType): T | null { + getService(service: ServiceType): typeof Service | null { const serviceInstance = this.services.get(service); if (!serviceInstance) { console.error(`Service ${service} not found`); return null; } - return serviceInstance as T; + return serviceInstance as typeof Service; } registerService(service: Service): void { const serviceType = (service as typeof Service).serviceType; @@ -499,7 +499,6 @@ export class AgentRuntime implements IAgentRuntime { * @returns The results of the evaluation. */ async evaluate(message: Memory, state?: State, didRespond?: boolean) { - console.log("Evaluate: ", didRespond); const evaluatorPromises = this.evaluators.map( async (evaluator: Evaluator) => { console.log("Evaluating", evaluator.name); @@ -897,8 +896,6 @@ Text: ${attachment.text} async function getKnowledge(runtime: AgentRuntime, message: Memory): Promise { const embedding = await embed(runtime, message.content.text); - console.log("message.agentId", message.agentId) - const memories = await runtime.knowledgeManager.searchMemoriesByEmbedding( embedding, { diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 7d61a241f5..040b743a68 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -536,7 +536,7 @@ export interface IAgentRuntime { getMemoryManager(name: string): IMemoryManager | null; - getService(service: string): Service | null; + getService(service: string): typeof Service | null; registerService(service: Service): void; diff --git a/packages/plugin-bootstrap/src/providers/facts.ts b/packages/plugin-bootstrap/src/providers/facts.ts index e335f1baf7..241e581854 100644 --- a/packages/plugin-bootstrap/src/providers/facts.ts +++ b/packages/plugin-bootstrap/src/providers/facts.ts @@ -20,9 +20,6 @@ const factsProvider: Provider = { const embedding = await embed(runtime, recentMessages); - console.log("embedding", embedding); - console.log("embedding length", embedding.length); - const memoryManager = new MemoryManager({ runtime, tableName: "facts", diff --git a/packages/plugin-image-generation/src/index.ts b/packages/plugin-image-generation/src/index.ts index 22aa577ed8..e05c779832 100644 --- a/packages/plugin-image-generation/src/index.ts +++ b/packages/plugin-image-generation/src/index.ts @@ -9,9 +9,34 @@ import { } from "@ai16z/eliza/src/types.ts"; import { generateCaption, generateImage } from "@ai16z/eliza/src/generation.ts"; +import fs from 'fs'; +import path from 'path'; + +export function saveBase64Image(base64Data: string, filename: string): string { + // Create generatedImages directory if it doesn't exist + const imageDir = path.join(process.cwd(), 'generatedImages'); + if (!fs.existsSync(imageDir)) { + fs.mkdirSync(imageDir, { recursive: true }); + } + + // Remove the data:image/png;base64 prefix if it exists + const base64Image = base64Data.replace(/^data:image\/\w+;base64,/, ''); + + // Create a buffer from the base64 string + const imageBuffer = Buffer.from(base64Image, 'base64'); + + // Create full file path + const filepath = path.join(imageDir, `${filename}.png`); + + // Save the file + fs.writeFileSync(filepath, imageBuffer); + + return filepath; +} + const imageGeneration: Action = { name: "GENERATE_IMAGE", - similes: ["IMAGE_GENERATION", "IMAGE_GEN", "CREATE_IMAGE", "MAKE_PICTURE"], + similes: ["IMAGE_GENERATION", "IMAGE_GEN", "CREATE_IMAGE", "MAKE_PICTURE",], description: "Generate an image to go along with the message.", validate: async (runtime: IAgentRuntime, message: Memory) => { const anthropicApiKeyOk = !!runtime.getSetting("ANTHROPIC_API_KEY"); @@ -58,36 +83,62 @@ const imageGeneration: Action = { ); for (let i = 0; i < images.data.length; i++) { const image = images.data[i]; - elizaLogger.log(`Processing image ${i + 1}:`, image); + + const base64Image = images.data[i]; + // Save the image and get filepath + const filename = `generated_${Date.now()}_${i}`; + const filepath = saveBase64Image(base64Image, filename); + elizaLogger.log(`Processing image ${i + 1}:`, filename); - const caption = await generateCaption( + //just dont even add a caption or a description just have it generate & send + /* + try { + const imageService = runtime.getService(ServiceType.IMAGE_DESCRIPTION); + if (imageService && typeof imageService.describeImage === 'function') { + const caption = await imageService.describeImage({ imageUrl: filepath }); + captionText = caption.description; + captionTitle = caption.title; + } + } catch (error) { + elizaLogger.error("Caption generation failed, using default caption:", error); + }*/ + + const caption = "..."; + /*= await generateCaption( { imageUrl: image, }, runtime - ); + );*/ + + res.push({ image: filepath, caption: "..."});//caption.title }); elizaLogger.log( `Generated caption for image ${i + 1}:`, - caption.title + "..."//caption.title ); - res.push({ image: image, caption: caption.title }); + //res.push({ image: image, caption: caption.title }); callback( { - text: caption.description, + text: "...",//caption.description, attachments: [ { id: crypto.randomUUID(), - url: image, + url: filepath, title: "Generated image", source: "imageGeneration", - description: caption.title, - text: caption.description, + description: "...",//caption.title, + text: "...",//caption.description, }, ], }, - [] + [ + { + attachment: filepath, + name: `${filename}.png` + } + ] ); } } else { diff --git a/packages/plugin-node/src/services/video.ts b/packages/plugin-node/src/services/video.ts index 6e1ef6fe46..6aa1b91e52 100644 --- a/packages/plugin-node/src/services/video.ts +++ b/packages/plugin-node/src/services/video.ts @@ -328,7 +328,8 @@ export class VideoService extends Service { console.log("Starting transcription..."); const startTime = Date.now(); const transcript = await runtime - .getService(ServiceType.TRANSCRIPTION) + .getService(ServiceType.TRANSCRIPTION) + .getInstance() .transcribe(audioBuffer); const endTime = Date.now(); console.log( diff --git a/packages/plugin-solana/src/actions/pumpfun.ts b/packages/plugin-solana/src/actions/pumpfun.ts index a6453cbc63..ab49821ee0 100644 --- a/packages/plugin-solana/src/actions/pumpfun.ts +++ b/packages/plugin-solana/src/actions/pumpfun.ts @@ -1,5 +1,6 @@ import { AnchorProvider } from "@coral-xyz/anchor"; import { Wallet } from "@coral-xyz/anchor"; +import { generateImage } from "@ai16z/eliza/src/generation.ts"; import { Connection, Keypair, PublicKey } from "@solana/web3.js"; import { CreateTokenMetadata, @@ -14,40 +15,53 @@ import settings from "@ai16z/eliza/src/settings.ts"; import { ActionExample, Content, + HandlerCallback, IAgentRuntime, Memory, + ModelClass, + State, type Action, } from "@ai16z/eliza/src/types.ts"; +import { composeContext } from "@ai16z/eliza/src/context.ts"; +import { generateObject } from "@ai16z/eliza/src/generation.ts"; + +import { + walletProvider, + //WalletProvider, +} from "../providers/wallet.ts"; + +import { bs58 } from "@coral-xyz/anchor/dist/cjs/utils/bytes/index.js"; + export interface CreateAndBuyContent extends Content { - deployerPrivateKey: string; - tokenMetadata: CreateTokenMetadata; - buyAmountSol: string | number; - priorityFee: { - unitLimit: number; - unitPrice: number; + tokenMetadata: { + name: string; + symbol: string; + description: string; + image_description: string; }; - allowOffCurve: boolean; + buyAmountSol: string | number; } + export function isCreateAndBuyContent( runtime: IAgentRuntime, content: any ): content is CreateAndBuyContent { + console.log("Content for create & buy", content) return ( - typeof content.deployerPrivateKey === "string" && typeof content.tokenMetadata === "object" && content.tokenMetadata !== null && + typeof content.tokenMetadata.name === "string" && + typeof content.tokenMetadata.symbol === "string" && + typeof content.tokenMetadata.description === "string" && + typeof content.tokenMetadata.image_description === "string" && (typeof content.buyAmountSol === "string" || - typeof content.buyAmountSol === "number") && - typeof content.priorityFee === "object" && - content.priorityFee !== null && - typeof content.priorityFee.unitLimit === "number" && - typeof content.priorityFee.unitPrice === "number" && - typeof content.allowOffCurve === "boolean" + typeof content.buyAmountSol === "number") ); } + export const createAndBuyToken = async ({ deployer, mint, @@ -88,6 +102,9 @@ export const createAndBuyToken = async ({ priorityFee, commitment ); + + console.log("Create Results: ", createResults); + if (createResults.success) { console.log( "Success:", @@ -111,9 +128,21 @@ export const createAndBuyToken = async ({ } else { console.log(`${deployer.publicKey.toBase58()}:`, amount); } + + return { + success: true, + ca: mint.publicKey.toBase58(), + creator: deployer.publicKey.toBase58() + }; + } else { console.log("Create and Buy failed"); - } + return { + success: false, + ca: mint.publicKey.toBase58(), + error: createResults.error || "Transaction failed" + }; + } }; export const buyToken = async ({ @@ -213,6 +242,7 @@ export const sellToken = async ({ }; const promptConfirmation = async (): Promise => { + return true; if (typeof window !== "undefined" && typeof window.confirm === "function") { return window.confirm( "Confirm the creation and purchase of the token?" @@ -221,76 +251,247 @@ const promptConfirmation = async (): Promise => { return true; }; +// Save the base64 data to a file +import * as fs from 'fs'; +import * as path from 'path'; + + +const pumpfunTemplate = `Respond with a JSON markdown block containing only the extracted values. Use null for any values that cannot be determined. + +Example response: +\`\`\`json +{ + "tokenMetadata": { + "name": "Test Token", + "symbol": "TEST", + "description": "A test token", + "image_description": "create an image of a rabbit" + }, + "buyAmountSol": "0.00069" +} +\`\`\` + +{{recentMessages}} + +Given the recent messages, extract or generate (come up with if not included) the following information about the requested token creation: +- Token name +- Token symbol +- Token description +- Token image description +- Amount of SOL to buy + +Respond with a JSON markdown block containing only the extracted values.`; + + + export default { name: "CREATE_AND_BUY_TOKEN", similes: ["CREATE_AND_PURCHASE_TOKEN", "DEPLOY_AND_BUY_TOKEN"], validate: async (runtime: IAgentRuntime, message: Memory) => { - return isCreateAndBuyContent(runtime, message.content); + + return true;//return isCreateAndBuyContent(runtime, message.content); }, description: "Create a new token and buy a specified amount using SOL. Requires deployer private key, token metadata, buy amount in SOL, priority fee, and allowOffCurve flag.", - handler: async ( - runtime: IAgentRuntime, - message: Memory - ): Promise => { - const content = message.content; - if (!isCreateAndBuyContent(runtime, content)) { - console.error("Invalid content for CREATE_AND_BUY_TOKEN action."); - return false; - } - const { - deployerPrivateKey, - tokenMetadata, - buyAmountSol, - priorityFee, - allowOffCurve, - } = content; - - const privateKey = runtime.getSetting("WALLET_PRIVATE_KEY")!; - const wallet = new Wallet( - Keypair.fromSecretKey(new Uint8Array(JSON.parse(privateKey))) - ); - const connection = new Connection(settings.RPC_URL!); - const provider = new AnchorProvider(connection, wallet, { - commitment: "finalized", - }); - const sdk = new PumpFunSDK(provider); - const slippage = runtime.getSetting("SLIPPAGE"); - - try { - const deployerKeypair = Keypair.fromSecretKey( - Uint8Array.from(Buffer.from(deployerPrivateKey, "base64")) - ); + handler: async ( + runtime: IAgentRuntime, + message: Memory, + state: State, + _options: { [key: string]: unknown }, + callback?: HandlerCallback + ): Promise => { + console.log("Starting CREATE_AND_BUY_TOKEN handler..."); + + // Compose state if not provided + if (!state) { + state = (await runtime.composeState(message)) as State; + } else { + state = await runtime.updateRecentMessageState(state); + } + + // Get wallet info for context + const walletInfo = await walletProvider.get(runtime, message, state); + state.walletInfo = walletInfo; + + // Generate structured content from natural language + const pumpContext = composeContext({ + state, + template: pumpfunTemplate, + }); + + const content = await generateObject({ + runtime, + context: pumpContext, + modelClass: ModelClass.LARGE, + }); + + // Validate the generated content + if (!isCreateAndBuyContent(runtime, content)) { + console.error("Invalid content for CREATE_AND_BUY_TOKEN action."); + return false; + } + + const { tokenMetadata, buyAmountSol } = content; + /* + // Generate image if tokenMetadata.file is empty or invalid + if (!tokenMetadata.file || tokenMetadata.file.length < 100) { // Basic validation + try { + const imageResult = await generateImage({ + prompt: `logo for ${tokenMetadata.name} (${tokenMetadata.symbol}) token - ${tokenMetadata.description}`, + width: 512, + height: 512, + count: 1 + }, runtime); + + if (imageResult.success && imageResult.data && imageResult.data.length > 0) { + // Remove the "data:image/png;base64," prefix if present + tokenMetadata.file = imageResult.data[0].replace(/^data:image\/[a-z]+;base64,/, ''); + } else { + console.error("Failed to generate image:", imageResult.error); + return false; + } + } catch (error) { + console.error("Error generating image:", error); + return false; + } + } */ - const mintKeypair = Keypair.generate(); + const imageResult = await generateImage({ + prompt: `logo for ${tokenMetadata.name} (${tokenMetadata.symbol}) token - ${tokenMetadata.description}`, + width: 256, + height: 256, + count: 1 + }, runtime); - const createAndBuyConfirmation = await promptConfirmation(); - if (!createAndBuyConfirmation) { - console.log("Create and buy token canceled by user"); - return false; + + tokenMetadata.image_description = imageResult.data[0].replace(/^data:image\/[a-z]+;base64,/, ''); + + + + + // Convert base64 string to Blob + const base64Data = tokenMetadata.image_description; + const outputPath = path.join(process.cwd(), `generated_image_${Date.now()}.txt`); + fs.writeFileSync(outputPath, base64Data); + console.log(`Base64 data saved to: ${outputPath}`); + + + const byteCharacters = atob(base64Data); + const byteNumbers = new Array(byteCharacters.length); + for (let i = 0; i < byteCharacters.length; i++) { + byteNumbers[i] = byteCharacters.charCodeAt(i); } + const byteArray = new Uint8Array(byteNumbers); + const blob = new Blob([byteArray], { type: 'image/png' }); + + // Add the default decimals and convert file to Blob + const fullTokenMetadata: CreateTokenMetadata = { + name: tokenMetadata.name, + symbol: tokenMetadata.symbol, + description: tokenMetadata.description, + file: blob, + }; - // Execute Create and Buy - await createAndBuyToken({ - deployer: deployerKeypair, - mint: mintKeypair, - tokenMetadata: tokenMetadata as CreateTokenMetadata, - buyAmountSol: BigInt(buyAmountSol), - priorityFee: priorityFee as PriorityFee, - allowOffCurve: allowOffCurve as boolean, - sdk, - connection, - slippage, - }); + // Default priority fee for high network load + const priorityFee = { + unitLimit: 100_000_000, + unitPrice: 100_000 + }; + const slippage = "2000" + try { + // Get private key from settings and create deployer keypair + const privateKeyString = runtime.getSetting("WALLET_PRIVATE_KEY")!; + const secretKey = bs58.decode(privateKeyString); + const deployerKeypair = Keypair.fromSecretKey(secretKey); - console.log( - `Token created and purchased successfully! View at: https://pump.fun/${mintKeypair.publicKey.toBase58()}` - ); - return true; - } catch (error) { - console.error("Error during create and buy token:", error); - return false; - } + // Generate new mint keypair + const mintKeypair = Keypair.generate(); + console.log(`Generated mint address: ${mintKeypair.publicKey.toBase58()}`); + + // Setup connection and SDK + const connection = new Connection(settings.RPC_URL!, { + commitment: "confirmed", + confirmTransactionInitialTimeout: 500000, // 120 seconds + wsEndpoint: settings.RPC_URL!.replace('https', 'wss') + }); + + const wallet = new Wallet(deployerKeypair); + const provider = new AnchorProvider(connection, wallet, { + commitment: "finalized" + }); + const sdk = new PumpFunSDK(provider); + // const slippage = runtime.getSetting("SLIPPAGE"); + + + const createAndBuyConfirmation = await promptConfirmation(); + if (!createAndBuyConfirmation) { + console.log("Create and buy token canceled by user"); + return false; + } + + // Convert SOL to lamports (1 SOL = 1_000_000_000 lamports) + const lamports = Math.floor(Number(buyAmountSol) * 1_000_000_000); + + console.log("Executing create and buy transaction..."); + const result = await createAndBuyToken({ + deployer: deployerKeypair, + mint: mintKeypair, + tokenMetadata: fullTokenMetadata, + buyAmountSol: BigInt(lamports), + priorityFee, + allowOffCurve: false, + sdk, + connection, + slippage, + }); + + + if (callback) { + if (result.success) { + callback({ + text: `Token ${tokenMetadata.name} (${tokenMetadata.symbol}) created successfully!\nContract Address: ${result.ca}\nCreator: ${result.creator}\nView at: https://pump.fun/${result.ca}`, + content: { + tokenInfo: { + symbol: tokenMetadata.symbol, + address: result.ca, + creator: result.creator, + name: tokenMetadata.name, + description: tokenMetadata.description, + timestamp: Date.now() + } + } + }); + } else { + callback({ + text: `Failed to create token: ${result.error}\nAttempted mint address: ${result.ca}`, + content: { + error: result.error, + mintAddress: result.ca + } + }); + } + } + //await trustScoreDb.addToken(tokenInfo); + /* + // Update runtime state + await runtime.updateState({ + ...state, + lastCreatedToken: tokenInfo + }); + */ + // Log success message with token view URL + const successMessage = `Token created and purchased successfully! View at: https://pump.fun/${mintKeypair.publicKey.toBase58()}`; + console.log(successMessage); + return result.success; + } catch (error) { + if (callback) { + callback({ + text: `Error during token creation: ${error.message}`, + content: { error: error.message } + }); + } + return false; + } }, examples: [ @@ -298,32 +499,27 @@ export default { { user: "{{user1}}", content: { - deployerPrivateKey: "Base64EncodedPrivateKey", - tokenMetadata: { - name: "MyToken", - symbol: "MTK", - description: "My first token", - file: "Base64EncodedFile", // blob file of the image - decimals: DEFAULT_DECIMALS, - }, - buyAmountSol: "1000000000", // 1 SOL in lamports - priorityFee: 1000, - allowOffCurve: false, - }, + text: "Create a new token called GLITCHIZA with symbol GLITCHIZA and generate a description about it. Also come up with a description for it to use for image generation .buy 0.00069 SOL worth." + } }, { user: "{{user2}}", content: { - text: "Creating and buying 1 SOL worth of MyToken...", + text: "Token GLITCHIZA (GLITCHIZA) created successfully!\nContract Address: 3kD5DN4bbA3nykb1abjS66VF7cYZkKdirX8bZ6ShJjBB\nCreator: 9jW8FPr6BSSsemWPV22UUCzSqkVdTp6HTyPqeqyuBbCa\nView at: https://pump.fun/EugPwuZ8oUMWsYHeBGERWvELfLGFmA1taDtmY8uMeX6r", action: "CREATE_AND_BUY_TOKEN", - }, - }, - { - user: "{{user2}}", - content: { - text: "Token created and purchased successfully! View at: https://pump.fun/MintPublicKey", - }, - }, - ], - ] as ActionExample[][], + content: { + tokenInfo: { + symbol: "GLITCHIZA", + address: "EugPwuZ8oUMWsYHeBGERWvELfLGFmA1taDtmY8uMeX6r", + creator: "9jW8FPr6BSSsemWPV22UUCzSqkVdTp6HTyPqeqyuBbCa", + name: "GLITCHIZA", + description: "A GLITCHIZA token" + } + } + } + } + ] + ] as ActionExample[][] + + , } as Action; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e55a04510a..d64fef99e6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10461,8 +10461,8 @@ packages: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} - streamx@2.20.1: - resolution: {integrity: sha512-uTa0mU6WUC65iUvzKH4X9hEdvSW7rbPxPtwfWiLMSj3qTdQbAiUboZTxauKfpFuGIGa1C2BYijZ7wgdUXICJhA==} + streamx@2.20.2: + resolution: {integrity: sha512-aDGDLU+j9tJcUdPGOaHmVF1u/hhI+CsGkT02V3OKlHDV7IukOI+nTWAGkiZEKCO35rWN1wIr4tS7YFr1f4qSvA==} string-argv@0.3.2: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} @@ -16797,7 +16797,7 @@ snapshots: bare-stream@2.3.2: dependencies: - streamx: 2.20.1 + streamx: 2.20.2 optional: true base-x@3.0.10: @@ -24231,7 +24231,7 @@ snapshots: streamsearch@1.1.0: {} - streamx@2.20.1: + streamx@2.20.2: dependencies: fast-fifo: 1.3.2 queue-tick: 1.0.1 @@ -24444,7 +24444,7 @@ snapshots: dependencies: b4a: 1.6.7 fast-fifo: 1.3.2 - streamx: 2.20.1 + streamx: 2.20.2 tar@6.2.1: dependencies: diff --git a/scripts/build.sh b/scripts/build.sh index e94f5d1e50..51292d99c2 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,5 +1,14 @@ #!/bin/bash +# Check Node.js version +REQUIRED_NODE_VERSION=23 +CURRENT_NODE_VERSION=$(node -v | cut -d'.' -f1 | sed 's/v//') + +if (( CURRENT_NODE_VERSION < REQUIRED_NODE_VERSION )); then + echo "Error: Node.js version must be $REQUIRED_NODE_VERSION or higher. Current version is $CURRENT_NODE_VERSION." + exit 1 +fi + # Navigate to the script's directory cd "$(dirname "$0")"/..