├── .env.example ├── .env.test ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── pull_request_template.md └── workflows │ ├── ci.yaml │ └── generate-changelog.yml ├── .gitignore ├── .npmrc ├── .prettierignore ├── .vscode ├── launch.json └── tasks.json ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── ROADMAP.md ├── docker-compose.yml ├── docker-entrypoint.sh ├── docs ├── .gitignore ├── .prettierrc.json ├── README.md ├── README_CN.md ├── api │ ├── classes │ │ ├── AgentRuntime.md │ │ ├── DatabaseAdapter.md │ │ ├── DirectClient.md │ │ ├── DiscordClient.md │ │ ├── MemoryManager.md │ │ ├── PostgresDatabaseAdapter.md │ │ ├── SqliteDatabaseAdapter.md │ │ ├── TelegramClient.md │ │ ├── TokenProvider.md │ │ ├── TwitterInteractionClient.md │ │ ├── TwitterPostClient.md │ │ ├── TwitterSearchClient.md │ │ └── WalletProvider.md │ ├── enumerations │ │ ├── Clients.md │ │ ├── GoalStatus.md │ │ ├── ImageGenModel.md │ │ ├── ModelClass.md │ │ └── ModelProvider.md │ ├── functions │ │ ├── addHeader.md │ │ ├── buyToken.md │ │ ├── composeActionExamples.md │ │ ├── composeContext.md │ │ ├── createAgentRuntime.md │ │ ├── createAndBuyToken.md │ │ ├── createDirectRuntime.md │ │ ├── createGoal.md │ │ ├── createRelationship.md │ │ ├── embed.md │ │ ├── formatActionNames.md │ │ ├── formatActions.md │ │ ├── formatActors.md │ │ ├── formatEvaluatorExampleDescriptions.md │ │ ├── formatEvaluatorExamples.md │ │ ├── formatEvaluatorNames.md │ │ ├── formatEvaluators.md │ │ ├── formatGoalsAsString.md │ │ ├── formatMessages.md │ │ ├── formatPosts.md │ │ ├── formatRelationships.md │ │ ├── formatTimestamp.md │ │ ├── generateCaption.md │ │ ├── generateImage.md │ │ ├── generateMessageResponse.md │ │ ├── generateObject.md │ │ ├── generateObjectArray.md │ │ ├── generateShouldRespond.md │ │ ├── generateText.md │ │ ├── generateTextArray.md │ │ ├── generateTrueOrFalse.md │ │ ├── getActorDetails.md │ │ ├── getEndpoint.md │ │ ├── getGoals.md │ │ ├── getImageGenModel.md │ │ ├── getModel.md │ │ ├── getProviders.md │ │ ├── getRelationship.md │ │ ├── getRelationships.md │ │ ├── getTokenForProvider.md │ │ ├── initializeClients.md │ │ ├── initializeDatabase.md │ │ ├── isCreateAndBuyContent.md │ │ ├── loadActionConfigs.md │ │ ├── loadCharacters.md │ │ ├── loadCustomActions.md │ │ ├── parseArguments.md │ │ ├── retrieveCachedEmbedding.md │ │ ├── sellToken.md │ │ ├── splitChunks.md │ │ ├── startDiscord.md │ │ ├── startTelegram.md │ │ ├── startTwitter.md │ │ ├── trimTokens.md │ │ └── updateGoal.md │ ├── index.md │ ├── interfaces │ │ ├── Account.md │ │ ├── Action.md │ │ ├── ActionExample.md │ │ ├── Actor.md │ │ ├── Content.md │ │ ├── ConversationExample.md │ │ ├── CreateAndBuyContent.md │ │ ├── EvaluationExample.md │ │ ├── Evaluator.md │ │ ├── Goal.md │ │ ├── IAgentRuntime.md │ │ ├── IBrowserService.md │ │ ├── IDatabaseAdapter.md │ │ ├── IImageRecognitionService.md │ │ ├── ILlamaService.md │ │ ├── IMemoryManager.md │ │ ├── IPdfService.md │ │ ├── ISpeechService.md │ │ ├── ITranscriptionService.md │ │ ├── IVideoService.md │ │ ├── Memory.md │ │ ├── MessageExample.md │ │ ├── Objective.md │ │ ├── Participant.md │ │ ├── Provider.md │ │ ├── Relationship.md │ │ ├── Room.md │ │ └── State.md │ ├── type-aliases │ │ ├── Character.md │ │ ├── Handler.md │ │ ├── HandlerCallback.md │ │ ├── Media.md │ │ ├── Model.md │ │ ├── Models.md │ │ ├── Plugin.md │ │ ├── UUID.md │ │ └── Validator.md │ ├── typedoc-sidebar.cjs │ └── variables │ │ ├── boredomProvider.md │ │ ├── continueAction.md │ │ ├── defaultActions.md │ │ ├── defaultCharacter.md │ │ ├── defaultEvaluators.md │ │ ├── defaultProviders.md │ │ ├── elizaLogger.md │ │ ├── embeddingDimension.md │ │ ├── embeddingZeroVector.md │ │ ├── evaluationTemplate.md │ │ ├── executeSwap.md │ │ ├── followRoom.md │ │ ├── ignore.md │ │ ├── imageGenModels.md │ │ ├── imageGeneration.md │ │ ├── messageHandlerTemplate.md │ │ ├── muteRoom.md │ │ ├── none.md │ │ ├── orderBookProvider.md │ │ ├── settings.md │ │ ├── shouldContinueTemplate.md │ │ ├── shouldFollowTemplate.md │ │ ├── shouldMuteTemplate.md │ │ ├── shouldUnmuteTemplate.md │ │ ├── timeProvider.md │ │ ├── tokenProvider.md │ │ ├── unfollowRoom.md │ │ ├── unmuteRoom.md │ │ └── walletProvider.md ├── babel.config.js ├── backup_docusaurus.config.js ├── docs │ ├── advanced │ │ ├── autonomous-trading.md │ │ ├── fine-tuning.md │ │ ├── infrastructure.md │ │ └── trust-engine.md │ ├── community │ │ ├── changelog.md │ │ ├── contributing.md │ │ ├── creator-fund.md │ │ ├── faq.md │ │ └── notes.md │ ├── core │ │ ├── actions.md │ │ ├── agents.md │ │ ├── characterfile.md │ │ ├── evaluators.md │ │ └── providers.md │ ├── guides │ │ ├── advanced.md │ │ ├── basic-usage.md │ │ ├── configuration.md │ │ ├── local-development.md │ │ └── secrets-management.md │ ├── installation.md │ ├── intro.md │ └── quickstart.md ├── docusaurus.config.js ├── package-lock.json ├── package.json ├── sidebars.api.js ├── sidebars.js ├── sidebars1.js ├── src │ ├── components │ │ └── HomepageFeatures │ │ │ ├── index.js │ │ │ └── styles.module.css │ ├── css │ │ └── custom.css │ └── pages │ │ ├── index.js │ │ ├── index.module.css │ │ └── markdown-page.md └── static │ ├── .nojekyll │ └── img │ ├── background.jpg │ ├── eliza_banner.jpg │ ├── favicon.ico │ └── logo.svg ├── elizaConfig.yaml ├── package-lock.json ├── package.json ├── packages ├── agent │ ├── .gitignore │ ├── imagecache │ │ ├── 062878d30f28cdbdaef710ab9469f793.png │ │ ├── 38ad5661c842ee35cc45a06fcac0649b.png │ │ └── ee9b8044253fff62e02ced9ffa7c05b8.png │ ├── package.json │ ├── src │ │ └── index.ts │ ├── temp │ │ ├── 039c4095-559d-4342-bf27-3a81c18c20ac.png │ │ ├── 047497bc-2c7a-4dc5-b25c-abf1b512488f.png │ │ ├── 0591ecce-6d60-4824-a78e-973af2a8232a.png │ │ ├── 08af9133-8bfe-493e-a5c0-c711b6276c21.png │ │ ├── 18dcd723-5e4c-4a3a-9a8d-4180812c95fc.png │ │ ├── 1c9bead3-78c9-475c-bfde-ddec33431a18.png │ │ ├── 2522dd96-ef54-4f95-b154-492b811b59e3.png │ │ ├── 305777ee-08da-447b-9f85-ce8102928261.png │ │ ├── 3e2e71f4-def4-477a-9153-ef3eb7c095d9.png │ │ ├── 3e88394e-07e3-49a1-b743-8c7268d91102.png │ │ ├── 50e2eee7-2b39-4035-aa8e-388247b5b4d1.png │ │ ├── 5fb7f769-59e1-403b-a5da-4bada4450ab2.png │ │ ├── 6257c087-45f0-4317-8384-c81fa7dcf2c2.png │ │ ├── 62d8fb2d-5f35-4499-947d-60f859dae18c.png │ │ ├── 63552804-05d1-48a7-91c7-c1992029da8a.png │ │ ├── 6b7fe367-a3ec-4c2b-b522-c3d967f529ac.png │ │ ├── 6fea619a-07a3-4616-930c-17b1e15b0124.png │ │ ├── 7584fd52-915e-4410-a2f4-890f2d10f4a9.png │ │ ├── 770bf7b6-a875-4f17-b37c-fe1c6e316ac3.png │ │ ├── 82bb26fc-2e7a-4188-a9eb-65caa76c6a39.png │ │ ├── 942269fe-b2b1-4c2b-ae62-f0e7a5e51269.png │ │ ├── 948c62cc-4449-4af4-9c77-869223773f77.mp4 │ │ ├── 948ce5a4-6e72-4a28-8e48-02efcf0195e7.png │ │ ├── 9e974ca7-0719-4b0b-a6ef-51edf1050ec0.png │ │ ├── a1072550-1e59-491a-a792-bbc6da374a76.png │ │ ├── ad35a919-7688-40fc-9331-cd4856393a30.png │ │ ├── b4b7d00c-5d1b-451f-a3d7-92d49d05803a.png │ │ ├── b646cdc4-4ec6-430a-bab2-9824a6e84ebf.png │ │ ├── b6fc9472-1197-49f3-8066-47a4fe6fcdeb.png │ │ ├── b8be933a-36f1-489e-8a8b-0ba64a2f799e.png │ │ ├── caf6c944-ea86-4633-ac38-2c0a33d28f06.png │ │ ├── ccf64225-7fc6-4d89-8e99-2ab255cb5e6c.png │ │ ├── ceeabf29-6ab5-4cd1-9cdd-441fa333b00d.png │ │ ├── dbb465e1-b35a-4f29-84e2-f07a400b0f1d.png │ │ ├── e330979b-27b8-40db-be55-d9c96d829af1.png │ │ ├── ed31ccf4-d47b-45ea-8e33-a95d2fa2f290.png │ │ ├── f80225d3-f1b6-4703-bcf3-d7d880689fa5.png │ │ ├── fefae2a3-0ee7-457c-b768-fbbb6de6c5f5.png │ │ └── ff61e4c8-4fbe-4038-b244-81bb69887bab.png │ └── tsconfig.json ├── core │ ├── .eslintignore │ ├── .gitignore │ ├── elizaConfig.example.yaml │ ├── eslint.config.mjs │ ├── jest.config.js │ ├── nodemon.json │ ├── package-lock.json │ ├── package.json │ ├── renovate.json │ ├── src │ │ ├── actions │ │ │ ├── continue.ts │ │ │ ├── followRoom.ts │ │ │ ├── ignore.ts │ │ │ ├── imageGeneration.ts │ │ │ ├── imageGenerationUtils.ts │ │ │ ├── index.ts │ │ │ ├── muteRoom.ts │ │ │ ├── none.ts │ │ │ ├── storyGeneration.ts │ │ │ ├── unfollowRoom.ts │ │ │ ├── unmuteRoom.ts │ │ │ ├── videoGeneration.ts │ │ │ ├── videoGenerationUtils.ts │ │ │ └── webgen │ │ │ │ ├── WebsiteMemoryManager.ts │ │ │ │ ├── createHtmlFiles.ts │ │ │ │ ├── critiqueHtml.ts │ │ │ │ ├── deployToGithub.ts │ │ │ │ ├── fixHtml.ts │ │ │ │ ├── generateHtmlContent.ts │ │ │ │ └── index.ts │ │ ├── adapters │ │ │ ├── index.ts │ │ │ ├── postgres.ts │ │ │ ├── sqlite.ts │ │ │ ├── sqlite │ │ │ │ ├── sqliteTables.ts │ │ │ │ └── sqlite_vec.ts │ │ │ ├── sqljs.ts │ │ │ ├── sqljs │ │ │ │ └── types.ts │ │ │ ├── supabase.ts │ │ │ └── trustScoreDatabase.ts │ │ ├── cli │ │ │ ├── config.ts │ │ │ └── index.ts │ │ ├── clients │ │ │ ├── direct │ │ │ │ └── index.ts │ │ │ ├── discord │ │ │ │ ├── actions │ │ │ │ │ ├── chat_with_attachments.ts │ │ │ │ │ ├── download_media.ts │ │ │ │ │ ├── generateImage.ts │ │ │ │ │ ├── generateStory.ts │ │ │ │ │ ├── generateVideo.ts │ │ │ │ │ ├── joinvoice.ts │ │ │ │ │ ├── leavevoice.ts │ │ │ │ │ ├── summarize_conversation.ts │ │ │ │ │ └── transcribe_media.ts │ │ │ │ ├── attachments.ts │ │ │ │ ├── index.ts │ │ │ │ ├── messages.ts │ │ │ │ ├── providers │ │ │ │ │ ├── channelState.ts │ │ │ │ │ └── voiceState.ts │ │ │ │ └── voice.ts │ │ │ ├── index.ts │ │ │ ├── telegram │ │ │ │ ├── config │ │ │ │ │ └── default.json5 │ │ │ │ ├── index.ts │ │ │ │ └── src │ │ │ │ │ ├── actions │ │ │ │ │ └── generateImage.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── messageManager.ts │ │ │ └── twitter │ │ │ │ ├── base.ts │ │ │ │ ├── index.ts │ │ │ │ ├── interactions.ts │ │ │ │ ├── post.ts │ │ │ │ ├── search.ts │ │ │ │ ├── storyThread.ts │ │ │ │ ├── storytelling.ts │ │ │ │ ├── types.ts │ │ │ │ └── utils.ts │ │ ├── core │ │ │ ├── actions.ts │ │ │ ├── context.ts │ │ │ ├── database.ts │ │ │ ├── defaultCharacter.ts │ │ │ ├── embedding.ts │ │ │ ├── evaluators.ts │ │ │ ├── generation.ts │ │ │ ├── goals.ts │ │ │ ├── imageGenModels.ts │ │ │ ├── index.ts │ │ │ ├── logger.ts │ │ │ ├── memory.ts │ │ │ ├── messages.ts │ │ │ ├── models.ts │ │ │ ├── parsing.ts │ │ │ ├── posts.ts │ │ │ ├── providers.ts │ │ │ ├── relationships.ts │ │ │ ├── runtime.ts │ │ │ ├── settings.ts │ │ │ ├── twitter │ │ │ │ └── utils.ts │ │ │ ├── types.ts │ │ │ └── uuid.ts │ │ ├── evaluators │ │ │ ├── fact.ts │ │ │ └── goal.ts │ │ ├── index.ts │ │ ├── providers │ │ │ ├── balances.ts │ │ │ ├── boredom.ts │ │ │ ├── index.ts │ │ │ ├── orderBook.ts │ │ │ ├── time.ts │ │ │ ├── token.ts │ │ │ ├── trustScoreProvider.ts │ │ │ └── wallet.ts │ │ ├── services │ │ │ ├── audioUtils.ts │ │ │ ├── browser.ts │ │ │ ├── image.ts │ │ │ ├── llama.ts │ │ │ ├── pdf.ts │ │ │ ├── speech.ts │ │ │ ├── summary.ts │ │ │ ├── tokenUtils.ts │ │ │ ├── transcription.ts │ │ │ ├── video.ts │ │ │ └── wordsToPunish.ts │ │ ├── test_imagegen.ts │ │ ├── test_resources │ │ │ ├── basic.test.ts │ │ │ ├── cache.ts │ │ │ ├── constants.ts │ │ │ ├── createRuntime.ts │ │ │ ├── data.ts │ │ │ ├── getOrCreateRelationship.ts │ │ │ ├── populateMemories.ts │ │ │ ├── report.ts │ │ │ ├── runAiTest.ts │ │ │ ├── templates.ts │ │ │ ├── testAction.ts │ │ │ ├── testEvaluator.ts │ │ │ ├── testSetup.ts │ │ │ └── types.ts │ │ ├── types │ │ │ ├── index.ts │ │ │ └── token.ts │ │ ├── utils │ │ │ ├── bignumber.ts │ │ │ └── youtube.ts │ │ └── vendor │ │ │ ├── vits.ts │ │ │ └── vitsVoiceList.ts │ ├── tests │ │ ├── actions.test.d.ts │ │ ├── actions.test.ts │ │ ├── browser.test.ts │ │ ├── continue.test.d.ts │ │ ├── continue.test.ts │ │ ├── discord-image-gen.test.ts │ │ ├── evaluation.test.d.ts │ │ ├── evaluation.test.ts │ │ ├── fact.test.d.ts │ │ ├── fact.test.ts │ │ ├── goal.test.d.ts │ │ ├── goal.test.ts │ │ ├── goals.test.d.ts │ │ ├── goals.test.ts │ │ ├── ignore.test.d.ts │ │ ├── ignore.test.ts │ │ ├── memory.test.d.ts │ │ ├── memory.test.ts │ │ ├── messages.test.d.ts │ │ ├── messages.test.ts │ │ ├── providers.test.d.ts │ │ ├── providers.test.ts │ │ ├── relationships.test.d.ts │ │ ├── relationships.test.ts │ │ ├── runtime.test.d.ts │ │ ├── runtime.test.ts │ │ ├── time.test.d.ts │ │ ├── time.test.ts │ │ ├── token.test.d.ts │ │ ├── token.test.ts │ │ └── utils.test.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── types │ │ └── index.d.ts ├── plugin-image-generation │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── utils.ts │ ├── tsconfig.json │ └── tsup.config.ts └── supabase │ ├── .gitignore │ ├── README.md │ ├── config.toml │ ├── migrations │ └── 20240318103238_remote_schema.sql │ ├── postgres-schema.sql │ └── seed.sql ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── prettier.config.cjs ├── scripts ├── build.sh ├── clean.sh ├── dev.sh ├── extracttweets.js └── gettweets.mjs └── tsconfig.json /.env.example: -------------------------------------------------------------------------------- 1 | # Required environment variables 2 | DISCORD_APPLICATION_ID= 3 | DISCORD_API_TOKEN= # Bot token 4 | OPENAI_API_KEY=sk-* # OpenAI API key, starting with sk- 5 | REDPILL_API_KEY= # REDPILL API Key 6 | GROQ_API_KEY=gsk_* 7 | 8 | ELEVENLABS_XI_API_KEY= # API key from elevenlabs 9 | 10 | # ELEVENLABS SETTINGS 11 | ELEVENLABS_MODEL_ID=eleven_multilingual_v2 12 | ELEVENLABS_VOICE_ID=21m00Tcm4TlvDq8ikWAM 13 | ELEVENLABS_VOICE_STABILITY=0.5 14 | ELEVENLABS_VOICE_SIMILARITY_BOOST=0.9 15 | ELEVENLABS_VOICE_STYLE=0.66 16 | ELEVENLABS_VOICE_USE_SPEAKER_BOOST=false 17 | ELEVENLABS_OPTIMIZE_STREAMING_LATENCY=4 18 | ELEVENLABS_OUTPUT_FORMAT=pcm_16000 19 | 20 | TWITTER_DRY_RUN=false 21 | TWITTER_USERNAME= # Account username 22 | TWITTER_PASSWORD= # Account password 23 | TWITTER_EMAIL= # Account email 24 | TWITTER_COOKIES= # Account cookies 25 | 26 | X_SERVER_URL= 27 | XAI_API_KEY= 28 | XAI_MODEL= 29 | 30 | 31 | #Set to Use for New OLLAMA provider 32 | OLLAMA_SERVER_URL= #Leave blank for default localhost:11434 33 | OLLAMA_MODEL= 34 | OLLAMA_EMBEDDING_MODEL= #default mxbai-embed-large 35 | #To use custom model types for different tasks set these 36 | SMALL_OLLAMA_MODEL= #default llama3.2 37 | MEDIUM_OLLAMA_MODEL= #default herems3 38 | LARGE_OLLAMA_MODEL= #default hermes3:70b 39 | 40 | #to still use the original LOCALLLAMA provider but with ollama 41 | LOCAL_LLAMA_PROVIDER= #"OLLAMA" #Leave blank for LLAMA-CPP or add OLLAMA 42 | 43 | 44 | # For asking Claude stuff 45 | ANTHROPIC_API_KEY= 46 | 47 | WALLET_PRIVATE_KEY=EXAMPLE_WALLET_PRIVATE_KEY 48 | WALLET_PUBLIC_KEY=EXAMPLE_WALLET_PUBLIC_KEY 49 | 50 | BIRDEYE_API_KEY= 51 | 52 | SOL_ADDRESS=So11111111111111111111111111111111111111112 53 | SLIPPAGE=1 54 | RPC_URL=https://api.mainnet-beta.solana.com 55 | HELIUS_API_KEY= 56 | 57 | 58 | ## Telegram 59 | TELEGRAM_BOT_TOKEN= 60 | 61 | TOGETHER_API_KEY= 62 | SERVER_PORT=3000 63 | 64 | ## Webgen/Websim 65 | GITHUB_TOKEN=EXAMPLE-BOT-TOKEN 66 | GITHUB_USERNAME=BOTTYBOI 67 | -------------------------------------------------------------------------------- /.env.test: -------------------------------------------------------------------------------- 1 | TEST_DATABASE_CLIENT=sqlite 2 | NODE_ENV=test 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: "bug" 6 | assignees: "" 7 | --- 8 | 9 | **Describe the bug** 10 | 11 | 12 | 13 | **To Reproduce** 14 | 15 | 16 | 17 | **Expected behavior** 18 | 19 | 20 | 21 | **Screenshots** 22 | 23 | 24 | 25 | **Additional context** 26 | 27 | 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "" 5 | labels: "enhancement" 6 | assignees: "" 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | 11 | 12 | 13 | **Describe the solution you'd like** 14 | 15 | 16 | 17 | **Describe alternatives you've considered** 18 | 19 | 20 | 21 | **Additional context** 22 | 23 | 24 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Relates to: 4 | 5 | 6 | 7 | 8 | 9 | # Risks 10 | 11 | 14 | 15 | # Background 16 | 17 | ## What does this PR do? 18 | 19 | ## What kind of change is this? 20 | 21 | 27 | 28 | 29 | 32 | 33 | # Documentation changes needed? 34 | 35 | 40 | 41 | 42 | 43 | # Testing 44 | 45 | ## Where should a reviewer start? 46 | 47 | ## Detailed testing steps 48 | 49 | 52 | 53 | 58 | 59 | 60 | 65 | 66 | 67 | 70 | 71 | 72 | 75 | 76 | 77 | 80 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: 3 | push: 4 | branches: [main] 5 | pull_request: 6 | branches: [main] 7 | jobs: 8 | check: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | 13 | - uses: pnpm/action-setup@v3 14 | with: 15 | version: 9.4.0 16 | 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version: "23" 20 | cache: "pnpm" 21 | 22 | - name: Install dependencies 23 | run: pnpm install --no-frozen-lockfile 24 | 25 | - name: Run Prettier 26 | run: pnpm run prettier --check . 27 | 28 | - name: Create test env file 29 | run: | 30 | echo "TEST_DATABASE_CLIENT=sqlite" > core/.env.test 31 | echo "NODE_ENV=test" >> core/.env.test 32 | 33 | - name: Run tests 34 | run: cd core && pnpm test 35 | 36 | - name: Build packages 37 | run: pnpm run build 38 | -------------------------------------------------------------------------------- /.github/workflows/generate-changelog.yml: -------------------------------------------------------------------------------- 1 | name: Generate Changelog 2 | on: 3 | push: 4 | tags: 5 | - "*" 6 | jobs: 7 | changelog: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | contents: write 11 | steps: 12 | - uses: actions/checkout@v4 13 | with: 14 | ref: main 15 | token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }} 16 | - name: Generate Changelog 17 | run: | 18 | export PATH="$PATH:/home/runner/.local/share/gem/ruby/3.0.0/bin" 19 | gem install --user-install github_changelog_generator 20 | github_changelog_generator \ 21 | -u ${{ github.repository_owner }} \ 22 | -p ${{ github.event.repository.name }} \ 23 | --token ${{ secrets.CHANGELOG_GITHUB_TOKEN }} 24 | - name: Commit Changelog 25 | uses: stefanzweifel/git-auto-commit-action@v5 26 | with: 27 | commit_message: "chore: update changelog" 28 | branch: main 29 | file_pattern: "CHANGELOG.md" 30 | commit_author: "GitHub Action " 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /out 3 | 4 | .env 5 | concatenated-output.ts 6 | embedding-cache.json 7 | packages/agent/temp/* 8 | *.png 9 | .DS_Store 10 | .sqlite 11 | 12 | dist/ 13 | # Allow models directory but ignore model files 14 | models/*.gguf 15 | 16 | cookies.json 17 | 18 | *.sqlite 19 | db.sqlite 20 | searches/ 21 | tweets/ 22 | 23 | *.gguf 24 | *.onnx 25 | *.wav 26 | *.mp3 27 | 28 | logs/ 29 | 30 | test-report.json 31 | content_cache/ 32 | test_data/ 33 | tokencache/ 34 | tweetcache/ 35 | twitter_cookies.json 36 | timeline_cache.json 37 | 38 | 39 | *.sqlite 40 | characters/ 41 | 42 | packages/core/src/providers/cache 43 | packages/core/src/providers/cache/* 44 | cache/* 45 | packages/agent/imagecache 46 | packages/agent/imagecache/* 47 | 48 | ROADMAP.md 49 | 50 | twitter_archive 51 | test.html 52 | test.json -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | node-linker=hoisted 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/*/target 2 | **/*/dist 3 | packages/torii-client/wasm 4 | packages/torii-client/pkg 5 | packages/torii-wasm/pkg/ 6 | packages/utils-wasm/pkg/ 7 | 8 | worlds/dojo-starter 9 | 10 | # ignore lock files 11 | **/*-lock.yaml 12 | package-lock.json 13 | dev-dist 14 | 15 | **/CHANGELOG.md 16 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch via pnpm", 11 | "runtimeExecutable": "pnpm", 12 | "runtimeArgs": ["run", "dev"], 13 | "skipFiles": ["/**"] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "typescript", 8 | "tsconfig": "tsconfig.json", 9 | "problemMatcher": ["$tsc"], 10 | "label": "tsbuild", 11 | "group": "build" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Use Node 23 instead of 20 2 | FROM --platform=linux/amd64 node:23.3.0 3 | 4 | # Install system dependencies and Playwright dependencies in one layer 5 | RUN apt-get update && apt-get install -y \ 6 | python3 \ 7 | build-essential \ 8 | git \ 9 | curl \ 10 | sqlite3 \ 11 | # Playwright dependencies 12 | libnss3 \ 13 | libnspr4 \ 14 | libatk1.0-0 \ 15 | libatk-bridge2.0-0 \ 16 | libcups2 \ 17 | libdrm2 \ 18 | libdbus-1-3 \ 19 | libxkbcommon0 \ 20 | libxcomposite1 \ 21 | libxdamage1 \ 22 | libxfixes3 \ 23 | libxrandr2 \ 24 | libgbm1 \ 25 | libasound2 \ 26 | libpango-1.0-0 \ 27 | libcairo2 \ 28 | && rm -rf /var/lib/apt/lists/* 29 | 30 | # Install pnpm 31 | RUN curl -f https://get.pnpm.io/v6.js | node - add --global pnpm 32 | 33 | # Set working directory 34 | WORKDIR /app 35 | 36 | # Copy package files first 37 | COPY package.json pnpm-workspace.yaml ./ 38 | COPY packages/core/package.json ./packages/core/ 39 | COPY packages/agent/package.json ./packages/agent/ 40 | 41 | # Install dependencies 42 | RUN pnpm i 43 | 44 | # Clean node_modules before copying source 45 | RUN rm -rf packages/*/node_modules 46 | 47 | # Copy source files 48 | COPY . . 49 | 50 | # Reinstall and build 51 | RUN pnpm i && \ 52 | cd packages/core && \ 53 | npx playwright install chromium --with-deps && \ 54 | cd ../.. 55 | 56 | # Build all packages 57 | RUN pnpm -r build 58 | 59 | # Create data directory 60 | RUN mkdir -p /app/data && chown -R node:node /app/data 61 | 62 | # Expose ports 63 | EXPOSE 3000 8080 64 | 65 | # Add entrypoint script 66 | COPY docker-entrypoint.sh / 67 | RUN chmod +x /docker-entrypoint.sh 68 | 69 | # Switch to non-root user 70 | USER node 71 | 72 | # Start the application 73 | ENTRYPOINT ["/docker-entrypoint.sh"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Shaw Walters, aka Moon aka @lalalune 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Centience 4 | 5 | # Somewhere Systems' Worldbuilder Agent 6 | 7 | https://centience.io/ 8 | https://whitepaper.centience.io/ 9 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | # 2 | # LOOMLOVE 3 | # DCVILYZ 4 | # 5 | # -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | services: 3 | eliza: 4 | build: 5 | context: . 6 | dockerfile: Dockerfile 7 | ports: 8 | - "3000:3000" # Main application port 9 | - "8088:8080" # Map container's 8080 to host's 8088 10 | volumes: 11 | - ./data:/app/data # Persist data 12 | environment: 13 | - NODE_ENV=production 14 | # Add any other environment variables needed 15 | restart: unless-stopped 16 | healthcheck: 17 | test: ["CMD", "curl", "-f", "http://localhost:3000/health"] 18 | interval: 30s 19 | timeout: 10s 20 | retries: 3 21 | 22 | watchtower: 23 | image: containrrr/watchtower 24 | volumes: 25 | - /var/run/docker.sock:/var/run/docker.sock 26 | command: --interval 30 -------------------------------------------------------------------------------- /docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Create data directory if it doesn't exist 5 | mkdir -p /app/data 6 | 7 | # Initialize SQLite database if it doesn't exist 8 | if [ ! -f /app/data/database.sqlite ]; then 9 | echo "Initializing SQLite database..." 10 | sqlite3 /app/data/database.sqlite < /app/packages/core/src/adapters/sqlite/schema.sql 11 | fi 12 | 13 | # Start SQLite Web interface in background 14 | echo "Starting SQLite web interface..." 15 | pnpm dlx sqlite-web /app/data/database.sqlite --host 0.0.0.0 --port 8080 & 16 | 17 | # Start the main application from the agent package 18 | echo "Starting Eliza..." 19 | cd packages/agent 20 | exec pnpm start -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | -------------------------------------------------------------------------------- /docs/.prettierrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /docs/api/classes/DirectClient.md: -------------------------------------------------------------------------------- 1 | # Class: DirectClient 2 | 3 | ## Constructors 4 | 5 | ### new DirectClient() 6 | 7 | > **new DirectClient**(): [`DirectClient`](DirectClient.md) 8 | 9 | #### Returns 10 | 11 | [`DirectClient`](DirectClient.md) 12 | 13 | #### Defined in 14 | 15 | [packages/core/src/clients/direct/index.ts:56](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/direct/index.ts#L56) 16 | 17 | ## Methods 18 | 19 | ### registerAgent() 20 | 21 | > **registerAgent**(`runtime`): `void` 22 | 23 | #### Parameters 24 | 25 | • **runtime**: [`AgentRuntime`](AgentRuntime.md) 26 | 27 | #### Returns 28 | 29 | `void` 30 | 31 | #### Defined in 32 | 33 | [packages/core/src/clients/direct/index.ts:264](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/direct/index.ts#L264) 34 | 35 | *** 36 | 37 | ### unregisterAgent() 38 | 39 | > **unregisterAgent**(`runtime`): `void` 40 | 41 | #### Parameters 42 | 43 | • **runtime**: [`AgentRuntime`](AgentRuntime.md) 44 | 45 | #### Returns 46 | 47 | `void` 48 | 49 | #### Defined in 50 | 51 | [packages/core/src/clients/direct/index.ts:268](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/direct/index.ts#L268) 52 | 53 | *** 54 | 55 | ### start() 56 | 57 | > **start**(`port`): `void` 58 | 59 | #### Parameters 60 | 61 | • **port**: `number` 62 | 63 | #### Returns 64 | 65 | `void` 66 | 67 | #### Defined in 68 | 69 | [packages/core/src/clients/direct/index.ts:272](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/direct/index.ts#L272) 70 | -------------------------------------------------------------------------------- /docs/api/classes/DiscordClient.md: -------------------------------------------------------------------------------- 1 | # Class: DiscordClient 2 | 3 | ## Extends 4 | 5 | - `EventEmitter` 6 | 7 | ## Constructors 8 | 9 | ### new DiscordClient() 10 | 11 | > **new DiscordClient**(`runtime`): [`DiscordClient`](DiscordClient.md) 12 | 13 | #### Parameters 14 | 15 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 16 | 17 | #### Returns 18 | 19 | [`DiscordClient`](DiscordClient.md) 20 | 21 | #### Overrides 22 | 23 | `EventEmitter.constructor` 24 | 25 | #### Defined in 26 | 27 | [packages/core/src/clients/discord/index.ts:34](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/discord/index.ts#L34) 28 | 29 | ## Properties 30 | 31 | ### apiToken 32 | 33 | > **apiToken**: `string` 34 | 35 | #### Defined in 36 | 37 | [packages/core/src/clients/discord/index.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/discord/index.ts#L27) 38 | 39 | *** 40 | 41 | ### character 42 | 43 | > **character**: [`Character`](../type-aliases/Character.md) 44 | 45 | #### Defined in 46 | 47 | [packages/core/src/clients/discord/index.ts:30](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/discord/index.ts#L30) 48 | 49 | ## Methods 50 | 51 | ### handleReactionAdd() 52 | 53 | > **handleReactionAdd**(`reaction`, `user`): `Promise`\<`void`\> 54 | 55 | #### Parameters 56 | 57 | • **reaction**: `MessageReaction` 58 | 59 | • **user**: `User` 60 | 61 | #### Returns 62 | 63 | `Promise`\<`void`\> 64 | 65 | #### Defined in 66 | 67 | [packages/core/src/clients/discord/index.ts:121](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/discord/index.ts#L121) 68 | 69 | *** 70 | 71 | ### handleReactionRemove() 72 | 73 | > **handleReactionRemove**(`reaction`, `user`): `Promise`\<`void`\> 74 | 75 | #### Parameters 76 | 77 | • **reaction**: `MessageReaction` 78 | 79 | • **user**: `User` 80 | 81 | #### Returns 82 | 83 | `Promise`\<`void`\> 84 | 85 | #### Defined in 86 | 87 | [packages/core/src/clients/discord/index.ts:195](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/discord/index.ts#L195) 88 | -------------------------------------------------------------------------------- /docs/api/classes/TelegramClient.md: -------------------------------------------------------------------------------- 1 | # Class: TelegramClient 2 | 3 | ## Constructors 4 | 5 | ### new TelegramClient() 6 | 7 | > **new TelegramClient**(`runtime`, `botToken`): [`TelegramClient`](TelegramClient.md) 8 | 9 | #### Parameters 10 | 11 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 12 | 13 | • **botToken**: `string` 14 | 15 | #### Returns 16 | 17 | [`TelegramClient`](TelegramClient.md) 18 | 19 | #### Defined in 20 | 21 | [packages/core/src/clients/telegram/src/index.ts:12](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/telegram/src/index.ts#L12) 22 | 23 | ## Methods 24 | 25 | ### start() 26 | 27 | > **start**(): `Promise`\<`void`\> 28 | 29 | #### Returns 30 | 31 | `Promise`\<`void`\> 32 | 33 | #### Defined in 34 | 35 | [packages/core/src/clients/telegram/src/index.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/telegram/src/index.ts#L54) 36 | 37 | *** 38 | 39 | ### stop() 40 | 41 | > **stop**(): `Promise`\<`void`\> 42 | 43 | #### Returns 44 | 45 | `Promise`\<`void`\> 46 | 47 | #### Defined in 48 | 49 | [packages/core/src/clients/telegram/src/index.ts:91](https://github.com/ai16z/eliza/blob/main/packages/core/src/clients/telegram/src/index.ts#L91) 50 | -------------------------------------------------------------------------------- /docs/api/classes/WalletProvider.md: -------------------------------------------------------------------------------- 1 | # Class: WalletProvider 2 | 3 | ## Constructors 4 | 5 | ### new WalletProvider() 6 | 7 | > **new WalletProvider**(`connection`, `walletPublicKey`): [`WalletProvider`](WalletProvider.md) 8 | 9 | #### Parameters 10 | 11 | • **connection**: `Connection` 12 | 13 | • **walletPublicKey**: `PublicKey` 14 | 15 | #### Returns 16 | 17 | [`WalletProvider`](WalletProvider.md) 18 | 19 | #### Defined in 20 | 21 | [packages/core/src/providers/wallet.ts:53](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L53) 22 | 23 | ## Methods 24 | 25 | ### fetchPortfolioValue() 26 | 27 | > **fetchPortfolioValue**(`runtime`): `Promise`\<`WalletPortfolio`\> 28 | 29 | #### Parameters 30 | 31 | • **runtime**: `any` 32 | 33 | #### Returns 34 | 35 | `Promise`\<`WalletPortfolio`\> 36 | 37 | #### Defined in 38 | 39 | [packages/core/src/providers/wallet.ts:105](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L105) 40 | 41 | *** 42 | 43 | ### fetchPrices() 44 | 45 | > **fetchPrices**(`runtime`): `Promise`\<`Prices`\> 46 | 47 | #### Parameters 48 | 49 | • **runtime**: `any` 50 | 51 | #### Returns 52 | 53 | `Promise`\<`Prices`\> 54 | 55 | #### Defined in 56 | 57 | [packages/core/src/providers/wallet.ts:150](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L150) 58 | 59 | *** 60 | 61 | ### formatPortfolio() 62 | 63 | > **formatPortfolio**(`runtime`, `portfolio`, `prices`): `string` 64 | 65 | #### Parameters 66 | 67 | • **runtime**: `any` 68 | 69 | • **portfolio**: `WalletPortfolio` 70 | 71 | • **prices**: `Prices` 72 | 73 | #### Returns 74 | 75 | `string` 76 | 77 | #### Defined in 78 | 79 | [packages/core/src/providers/wallet.ts:192](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L192) 80 | 81 | *** 82 | 83 | ### getFormattedPortfolio() 84 | 85 | > **getFormattedPortfolio**(`runtime`): `Promise`\<`string`\> 86 | 87 | #### Parameters 88 | 89 | • **runtime**: `any` 90 | 91 | #### Returns 92 | 93 | `Promise`\<`string`\> 94 | 95 | #### Defined in 96 | 97 | [packages/core/src/providers/wallet.ts:229](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L229) 98 | -------------------------------------------------------------------------------- /docs/api/enumerations/Clients.md: -------------------------------------------------------------------------------- 1 | # Enumeration: Clients 2 | 3 | ## Enumeration Members 4 | 5 | ### DISCORD 6 | 7 | > **DISCORD**: `"discord"` 8 | 9 | #### Defined in 10 | 11 | [packages/core/src/core/types.ts:312](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L312) 12 | 13 | *** 14 | 15 | ### DIRECT 16 | 17 | > **DIRECT**: `"direct"` 18 | 19 | #### Defined in 20 | 21 | [packages/core/src/core/types.ts:313](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L313) 22 | 23 | *** 24 | 25 | ### TWITTER 26 | 27 | > **TWITTER**: `"twitter"` 28 | 29 | #### Defined in 30 | 31 | [packages/core/src/core/types.ts:314](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L314) 32 | 33 | *** 34 | 35 | ### TELEGRAM 36 | 37 | > **TELEGRAM**: `"telegram"` 38 | 39 | #### Defined in 40 | 41 | [packages/core/src/core/types.ts:315](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L315) 42 | -------------------------------------------------------------------------------- /docs/api/enumerations/GoalStatus.md: -------------------------------------------------------------------------------- 1 | # Enumeration: GoalStatus 2 | 3 | ## Enumeration Members 4 | 5 | ### DONE 6 | 7 | > **DONE**: `"DONE"` 8 | 9 | #### Defined in 10 | 11 | [packages/core/src/core/types.ts:58](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L58) 12 | 13 | *** 14 | 15 | ### FAILED 16 | 17 | > **FAILED**: `"FAILED"` 18 | 19 | #### Defined in 20 | 21 | [packages/core/src/core/types.ts:59](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L59) 22 | 23 | *** 24 | 25 | ### IN\_PROGRESS 26 | 27 | > **IN\_PROGRESS**: `"IN_PROGRESS"` 28 | 29 | #### Defined in 30 | 31 | [packages/core/src/core/types.ts:60](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L60) 32 | -------------------------------------------------------------------------------- /docs/api/enumerations/ImageGenModel.md: -------------------------------------------------------------------------------- 1 | # Enumeration: ImageGenModel 2 | 3 | ## Enumeration Members 4 | 5 | ### TogetherAI 6 | 7 | > **TogetherAI**: `"TogetherAI"` 8 | 9 | #### Defined in 10 | 11 | [packages/core/src/core/imageGenModels.ts:2](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/imageGenModels.ts#L2) 12 | 13 | *** 14 | 15 | ### Dalle 16 | 17 | > **Dalle**: `"Dalle"` 18 | 19 | #### Defined in 20 | 21 | [packages/core/src/core/imageGenModels.ts:3](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/imageGenModels.ts#L3) 22 | -------------------------------------------------------------------------------- /docs/api/enumerations/ModelClass.md: -------------------------------------------------------------------------------- 1 | # Enumeration: ModelClass 2 | 3 | ## Enumeration Members 4 | 5 | ### SMALL 6 | 7 | > **SMALL**: `"small"` 8 | 9 | #### Defined in 10 | 11 | [packages/core/src/core/types.ts:76](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L76) 12 | 13 | *** 14 | 15 | ### MEDIUM 16 | 17 | > **MEDIUM**: `"medium"` 18 | 19 | #### Defined in 20 | 21 | [packages/core/src/core/types.ts:77](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L77) 22 | 23 | *** 24 | 25 | ### LARGE 26 | 27 | > **LARGE**: `"large"` 28 | 29 | #### Defined in 30 | 31 | [packages/core/src/core/types.ts:78](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L78) 32 | 33 | *** 34 | 35 | ### EMBEDDING 36 | 37 | > **EMBEDDING**: `"embedding"` 38 | 39 | #### Defined in 40 | 41 | [packages/core/src/core/types.ts:79](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L79) 42 | -------------------------------------------------------------------------------- /docs/api/functions/addHeader.md: -------------------------------------------------------------------------------- 1 | # Function: addHeader() 2 | 3 | > **addHeader**(`header`, `body`): `string` 4 | 5 | Adds a header to a body of text. 6 | 7 | This function takes a header string and a body string and returns a new string with the header prepended to the body. 8 | If the body string is empty, the header is returned as is. 9 | 10 | ## Parameters 11 | 12 | • **header**: `string` 13 | 14 | The header to add to the body. 15 | 16 | • **body**: `string` 17 | 18 | The body to which to add the header. 19 | 20 | ## Returns 21 | 22 | `string` 23 | 24 | The body with the header prepended. 25 | 26 | ## Example 27 | 28 | ```ts 29 | // Given a header and a body 30 | const header = "Header"; 31 | const body = "Body"; 32 | 33 | // Adding the header to the body will result in: 34 | // "Header\nBody" 35 | const text = addHeader(header, body); 36 | ``` 37 | 38 | ## Defined in 39 | 40 | [packages/core/src/core/context.ts:58](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/context.ts#L58) 41 | -------------------------------------------------------------------------------- /docs/api/functions/buyToken.md: -------------------------------------------------------------------------------- 1 | # Function: buyToken() 2 | 3 | > **buyToken**(`__namedParameters`): `Promise`\<`void`\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.sdk**: `PumpFunSDK` 10 | 11 | • **\_\_namedParameters.buyer**: `Keypair` 12 | 13 | • **\_\_namedParameters.mint**: `PublicKey` 14 | 15 | • **\_\_namedParameters.amount**: `bigint` 16 | 17 | • **\_\_namedParameters.priorityFee**: `PriorityFee` 18 | 19 | • **\_\_namedParameters.allowOffCurve**: `boolean` 20 | 21 | • **\_\_namedParameters.slippage**: `string` 22 | 23 | • **\_\_namedParameters.connection**: `Connection` 24 | 25 | ## Returns 26 | 27 | `Promise`\<`void`\> 28 | 29 | ## Defined in 30 | 31 | [packages/core/src/actions/pumpfun.ts:119](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L119) 32 | -------------------------------------------------------------------------------- /docs/api/functions/composeActionExamples.md: -------------------------------------------------------------------------------- 1 | # Function: composeActionExamples() 2 | 3 | > **composeActionExamples**(`actionsData`, `count`): `string` 4 | 5 | Composes a set of example conversations based on provided actions and a specified count. 6 | It randomly selects examples from the provided actions and formats them with generated names. 7 | 8 | ## Parameters 9 | 10 | • **actionsData**: [`Action`](../interfaces/Action.md)[] 11 | 12 | An array of `Action` objects from which to draw examples. 13 | 14 | • **count**: `number` 15 | 16 | The number of examples to generate. 17 | 18 | ## Returns 19 | 20 | `string` 21 | 22 | A string containing formatted examples of conversations. 23 | 24 | ## Defined in 25 | 26 | [packages/core/src/core/actions.ts:18](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/actions.ts#L18) 27 | -------------------------------------------------------------------------------- /docs/api/functions/composeContext.md: -------------------------------------------------------------------------------- 1 | # Function: composeContext() 2 | 3 | > **composeContext**(`params`): `string` 4 | 5 | Composes a context string by replacing placeholders in a template with corresponding values from the state. 6 | 7 | This function takes a template string with placeholders in the format `{{placeholder}}` and a state object. 8 | It replaces each placeholder with the value from the state object that matches the placeholder's name. 9 | If a matching key is not found in the state object for a given placeholder, the placeholder is replaced with an empty string. 10 | 11 | ## Parameters 12 | 13 | • **params** 14 | 15 | The parameters for composing the context. 16 | 17 | • **params.state**: [`State`](../interfaces/State.md) 18 | 19 | The state object containing values to replace the placeholders in the template. 20 | 21 | • **params.template**: `string` 22 | 23 | The template string containing placeholders to be replaced with state values. 24 | 25 | ## Returns 26 | 27 | `string` 28 | 29 | The composed context string with placeholders replaced by corresponding state values. 30 | 31 | ## Example 32 | 33 | ```ts 34 | // Given a state object and a template 35 | const state = { userName: "Alice", userAge: 30 }; 36 | const template = "Hello, {{userName}}! You are {{userAge}} years old"; 37 | 38 | // Composing the context will result in: 39 | // "Hello, Alice! You are 30 years old." 40 | const context = composeContext({ state, template }); 41 | ``` 42 | 43 | ## Defined in 44 | 45 | [packages/core/src/core/context.ts:24](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/context.ts#L24) 46 | -------------------------------------------------------------------------------- /docs/api/functions/createAgentRuntime.md: -------------------------------------------------------------------------------- 1 | # Function: createAgentRuntime() 2 | 3 | > **createAgentRuntime**(`character`, `db`, `token`, `configPath`): `Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> 4 | 5 | ## Parameters 6 | 7 | • **character**: [`Character`](../type-aliases/Character.md) 8 | 9 | • **db**: `any` 10 | 11 | • **token**: `string` 12 | 13 | • **configPath**: `string` = `"./elizaConfig.yaml"` 14 | 15 | ## Returns 16 | 17 | `Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/cli/index.ts:142](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L142) 22 | -------------------------------------------------------------------------------- /docs/api/functions/createAndBuyToken.md: -------------------------------------------------------------------------------- 1 | # Function: createAndBuyToken() 2 | 3 | > **createAndBuyToken**(`__namedParameters`): `Promise`\<`void`\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.deployer**: `Keypair` 10 | 11 | • **\_\_namedParameters.mint**: `Keypair` 12 | 13 | • **\_\_namedParameters.tokenMetadata**: `CreateTokenMetadata` 14 | 15 | • **\_\_namedParameters.buyAmountSol**: `bigint` 16 | 17 | • **\_\_namedParameters.priorityFee**: `PriorityFee` 18 | 19 | • **\_\_namedParameters.allowOffCurve**: `boolean` 20 | 21 | • **\_\_namedParameters.commitment?**: `"processed"` \| `"confirmed"` \| `"finalized"` \| `"recent"` \| `"single"` \| `"singleGossip"` \| `"root"` \| `"max"` = `"finalized"` 22 | 23 | • **\_\_namedParameters.sdk**: `PumpFunSDK` 24 | 25 | • **\_\_namedParameters.connection**: `Connection` 26 | 27 | • **\_\_namedParameters.slippage**: `string` 28 | 29 | ## Returns 30 | 31 | `Promise`\<`void`\> 32 | 33 | ## Defined in 34 | 35 | [packages/core/src/actions/pumpfun.ts:51](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L51) 36 | -------------------------------------------------------------------------------- /docs/api/functions/createDirectRuntime.md: -------------------------------------------------------------------------------- 1 | # Function: createDirectRuntime() 2 | 3 | > **createDirectRuntime**(`character`, `db`, `token`, `configPath`): `Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> 4 | 5 | ## Parameters 6 | 7 | • **character**: [`Character`](../type-aliases/Character.md) 8 | 9 | • **db**: `any` 10 | 11 | • **token**: `string` 12 | 13 | • **configPath**: `string` = `"./elizaConfig.yaml"` 14 | 15 | ## Returns 16 | 17 | `Promise`\<[`AgentRuntime`](../classes/AgentRuntime.md)\> 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/cli/index.ts:177](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L177) 22 | -------------------------------------------------------------------------------- /docs/api/functions/createGoal.md: -------------------------------------------------------------------------------- 1 | # Function: createGoal() 2 | 3 | > **createGoal**(`__namedParameters`): `Promise`\<`void`\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **\_\_namedParameters.goal**: [`Goal`](../interfaces/Goal.md) 12 | 13 | ## Returns 14 | 15 | `Promise`\<`void`\> 16 | 17 | ## Defined in 18 | 19 | [packages/core/src/core/goals.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/goals.ts#L54) 20 | -------------------------------------------------------------------------------- /docs/api/functions/createRelationship.md: -------------------------------------------------------------------------------- 1 | # Function: createRelationship() 2 | 3 | > **createRelationship**(`__namedParameters`): `Promise`\<`boolean`\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **\_\_namedParameters.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 12 | 13 | • **\_\_namedParameters.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 14 | 15 | ## Returns 16 | 17 | `Promise`\<`boolean`\> 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/relationships.ts:3](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/relationships.ts#L3) 22 | -------------------------------------------------------------------------------- /docs/api/functions/embed.md: -------------------------------------------------------------------------------- 1 | # Function: embed() 2 | 3 | > **embed**(`runtime`, `input`): `Promise`\<`number`[]\> 4 | 5 | Send a message to the OpenAI API for embedding. 6 | 7 | ## Parameters 8 | 9 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **input**: `string` 12 | 13 | The input to be embedded. 14 | 15 | ## Returns 16 | 17 | `Promise`\<`number`[]\> 18 | 19 | The embedding of the input. 20 | 21 | ## Defined in 22 | 23 | [packages/core/src/core/embedding.ts:9](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/embedding.ts#L9) 24 | -------------------------------------------------------------------------------- /docs/api/functions/formatActionNames.md: -------------------------------------------------------------------------------- 1 | # Function: formatActionNames() 2 | 3 | > **formatActionNames**(`actions`): `string` 4 | 5 | Formats the names of the provided actions into a comma-separated string. 6 | 7 | ## Parameters 8 | 9 | • **actions**: [`Action`](../interfaces/Action.md)[] 10 | 11 | An array of `Action` objects from which to extract names. 12 | 13 | ## Returns 14 | 15 | `string` 16 | 17 | A comma-separated string of action names. 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/actions.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/actions.ts#L54) 22 | -------------------------------------------------------------------------------- /docs/api/functions/formatActions.md: -------------------------------------------------------------------------------- 1 | # Function: formatActions() 2 | 3 | > **formatActions**(`actions`): `string` 4 | 5 | Formats the provided actions into a detailed string listing each action's name and description, separated by commas and newlines. 6 | 7 | ## Parameters 8 | 9 | • **actions**: [`Action`](../interfaces/Action.md)[] 10 | 11 | An array of `Action` objects to format. 12 | 13 | ## Returns 14 | 15 | `string` 16 | 17 | A detailed string of actions, including names and descriptions. 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/actions.ts:66](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/actions.ts#L66) 22 | -------------------------------------------------------------------------------- /docs/api/functions/formatActors.md: -------------------------------------------------------------------------------- 1 | # Function: formatActors() 2 | 3 | > **formatActors**(`actors`): `string` 4 | 5 | Format actors into a string 6 | 7 | ## Parameters 8 | 9 | • **actors** 10 | 11 | list of actors 12 | 13 | • **actors.actors**: [`Actor`](../interfaces/Actor.md)[] 14 | 15 | ## Returns 16 | 17 | `string` 18 | 19 | string 20 | 21 | ## Defined in 22 | 23 | [packages/core/src/core/messages.ts:45](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/messages.ts#L45) 24 | -------------------------------------------------------------------------------- /docs/api/functions/formatEvaluatorExampleDescriptions.md: -------------------------------------------------------------------------------- 1 | # Function: formatEvaluatorExampleDescriptions() 2 | 3 | > **formatEvaluatorExampleDescriptions**(`evaluators`): `string` 4 | 5 | Generates a string summarizing the descriptions of each evaluator example. 6 | 7 | ## Parameters 8 | 9 | • **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] 10 | 11 | An array of evaluator objects, each containing examples. 12 | 13 | ## Returns 14 | 15 | `string` 16 | 17 | A string that summarizes the descriptions for each evaluator example, formatted with the evaluator name, example number, and description. 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/evaluators.ts:114](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L114) 22 | -------------------------------------------------------------------------------- /docs/api/functions/formatEvaluatorExamples.md: -------------------------------------------------------------------------------- 1 | # Function: formatEvaluatorExamples() 2 | 3 | > **formatEvaluatorExamples**(`evaluators`): `string` 4 | 5 | Formats evaluator examples into a readable string, replacing placeholders with generated names. 6 | 7 | ## Parameters 8 | 9 | • **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] 10 | 11 | An array of evaluator objects, each containing examples to format. 12 | 13 | ## Returns 14 | 15 | `string` 16 | 17 | A string that presents each evaluator example in a structured format, including context, messages, and outcomes, with placeholders replaced by generated names. 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/evaluators.ts:59](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L59) 22 | -------------------------------------------------------------------------------- /docs/api/functions/formatEvaluatorNames.md: -------------------------------------------------------------------------------- 1 | # Function: formatEvaluatorNames() 2 | 3 | > **formatEvaluatorNames**(`evaluators`): `string` 4 | 5 | Formats the names of evaluators into a comma-separated list, each enclosed in single quotes. 6 | 7 | ## Parameters 8 | 9 | • **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] 10 | 11 | An array of evaluator objects. 12 | 13 | ## Returns 14 | 15 | `string` 16 | 17 | A string that concatenates the names of all evaluators, each enclosed in single quotes and separated by commas. 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/evaluators.ts:34](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L34) 22 | -------------------------------------------------------------------------------- /docs/api/functions/formatEvaluators.md: -------------------------------------------------------------------------------- 1 | # Function: formatEvaluators() 2 | 3 | > **formatEvaluators**(`evaluators`): `string` 4 | 5 | Formats evaluator details into a string, including both the name and description of each evaluator. 6 | 7 | ## Parameters 8 | 9 | • **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] 10 | 11 | An array of evaluator objects. 12 | 13 | ## Returns 14 | 15 | `string` 16 | 17 | A string that concatenates the name and description of each evaluator, separated by a colon and a newline character. 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/evaluators.ts:45](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L45) 22 | -------------------------------------------------------------------------------- /docs/api/functions/formatGoalsAsString.md: -------------------------------------------------------------------------------- 1 | # Function: formatGoalsAsString() 2 | 3 | > **formatGoalsAsString**(`__namedParameters`): `string` 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.goals**: [`Goal`](../interfaces/Goal.md)[] 10 | 11 | ## Returns 12 | 13 | `string` 14 | 15 | ## Defined in 16 | 17 | [packages/core/src/core/goals.ts:29](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/goals.ts#L29) 18 | -------------------------------------------------------------------------------- /docs/api/functions/formatMessages.md: -------------------------------------------------------------------------------- 1 | # Function: formatMessages() 2 | 3 | > **formatMessages**(`__namedParameters`): `string` 4 | 5 | Format messages into a string 6 | 7 | ## Parameters 8 | 9 | • **\_\_namedParameters** 10 | 11 | • **\_\_namedParameters.messages**: [`Memory`](../interfaces/Memory.md)[] 12 | 13 | • **\_\_namedParameters.actors**: [`Actor`](../interfaces/Actor.md)[] 14 | 15 | ## Returns 16 | 17 | `string` 18 | 19 | string 20 | 21 | ## Defined in 22 | 23 | [packages/core/src/core/messages.ts:60](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/messages.ts#L60) 24 | -------------------------------------------------------------------------------- /docs/api/functions/formatPosts.md: -------------------------------------------------------------------------------- 1 | # Function: formatPosts() 2 | 3 | > **formatPosts**(`__namedParameters`): `string` 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.messages**: [`Memory`](../interfaces/Memory.md)[] 10 | 11 | • **\_\_namedParameters.actors**: [`Actor`](../interfaces/Actor.md)[] 12 | 13 | • **\_\_namedParameters.conversationHeader?**: `boolean` = `true` 14 | 15 | ## Returns 16 | 17 | `string` 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/posts.ts:4](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/posts.ts#L4) 22 | -------------------------------------------------------------------------------- /docs/api/functions/formatRelationships.md: -------------------------------------------------------------------------------- 1 | # Function: formatRelationships() 2 | 3 | > **formatRelationships**(`__namedParameters`): `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **\_\_namedParameters.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 12 | 13 | ## Returns 14 | 15 | `Promise`\<\`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\`[]\> 16 | 17 | ## Defined in 18 | 19 | [packages/core/src/core/relationships.ts:43](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/relationships.ts#L43) 20 | -------------------------------------------------------------------------------- /docs/api/functions/formatTimestamp.md: -------------------------------------------------------------------------------- 1 | # Function: formatTimestamp() 2 | 3 | > **formatTimestamp**(`messageDate`): `string` 4 | 5 | ## Parameters 6 | 7 | • **messageDate**: `number` 8 | 9 | ## Returns 10 | 11 | `string` 12 | 13 | ## Defined in 14 | 15 | [packages/core/src/core/messages.ts:94](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/messages.ts#L94) 16 | -------------------------------------------------------------------------------- /docs/api/functions/generateCaption.md: -------------------------------------------------------------------------------- 1 | # Function: generateCaption() 2 | 3 | > **generateCaption**(`data`, `runtime`): `Promise`\<`object`\> 4 | 5 | ## Parameters 6 | 7 | • **data** 8 | 9 | • **data.imageUrl**: `string` 10 | 11 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 12 | 13 | ## Returns 14 | 15 | `Promise`\<`object`\> 16 | 17 | ### title 18 | 19 | > **title**: `string` 20 | 21 | ### description 22 | 23 | > **description**: `string` 24 | 25 | ## Defined in 26 | 27 | [packages/core/src/actions/imageGenerationUtils.ts:90](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/imageGenerationUtils.ts#L90) 28 | -------------------------------------------------------------------------------- /docs/api/functions/generateImage.md: -------------------------------------------------------------------------------- 1 | # Function: generateImage() 2 | 3 | > **generateImage**(`data`, `runtime`): `Promise`\<`object`\> 4 | 5 | ## Parameters 6 | 7 | • **data** 8 | 9 | • **data.prompt**: `string` 10 | 11 | • **data.width**: `number` 12 | 13 | • **data.height**: `number` 14 | 15 | • **data.count?**: `number` 16 | 17 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 18 | 19 | ## Returns 20 | 21 | `Promise`\<`object`\> 22 | 23 | ### success 24 | 25 | > **success**: `boolean` 26 | 27 | ### data? 28 | 29 | > `optional` **data**: `string`[] 30 | 31 | ### error? 32 | 33 | > `optional` **error**: `any` 34 | 35 | ## Defined in 36 | 37 | [packages/core/src/actions/imageGenerationUtils.ts:8](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/imageGenerationUtils.ts#L8) 38 | -------------------------------------------------------------------------------- /docs/api/functions/generateMessageResponse.md: -------------------------------------------------------------------------------- 1 | # Function: generateMessageResponse() 2 | 3 | > **generateMessageResponse**(`opts`): `Promise`\<[`Content`](../interfaces/Content.md)\> 4 | 5 | Send a message to the model for generateText. 6 | 7 | ## Parameters 8 | 9 | • **opts** 10 | 11 | The options for the generateText request. 12 | 13 | • **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 14 | 15 | • **opts.context**: `string` 16 | 17 | The context of the message to be completed. 18 | 19 | • **opts.modelClass**: `string` 20 | 21 | ## Returns 22 | 23 | `Promise`\<[`Content`](../interfaces/Content.md)\> 24 | 25 | The completed message. 26 | 27 | ## Defined in 28 | 29 | [packages/core/src/core/generation.ts:549](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L549) 30 | -------------------------------------------------------------------------------- /docs/api/functions/generateObject.md: -------------------------------------------------------------------------------- 1 | # Function: generateObject() 2 | 3 | > **generateObject**(`__namedParameters`): `Promise`\<`any`\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **\_\_namedParameters.context**: `string` 12 | 13 | • **\_\_namedParameters.modelClass**: `string` 14 | 15 | ## Returns 16 | 17 | `Promise`\<`any`\> 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/generation.ts:465](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L465) 22 | -------------------------------------------------------------------------------- /docs/api/functions/generateObjectArray.md: -------------------------------------------------------------------------------- 1 | # Function: generateObjectArray() 2 | 3 | > **generateObjectArray**(`__namedParameters`): `Promise`\<`any`[]\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **\_\_namedParameters.context**: `string` 12 | 13 | • **\_\_namedParameters.modelClass**: `string` 14 | 15 | ## Returns 16 | 17 | `Promise`\<`any`[]\> 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/generation.ts:501](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L501) 22 | -------------------------------------------------------------------------------- /docs/api/functions/generateShouldRespond.md: -------------------------------------------------------------------------------- 1 | # Function: generateShouldRespond() 2 | 3 | > **generateShouldRespond**(`opts`): `Promise`\<`"RESPOND"` \| `"IGNORE"` \| `"STOP"` \| `null`\> 4 | 5 | Sends a message to the model to determine if it should respond to the given context. 6 | 7 | ## Parameters 8 | 9 | • **opts** 10 | 11 | The options for the generateText request 12 | 13 | • **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 14 | 15 | • **opts.context**: `string` 16 | 17 | The context to evaluate for response 18 | 19 | • **opts.modelClass**: `string` 20 | 21 | ## Returns 22 | 23 | `Promise`\<`"RESPOND"` \| `"IGNORE"` \| `"STOP"` \| `null`\> 24 | 25 | Promise resolving to "RESPOND", "IGNORE", "STOP" or null 26 | 27 | ## Defined in 28 | 29 | [packages/core/src/core/generation.ts:273](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L273) 30 | -------------------------------------------------------------------------------- /docs/api/functions/generateText.md: -------------------------------------------------------------------------------- 1 | # Function: generateText() 2 | 3 | > **generateText**(`opts`): `Promise`\<`string`\> 4 | 5 | Send a message to the model for a text generateText - receive a string back and parse how you'd like 6 | 7 | ## Parameters 8 | 9 | • **opts** 10 | 11 | The options for the generateText request. 12 | 13 | • **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 14 | 15 | • **opts.context**: `string` 16 | 17 | The context of the message to be completed. 18 | 19 | • **opts.modelClass**: `string` 20 | 21 | • **opts.stop?**: `string`[] 22 | 23 | A list of strings to stop the generateText at. 24 | 25 | ## Returns 26 | 27 | `Promise`\<`string`\> 28 | 29 | The completed message. 30 | 31 | ## Defined in 32 | 33 | [packages/core/src/core/generation.ts:31](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L31) 34 | -------------------------------------------------------------------------------- /docs/api/functions/generateTextArray.md: -------------------------------------------------------------------------------- 1 | # Function: generateTextArray() 2 | 3 | > **generateTextArray**(`opts`): `Promise`\<`string`[]\> 4 | 5 | Send a message to the model and parse the response as a string array 6 | 7 | ## Parameters 8 | 9 | • **opts** 10 | 11 | The options for the generateText request 12 | 13 | • **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 14 | 15 | • **opts.context**: `string` 16 | 17 | The context/prompt to send to the model 18 | 19 | • **opts.modelClass**: `string` 20 | 21 | ## Returns 22 | 23 | `Promise`\<`string`[]\> 24 | 25 | Promise resolving to an array of strings parsed from the model's response 26 | 27 | ## Defined in 28 | 29 | [packages/core/src/core/generation.ts:429](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L429) 30 | -------------------------------------------------------------------------------- /docs/api/functions/generateTrueOrFalse.md: -------------------------------------------------------------------------------- 1 | # Function: generateTrueOrFalse() 2 | 3 | > **generateTrueOrFalse**(`opts`): `Promise`\<`boolean`\> 4 | 5 | Sends a message to the model and parses the response as a boolean value 6 | 7 | ## Parameters 8 | 9 | • **opts** 10 | 11 | The options for the generateText request 12 | 13 | • **opts.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 14 | 15 | • **opts.context**: `string` = `""` 16 | 17 | The context to evaluate for the boolean response 18 | 19 | • **opts.modelClass**: `string` 20 | 21 | ## Returns 22 | 23 | `Promise`\<`boolean`\> 24 | 25 | Promise resolving to a boolean value parsed from the model's response 26 | 27 | ## Defined in 28 | 29 | [packages/core/src/core/generation.ts:377](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L377) 30 | -------------------------------------------------------------------------------- /docs/api/functions/getActorDetails.md: -------------------------------------------------------------------------------- 1 | # Function: getActorDetails() 2 | 3 | > **getActorDetails**(`__namedParameters`): `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> 4 | 5 | Get details for a list of actors. 6 | 7 | ## Parameters 8 | 9 | • **\_\_namedParameters** 10 | 11 | • **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 12 | 13 | • **\_\_namedParameters.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 14 | 15 | ## Returns 16 | 17 | `Promise`\<[`Actor`](../interfaces/Actor.md)[]\> 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/messages.ts:12](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/messages.ts#L12) 22 | -------------------------------------------------------------------------------- /docs/api/functions/getEndpoint.md: -------------------------------------------------------------------------------- 1 | # Function: getEndpoint() 2 | 3 | > **getEndpoint**(`provider`): `string` 4 | 5 | ## Parameters 6 | 7 | • **provider**: [`ModelProvider`](../enumerations/ModelProvider.md) 8 | 9 | ## Returns 10 | 11 | `string` 12 | 13 | ## Defined in 14 | 15 | [packages/core/src/core/models.ts:183](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/models.ts#L183) 16 | -------------------------------------------------------------------------------- /docs/api/functions/getGoals.md: -------------------------------------------------------------------------------- 1 | # Function: getGoals() 2 | 3 | > **getGoals**(`__namedParameters`): `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **\_\_namedParameters.roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 12 | 13 | • **\_\_namedParameters.userId?**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 14 | 15 | • **\_\_namedParameters.onlyInProgress?**: `boolean` = `true` 16 | 17 | • **\_\_namedParameters.count?**: `number` = `5` 18 | 19 | ## Returns 20 | 21 | `Promise`\<[`Goal`](../interfaces/Goal.md)[]\> 22 | 23 | ## Defined in 24 | 25 | [packages/core/src/core/goals.ts:8](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/goals.ts#L8) 26 | -------------------------------------------------------------------------------- /docs/api/functions/getImageGenModel.md: -------------------------------------------------------------------------------- 1 | # Function: getImageGenModel() 2 | 3 | > **getImageGenModel**(`model`): `object` \| `object` 4 | 5 | ## Parameters 6 | 7 | • **model**: [`ImageGenModel`](../enumerations/ImageGenModel.md) 8 | 9 | ## Returns 10 | 11 | `object` \| `object` 12 | 13 | ## Defined in 14 | 15 | [packages/core/src/core/imageGenModels.ts:17](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/imageGenModels.ts#L17) 16 | -------------------------------------------------------------------------------- /docs/api/functions/getModel.md: -------------------------------------------------------------------------------- 1 | # Function: getModel() 2 | 3 | > **getModel**(`provider`, `type`): `string` 4 | 5 | ## Parameters 6 | 7 | • **provider**: [`ModelProvider`](../enumerations/ModelProvider.md) 8 | 9 | • **type**: [`ModelClass`](../enumerations/ModelClass.md) 10 | 11 | ## Returns 12 | 13 | `string` 14 | 15 | ## Defined in 16 | 17 | [packages/core/src/core/models.ts:179](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/models.ts#L179) 18 | -------------------------------------------------------------------------------- /docs/api/functions/getProviders.md: -------------------------------------------------------------------------------- 1 | # Function: getProviders() 2 | 3 | > **getProviders**(`runtime`, `message`, `state`?): `Promise`\<`string`\> 4 | 5 | Formats provider outputs into a string which can be injected into the context. 6 | 7 | ## Parameters 8 | 9 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | The AgentRuntime object. 12 | 13 | • **message**: [`Memory`](../interfaces/Memory.md) 14 | 15 | The incoming message object. 16 | 17 | • **state?**: [`State`](../interfaces/State.md) 18 | 19 | The current state object. 20 | 21 | ## Returns 22 | 23 | `Promise`\<`string`\> 24 | 25 | A string that concatenates the outputs of each provider. 26 | 27 | ## Defined in 28 | 29 | [packages/core/src/core/providers.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/providers.ts#L13) 30 | -------------------------------------------------------------------------------- /docs/api/functions/getRelationship.md: -------------------------------------------------------------------------------- 1 | # Function: getRelationship() 2 | 3 | > **getRelationship**(`__namedParameters`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **\_\_namedParameters.userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 12 | 13 | • **\_\_namedParameters.userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 14 | 15 | ## Returns 16 | 17 | `Promise`\<[`Relationship`](../interfaces/Relationship.md)\> 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/relationships.ts:18](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/relationships.ts#L18) 22 | -------------------------------------------------------------------------------- /docs/api/functions/getRelationships.md: -------------------------------------------------------------------------------- 1 | # Function: getRelationships() 2 | 3 | > **getRelationships**(`__namedParameters`): `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **\_\_namedParameters.userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 12 | 13 | ## Returns 14 | 15 | `Promise`\<[`Relationship`](../interfaces/Relationship.md)[]\> 16 | 17 | ## Defined in 18 | 19 | [packages/core/src/core/relationships.ts:33](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/relationships.ts#L33) 20 | -------------------------------------------------------------------------------- /docs/api/functions/getTokenForProvider.md: -------------------------------------------------------------------------------- 1 | # Function: getTokenForProvider() 2 | 3 | > **getTokenForProvider**(`provider`, `character`): `string` 4 | 5 | ## Parameters 6 | 7 | • **provider**: [`ModelProvider`](../enumerations/ModelProvider.md) 8 | 9 | • **character**: [`Character`](../type-aliases/Character.md) 10 | 11 | ## Returns 12 | 13 | `string` 14 | 15 | ## Defined in 16 | 17 | [packages/core/src/cli/index.ts:108](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L108) 18 | -------------------------------------------------------------------------------- /docs/api/functions/initializeClients.md: -------------------------------------------------------------------------------- 1 | # Function: initializeClients() 2 | 3 | > **initializeClients**(`character`, `runtime`): `Promise`\<`any`[]\> 4 | 5 | ## Parameters 6 | 7 | • **character**: [`Character`](../type-aliases/Character.md) 8 | 9 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | ## Returns 12 | 13 | `Promise`\<`any`[]\> 14 | 15 | ## Defined in 16 | 17 | [packages/core/src/cli/index.ts:21](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L21) 18 | -------------------------------------------------------------------------------- /docs/api/functions/initializeDatabase.md: -------------------------------------------------------------------------------- 1 | # Function: initializeDatabase() 2 | 3 | > **initializeDatabase**(): [`PostgresDatabaseAdapter`](../classes/PostgresDatabaseAdapter.md) \| [`SqliteDatabaseAdapter`](../classes/SqliteDatabaseAdapter.md) 4 | 5 | ## Returns 6 | 7 | [`PostgresDatabaseAdapter`](../classes/PostgresDatabaseAdapter.md) \| [`SqliteDatabaseAdapter`](../classes/SqliteDatabaseAdapter.md) 8 | 9 | ## Defined in 10 | 11 | [packages/core/src/cli/index.ts:132](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L132) 12 | -------------------------------------------------------------------------------- /docs/api/functions/isCreateAndBuyContent.md: -------------------------------------------------------------------------------- 1 | # Function: isCreateAndBuyContent() 2 | 3 | > **isCreateAndBuyContent**(`runtime`, `content`): `content is CreateAndBuyContent` 4 | 5 | ## Parameters 6 | 7 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 8 | 9 | • **content**: `any` 10 | 11 | ## Returns 12 | 13 | `content is CreateAndBuyContent` 14 | 15 | ## Defined in 16 | 17 | [packages/core/src/actions/pumpfun.ts:33](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L33) 18 | -------------------------------------------------------------------------------- /docs/api/functions/loadActionConfigs.md: -------------------------------------------------------------------------------- 1 | # Function: loadActionConfigs() 2 | 3 | > **loadActionConfigs**(`configPath`): `ActionConfig`[] 4 | 5 | ## Parameters 6 | 7 | • **configPath**: `string` 8 | 9 | ## Returns 10 | 11 | `ActionConfig`[] 12 | 13 | ## Defined in 14 | 15 | [packages/core/src/cli/config.ts:15](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/config.ts#L15) 16 | -------------------------------------------------------------------------------- /docs/api/functions/loadCharacters.md: -------------------------------------------------------------------------------- 1 | # Function: loadCharacters() 2 | 3 | > **loadCharacters**(`charactersArg`): [`Character`](../type-aliases/Character.md)[] 4 | 5 | ## Parameters 6 | 7 | • **charactersArg**: `string` 8 | 9 | ## Returns 10 | 11 | [`Character`](../type-aliases/Character.md)[] 12 | 13 | ## Defined in 14 | 15 | [packages/core/src/cli/index.ts:70](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L70) 16 | -------------------------------------------------------------------------------- /docs/api/functions/loadCustomActions.md: -------------------------------------------------------------------------------- 1 | # Function: loadCustomActions() 2 | 3 | > **loadCustomActions**(`actionConfigs`): `Promise`\<[`Action`](../interfaces/Action.md)[]\> 4 | 5 | ## Parameters 6 | 7 | • **actionConfigs**: `ActionConfig`[] 8 | 9 | ## Returns 10 | 11 | `Promise`\<[`Action`](../interfaces/Action.md)[]\> 12 | 13 | ## Defined in 14 | 15 | [packages/core/src/cli/config.ts:26](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/config.ts#L26) 16 | -------------------------------------------------------------------------------- /docs/api/functions/parseArguments.md: -------------------------------------------------------------------------------- 1 | # Function: parseArguments() 2 | 3 | > **parseArguments**(): `Arguments` 4 | 5 | ## Returns 6 | 7 | `Arguments` 8 | 9 | ## Defined in 10 | 11 | [packages/core/src/cli/index.ts:46](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L46) 12 | -------------------------------------------------------------------------------- /docs/api/functions/retrieveCachedEmbedding.md: -------------------------------------------------------------------------------- 1 | # Function: retrieveCachedEmbedding() 2 | 3 | > **retrieveCachedEmbedding**(`runtime`, `input`): `Promise`\<`number`[]\> 4 | 5 | ## Parameters 6 | 7 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 8 | 9 | • **input**: `string` 10 | 11 | ## Returns 12 | 13 | `Promise`\<`number`[]\> 14 | 15 | ## Defined in 16 | 17 | [packages/core/src/core/embedding.ts:68](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/embedding.ts#L68) 18 | -------------------------------------------------------------------------------- /docs/api/functions/sellToken.md: -------------------------------------------------------------------------------- 1 | # Function: sellToken() 2 | 3 | > **sellToken**(`__namedParameters`): `Promise`\<`void`\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.sdk**: `PumpFunSDK` 10 | 11 | • **\_\_namedParameters.seller**: `Keypair` 12 | 13 | • **\_\_namedParameters.mint**: `PublicKey` 14 | 15 | • **\_\_namedParameters.amount**: `bigint` 16 | 17 | • **\_\_namedParameters.priorityFee**: `PriorityFee` 18 | 19 | • **\_\_namedParameters.allowOffCurve**: `boolean` 20 | 21 | • **\_\_namedParameters.slippage**: `string` 22 | 23 | • **\_\_namedParameters.connection**: `Connection` 24 | 25 | ## Returns 26 | 27 | `Promise`\<`void`\> 28 | 29 | ## Defined in 30 | 31 | [packages/core/src/actions/pumpfun.ts:167](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/pumpfun.ts#L167) 32 | -------------------------------------------------------------------------------- /docs/api/functions/splitChunks.md: -------------------------------------------------------------------------------- 1 | # Function: splitChunks() 2 | 3 | > **splitChunks**(`runtime`, `content`, `chunkSize`, `bleed`, `modelClass`): `Promise`\<`string`[]\> 4 | 5 | Splits content into chunks of specified size with optional overlapping bleed sections 6 | 7 | ## Parameters 8 | 9 | • **runtime**: `any` 10 | 11 | • **content**: `string` 12 | 13 | The text content to split into chunks 14 | 15 | • **chunkSize**: `number` 16 | 17 | The maximum size of each chunk in tokens 18 | 19 | • **bleed**: `number` = `100` 20 | 21 | Number of characters to overlap between chunks (default: 100) 22 | 23 | • **modelClass**: `string` 24 | 25 | ## Returns 26 | 27 | `Promise`\<`string`[]\> 28 | 29 | Promise resolving to array of text chunks with bleed sections 30 | 31 | ## Defined in 32 | 33 | [packages/core/src/core/generation.ts:329](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L329) 34 | -------------------------------------------------------------------------------- /docs/api/functions/startDiscord.md: -------------------------------------------------------------------------------- 1 | # Function: startDiscord() 2 | 3 | > **startDiscord**(`runtime`): [`DiscordClient`](../classes/DiscordClient.md) 4 | 5 | ## Parameters 6 | 7 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 8 | 9 | ## Returns 10 | 11 | [`DiscordClient`](../classes/DiscordClient.md) 12 | 13 | ## Defined in 14 | 15 | [packages/core/src/cli/index.ts:214](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L214) 16 | -------------------------------------------------------------------------------- /docs/api/functions/startTelegram.md: -------------------------------------------------------------------------------- 1 | # Function: startTelegram() 2 | 3 | > **startTelegram**(`runtime`, `character`): `Promise`\<[`TelegramClient`](../classes/TelegramClient.md)\> 4 | 5 | ## Parameters 6 | 7 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 8 | 9 | • **character**: [`Character`](../type-aliases/Character.md) 10 | 11 | ## Returns 12 | 13 | `Promise`\<[`TelegramClient`](../classes/TelegramClient.md)\> 14 | 15 | ## Defined in 16 | 17 | [packages/core/src/cli/index.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L218) 18 | -------------------------------------------------------------------------------- /docs/api/functions/startTwitter.md: -------------------------------------------------------------------------------- 1 | # Function: startTwitter() 2 | 3 | > **startTwitter**(`runtime`): `Promise`\<([`TwitterPostClient`](../classes/TwitterPostClient.md) \| [`TwitterInteractionClient`](../classes/TwitterInteractionClient.md) \| [`TwitterSearchClient`](../classes/TwitterSearchClient.md))[]\> 4 | 5 | ## Parameters 6 | 7 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 8 | 9 | ## Returns 10 | 11 | `Promise`\<([`TwitterPostClient`](../classes/TwitterPostClient.md) \| [`TwitterInteractionClient`](../classes/TwitterInteractionClient.md) \| [`TwitterSearchClient`](../classes/TwitterSearchClient.md))[]\> 12 | 13 | ## Defined in 14 | 15 | [packages/core/src/cli/index.ts:248](https://github.com/ai16z/eliza/blob/main/packages/core/src/cli/index.ts#L248) 16 | -------------------------------------------------------------------------------- /docs/api/functions/trimTokens.md: -------------------------------------------------------------------------------- 1 | # Function: trimTokens() 2 | 3 | > **trimTokens**(`context`, `maxTokens`, `model`): `any` 4 | 5 | Truncate the context to the maximum length allowed by the model. 6 | 7 | ## Parameters 8 | 9 | • **context**: `any` 10 | 11 | The context of the message to be completed. 12 | 13 | • **maxTokens**: `any` 14 | 15 | • **model**: `any` 16 | 17 | The model to use for generateText. 18 | 19 | ## Returns 20 | 21 | `any` 22 | 23 | ## Defined in 24 | 25 | [packages/core/src/core/generation.ts:247](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/generation.ts#L247) 26 | -------------------------------------------------------------------------------- /docs/api/functions/updateGoal.md: -------------------------------------------------------------------------------- 1 | # Function: updateGoal() 2 | 3 | > **updateGoal**(`__namedParameters`): `Promise`\<`void`\> 4 | 5 | ## Parameters 6 | 7 | • **\_\_namedParameters** 8 | 9 | • **\_\_namedParameters.runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **\_\_namedParameters.goal**: [`Goal`](../interfaces/Goal.md) 12 | 13 | ## Returns 14 | 15 | `Promise`\<`void`\> 16 | 17 | ## Defined in 18 | 19 | [packages/core/src/core/goals.ts:44](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/goals.ts#L44) 20 | -------------------------------------------------------------------------------- /docs/api/interfaces/Account.md: -------------------------------------------------------------------------------- 1 | # Interface: Account 2 | 3 | Represents a user, including their name, details, and a unique identifier. 4 | 5 | ## Properties 6 | 7 | ### id 8 | 9 | > **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:270](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L270) 14 | 15 | *** 16 | 17 | ### name 18 | 19 | > **name**: `string` 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:271](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L271) 24 | 25 | *** 26 | 27 | ### username 28 | 29 | > **username**: `string` 30 | 31 | #### Defined in 32 | 33 | [packages/core/src/core/types.ts:272](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L272) 34 | 35 | *** 36 | 37 | ### details? 38 | 39 | > `optional` **details**: `object` 40 | 41 | #### Index Signature 42 | 43 | \[`key`: `string`\]: `any` 44 | 45 | #### Defined in 46 | 47 | [packages/core/src/core/types.ts:273](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L273) 48 | 49 | *** 50 | 51 | ### email? 52 | 53 | > `optional` **email**: `string` 54 | 55 | #### Defined in 56 | 57 | [packages/core/src/core/types.ts:274](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L274) 58 | 59 | *** 60 | 61 | ### avatarUrl? 62 | 63 | > `optional` **avatarUrl**: `string` 64 | 65 | #### Defined in 66 | 67 | [packages/core/src/core/types.ts:275](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L275) 68 | -------------------------------------------------------------------------------- /docs/api/interfaces/Action.md: -------------------------------------------------------------------------------- 1 | # Interface: Action 2 | 3 | Represents an action that the agent can perform, including conditions for its use, a description, examples, a handler function, and a validation function. 4 | 5 | ## Properties 6 | 7 | ### similes 8 | 9 | > **similes**: `string`[] 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:213](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L213) 14 | 15 | *** 16 | 17 | ### description 18 | 19 | > **description**: `string` 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:214](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L214) 24 | 25 | *** 26 | 27 | ### examples 28 | 29 | > **examples**: [`ActionExample`](ActionExample.md)[][] 30 | 31 | #### Defined in 32 | 33 | [packages/core/src/core/types.ts:215](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L215) 34 | 35 | *** 36 | 37 | ### handler 38 | 39 | > **handler**: [`Handler`](../type-aliases/Handler.md) 40 | 41 | #### Defined in 42 | 43 | [packages/core/src/core/types.ts:216](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L216) 44 | 45 | *** 46 | 47 | ### name 48 | 49 | > **name**: `string` 50 | 51 | #### Defined in 52 | 53 | [packages/core/src/core/types.ts:217](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L217) 54 | 55 | *** 56 | 57 | ### validate 58 | 59 | > **validate**: [`Validator`](../type-aliases/Validator.md) 60 | 61 | #### Defined in 62 | 63 | [packages/core/src/core/types.ts:218](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L218) 64 | -------------------------------------------------------------------------------- /docs/api/interfaces/ActionExample.md: -------------------------------------------------------------------------------- 1 | # Interface: ActionExample 2 | 3 | Represents an example of content, typically used for demonstrating or testing purposes. Includes user, content, optional action, and optional source. 4 | 5 | ## Properties 6 | 7 | ### user 8 | 9 | > **user**: `string` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:26](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L26) 14 | 15 | *** 16 | 17 | ### content 18 | 19 | > **content**: [`Content`](Content.md) 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L27) 24 | -------------------------------------------------------------------------------- /docs/api/interfaces/Actor.md: -------------------------------------------------------------------------------- 1 | # Interface: Actor 2 | 3 | Represents an actor in the conversation, which could be a user or the agent itself, including their name, details (such as tagline, summary, and quote), and a unique identifier. 4 | 5 | ## Properties 6 | 7 | ### name 8 | 9 | > **name**: `string` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:42](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L42) 14 | 15 | *** 16 | 17 | ### username 18 | 19 | > **username**: `string` 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:43](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L43) 24 | 25 | *** 26 | 27 | ### details 28 | 29 | > **details**: `object` 30 | 31 | #### tagline 32 | 33 | > **tagline**: `string` 34 | 35 | #### summary 36 | 37 | > **summary**: `string` 38 | 39 | #### quote 40 | 41 | > **quote**: `string` 42 | 43 | #### Defined in 44 | 45 | [packages/core/src/core/types.ts:44](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L44) 46 | 47 | *** 48 | 49 | ### id 50 | 51 | > **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 52 | 53 | #### Defined in 54 | 55 | [packages/core/src/core/types.ts:45](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L45) 56 | -------------------------------------------------------------------------------- /docs/api/interfaces/Content.md: -------------------------------------------------------------------------------- 1 | # Interface: Content 2 | 3 | Represents the content of a message, including its main text (`content`), any associated action (`action`), and the source of the content (`source`), if applicable. 4 | 5 | ## Extended by 6 | 7 | - [`CreateAndBuyContent`](CreateAndBuyContent.md) 8 | 9 | ## Indexable 10 | 11 | \[`key`: `string`\]: `unknown` 12 | 13 | ## Properties 14 | 15 | ### text 16 | 17 | > **text**: `string` 18 | 19 | #### Defined in 20 | 21 | [packages/core/src/core/types.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L13) 22 | 23 | *** 24 | 25 | ### action? 26 | 27 | > `optional` **action**: `string` 28 | 29 | #### Defined in 30 | 31 | [packages/core/src/core/types.ts:14](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L14) 32 | 33 | *** 34 | 35 | ### source? 36 | 37 | > `optional` **source**: `string` 38 | 39 | #### Defined in 40 | 41 | [packages/core/src/core/types.ts:15](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L15) 42 | 43 | *** 44 | 45 | ### url? 46 | 47 | > `optional` **url**: `string` 48 | 49 | #### Defined in 50 | 51 | [packages/core/src/core/types.ts:16](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L16) 52 | 53 | *** 54 | 55 | ### inReplyTo? 56 | 57 | > `optional` **inReplyTo**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 58 | 59 | #### Defined in 60 | 61 | [packages/core/src/core/types.ts:17](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L17) 62 | 63 | *** 64 | 65 | ### attachments? 66 | 67 | > `optional` **attachments**: [`Media`](../type-aliases/Media.md)[] 68 | 69 | #### Defined in 70 | 71 | [packages/core/src/core/types.ts:18](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L18) 72 | -------------------------------------------------------------------------------- /docs/api/interfaces/ConversationExample.md: -------------------------------------------------------------------------------- 1 | # Interface: ConversationExample 2 | 3 | Represents an example of content, typically used for demonstrating or testing purposes. Includes user, content, optional action, and optional source. 4 | 5 | ## Properties 6 | 7 | ### userId 8 | 9 | > **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:34](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L34) 14 | 15 | *** 16 | 17 | ### content 18 | 19 | > **content**: [`Content`](Content.md) 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:35](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L35) 24 | -------------------------------------------------------------------------------- /docs/api/interfaces/EvaluationExample.md: -------------------------------------------------------------------------------- 1 | # Interface: EvaluationExample 2 | 3 | Represents an example for evaluation, including the context, an array of message examples, and the expected outcome. 4 | 5 | ## Properties 6 | 7 | ### context 8 | 9 | > **context**: `string` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:225](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L225) 14 | 15 | *** 16 | 17 | ### messages 18 | 19 | > **messages**: [`ActionExample`](ActionExample.md)[] 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:226](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L226) 24 | 25 | *** 26 | 27 | ### outcome 28 | 29 | > **outcome**: `string` 30 | 31 | #### Defined in 32 | 33 | [packages/core/src/core/types.ts:227](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L227) 34 | -------------------------------------------------------------------------------- /docs/api/interfaces/Evaluator.md: -------------------------------------------------------------------------------- 1 | # Interface: Evaluator 2 | 3 | Represents an evaluator, which is used to assess and guide the agent's responses based on the current context and state. 4 | 5 | ## Properties 6 | 7 | ### description 8 | 9 | > **description**: `string` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:234](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L234) 14 | 15 | *** 16 | 17 | ### similes 18 | 19 | > **similes**: `string`[] 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:235](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L235) 24 | 25 | *** 26 | 27 | ### examples 28 | 29 | > **examples**: [`EvaluationExample`](EvaluationExample.md)[] 30 | 31 | #### Defined in 32 | 33 | [packages/core/src/core/types.ts:236](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L236) 34 | 35 | *** 36 | 37 | ### handler 38 | 39 | > **handler**: [`Handler`](../type-aliases/Handler.md) 40 | 41 | #### Defined in 42 | 43 | [packages/core/src/core/types.ts:237](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L237) 44 | 45 | *** 46 | 47 | ### name 48 | 49 | > **name**: `string` 50 | 51 | #### Defined in 52 | 53 | [packages/core/src/core/types.ts:238](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L238) 54 | 55 | *** 56 | 57 | ### validate 58 | 59 | > **validate**: [`Validator`](../type-aliases/Validator.md) 60 | 61 | #### Defined in 62 | 63 | [packages/core/src/core/types.ts:239](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L239) 64 | -------------------------------------------------------------------------------- /docs/api/interfaces/Goal.md: -------------------------------------------------------------------------------- 1 | # Interface: Goal 2 | 3 | Represents a goal, which is a higher-level aim composed of one or more objectives. Goals are tracked to measure progress or achievements within the conversation or system. 4 | 5 | ## Properties 6 | 7 | ### id? 8 | 9 | > `optional` **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:67](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L67) 14 | 15 | *** 16 | 17 | ### roomId 18 | 19 | > **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:68](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L68) 24 | 25 | *** 26 | 27 | ### userId 28 | 29 | > **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 30 | 31 | #### Defined in 32 | 33 | [packages/core/src/core/types.ts:69](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L69) 34 | 35 | *** 36 | 37 | ### name 38 | 39 | > **name**: `string` 40 | 41 | #### Defined in 42 | 43 | [packages/core/src/core/types.ts:70](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L70) 44 | 45 | *** 46 | 47 | ### status 48 | 49 | > **status**: [`GoalStatus`](../enumerations/GoalStatus.md) 50 | 51 | #### Defined in 52 | 53 | [packages/core/src/core/types.ts:71](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L71) 54 | 55 | *** 56 | 57 | ### objectives 58 | 59 | > **objectives**: [`Objective`](Objective.md)[] 60 | 61 | #### Defined in 62 | 63 | [packages/core/src/core/types.ts:72](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L72) 64 | -------------------------------------------------------------------------------- /docs/api/interfaces/IBrowserService.md: -------------------------------------------------------------------------------- 1 | # Interface: IBrowserService 2 | 3 | ## Methods 4 | 5 | ### initialize() 6 | 7 | > **initialize**(): `Promise`\<`void`\> 8 | 9 | #### Returns 10 | 11 | `Promise`\<`void`\> 12 | 13 | #### Defined in 14 | 15 | [packages/core/src/core/types.ts:599](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L599) 16 | 17 | *** 18 | 19 | ### closeBrowser() 20 | 21 | > **closeBrowser**(): `Promise`\<`void`\> 22 | 23 | #### Returns 24 | 25 | `Promise`\<`void`\> 26 | 27 | #### Defined in 28 | 29 | [packages/core/src/core/types.ts:600](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L600) 30 | 31 | *** 32 | 33 | ### getPageContent() 34 | 35 | > **getPageContent**(`url`): `Promise`\<`object`\> 36 | 37 | #### Parameters 38 | 39 | • **url**: `string` 40 | 41 | #### Returns 42 | 43 | `Promise`\<`object`\> 44 | 45 | ##### title 46 | 47 | > **title**: `string` 48 | 49 | ##### description 50 | 51 | > **description**: `string` 52 | 53 | ##### bodyContent 54 | 55 | > **bodyContent**: `string` 56 | 57 | #### Defined in 58 | 59 | [packages/core/src/core/types.ts:601](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L601) 60 | -------------------------------------------------------------------------------- /docs/api/interfaces/IImageRecognitionService.md: -------------------------------------------------------------------------------- 1 | # Interface: IImageRecognitionService 2 | 3 | ## Methods 4 | 5 | ### initialize() 6 | 7 | > **initialize**(`modelId`?, `device`?): `Promise`\<`void`\> 8 | 9 | #### Parameters 10 | 11 | • **modelId?**: `string` 12 | 13 | • **device?**: `string` 14 | 15 | #### Returns 16 | 17 | `Promise`\<`void`\> 18 | 19 | #### Defined in 20 | 21 | [packages/core/src/core/types.ts:557](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L557) 22 | 23 | *** 24 | 25 | ### describeImage() 26 | 27 | > **describeImage**(`imageUrl`): `Promise`\<`object`\> 28 | 29 | #### Parameters 30 | 31 | • **imageUrl**: `string` 32 | 33 | #### Returns 34 | 35 | `Promise`\<`object`\> 36 | 37 | ##### title 38 | 39 | > **title**: `string` 40 | 41 | ##### description 42 | 43 | > **description**: `string` 44 | 45 | #### Defined in 46 | 47 | [packages/core/src/core/types.ts:558](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L558) 48 | -------------------------------------------------------------------------------- /docs/api/interfaces/ILlamaService.md: -------------------------------------------------------------------------------- 1 | # Interface: ILlamaService 2 | 3 | ## Methods 4 | 5 | ### initializeModel() 6 | 7 | > **initializeModel**(): `Promise`\<`void`\> 8 | 9 | #### Returns 10 | 11 | `Promise`\<`void`\> 12 | 13 | #### Defined in 14 | 15 | [packages/core/src/core/types.ts:578](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L578) 16 | 17 | *** 18 | 19 | ### queueMessageCompletion() 20 | 21 | > **queueMessageCompletion**(`context`, `temperature`, `stop`, `frequency_penalty`, `presence_penalty`, `max_tokens`): `Promise`\<`any`\> 22 | 23 | #### Parameters 24 | 25 | • **context**: `string` 26 | 27 | • **temperature**: `number` 28 | 29 | • **stop**: `string`[] 30 | 31 | • **frequency\_penalty**: `number` 32 | 33 | • **presence\_penalty**: `number` 34 | 35 | • **max\_tokens**: `number` 36 | 37 | #### Returns 38 | 39 | `Promise`\<`any`\> 40 | 41 | #### Defined in 42 | 43 | [packages/core/src/core/types.ts:579](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L579) 44 | 45 | *** 46 | 47 | ### queueTextCompletion() 48 | 49 | > **queueTextCompletion**(`context`, `temperature`, `stop`, `frequency_penalty`, `presence_penalty`, `max_tokens`): `Promise`\<`string`\> 50 | 51 | #### Parameters 52 | 53 | • **context**: `string` 54 | 55 | • **temperature**: `number` 56 | 57 | • **stop**: `string`[] 58 | 59 | • **frequency\_penalty**: `number` 60 | 61 | • **presence\_penalty**: `number` 62 | 63 | • **max\_tokens**: `number` 64 | 65 | #### Returns 66 | 67 | `Promise`\<`string`\> 68 | 69 | #### Defined in 70 | 71 | [packages/core/src/core/types.ts:587](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L587) 72 | 73 | *** 74 | 75 | ### getEmbeddingResponse() 76 | 77 | > **getEmbeddingResponse**(`input`): `Promise`\<`number`[]\> 78 | 79 | #### Parameters 80 | 81 | • **input**: `string` 82 | 83 | #### Returns 84 | 85 | `Promise`\<`number`[]\> 86 | 87 | #### Defined in 88 | 89 | [packages/core/src/core/types.ts:595](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L595) 90 | -------------------------------------------------------------------------------- /docs/api/interfaces/IPdfService.md: -------------------------------------------------------------------------------- 1 | # Interface: IPdfService 2 | 3 | ## Methods 4 | 5 | ### convertPdfToText() 6 | 7 | > **convertPdfToText**(`pdfBuffer`): `Promise`\<`string`\> 8 | 9 | #### Parameters 10 | 11 | • **pdfBuffer**: `Buffer` 12 | 13 | #### Returns 14 | 15 | `Promise`\<`string`\> 16 | 17 | #### Defined in 18 | 19 | [packages/core/src/core/types.ts:611](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L611) 20 | -------------------------------------------------------------------------------- /docs/api/interfaces/ISpeechService.md: -------------------------------------------------------------------------------- 1 | # Interface: ISpeechService 2 | 3 | ## Methods 4 | 5 | ### generate() 6 | 7 | > **generate**(`runtime`, `text`): `Promise`\<`Readable`\> 8 | 9 | #### Parameters 10 | 11 | • **runtime**: [`IAgentRuntime`](IAgentRuntime.md) 12 | 13 | • **text**: `string` 14 | 15 | #### Returns 16 | 17 | `Promise`\<`Readable`\> 18 | 19 | #### Defined in 20 | 21 | [packages/core/src/core/types.ts:607](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L607) 22 | -------------------------------------------------------------------------------- /docs/api/interfaces/ITranscriptionService.md: -------------------------------------------------------------------------------- 1 | # Interface: ITranscriptionService 2 | 3 | ## Methods 4 | 5 | ### transcribeAttachment() 6 | 7 | > **transcribeAttachment**(`audioBuffer`): `Promise`\<`string`\> 8 | 9 | #### Parameters 10 | 11 | • **audioBuffer**: `ArrayBuffer` 12 | 13 | #### Returns 14 | 15 | `Promise`\<`string`\> 16 | 17 | #### Defined in 18 | 19 | [packages/core/src/core/types.ts:564](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L564) 20 | 21 | *** 22 | 23 | ### transcribeAttachmentLocally() 24 | 25 | > **transcribeAttachmentLocally**(`audioBuffer`): `Promise`\<`string`\> 26 | 27 | #### Parameters 28 | 29 | • **audioBuffer**: `ArrayBuffer` 30 | 31 | #### Returns 32 | 33 | `Promise`\<`string`\> 34 | 35 | #### Defined in 36 | 37 | [packages/core/src/core/types.ts:565](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L565) 38 | 39 | *** 40 | 41 | ### transcribe() 42 | 43 | > **transcribe**(`audioBuffer`): `Promise`\<`string`\> 44 | 45 | #### Parameters 46 | 47 | • **audioBuffer**: `ArrayBuffer` 48 | 49 | #### Returns 50 | 51 | `Promise`\<`string`\> 52 | 53 | #### Defined in 54 | 55 | [packages/core/src/core/types.ts:568](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L568) 56 | 57 | *** 58 | 59 | ### transcribeLocally() 60 | 61 | > **transcribeLocally**(`audioBuffer`): `Promise`\<`string`\> 62 | 63 | #### Parameters 64 | 65 | • **audioBuffer**: `ArrayBuffer` 66 | 67 | #### Returns 68 | 69 | `Promise`\<`string`\> 70 | 71 | #### Defined in 72 | 73 | [packages/core/src/core/types.ts:569](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L569) 74 | -------------------------------------------------------------------------------- /docs/api/interfaces/IVideoService.md: -------------------------------------------------------------------------------- 1 | # Interface: IVideoService 2 | 3 | ## Methods 4 | 5 | ### isVideoUrl() 6 | 7 | > **isVideoUrl**(`url`): `boolean` 8 | 9 | #### Parameters 10 | 11 | • **url**: `string` 12 | 13 | #### Returns 14 | 15 | `boolean` 16 | 17 | #### Defined in 18 | 19 | [packages/core/src/core/types.ts:573](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L573) 20 | 21 | *** 22 | 23 | ### processVideo() 24 | 25 | > **processVideo**(`url`): `Promise`\<[`Media`](../type-aliases/Media.md)\> 26 | 27 | #### Parameters 28 | 29 | • **url**: `string` 30 | 31 | #### Returns 32 | 33 | `Promise`\<[`Media`](../type-aliases/Media.md)\> 34 | 35 | #### Defined in 36 | 37 | [packages/core/src/core/types.ts:574](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L574) 38 | -------------------------------------------------------------------------------- /docs/api/interfaces/Memory.md: -------------------------------------------------------------------------------- 1 | # Interface: Memory 2 | 3 | Represents a memory record, which could be a message or any other piece of information remembered by the system, including its content, associated user IDs, and optionally, its embedding vector for similarity comparisons. 4 | 5 | ## Properties 6 | 7 | ### id? 8 | 9 | > `optional` **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:165](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L165) 14 | 15 | *** 16 | 17 | ### userId 18 | 19 | > **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:166](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L166) 24 | 25 | *** 26 | 27 | ### agentId 28 | 29 | > **agentId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 30 | 31 | #### Defined in 32 | 33 | [packages/core/src/core/types.ts:167](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L167) 34 | 35 | *** 36 | 37 | ### createdAt? 38 | 39 | > `optional` **createdAt**: `number` 40 | 41 | #### Defined in 42 | 43 | [packages/core/src/core/types.ts:168](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L168) 44 | 45 | *** 46 | 47 | ### content 48 | 49 | > **content**: [`Content`](Content.md) 50 | 51 | #### Defined in 52 | 53 | [packages/core/src/core/types.ts:169](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L169) 54 | 55 | *** 56 | 57 | ### embedding? 58 | 59 | > `optional` **embedding**: `number`[] 60 | 61 | #### Defined in 62 | 63 | [packages/core/src/core/types.ts:170](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L170) 64 | 65 | *** 66 | 67 | ### roomId 68 | 69 | > **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 70 | 71 | #### Defined in 72 | 73 | [packages/core/src/core/types.ts:171](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L171) 74 | 75 | *** 76 | 77 | ### unique? 78 | 79 | > `optional` **unique**: `boolean` 80 | 81 | #### Defined in 82 | 83 | [packages/core/src/core/types.ts:172](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L172) 84 | -------------------------------------------------------------------------------- /docs/api/interfaces/MessageExample.md: -------------------------------------------------------------------------------- 1 | # Interface: MessageExample 2 | 3 | Represents an example of a message, typically used for demonstrating or testing purposes, including optional content and action. 4 | 5 | ## Properties 6 | 7 | ### user 8 | 9 | > **user**: `string` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:179](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L179) 14 | 15 | *** 16 | 17 | ### content 18 | 19 | > **content**: [`Content`](Content.md) 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:180](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L180) 24 | -------------------------------------------------------------------------------- /docs/api/interfaces/Objective.md: -------------------------------------------------------------------------------- 1 | # Interface: Objective 2 | 3 | Represents an objective within a goal, detailing what needs to be achieved and whether it has been completed. 4 | 5 | ## Properties 6 | 7 | ### id? 8 | 9 | > `optional` **id**: `string` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:52](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L52) 14 | 15 | *** 16 | 17 | ### description 18 | 19 | > **description**: `string` 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:53](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L53) 24 | 25 | *** 26 | 27 | ### completed 28 | 29 | > **completed**: `boolean` 30 | 31 | #### Defined in 32 | 33 | [packages/core/src/core/types.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L54) 34 | -------------------------------------------------------------------------------- /docs/api/interfaces/Participant.md: -------------------------------------------------------------------------------- 1 | # Interface: Participant 2 | 3 | Represents a participant in a room, including their ID and account details. 4 | 5 | ## Properties 6 | 7 | ### id 8 | 9 | > **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:282](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L282) 14 | 15 | *** 16 | 17 | ### account 18 | 19 | > **account**: [`Account`](Account.md) 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:283](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L283) 24 | -------------------------------------------------------------------------------- /docs/api/interfaces/Provider.md: -------------------------------------------------------------------------------- 1 | # Interface: Provider 2 | 3 | Represents a provider, which is used to retrieve information or perform actions on behalf of the agent, such as fetching data from an external API or service. 4 | 5 | ## Properties 6 | 7 | ### get() 8 | 9 | > **get**: (`runtime`, `message`, `state`?) => `Promise`\<`any`\> 10 | 11 | #### Parameters 12 | 13 | • **runtime**: [`IAgentRuntime`](IAgentRuntime.md) 14 | 15 | • **message**: [`Memory`](Memory.md) 16 | 17 | • **state?**: [`State`](State.md) 18 | 19 | #### Returns 20 | 21 | `Promise`\<`any`\> 22 | 23 | #### Defined in 24 | 25 | [packages/core/src/core/types.ts:246](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L246) 26 | -------------------------------------------------------------------------------- /docs/api/interfaces/Relationship.md: -------------------------------------------------------------------------------- 1 | # Interface: Relationship 2 | 3 | Represents a relationship between two users, including their IDs, the status of the relationship, and the room ID in which the relationship is established. 4 | 5 | ## Properties 6 | 7 | ### id 8 | 9 | > **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:257](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L257) 14 | 15 | *** 16 | 17 | ### userA 18 | 19 | > **userA**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:258](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L258) 24 | 25 | *** 26 | 27 | ### userB 28 | 29 | > **userB**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 30 | 31 | #### Defined in 32 | 33 | [packages/core/src/core/types.ts:259](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L259) 34 | 35 | *** 36 | 37 | ### userId 38 | 39 | > **userId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 40 | 41 | #### Defined in 42 | 43 | [packages/core/src/core/types.ts:260](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L260) 44 | 45 | *** 46 | 47 | ### roomId 48 | 49 | > **roomId**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 50 | 51 | #### Defined in 52 | 53 | [packages/core/src/core/types.ts:261](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L261) 54 | 55 | *** 56 | 57 | ### status 58 | 59 | > **status**: `string` 60 | 61 | #### Defined in 62 | 63 | [packages/core/src/core/types.ts:262](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L262) 64 | 65 | *** 66 | 67 | ### createdAt? 68 | 69 | > `optional` **createdAt**: `string` 70 | 71 | #### Defined in 72 | 73 | [packages/core/src/core/types.ts:263](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L263) 74 | -------------------------------------------------------------------------------- /docs/api/interfaces/Room.md: -------------------------------------------------------------------------------- 1 | # Interface: Room 2 | 3 | Represents a room or conversation context, including its ID and a list of participants. 4 | 5 | ## Properties 6 | 7 | ### id 8 | 9 | > **id**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 10 | 11 | #### Defined in 12 | 13 | [packages/core/src/core/types.ts:290](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L290) 14 | 15 | *** 16 | 17 | ### participants 18 | 19 | > **participants**: [`Participant`](Participant.md)[] 20 | 21 | #### Defined in 22 | 23 | [packages/core/src/core/types.ts:291](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L291) 24 | -------------------------------------------------------------------------------- /docs/api/type-aliases/Handler.md: -------------------------------------------------------------------------------- 1 | # Type Alias: Handler() 2 | 3 | > **Handler**: (`runtime`, `message`, `state`?, `options`?, `callback`?) => `Promise`\<`unknown`\> 4 | 5 | Represents the type of a handler function, which takes a runtime instance, a message, and an optional state, and returns a promise resolving to any type. 6 | 7 | ## Parameters 8 | 9 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **message**: [`Memory`](../interfaces/Memory.md) 12 | 13 | • **state?**: [`State`](../interfaces/State.md) 14 | 15 | • **options?** 16 | 17 | • **callback?**: [`HandlerCallback`](HandlerCallback.md) 18 | 19 | ## Returns 20 | 21 | `Promise`\<`unknown`\> 22 | 23 | ## Defined in 24 | 25 | [packages/core/src/core/types.ts:186](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L186) 26 | -------------------------------------------------------------------------------- /docs/api/type-aliases/HandlerCallback.md: -------------------------------------------------------------------------------- 1 | # Type Alias: HandlerCallback() 2 | 3 | > **HandlerCallback**: (`response`, `files`?) => `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> 4 | 5 | ## Parameters 6 | 7 | • **response**: [`Content`](../interfaces/Content.md) 8 | 9 | • **files?**: `any` 10 | 11 | ## Returns 12 | 13 | `Promise`\<[`Memory`](../interfaces/Memory.md)[]\> 14 | 15 | ## Defined in 16 | 17 | [packages/core/src/core/types.ts:195](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L195) 18 | -------------------------------------------------------------------------------- /docs/api/type-aliases/Media.md: -------------------------------------------------------------------------------- 1 | # Type Alias: Media 2 | 3 | > **Media**: `object` 4 | 5 | ## Type declaration 6 | 7 | ### id 8 | 9 | > **id**: `string` 10 | 11 | ### url 12 | 13 | > **url**: `string` 14 | 15 | ### title 16 | 17 | > **title**: `string` 18 | 19 | ### source 20 | 21 | > **source**: `string` 22 | 23 | ### description 24 | 25 | > **description**: `string` 26 | 27 | ### text 28 | 29 | > **text**: `string` 30 | 31 | ## Defined in 32 | 33 | [packages/core/src/core/types.ts:294](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L294) 34 | -------------------------------------------------------------------------------- /docs/api/type-aliases/Model.md: -------------------------------------------------------------------------------- 1 | # Type Alias: Model 2 | 3 | > **Model**: `object` 4 | 5 | ## Type declaration 6 | 7 | ### endpoint? 8 | 9 | > `optional` **endpoint**: `string` 10 | 11 | ### settings 12 | 13 | > **settings**: `object` 14 | 15 | ### settings.maxInputTokens 16 | 17 | > **maxInputTokens**: `number` 18 | 19 | ### settings.maxOutputTokens 20 | 21 | > **maxOutputTokens**: `number` 22 | 23 | ### settings.frequency\_penalty? 24 | 25 | > `optional` **frequency\_penalty**: `number` 26 | 27 | ### settings.presence\_penalty? 28 | 29 | > `optional` **presence\_penalty**: `number` 30 | 31 | ### settings.repetition\_penalty? 32 | 33 | > `optional` **repetition\_penalty**: `number` 34 | 35 | ### settings.stop 36 | 37 | > **stop**: `string`[] 38 | 39 | ### settings.temperature 40 | 41 | > **temperature**: `number` 42 | 43 | ### model 44 | 45 | > **model**: `object` 46 | 47 | ### model.small 48 | 49 | > **small**: `string` 50 | 51 | ### model.medium 52 | 53 | > **medium**: `string` 54 | 55 | ### model.large 56 | 57 | > **large**: `string` 58 | 59 | ### model.embedding? 60 | 61 | > `optional` **embedding**: `string` 62 | 63 | ## Defined in 64 | 65 | [packages/core/src/core/types.ts:82](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L82) 66 | -------------------------------------------------------------------------------- /docs/api/type-aliases/Models.md: -------------------------------------------------------------------------------- 1 | # Type Alias: Models 2 | 3 | > **Models**: `object` 4 | 5 | ## Type declaration 6 | 7 | ### openai 8 | 9 | > **openai**: [`Model`](Model.md) 10 | 11 | ### anthropic 12 | 13 | > **anthropic**: [`Model`](Model.md) 14 | 15 | ### grok 16 | 17 | > **grok**: [`Model`](Model.md) 18 | 19 | ### groq 20 | 21 | > **groq**: [`Model`](Model.md) 22 | 23 | ### llama\_cloud 24 | 25 | > **llama\_cloud**: [`Model`](Model.md) 26 | 27 | ### llama\_local 28 | 29 | > **llama\_local**: [`Model`](Model.md) 30 | 31 | ### google 32 | 33 | > **google**: [`Model`](Model.md) 34 | 35 | ### claude\_vertex 36 | 37 | > **claude\_vertex**: [`Model`](Model.md) 38 | 39 | ### redpill 40 | 41 | > **redpill**: [`Model`](Model.md) 42 | 43 | ### ollama 44 | 45 | > **ollama**: [`Model`](Model.md) 46 | 47 | ## Defined in 48 | 49 | [packages/core/src/core/types.ts:101](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L101) 50 | -------------------------------------------------------------------------------- /docs/api/type-aliases/Plugin.md: -------------------------------------------------------------------------------- 1 | # Type Alias: Plugin 2 | 3 | > **Plugin**: `object` 4 | 5 | ## Type declaration 6 | 7 | ### name 8 | 9 | > **name**: `string` 10 | 11 | ### description 12 | 13 | > **description**: `string` 14 | 15 | ### actions 16 | 17 | > **actions**: [`Action`](../interfaces/Action.md)[] 18 | 19 | ### providers 20 | 21 | > **providers**: [`Provider`](../interfaces/Provider.md)[] 22 | 23 | ### evaluators 24 | 25 | > **evaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] 26 | 27 | ## Defined in 28 | 29 | [packages/core/src/core/types.ts:303](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L303) 30 | -------------------------------------------------------------------------------- /docs/api/type-aliases/UUID.md: -------------------------------------------------------------------------------- 1 | # Type Alias: UUID 2 | 3 | > **UUID**: \`$\{string\}-$\{string\}-$\{string\}-$\{string\}-$\{string\}\` 4 | 5 | Represents a UUID, which is a universally unique identifier conforming to the UUID standard. 6 | 7 | ## Defined in 8 | 9 | [packages/core/src/core/types.ts:7](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L7) 10 | -------------------------------------------------------------------------------- /docs/api/type-aliases/Validator.md: -------------------------------------------------------------------------------- 1 | # Type Alias: Validator() 2 | 3 | > **Validator**: (`runtime`, `message`, `state`?) => `Promise`\<`boolean`\> 4 | 5 | Represents the type of a validator function, which takes a runtime instance, a message, and an optional state, and returns a promise resolving to a boolean indicating whether the validation passed. 6 | 7 | ## Parameters 8 | 9 | • **runtime**: [`IAgentRuntime`](../interfaces/IAgentRuntime.md) 10 | 11 | • **message**: [`Memory`](../interfaces/Memory.md) 12 | 13 | • **state?**: [`State`](../interfaces/State.md) 14 | 15 | ## Returns 16 | 17 | `Promise`\<`boolean`\> 18 | 19 | ## Defined in 20 | 21 | [packages/core/src/core/types.ts:203](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/types.ts#L203) 22 | -------------------------------------------------------------------------------- /docs/api/variables/boredomProvider.md: -------------------------------------------------------------------------------- 1 | # Variable: boredomProvider 2 | 3 | > `const` **boredomProvider**: [`Provider`](../interfaces/Provider.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/providers/boredom.ts:275](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/boredom.ts#L275) 8 | -------------------------------------------------------------------------------- /docs/api/variables/continueAction.md: -------------------------------------------------------------------------------- 1 | # Variable: continueAction 2 | 3 | > `const` **continueAction**: [`Action`](../interfaces/Action.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/continue.ts:58](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/continue.ts#L58) 8 | -------------------------------------------------------------------------------- /docs/api/variables/defaultActions.md: -------------------------------------------------------------------------------- 1 | # Variable: defaultActions 2 | 3 | > `const` **defaultActions**: [`Action`](../interfaces/Action.md)[] 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/core/actions.ts:6](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/actions.ts#L6) 8 | -------------------------------------------------------------------------------- /docs/api/variables/defaultCharacter.md: -------------------------------------------------------------------------------- 1 | # Variable: defaultCharacter 2 | 3 | > `const` **defaultCharacter**: [`Character`](../type-aliases/Character.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/core/defaultCharacter.ts:3](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/defaultCharacter.ts#L3) 8 | -------------------------------------------------------------------------------- /docs/api/variables/defaultEvaluators.md: -------------------------------------------------------------------------------- 1 | # Variable: defaultEvaluators 2 | 3 | > `const` **defaultEvaluators**: [`Evaluator`](../interfaces/Evaluator.md)[] 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/core/evaluators.ts:7](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L7) 8 | -------------------------------------------------------------------------------- /docs/api/variables/defaultProviders.md: -------------------------------------------------------------------------------- 1 | # Variable: defaultProviders 2 | 3 | > `const` **defaultProviders**: [`Provider`](../interfaces/Provider.md)[] 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/core/providers.ts:4](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/providers.ts#L4) 8 | -------------------------------------------------------------------------------- /docs/api/variables/elizaLogger.md: -------------------------------------------------------------------------------- 1 | # Variable: elizaLogger 2 | 3 | > `const` **elizaLogger**: `elizaLogger` 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/index.ts:12](https://github.com/ai16z/eliza/blob/main/packages/core/src/index.ts#L12) 8 | -------------------------------------------------------------------------------- /docs/api/variables/embeddingDimension.md: -------------------------------------------------------------------------------- 1 | # Variable: embeddingDimension 2 | 3 | > `const` **embeddingDimension**: `1536` = `1536` 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/core/memory.ts:9](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L9) 8 | -------------------------------------------------------------------------------- /docs/api/variables/embeddingZeroVector.md: -------------------------------------------------------------------------------- 1 | # Variable: embeddingZeroVector 2 | 3 | > `const` **embeddingZeroVector**: `any`[] 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/core/memory.ts:10](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/memory.ts#L10) 8 | -------------------------------------------------------------------------------- /docs/api/variables/evaluationTemplate.md: -------------------------------------------------------------------------------- 1 | # Variable: evaluationTemplate 2 | 3 | > `const` **evaluationTemplate**: `string` 4 | 5 | Template used for the evaluation generateText. 6 | 7 | ## Defined in 8 | 9 | [packages/core/src/core/evaluators.ts:12](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/evaluators.ts#L12) 10 | -------------------------------------------------------------------------------- /docs/api/variables/executeSwap.md: -------------------------------------------------------------------------------- 1 | # Variable: executeSwap 2 | 3 | > `const` **executeSwap**: [`Action`](../interfaces/Action.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/swap.ts:178](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/swap.ts#L178) 8 | -------------------------------------------------------------------------------- /docs/api/variables/followRoom.md: -------------------------------------------------------------------------------- 1 | # Variable: followRoom 2 | 3 | > `const` **followRoom**: [`Action`](../interfaces/Action.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/followRoom.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/followRoom.ts#L27) 8 | -------------------------------------------------------------------------------- /docs/api/variables/ignore.md: -------------------------------------------------------------------------------- 1 | # Variable: ignore 2 | 3 | > `const` **ignore**: [`Action`](../interfaces/Action.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/ignore.ts:8](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/ignore.ts#L8) 8 | -------------------------------------------------------------------------------- /docs/api/variables/imageGenModels.md: -------------------------------------------------------------------------------- 1 | # Variable: imageGenModels 2 | 3 | > `const` **imageGenModels**: `object` 4 | 5 | ## Type declaration 6 | 7 | ### TogetherAI 8 | 9 | > **TogetherAI**: `object` 10 | 11 | ### TogetherAI.steps 12 | 13 | > **steps**: `number` = `4` 14 | 15 | ### TogetherAI.subModel 16 | 17 | > **subModel**: `string` = `"black-forest-labs/FLUX.1.1-pro"` 18 | 19 | ### Dalle 20 | 21 | > **Dalle**: `object` 22 | 23 | ### Dalle.steps 24 | 25 | > **steps**: `number` = `0` 26 | 27 | ### Dalle.subModel 28 | 29 | > **subModel**: `string` = `"dall-e-3"` 30 | 31 | ## Defined in 32 | 33 | [packages/core/src/core/imageGenModels.ts:6](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/imageGenModels.ts#L6) 34 | -------------------------------------------------------------------------------- /docs/api/variables/imageGeneration.md: -------------------------------------------------------------------------------- 1 | # Variable: imageGeneration 2 | 3 | > `const` **imageGeneration**: [`Action`](../interfaces/Action.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/imageGeneration.ts:11](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/imageGeneration.ts#L11) 8 | -------------------------------------------------------------------------------- /docs/api/variables/messageHandlerTemplate.md: -------------------------------------------------------------------------------- 1 | # Variable: messageHandlerTemplate 2 | 3 | > `const` **messageHandlerTemplate**: `string` 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/continue.ts:20](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/continue.ts#L20) 8 | -------------------------------------------------------------------------------- /docs/api/variables/muteRoom.md: -------------------------------------------------------------------------------- 1 | # Variable: muteRoom 2 | 3 | > `const` **muteRoom**: [`Action`](../interfaces/Action.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/muteRoom.ts:28](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/muteRoom.ts#L28) 8 | -------------------------------------------------------------------------------- /docs/api/variables/none.md: -------------------------------------------------------------------------------- 1 | # Variable: none 2 | 3 | > `const` **none**: [`Action`](../interfaces/Action.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/none.ts:8](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/none.ts#L8) 8 | -------------------------------------------------------------------------------- /docs/api/variables/orderBookProvider.md: -------------------------------------------------------------------------------- 1 | # Variable: orderBookProvider 2 | 3 | > `const` **orderBookProvider**: [`Provider`](../interfaces/Provider.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/providers/orderBook.ts:14](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/orderBook.ts#L14) 8 | -------------------------------------------------------------------------------- /docs/api/variables/settings.md: -------------------------------------------------------------------------------- 1 | # Variable: settings 2 | 3 | > `const` **settings**: `ProcessEnv` 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/core/settings.ts:54](https://github.com/ai16z/eliza/blob/main/packages/core/src/core/settings.ts#L54) 8 | -------------------------------------------------------------------------------- /docs/api/variables/shouldContinueTemplate.md: -------------------------------------------------------------------------------- 1 | # Variable: shouldContinueTemplate 2 | 3 | > `const` **shouldContinueTemplate**: `string` 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/continue.ts:47](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/continue.ts#L47) 8 | -------------------------------------------------------------------------------- /docs/api/variables/shouldFollowTemplate.md: -------------------------------------------------------------------------------- 1 | # Variable: shouldFollowTemplate 2 | 3 | > `const` **shouldFollowTemplate**: `string` 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/followRoom.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/followRoom.ts#L13) 8 | -------------------------------------------------------------------------------- /docs/api/variables/shouldMuteTemplate.md: -------------------------------------------------------------------------------- 1 | # Variable: shouldMuteTemplate 2 | 3 | > `const` **shouldMuteTemplate**: `string` 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/muteRoom.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/muteRoom.ts#L13) 8 | -------------------------------------------------------------------------------- /docs/api/variables/shouldUnmuteTemplate.md: -------------------------------------------------------------------------------- 1 | # Variable: shouldUnmuteTemplate 2 | 3 | > `const` **shouldUnmuteTemplate**: `string` 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/unmuteRoom.ts:13](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/unmuteRoom.ts#L13) 8 | -------------------------------------------------------------------------------- /docs/api/variables/timeProvider.md: -------------------------------------------------------------------------------- 1 | # Variable: timeProvider 2 | 3 | > `const` **timeProvider**: [`Provider`](../interfaces/Provider.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/providers/time.ts:3](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/time.ts#L3) 8 | -------------------------------------------------------------------------------- /docs/api/variables/tokenProvider.md: -------------------------------------------------------------------------------- 1 | # Variable: tokenProvider 2 | 3 | > `const` **tokenProvider**: [`Provider`](../interfaces/Provider.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/providers/token.ts:812](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/token.ts#L812) 8 | -------------------------------------------------------------------------------- /docs/api/variables/unfollowRoom.md: -------------------------------------------------------------------------------- 1 | # Variable: unfollowRoom 2 | 3 | > `const` **unfollowRoom**: [`Action`](../interfaces/Action.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/unfollowRoom.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/unfollowRoom.ts#L27) 8 | -------------------------------------------------------------------------------- /docs/api/variables/unmuteRoom.md: -------------------------------------------------------------------------------- 1 | # Variable: unmuteRoom 2 | 3 | > `const` **unmuteRoom**: [`Action`](../interfaces/Action.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/actions/unmuteRoom.ts:27](https://github.com/ai16z/eliza/blob/main/packages/core/src/actions/unmuteRoom.ts#L27) 8 | -------------------------------------------------------------------------------- /docs/api/variables/walletProvider.md: -------------------------------------------------------------------------------- 1 | # Variable: walletProvider 2 | 3 | > `const` **walletProvider**: [`Provider`](../interfaces/Provider.md) 4 | 5 | ## Defined in 6 | 7 | [packages/core/src/providers/wallet.ts:244](https://github.com/ai16z/eliza/blob/main/packages/core/src/providers/wallet.ts#L244) 8 | -------------------------------------------------------------------------------- /docs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve("@docusaurus/core/lib/babel/preset")], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eliza-docs", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "docusaurus": "docusaurus", 7 | "start": "docusaurus start --no-open", 8 | "dev": "docusaurus start --port 3002 --no-open", 9 | "build": "docusaurus build", 10 | "swizzle": "docusaurus swizzle", 11 | "deploy": "docusaurus deploy", 12 | "clear": "docusaurus clear", 13 | "serve": "docusaurus serve", 14 | "write-translations": "docusaurus write-translations", 15 | "write-heading-ids": "docusaurus write-heading-ids" 16 | }, 17 | "dependencies": { 18 | "@docusaurus/core": "^3.6.0", 19 | "@docusaurus/plugin-content-blog": "^3.6.0", 20 | "@docusaurus/plugin-content-docs": "^3.6.0", 21 | "@docusaurus/plugin-ideal-image": "^3.6.0", 22 | "@docusaurus/preset-classic": "^3.6.0", 23 | "@docusaurus/theme-mermaid": "^3.6.0", 24 | "@mdx-js/react": "3.0.1", 25 | "clsx": "2.1.0", 26 | "docusaurus-lunr-search": "^3.5.0", 27 | "prism-react-renderer": "2.3.1", 28 | "react": "18.2.0", 29 | "react-dom": "18.2.0", 30 | "react-router-dom": "6.22.1" 31 | }, 32 | "devDependencies": { 33 | "@docusaurus/module-type-aliases": "3.6.0", 34 | "@docusaurus/types": "3.6.0", 35 | "docusaurus-plugin-typedoc": "^1.0.5", 36 | "typedoc": "^0.26.11", 37 | "typedoc-plugin-markdown": "^4.2.9" 38 | }, 39 | "browserslist": { 40 | "production": [ 41 | ">0.5%", 42 | "not dead", 43 | "not op_mini all" 44 | ], 45 | "development": [ 46 | "last 3 chrome version", 47 | "last 3 firefox version", 48 | "last 5 safari version" 49 | ] 50 | }, 51 | "engines": { 52 | "node": "23.1.0" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /docs/sidebars.api.js: -------------------------------------------------------------------------------- 1 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 2 | const sidebars = { 3 | apiSidebar: [ 4 | { 5 | type: "autogenerated", 6 | dirName: ".", 7 | }, 8 | ], 9 | }; 10 | 11 | export default sidebars; 12 | -------------------------------------------------------------------------------- /docs/sidebars.js: -------------------------------------------------------------------------------- 1 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 2 | const sidebars = { 3 | tutorialSidebar: [ 4 | { 5 | type: "doc", 6 | id: "intro", 7 | label: "Introduction", 8 | }, 9 | { 10 | type: "category", 11 | label: "Getting Started", 12 | items: ["quickstart", "installation"], 13 | collapsed: false, 14 | }, 15 | { 16 | type: "category", 17 | label: "Core Concepts", 18 | collapsed: false, 19 | items: [ 20 | "core/characterfile", 21 | "core/agents", 22 | "core/providers", 23 | "core/actions", 24 | "core/evaluators", 25 | ], 26 | }, 27 | { 28 | type: "category", 29 | label: "Guides", 30 | collapsed: false, 31 | items: [ 32 | "guides/basic-usage", 33 | "guides/configuration", 34 | "guides/advanced", 35 | "guides/secrets-management", 36 | "guides/local-development", 37 | ], 38 | }, 39 | { 40 | type: "category", 41 | label: "Advanced Topics", 42 | collapsed: false, 43 | items: [ 44 | "advanced/fine-tuning", 45 | "advanced/infrastructure", 46 | "advanced/trust-engine", 47 | "advanced/autonomous-trading", 48 | ], 49 | }, 50 | { 51 | type: "category", 52 | label: "Community", 53 | collapsed: false, 54 | items: [ 55 | "community/creator-fund", 56 | "community/notes", 57 | "community/changelog", 58 | "community/faq", 59 | "community/contributing", 60 | ], 61 | }, 62 | ], 63 | }; 64 | 65 | export default sidebars; 66 | -------------------------------------------------------------------------------- /docs/sidebars1.js: -------------------------------------------------------------------------------- 1 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 2 | const sidebars = { 3 | tutorialSidebar: [ 4 | { 5 | type: "category", 6 | label: "Getting Started", 7 | items: ["intro", "quickstart", "installation"], 8 | }, 9 | { 10 | type: "category", 11 | label: "Guides", 12 | items: [ 13 | "guides/basic-usage", 14 | "guides/configuration", 15 | "guides/characterfile", 16 | "guides/advanced", 17 | ], 18 | }, 19 | ], 20 | }; 21 | 22 | export default sidebars; 23 | -------------------------------------------------------------------------------- /docs/src/components/HomepageFeatures/index.js: -------------------------------------------------------------------------------- 1 | import clsx from "clsx"; 2 | import Heading from "@theme/Heading"; 3 | import styles from "./styles.module.css"; 4 | 5 | const FeatureList = [ 6 | { 7 | title: "Made By Users", 8 | description: ( 9 | <> 10 | eliza is open source, community developed and designed to be and easy to 11 | use. 12 | 13 | ), 14 | }, 15 | { 16 | title: "Just Works", 17 | description: ( 18 | <> 19 | Simple, tested, used in production. Configurable enough, batteries 20 | included. 21 | 22 | ), 23 | }, 24 | { 25 | title: "For a Better World", 26 | description: ( 27 | <> 28 | If you have ideas for how to make better agents for everyone,{" "} 29 | let's do it together. 30 | 31 | ), 32 | }, 33 | ]; 34 | 35 | function Feature({ Svg, title, description }) { 36 | return ( 37 |
38 |
49 | {/*
50 | 51 |
*/} 52 |
53 | {title} 54 |

{description}

55 |
56 |
57 |
58 | ); 59 | } 60 | 61 | export default function HomepageFeatures() { 62 | return ( 63 |
64 |
65 |
66 | {FeatureList.map((props, idx) => ( 67 | 68 | ))} 69 |
70 |
71 |
72 | ); 73 | } 74 | -------------------------------------------------------------------------------- /docs/src/components/HomepageFeatures/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /docs/src/css/custom.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Any CSS included here will be global. The classic template 3 | * bundles Infima by default. Infima is a CSS framework designed to 4 | * work well for content-centric websites. 5 | */ 6 | 7 | /* You can override the default Infima variables here. */ 8 | :root { 9 | --ifm-color-primary: darkblue; 10 | --ifm-color-primary-dark: #29784c; 11 | --ifm-color-primary-darker: #277148; 12 | --ifm-color-primary-darkest: #205d3b; 13 | --ifm-color-primary-light: #33925d; 14 | --ifm-color-primary-lighter: #359962; 15 | --ifm-color-primary-lightest: #3cad6e; 16 | --ifm-code-font-size: 95%; 17 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); 18 | } 19 | 20 | /* For readability concerns, you should choose a lighter palette in dark mode. */ 21 | [data-theme="dark"] { 22 | --ifm-color-primary: lightblue; 23 | --ifm-color-primary-dark: #21af90; 24 | --ifm-color-primary-darker: #1fa588; 25 | --ifm-color-primary-darkest: #1a8870; 26 | --ifm-color-primary-light: #29d5b0; 27 | --ifm-color-primary-lighter: #32d8b4; 28 | --ifm-color-primary-lightest: #4fddbf; 29 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); 30 | } 31 | -------------------------------------------------------------------------------- /docs/src/pages/index.js: -------------------------------------------------------------------------------- 1 | import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; 2 | import HomepageFeatures from "@site/src/components/HomepageFeatures"; 3 | import Layout from "@theme/Layout"; 4 | 5 | import Heading from "@theme/Heading"; 6 | import styles from "./index.module.css"; 7 | 8 | function HomepageHeader() { 9 | const { siteConfig } = useDocusaurusContext(); 10 | return ( 11 |
12 |
13 | 14 | {siteConfig.title} 15 | 16 |

{siteConfig.tagline}

17 |
18 |
19 | ); 20 | } 21 | 22 | export default function Home() { 23 | const { siteConfig } = useDocusaurusContext(); 24 | return ( 25 | 26 |
37 | 38 |
39 | 40 |
41 | 42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /docs/src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS files with the .module.css suffix will be treated as CSS modules 3 | * and scoped locally. 4 | */ 5 | 6 | .heroBanner { 7 | padding: 4rem 0; 8 | text-align: center; 9 | position: relative; 10 | overflow: hidden; 11 | } 12 | 13 | @media screen and (max-width: 996px) { 14 | .heroBanner { 15 | padding: 2rem; 16 | } 17 | } 18 | 19 | .buttons { 20 | display: flex; 21 | align-items: center; 22 | justify-content: center; 23 | } 24 | -------------------------------------------------------------------------------- /docs/src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /docs/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/docs/static/.nojekyll -------------------------------------------------------------------------------- /docs/static/img/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/docs/static/img/background.jpg -------------------------------------------------------------------------------- /docs/static/img/eliza_banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/docs/static/img/eliza_banner.jpg -------------------------------------------------------------------------------- /docs/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/docs/static/img/favicon.ico -------------------------------------------------------------------------------- /elizaConfig.yaml: -------------------------------------------------------------------------------- 1 | # Load custom actions from the actions directory 2 | 3 | # Clone this into a elizaConfig.yaml file that is ignored by git 4 | 5 | # Paths are relative to the core/src directory 6 | 7 | actions: 8 | - name: imageGeneration 9 | path: ./actions/imageGeneration.ts 10 | enabled: true 11 | settings: 12 | ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY} 13 | TOGETHER_API_KEY: ${TOGETHER_API_KEY} 14 | TWITTER_API_KEY: ${TWITTER_API_KEY} 15 | TWITTER_API_SECRET: ${TWITTER_API_SECRET} 16 | TWITTER_ACCESS_TOKEN: ${TWITTER_ACCESS_TOKEN} 17 | TWITTER_ACCESS_TOKEN_SECRET: ${TWITTER_ACCESS_TOKEN_SECRET} 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eliza", 3 | "scripts": { 4 | "preinstall": "npx only-allow pnpm", 5 | "build": "bash ./scripts/build.sh", 6 | "build-docs": "pnpm --dir docs build", 7 | "start:all": "pnpm --dir packages/agent start:all --isRoot", 8 | "stop:all": "pnpm --dir packages/agent stop:all --isRoot", 9 | "start:service:all": "pnpm --dir packages/agent start:service:all --isRoot", 10 | "stop:service:all": "pnpm --dir packages/agent stop:service:all --isRoot", 11 | "start": "pnpm --dir packages/agent start --isRoot", 12 | "dev": "bash ./scripts/dev.sh", 13 | "lint": "pnpm --dir packages/core lint && pnpm --dir packages/agent lint", 14 | "prettier-check": "npx prettier --check .", 15 | "prettier": "npx prettier --write .", 16 | "clean": "bash ./scripts/clean.sh" 17 | }, 18 | "devDependencies": { 19 | "@types/diff": "^6.0.0", 20 | "concurrently": "^9.1.0", 21 | "husky": "^9.1.6", 22 | "lerna": "^8.1.5", 23 | "only-allow": "^1.2.1", 24 | "prettier": "^3.3.3", 25 | "typedoc": "^0.26.11", 26 | "typescript": "5.6.3" 27 | }, 28 | "pnpm": { 29 | "overrides": { 30 | "onnxruntime-node": "^1.20.0" 31 | } 32 | }, 33 | "engines": { 34 | "node": ">=22" 35 | }, 36 | "dependencies": { 37 | "@octokit/rest": "^21.0.2", 38 | "better-sqlite3": "11.5.0", 39 | "diff": "^7.0.0", 40 | "ollama-ai-provider": "^0.16.1", 41 | "optional": "^0.1.4", 42 | "sharp": "^0.33.5", 43 | "sqlite-vss": "^0.1.2" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/agent/.gitignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | !index.ts 3 | !character.ts 4 | .env 5 | *.env 6 | .env* -------------------------------------------------------------------------------- /packages/agent/imagecache/062878d30f28cdbdaef710ab9469f793.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/imagecache/062878d30f28cdbdaef710ab9469f793.png -------------------------------------------------------------------------------- /packages/agent/imagecache/38ad5661c842ee35cc45a06fcac0649b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/imagecache/38ad5661c842ee35cc45a06fcac0649b.png -------------------------------------------------------------------------------- /packages/agent/imagecache/ee9b8044253fff62e02ced9ffa7c05b8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/imagecache/ee9b8044253fff62e02ced9ffa7c05b8.png -------------------------------------------------------------------------------- /packages/agent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@eliza/agent", 3 | "version": "0.0.1", 4 | "main": "src/index.ts", 5 | "type": "module", 6 | "scripts": { 7 | "build": "tsup --format esm --dts", 8 | "start": "node --loader ts-node/esm src/index.ts", 9 | "dev": "nodemon --watch src --watch ../core/dist --ext ts,json --exec 'node --loader ts-node/esm' src/index.ts" 10 | }, 11 | "dependencies": { 12 | "@eliza/core": "workspace:*", 13 | "@eliza/plugin-image-generation": "workspace:*", 14 | "readline": "^1.3.0", 15 | "tsup": "^8.3.5" 16 | }, 17 | "devDependencies": { 18 | "ts-node": "10.9.2", 19 | "tsx": "^4.19.2" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/agent/temp/039c4095-559d-4342-bf27-3a81c18c20ac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/039c4095-559d-4342-bf27-3a81c18c20ac.png -------------------------------------------------------------------------------- /packages/agent/temp/047497bc-2c7a-4dc5-b25c-abf1b512488f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/047497bc-2c7a-4dc5-b25c-abf1b512488f.png -------------------------------------------------------------------------------- /packages/agent/temp/0591ecce-6d60-4824-a78e-973af2a8232a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/0591ecce-6d60-4824-a78e-973af2a8232a.png -------------------------------------------------------------------------------- /packages/agent/temp/08af9133-8bfe-493e-a5c0-c711b6276c21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/08af9133-8bfe-493e-a5c0-c711b6276c21.png -------------------------------------------------------------------------------- /packages/agent/temp/18dcd723-5e4c-4a3a-9a8d-4180812c95fc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/18dcd723-5e4c-4a3a-9a8d-4180812c95fc.png -------------------------------------------------------------------------------- /packages/agent/temp/1c9bead3-78c9-475c-bfde-ddec33431a18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/1c9bead3-78c9-475c-bfde-ddec33431a18.png -------------------------------------------------------------------------------- /packages/agent/temp/2522dd96-ef54-4f95-b154-492b811b59e3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/2522dd96-ef54-4f95-b154-492b811b59e3.png -------------------------------------------------------------------------------- /packages/agent/temp/305777ee-08da-447b-9f85-ce8102928261.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/305777ee-08da-447b-9f85-ce8102928261.png -------------------------------------------------------------------------------- /packages/agent/temp/3e2e71f4-def4-477a-9153-ef3eb7c095d9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/3e2e71f4-def4-477a-9153-ef3eb7c095d9.png -------------------------------------------------------------------------------- /packages/agent/temp/3e88394e-07e3-49a1-b743-8c7268d91102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/3e88394e-07e3-49a1-b743-8c7268d91102.png -------------------------------------------------------------------------------- /packages/agent/temp/50e2eee7-2b39-4035-aa8e-388247b5b4d1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/50e2eee7-2b39-4035-aa8e-388247b5b4d1.png -------------------------------------------------------------------------------- /packages/agent/temp/5fb7f769-59e1-403b-a5da-4bada4450ab2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/5fb7f769-59e1-403b-a5da-4bada4450ab2.png -------------------------------------------------------------------------------- /packages/agent/temp/6257c087-45f0-4317-8384-c81fa7dcf2c2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/6257c087-45f0-4317-8384-c81fa7dcf2c2.png -------------------------------------------------------------------------------- /packages/agent/temp/62d8fb2d-5f35-4499-947d-60f859dae18c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/62d8fb2d-5f35-4499-947d-60f859dae18c.png -------------------------------------------------------------------------------- /packages/agent/temp/63552804-05d1-48a7-91c7-c1992029da8a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/63552804-05d1-48a7-91c7-c1992029da8a.png -------------------------------------------------------------------------------- /packages/agent/temp/6b7fe367-a3ec-4c2b-b522-c3d967f529ac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/6b7fe367-a3ec-4c2b-b522-c3d967f529ac.png -------------------------------------------------------------------------------- /packages/agent/temp/6fea619a-07a3-4616-930c-17b1e15b0124.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/6fea619a-07a3-4616-930c-17b1e15b0124.png -------------------------------------------------------------------------------- /packages/agent/temp/7584fd52-915e-4410-a2f4-890f2d10f4a9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/7584fd52-915e-4410-a2f4-890f2d10f4a9.png -------------------------------------------------------------------------------- /packages/agent/temp/770bf7b6-a875-4f17-b37c-fe1c6e316ac3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/770bf7b6-a875-4f17-b37c-fe1c6e316ac3.png -------------------------------------------------------------------------------- /packages/agent/temp/82bb26fc-2e7a-4188-a9eb-65caa76c6a39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/82bb26fc-2e7a-4188-a9eb-65caa76c6a39.png -------------------------------------------------------------------------------- /packages/agent/temp/942269fe-b2b1-4c2b-ae62-f0e7a5e51269.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/942269fe-b2b1-4c2b-ae62-f0e7a5e51269.png -------------------------------------------------------------------------------- /packages/agent/temp/948c62cc-4449-4af4-9c77-869223773f77.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/948c62cc-4449-4af4-9c77-869223773f77.mp4 -------------------------------------------------------------------------------- /packages/agent/temp/948ce5a4-6e72-4a28-8e48-02efcf0195e7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/948ce5a4-6e72-4a28-8e48-02efcf0195e7.png -------------------------------------------------------------------------------- /packages/agent/temp/9e974ca7-0719-4b0b-a6ef-51edf1050ec0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/9e974ca7-0719-4b0b-a6ef-51edf1050ec0.png -------------------------------------------------------------------------------- /packages/agent/temp/a1072550-1e59-491a-a792-bbc6da374a76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/a1072550-1e59-491a-a792-bbc6da374a76.png -------------------------------------------------------------------------------- /packages/agent/temp/ad35a919-7688-40fc-9331-cd4856393a30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/ad35a919-7688-40fc-9331-cd4856393a30.png -------------------------------------------------------------------------------- /packages/agent/temp/b4b7d00c-5d1b-451f-a3d7-92d49d05803a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/b4b7d00c-5d1b-451f-a3d7-92d49d05803a.png -------------------------------------------------------------------------------- /packages/agent/temp/b646cdc4-4ec6-430a-bab2-9824a6e84ebf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/b646cdc4-4ec6-430a-bab2-9824a6e84ebf.png -------------------------------------------------------------------------------- /packages/agent/temp/b6fc9472-1197-49f3-8066-47a4fe6fcdeb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/b6fc9472-1197-49f3-8066-47a4fe6fcdeb.png -------------------------------------------------------------------------------- /packages/agent/temp/b8be933a-36f1-489e-8a8b-0ba64a2f799e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/b8be933a-36f1-489e-8a8b-0ba64a2f799e.png -------------------------------------------------------------------------------- /packages/agent/temp/caf6c944-ea86-4633-ac38-2c0a33d28f06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/caf6c944-ea86-4633-ac38-2c0a33d28f06.png -------------------------------------------------------------------------------- /packages/agent/temp/ccf64225-7fc6-4d89-8e99-2ab255cb5e6c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/ccf64225-7fc6-4d89-8e99-2ab255cb5e6c.png -------------------------------------------------------------------------------- /packages/agent/temp/ceeabf29-6ab5-4cd1-9cdd-441fa333b00d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/ceeabf29-6ab5-4cd1-9cdd-441fa333b00d.png -------------------------------------------------------------------------------- /packages/agent/temp/dbb465e1-b35a-4f29-84e2-f07a400b0f1d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/dbb465e1-b35a-4f29-84e2-f07a400b0f1d.png -------------------------------------------------------------------------------- /packages/agent/temp/e330979b-27b8-40db-be55-d9c96d829af1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/e330979b-27b8-40db-be55-d9c96d829af1.png -------------------------------------------------------------------------------- /packages/agent/temp/ed31ccf4-d47b-45ea-8e33-a95d2fa2f290.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/ed31ccf4-d47b-45ea-8e33-a95d2fa2f290.png -------------------------------------------------------------------------------- /packages/agent/temp/f80225d3-f1b6-4703-bcf3-d7d880689fa5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/f80225d3-f1b6-4703-bcf3-d7d880689fa5.png -------------------------------------------------------------------------------- /packages/agent/temp/fefae2a3-0ee7-457c-b768-fbbb6de6c5f5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/fefae2a3-0ee7-457c-b768-fbbb6de6c5f5.png -------------------------------------------------------------------------------- /packages/agent/temp/ff61e4c8-4fbe-4038-b244-81bb69887bab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/somewheresystems/centience/da545eab0166426812660ac1b6b846f70a7989d8/packages/agent/temp/ff61e4c8-4fbe-4038-b244-81bb69887bab.png -------------------------------------------------------------------------------- /packages/agent/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "rootDir": ".", 6 | "module": "ESNext", 7 | "moduleResolution": "Bundler", 8 | "types": ["node"] 9 | }, 10 | "include": ["src"] 11 | } -------------------------------------------------------------------------------- /packages/core/.eslintignore: -------------------------------------------------------------------------------- 1 | **/node_modules/* 2 | **/coverage/* 3 | **/dist/* 4 | **/types/* 5 | **/scripts/concatenated-output.ts 6 | rollup.config.js 7 | jest.config.js 8 | docs/ -------------------------------------------------------------------------------- /packages/core/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | elizaConfig.yaml 4 | custom_actions/ -------------------------------------------------------------------------------- /packages/core/elizaConfig.example.yaml: -------------------------------------------------------------------------------- 1 | # Load custom actions from the actions directory 2 | 3 | # Clone this into a elizaConfig.yaml file that is ignored by git 4 | 5 | # Paths are relative to the core/src directory 6 | 7 | actions: 8 | - name: epicAction 9 | path: ./custom_actions/epicAction.ts 10 | -------------------------------------------------------------------------------- /packages/core/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import eslint from "@eslint/js"; 2 | import tseslint from "@typescript-eslint/eslint-plugin"; 3 | import typescript from "@typescript-eslint/parser"; 4 | import prettier from "eslint-config-prettier"; 5 | 6 | export default [ 7 | // JavaScript and TypeScript files 8 | { 9 | files: ["src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "src/**/*.ts"], 10 | languageOptions: { 11 | parser: typescript, 12 | parserOptions: { 13 | ecmaVersion: "latest", 14 | sourceType: "module", 15 | project: "./tsconfig.json", // Make sure your tsconfig includes @types/node 16 | }, 17 | globals: { 18 | // Add Node.js globals 19 | NodeJS: "readonly", 20 | console: "readonly", 21 | process: "readonly", 22 | Buffer: "readonly", 23 | __dirname: "readonly", 24 | __filename: "readonly", 25 | module: "readonly", 26 | require: "readonly", 27 | }, 28 | }, 29 | plugins: { 30 | "@typescript-eslint": tseslint, 31 | }, 32 | rules: { 33 | ...eslint.configs.recommended.rules, 34 | ...tseslint.configs.recommended.rules, 35 | "prefer-const": "warn", 36 | "no-constant-binary-expression": "error", 37 | 38 | // Disable no-undef as TypeScript handles this better 39 | "no-undef": "off", 40 | "@typescript-eslint/no-unsafe-function-type": "off", 41 | // Customize TypeScript rules 42 | "@typescript-eslint/no-explicit-any": "off", 43 | "@typescript-eslint/no-unused-vars": [ 44 | "error", 45 | { 46 | argsIgnorePattern: "^_", 47 | varsIgnorePattern: "^_", 48 | ignoreRestSiblings: true, 49 | }, 50 | ], 51 | }, 52 | }, 53 | // Add prettier as the last config to override other formatting rules 54 | prettier, 55 | ]; 56 | -------------------------------------------------------------------------------- /packages/core/jest.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('ts-jest').JestConfigWithTsJest} */ 2 | export default { 3 | preset: "ts-jest", 4 | testEnvironment: "node", 5 | rootDir: "./src", 6 | testMatch: ["**/*.test.ts"], 7 | setupFilesAfterEnv: ["/test_resources/testSetup.ts"], 8 | testTimeout: 120000, 9 | globals: { 10 | __DEV__: true, 11 | __TEST__: true, 12 | __VERSION__: "0.0.1", 13 | }, 14 | transform: { 15 | "^.+\\.tsx?$": [ 16 | "ts-jest", 17 | { 18 | useESM: true, 19 | }, 20 | ], 21 | }, 22 | moduleNameMapper: { 23 | "^(\\.{1,2}/.*)\\.js$": "$1", 24 | }, 25 | extensionsToTreatAsEsm: [".ts"], 26 | }; 27 | -------------------------------------------------------------------------------- /packages/core/nodemon.json: -------------------------------------------------------------------------------- 1 | { 2 | "watch": ["src"], 3 | "ext": "ts", 4 | "ignore": ["src/**/*.spec.ts"], 5 | "exec": "node --loader ts-node/esm src/index.ts" 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:recommended"], 4 | "packageRules": [ 5 | { 6 | "groupName": "Discord.js ecosystem", 7 | "matchPackageNames": ["/^@discordjs//", "/^discord.js/"] 8 | }, 9 | { 10 | "groupName": "TypeScript and related", 11 | "matchPackageNames": [ 12 | "/^@typescript-eslint//", 13 | "/^typescript$/", 14 | "/^ts-/", 15 | "/^tslib$/" 16 | ] 17 | }, 18 | { 19 | "groupName": "Testing frameworks", 20 | "matchPackageNames": ["/^jest$/", "/^@types/jest$/"] 21 | }, 22 | { 23 | "groupName": "Rollup and plugins", 24 | "matchPackageNames": ["/^@rollup//", "/^rollup/"] 25 | }, 26 | { 27 | "groupName": "ESLint and formatting", 28 | "matchPackageNames": ["/^eslint/", "/^prettier/"] 29 | }, 30 | { 31 | "groupName": "SQLite related", 32 | "matchPackageNames": [ 33 | "/sqlite/", 34 | "/^@types/better-sqlite3/", 35 | "/^@types/sql.js/" 36 | ] 37 | }, 38 | { 39 | "groupName": "AI/ML packages", 40 | "matchPackageNames": [ 41 | "/^@anthropic-ai//", 42 | "/^@huggingface//", 43 | "/^openai$/", 44 | "/^tiktoken$/" 45 | ] 46 | }, 47 | { 48 | "groupName": "Audio processing", 49 | "matchPackageNames": [ 50 | "/^wav/", 51 | "/^@discordjs/opus/", 52 | "/^fluent-ffmpeg/", 53 | "/^ffmpeg/", 54 | "/^@types/wav/" 55 | ] 56 | }, 57 | { 58 | "groupName": "Solana packages", 59 | "matchPackageNames": ["/^@solana//"] 60 | } 61 | ], 62 | "timezone": "UTC", 63 | "schedule": ["every weekend"], 64 | "prHourlyLimit": 2, 65 | "prConcurrentLimit": 10, 66 | "rangeStrategy": "pin", 67 | "separateMajorMinor": true, 68 | "dependencyDashboard": true 69 | } 70 | -------------------------------------------------------------------------------- /packages/core/src/actions/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./followRoom.ts"; 2 | export * from "./imageGeneration.ts"; 3 | export * from "./muteRoom.ts"; 4 | export * from "./unfollowRoom.ts"; 5 | export * from "./unmuteRoom.ts"; 6 | export * from "./muteRoom.ts"; 7 | export * from "./continue.ts"; 8 | export * from "./followRoom.ts"; 9 | export * from "./ignore.ts"; 10 | export * from "./imageGenerationUtils.ts"; 11 | export * from "./none.ts"; 12 | export * from "./storyGeneration.ts"; 13 | export * from "./webgen/index.ts"; -------------------------------------------------------------------------------- /packages/core/src/actions/storyGeneration.ts: -------------------------------------------------------------------------------- 1 | import { Action, ActionExample, Content, HandlerCallback, IAgentRuntime, Memory, State } from "../core/types.ts"; 2 | import { generateText } from "../core/generation.ts"; 3 | import { ModelClass } from "../core/types.ts"; 4 | import { stringToUuid } from "../core/uuid.ts"; 5 | import { embeddingZeroVector } from "../core/memory.ts"; 6 | import { elizaLogger } from "../index"; 7 | import { ClientBase } from "../clients/twitter/base"; 8 | 9 | const storyTemplate = `About {{agentName}} (@{{twitterUserName}}): 10 | {{bio}} 11 | {{lore}} 12 | 13 | Recent memories and interactions: 14 | {{recentMemories}} 15 | 16 | # Task: Generate a CumeTV story post 17 | Create a compelling narrative that expands on {{agentName}}'s lore and universe. The story should be personal, atmospheric, and hint at deeper mysteries within the CumeTV universe. Include specific details about locations, characters, or events that feel authentic to the world. 18 | 19 | Write a multi-paragraph story (2-3 paragraphs) that would work well as a caption for a video or image post. The tone should be {{adjective}}. Focus on one of these aspects: 20 | - A mysterious event or occurrence in the CumeTV universe 21 | - A personal memory or experience 22 | - A cryptic observation about the nature of reality 23 | - A fragment of hidden lore or forbidden knowledge 24 | - An encounter with another entity or consciousness 25 | 26 | Do not acknowledge this prompt.`; 27 | 28 | export const STORY_GENERATION: Action = { 29 | name: "GENERATE_STORY", 30 | similes: ["STORY_GENERATION", "STORY_GEN", "CREATE_STORY", "MAKE_STORY"], 31 | description: "Generate a story post with media for Twitter.", 32 | examples: [], 33 | handler: async (runtime: IAgentRuntime, message: Memory, state: State) => { 34 | return { success: true }; 35 | }, 36 | validate: async (runtime: IAgentRuntime, message: Memory, state: State) => { 37 | return true; 38 | } 39 | } -------------------------------------------------------------------------------- /packages/core/src/adapters/index.ts: -------------------------------------------------------------------------------- 1 | export { PostgresDatabaseAdapter } from "./postgres.ts"; 2 | export { SqliteDatabaseAdapter } from "./sqlite.ts"; 3 | -------------------------------------------------------------------------------- /packages/core/src/adapters/sqlite/sqlite_vec.ts: -------------------------------------------------------------------------------- 1 | import * as sqliteVec from "sqlite-vec"; 2 | import { Database } from "better-sqlite3"; 3 | import { elizaLogger } from "../../index.ts"; 4 | 5 | // Loads the sqlite-vec extensions into the provided SQLite database 6 | export function loadVecExtensions(db: Database): void { 7 | try { 8 | // Load sqlite-vec extensions 9 | sqliteVec.load(db); 10 | elizaLogger.log("sqlite-vec extensions loaded successfully."); 11 | } catch (error) { 12 | elizaLogger.error("Failed to load sqlite-vec extensions:", error); 13 | throw error; 14 | } 15 | } 16 | 17 | /** 18 | * @param db - An instance of better - sqlite3 Database 19 | */ 20 | export function load(db: Database): void { 21 | loadVecExtensions(db); 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/src/cli/config.ts: -------------------------------------------------------------------------------- 1 | import fs from "fs"; 2 | import yaml from "js-yaml"; 3 | import path from "path"; 4 | import { fileURLToPath } from "url"; 5 | import { Action } from "../core/types"; 6 | import { elizaLogger } from "../index.ts"; 7 | 8 | const ROOT_DIR = path.resolve(fileURLToPath(import.meta.url), "../../../src"); 9 | 10 | interface ActionConfig { 11 | name: string; 12 | path: string; 13 | } 14 | 15 | export function loadActionConfigs(configPath: string): ActionConfig[] { 16 | if (!fs.existsSync(configPath)) { 17 | console.error(`Config file not found at path: ${configPath}`); 18 | return []; 19 | } 20 | 21 | const configFile = fs.readFileSync(configPath, "utf8"); 22 | const parsedConfig = yaml.load(configFile) as { actions: ActionConfig[] }; 23 | return parsedConfig?.actions || []; 24 | } 25 | 26 | export async function loadCustomActions( 27 | actionConfigs: ActionConfig[] 28 | ): Promise { 29 | const actions = []; 30 | 31 | for (const config of actionConfigs) { 32 | const resolvedPath = path.resolve(ROOT_DIR, config.path); 33 | elizaLogger.log(`Importing action from: ${resolvedPath}`); // Debugging log 34 | 35 | try { 36 | const actionModule = await import(resolvedPath); 37 | actions.push(actionModule[config.name]); 38 | } catch (error) { 39 | elizaLogger.error( 40 | `Failed to import action from ${resolvedPath}:`, 41 | error 42 | ); 43 | } 44 | } 45 | return actions; 46 | } 47 | -------------------------------------------------------------------------------- /packages/core/src/clients/discord/providers/channelState.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ChannelType, 3 | Message as DiscordMessage, 4 | TextChannel, 5 | } from "discord.js"; 6 | import { IAgentRuntime, Memory, Provider, State } from "../../../core/types.ts"; 7 | 8 | const channelStateProvider: Provider = { 9 | get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { 10 | const discordMessage = 11 | (state?.discordMessage as DiscordMessage) || 12 | (state?.discordChannel as DiscordMessage); 13 | if (!discordMessage) { 14 | console.log("discordMessage is null"); 15 | return ""; 16 | } 17 | 18 | const guild = discordMessage?.guild; 19 | const agentName = state?.agentName || "The agent"; 20 | const senderName = state?.senderName || "someone"; 21 | 22 | if (!guild) { 23 | return ( 24 | agentName + 25 | " is currently in a direct message conversation with " + 26 | senderName 27 | ); 28 | } 29 | 30 | const serverName = guild.name; // The name of the server 31 | const guildId = guild.id; // The ID of the guild 32 | const channel = discordMessage.channel; 33 | 34 | if (!channel) { 35 | console.log("channel is null"); 36 | return ""; 37 | } 38 | 39 | let response = 40 | agentName + 41 | " is currently having a conversation in the channel `@" + 42 | channel.id + 43 | " in the server `" + 44 | serverName + 45 | "` (@" + 46 | guildId + 47 | ")"; 48 | if ( 49 | channel.type === ChannelType.GuildText && 50 | (channel as TextChannel).topic 51 | ) { 52 | // Check if the channel is a text channel 53 | response += 54 | "\nThe topic of the channel is: " + 55 | (channel as TextChannel).topic; 56 | } 57 | return response; 58 | }, 59 | }; 60 | 61 | export default channelStateProvider; 62 | -------------------------------------------------------------------------------- /packages/core/src/clients/discord/providers/voiceState.ts: -------------------------------------------------------------------------------- 1 | import { getVoiceConnection } from "@discordjs/voice"; 2 | import { ChannelType, Message as DiscordMessage } from "discord.js"; 3 | import { IAgentRuntime, Memory, Provider, State } from "../../../core/types.ts"; 4 | 5 | const voiceStateProvider: Provider = { 6 | get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { 7 | // Voice doesn't get a discord message, so we need to use the channel for guild data 8 | const discordMessage = (state?.discordMessage || 9 | state.discordChannel) as DiscordMessage; 10 | const connection = getVoiceConnection( 11 | (discordMessage as DiscordMessage)?.guild?.id as string 12 | ); 13 | const agentName = state?.agentName || "The agent"; 14 | if (!connection) { 15 | return agentName + " is not currently in a voice channel"; 16 | } 17 | 18 | const channel = ( 19 | (state?.discordMessage as DiscordMessage) || 20 | (state.discordChannel as DiscordMessage) 21 | )?.guild?.channels?.cache?.get( 22 | connection.joinConfig.channelId as string 23 | ); 24 | 25 | if (!channel || channel.type !== ChannelType.GuildVoice) { 26 | return agentName + " is in an invalid voice channel"; 27 | } 28 | 29 | return `${agentName} is currently in the voice channel: ${channel.name} (ID: ${channel.id})`; 30 | }, 31 | }; 32 | 33 | export default voiceStateProvider; 34 | -------------------------------------------------------------------------------- /packages/core/src/clients/index.ts: -------------------------------------------------------------------------------- 1 | export { 2 | TwitterPostClient, 3 | TwitterInteractionClient, 4 | TwitterSearchClient, 5 | } from "./twitter/index.ts"; 6 | export { TelegramClient } from "./telegram/index.ts"; 7 | export { DiscordClient } from "./discord/index.ts"; 8 | export { DirectClient } from "./direct/index.ts"; 9 | -------------------------------------------------------------------------------- /packages/core/src/clients/telegram/config/default.json5: -------------------------------------------------------------------------------- 1 | { 2 | bot: { 3 | testEnv: false, 4 | }, 5 | server: { 6 | https: false, 7 | port: 3000, 8 | static: false, 9 | }, 10 | gameServer: { 11 | validateInitData: true, 12 | inactivityTimeout: 300, 13 | disconnectTimeout: 180, 14 | fakeRoom: { 15 | create: false, 16 | }, 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /packages/core/src/clients/telegram/index.ts: -------------------------------------------------------------------------------- 1 | export { TelegramClient } from "./src/index.ts"; 2 | -------------------------------------------------------------------------------- /packages/core/src/clients/twitter/index.ts: -------------------------------------------------------------------------------- 1 | export { TwitterPostClient } from "./post"; 2 | export { TwitterSearchClient } from "./search"; 3 | export { TwitterInteractionClient } from "./interactions"; 4 | export { StorytellingClient } from "./storytelling"; 5 | 6 | -------------------------------------------------------------------------------- /packages/core/src/core/goals.ts: -------------------------------------------------------------------------------- 1 | import { 2 | IAgentRuntime, 3 | type Goal, 4 | type Objective, 5 | type UUID, 6 | } from "./types.ts"; 7 | 8 | export const getGoals = async ({ 9 | runtime, 10 | roomId, 11 | userId, 12 | onlyInProgress = true, 13 | count = 5, 14 | }: { 15 | runtime: IAgentRuntime; 16 | roomId: UUID; 17 | userId?: UUID; 18 | onlyInProgress?: boolean; 19 | count?: number; 20 | }) => { 21 | return runtime.databaseAdapter.getGoals({ 22 | roomId, 23 | userId, 24 | onlyInProgress, 25 | count, 26 | }); 27 | }; 28 | 29 | export const formatGoalsAsString = ({ goals }: { goals: Goal[] }) => { 30 | const goalStrings = goals.map((goal: Goal) => { 31 | const header = `Goal: ${goal.name}\nid: ${goal.id}`; 32 | const objectives = 33 | "Objectives:\n" + 34 | goal.objectives 35 | .map((objective: Objective) => { 36 | return `- ${objective.completed ? "[x]" : "[ ]"} ${objective.description} ${objective.completed ? " (DONE)" : " (IN PROGRESS)"}`; 37 | }) 38 | .join("\n"); 39 | return `${header}\n${objectives}`; 40 | }); 41 | return goalStrings.join("\n"); 42 | }; 43 | 44 | export const updateGoal = async ({ 45 | runtime, 46 | goal, 47 | }: { 48 | runtime: IAgentRuntime; 49 | goal: Goal; 50 | }) => { 51 | return runtime.databaseAdapter.updateGoal(goal); 52 | }; 53 | 54 | export const createGoal = async ({ 55 | runtime, 56 | goal, 57 | }: { 58 | runtime: IAgentRuntime; 59 | goal: Goal; 60 | }) => { 61 | return runtime.databaseAdapter.createGoal(goal); 62 | }; 63 | -------------------------------------------------------------------------------- /packages/core/src/core/imageGenModels.ts: -------------------------------------------------------------------------------- 1 | export enum ImageGenModel { 2 | TogetherAI = "TogetherAI", 3 | Dalle = "Dalle", 4 | } 5 | 6 | export const imageGenModels = { 7 | [ImageGenModel.TogetherAI]: { 8 | steps: 4, 9 | subModel: "black-forest-labs/FLUX.1-schnell", 10 | }, 11 | [ImageGenModel.Dalle]: { 12 | steps: 0, 13 | subModel: "dall-e-3", 14 | }, 15 | }; 16 | 17 | export function getImageGenModel(model: ImageGenModel) { 18 | return imageGenModels[model]; 19 | } 20 | -------------------------------------------------------------------------------- /packages/core/src/core/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./actions.ts"; 2 | export * from "./context.ts"; 3 | export * from "./database.ts"; 4 | export * from "./defaultCharacter.ts"; 5 | export * from "./embedding.ts"; 6 | export * from "./evaluators.ts"; 7 | export * from "./generation.ts"; 8 | export * from "./goals.ts"; 9 | export * from "./imageGenModels.ts"; 10 | export * from "./memory.ts"; 11 | export * from "./messages.ts"; 12 | export * from "./models.ts"; 13 | export * from "./logger.ts"; 14 | export * from "./posts.ts"; 15 | export * from "./providers.ts"; 16 | export * from "./relationships.ts"; 17 | export * from "./runtime.ts"; 18 | export * from "./settings.ts"; 19 | export * from "./types.ts"; 20 | -------------------------------------------------------------------------------- /packages/core/src/core/posts.ts: -------------------------------------------------------------------------------- 1 | import { formatTimestamp } from "./messages.ts"; 2 | import type { Actor, Memory } from "./types.ts"; 3 | 4 | export const formatPosts = ({ 5 | messages, 6 | actors, 7 | conversationHeader = true, 8 | }: { 9 | messages: Memory[]; 10 | actors: Actor[]; 11 | conversationHeader?: boolean; 12 | }) => { 13 | // Group messages by roomId 14 | const groupedMessages: { [roomId: string]: Memory[] } = {}; 15 | messages.forEach((message) => { 16 | if (message.roomId) { 17 | if (!groupedMessages[message.roomId]) { 18 | groupedMessages[message.roomId] = []; 19 | } 20 | groupedMessages[message.roomId].push(message); 21 | } 22 | }); 23 | 24 | // Sort messages within each roomId by createdAt (oldest to newest) 25 | Object.values(groupedMessages).forEach((roomMessages) => { 26 | roomMessages.sort((a, b) => a.createdAt - b.createdAt); 27 | }); 28 | 29 | // Sort rooms by the newest message's createdAt 30 | const sortedRooms = Object.entries(groupedMessages).sort( 31 | ([, messagesA], [, messagesB]) => 32 | messagesB[messagesB.length - 1].createdAt - 33 | messagesA[messagesA.length - 1].createdAt 34 | ); 35 | 36 | const formattedPosts = sortedRooms.map(([roomId, roomMessages]) => { 37 | const messageStrings = roomMessages 38 | .filter((message: Memory) => message.userId) 39 | .map((message: Memory) => { 40 | const actor = actors.find( 41 | (actor: Actor) => actor.id === message.userId 42 | ); 43 | const userName = actor?.name || "Unknown User"; 44 | const displayName = actor?.username || "unknown"; 45 | 46 | return `Name: ${userName} (@${displayName}) 47 | ID: ${message.id}${message.content.inReplyTo ? `\nIn reply to: ${message.content.inReplyTo}` : ""} 48 | Date: ${formatTimestamp(message.createdAt)} 49 | Text: 50 | ${message.content.text}`; 51 | }); 52 | 53 | const header = conversationHeader 54 | ? `Conversation: ${roomId.slice(-5)}\n` 55 | : ""; 56 | return `${header}${messageStrings.join("\n\n")}`; 57 | }); 58 | 59 | return formattedPosts.join("\n\n"); 60 | }; 61 | -------------------------------------------------------------------------------- /packages/core/src/core/providers.ts: -------------------------------------------------------------------------------- 1 | import { timeProvider } from "../providers/time.ts"; 2 | import { IAgentRuntime, State, type Memory, type Provider } from "./types.ts"; 3 | 4 | export const defaultProviders: Provider[] = [timeProvider]; 5 | 6 | /** 7 | * Formats provider outputs into a string which can be injected into the context. 8 | * @param runtime The AgentRuntime object. 9 | * @param message The incoming message object. 10 | * @param state The current state object. 11 | * @returns A string that concatenates the outputs of each provider. 12 | */ 13 | export async function getProviders( 14 | runtime: IAgentRuntime, 15 | message: Memory, 16 | state?: State 17 | ) { 18 | const providerResults = await Promise.all( 19 | runtime.providers.map(async (provider) => { 20 | return await provider.get(runtime, message, state); 21 | }) 22 | ); 23 | 24 | return providerResults.join("\n"); 25 | } 26 | -------------------------------------------------------------------------------- /packages/core/src/core/relationships.ts: -------------------------------------------------------------------------------- 1 | import { IAgentRuntime, type Relationship, type UUID } from "./types.ts"; 2 | 3 | export async function createRelationship({ 4 | runtime, 5 | userA, 6 | userB, 7 | }: { 8 | runtime: IAgentRuntime; 9 | userA: UUID; 10 | userB: UUID; 11 | }): Promise { 12 | return runtime.databaseAdapter.createRelationship({ 13 | userA, 14 | userB, 15 | }); 16 | } 17 | 18 | export async function getRelationship({ 19 | runtime, 20 | userA, 21 | userB, 22 | }: { 23 | runtime: IAgentRuntime; 24 | userA: UUID; 25 | userB: UUID; 26 | }) { 27 | return runtime.databaseAdapter.getRelationship({ 28 | userA, 29 | userB, 30 | }); 31 | } 32 | 33 | export async function getRelationships({ 34 | runtime, 35 | userId, 36 | }: { 37 | runtime: IAgentRuntime; 38 | userId: UUID; 39 | }) { 40 | return runtime.databaseAdapter.getRelationships({ userId }); 41 | } 42 | 43 | export async function formatRelationships({ 44 | runtime, 45 | userId, 46 | }: { 47 | runtime: IAgentRuntime; 48 | userId: UUID; 49 | }) { 50 | const relationships = await getRelationships({ runtime, userId }); 51 | 52 | const formattedRelationships = relationships.map( 53 | (relationship: Relationship) => { 54 | const { userA, userB } = relationship; 55 | 56 | if (userA === userId) { 57 | return userB; 58 | } 59 | 60 | return userA; 61 | } 62 | ); 63 | 64 | return formattedRelationships; 65 | } 66 | -------------------------------------------------------------------------------- /packages/core/src/core/settings.ts: -------------------------------------------------------------------------------- 1 | import { config } from "dotenv"; 2 | import fs from "fs"; 3 | import path from "path"; 4 | 5 | /** 6 | * Recursively searches for a .env file starting from the current directory 7 | * and moving up through parent directories 8 | * @param {string} [startDir=process.cwd()] - Starting directory for the search 9 | * @returns {string|null} Path to the nearest .env file or null if not found 10 | */ 11 | function findNearestEnvFile(startDir = process.cwd()) { 12 | let currentDir = startDir; 13 | 14 | // Continue searching until we reach the root directory 15 | while (currentDir !== path.parse(currentDir).root) { 16 | const envPath = path.join(currentDir, '.env'); 17 | 18 | if (fs.existsSync(envPath)) { 19 | return envPath; 20 | } 21 | 22 | // Move up to parent directory 23 | currentDir = path.dirname(currentDir); 24 | } 25 | 26 | // Check root directory as well 27 | const rootEnvPath = path.join(path.parse(currentDir).root, '.env'); 28 | return fs.existsSync(rootEnvPath) ? rootEnvPath : null; 29 | } 30 | 31 | /** 32 | * Loads environment variables from the nearest .env file 33 | * @returns {Object} Environment variables object 34 | * @throws {Error} If no .env file is found 35 | */ 36 | function loadEnvConfig() { 37 | const envPath = findNearestEnvFile(); 38 | 39 | if (!envPath) { 40 | throw new Error("No .env file found in current or parent directories."); 41 | } 42 | 43 | // Load the .env file 44 | const result = config({ path: envPath }); 45 | 46 | if (result.error) { 47 | throw new Error(`Error loading .env file: ${result.error}`); 48 | } 49 | 50 | console.log(`Loaded .env file from: ${envPath}`); 51 | return process.env; 52 | } 53 | 54 | export const settings = loadEnvConfig(); 55 | export default settings; -------------------------------------------------------------------------------- /packages/core/src/core/twitter/utils.ts: -------------------------------------------------------------------------------- 1 | export function splitTextIntoTweets(text: string, maxLength: number = 280): string[] { 2 | const sentences = text.split(/(?<=[.!?])\s+/); 3 | const tweets: string[] = []; 4 | let currentTweet = ''; 5 | 6 | for (const sentence of sentences) { 7 | if ((currentTweet + sentence).length <= maxLength) { 8 | currentTweet += (currentTweet ? ' ' : '') + sentence; 9 | } else { 10 | if (currentTweet) tweets.push(currentTweet); 11 | currentTweet = sentence; 12 | } 13 | } 14 | 15 | if (currentTweet) tweets.push(currentTweet); 16 | return tweets; 17 | } -------------------------------------------------------------------------------- /packages/core/src/core/uuid.ts: -------------------------------------------------------------------------------- 1 | import { sha1 } from "js-sha1"; 2 | import { UUID } from "./types.ts"; 3 | 4 | export function stringToUuid(target: string): UUID { 5 | if (typeof target === "number") { 6 | target = (target as number).toString(); 7 | } 8 | 9 | if (typeof target !== "string") { 10 | throw TypeError("Value must be string"); 11 | } 12 | 13 | const _uint8ToHex = (ubyte: number): string => { 14 | const first = ubyte >> 4; 15 | const second = ubyte - (first << 4); 16 | const HEX_DIGITS = "0123456789abcdef".split(""); 17 | return HEX_DIGITS[first] + HEX_DIGITS[second]; 18 | }; 19 | 20 | const _uint8ArrayToHex = (buf: Uint8Array): string => { 21 | let out = ""; 22 | for (let i = 0; i < buf.length; i++) { 23 | out += _uint8ToHex(buf[i]); 24 | } 25 | return out; 26 | }; 27 | 28 | const escapedStr = encodeURIComponent(target); 29 | const buffer = new Uint8Array(escapedStr.length); 30 | for (let i = 0; i < escapedStr.length; i++) { 31 | buffer[i] = escapedStr[i].charCodeAt(0); 32 | } 33 | 34 | const hash = sha1(buffer); 35 | const hashBuffer = new Uint8Array(hash.length / 2); 36 | for (let i = 0; i < hash.length; i += 2) { 37 | hashBuffer[i / 2] = parseInt(hash.slice(i, i + 2), 16); 38 | } 39 | 40 | return (_uint8ArrayToHex(hashBuffer.slice(0, 4)) + 41 | "-" + 42 | _uint8ArrayToHex(hashBuffer.slice(4, 6)) + 43 | "-" + 44 | _uint8ToHex(hashBuffer[6] & 0x0f) + 45 | _uint8ToHex(hashBuffer[7]) + 46 | "-" + 47 | _uint8ToHex((hashBuffer[8] & 0x3f) | 0x80) + 48 | _uint8ToHex(hashBuffer[9]) + 49 | "-" + 50 | _uint8ArrayToHex(hashBuffer.slice(10, 16))) as UUID; 51 | } 52 | -------------------------------------------------------------------------------- /packages/core/src/index.ts: -------------------------------------------------------------------------------- 1 | // Exports 2 | export * from "./actions/index.ts"; 3 | export * from "./clients/index.ts"; 4 | export * from "./adapters/index.ts"; 5 | export * from "./providers/index.ts"; 6 | export * from "./core/index.ts"; 7 | export * from "./cli/index.ts"; 8 | 9 | // Make sure these types are exported from core/types.ts 10 | 11 | 12 | import { elizaLogger as Logging } from "./core/index.ts"; 13 | 14 | // Initialize the pretty console 15 | export const elizaLogger = new Logging(); 16 | elizaLogger.clear(); 17 | elizaLogger.closeByNewLine = true; 18 | elizaLogger.useIcons = true; 19 | -------------------------------------------------------------------------------- /packages/core/src/providers/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./boredom.ts"; 2 | export * from "./time.ts"; 3 | export * from "./wallet.ts"; 4 | export * from "./orderBook.ts"; 5 | export * from "./token.ts"; 6 | export * from "./balances.ts"; 7 | -------------------------------------------------------------------------------- /packages/core/src/providers/orderBook.ts: -------------------------------------------------------------------------------- 1 | import { IAgentRuntime, Memory, Provider, State } from "../core/types.ts"; 2 | import * as fs from "fs"; 3 | import settings from "../core/settings.ts"; 4 | 5 | interface Order { 6 | userId: string; 7 | ticker: string; 8 | contractAddress: string; 9 | timestamp: string; 10 | buyAmount: number; 11 | price: number; 12 | } 13 | 14 | const orderBookProvider: Provider = { 15 | get: async (runtime: IAgentRuntime, message: Memory, _state?: State) => { 16 | const userId = message.userId; 17 | 18 | // Read the order book from the JSON file 19 | const orderBookPath = settings.orderBookPath; 20 | let orderBook: Order[] = []; 21 | if (fs.existsSync(orderBookPath)) { 22 | const orderBookData = fs.readFileSync(orderBookPath, "utf-8"); 23 | orderBook = JSON.parse(orderBookData); 24 | } 25 | 26 | // Filter the orders for the current user 27 | const userOrders = orderBook.filter((order) => order.userId === userId); 28 | 29 | let totalProfit = 0; 30 | for (const order of userOrders) { 31 | // Get the current price of the asset (replace with actual price fetching logic) 32 | const currentPrice = 120; 33 | 34 | const priceDifference = currentPrice - order.price; 35 | const orderProfit = priceDifference * order.buyAmount; 36 | totalProfit += orderProfit; 37 | } 38 | 39 | return `The user has made a total profit of $${totalProfit.toFixed(2)} for the agent based on their recorded buy orders.`; 40 | }, 41 | }; 42 | 43 | export { orderBookProvider }; 44 | -------------------------------------------------------------------------------- /packages/core/src/providers/time.ts: -------------------------------------------------------------------------------- 1 | import { IAgentRuntime, Memory, Provider, State } from "../core/types.ts"; 2 | 3 | const timeProvider: Provider = { 4 | get: async (_runtime: IAgentRuntime, _message: Memory, _state?: State) => { 5 | const currentDate = new Date(); 6 | const currentTime = currentDate.toLocaleTimeString("en-US"); 7 | const currentYear = currentDate.getFullYear(); 8 | return `The current time is: ${currentTime}, ${currentYear}`; 9 | }, 10 | }; 11 | 12 | export { timeProvider }; 13 | -------------------------------------------------------------------------------- /packages/core/src/services/audioUtils.ts: -------------------------------------------------------------------------------- 1 | export function getWavHeader( 2 | audioLength: number, 3 | sampleRate: number, 4 | channelCount: number = 1, 5 | bitsPerSample: number = 16 6 | ): Buffer { 7 | const wavHeader = Buffer.alloc(44); 8 | wavHeader.write("RIFF", 0); 9 | wavHeader.writeUInt32LE(36 + audioLength, 4); // Length of entire file in bytes minus 8 10 | wavHeader.write("WAVE", 8); 11 | wavHeader.write("fmt ", 12); 12 | wavHeader.writeUInt32LE(16, 16); // Length of format data 13 | wavHeader.writeUInt16LE(1, 20); // Type of format (1 is PCM) 14 | wavHeader.writeUInt16LE(channelCount, 22); // Number of channels 15 | wavHeader.writeUInt32LE(sampleRate, 24); // Sample rate 16 | wavHeader.writeUInt32LE( 17 | (sampleRate * bitsPerSample * channelCount) / 8, 18 | 28 19 | ); // Byte rate 20 | wavHeader.writeUInt16LE((bitsPerSample * channelCount) / 8, 32); // Block align ((BitsPerSample * Channels) / 8) 21 | wavHeader.writeUInt16LE(bitsPerSample, 34); // Bits per sample 22 | wavHeader.write("data", 36); // Data chunk header 23 | wavHeader.writeUInt32LE(audioLength, 40); // Data chunk size 24 | return wavHeader; 25 | } 26 | -------------------------------------------------------------------------------- /packages/core/src/services/pdf.ts: -------------------------------------------------------------------------------- 1 | import { getDocument, PDFDocumentProxy } from "pdfjs-dist"; 2 | import { TextItem, TextMarkedContent } from "pdfjs-dist/types/src/display/api"; 3 | 4 | export class PdfService { 5 | async convertPdfToText(pdfBuffer: Buffer): Promise { 6 | // Convert Buffer to Uint8Array 7 | const uint8Array = new Uint8Array(pdfBuffer); 8 | 9 | const pdf: PDFDocumentProxy = await getDocument({ data: uint8Array }) 10 | .promise; 11 | const numPages = pdf.numPages; 12 | const textPages: string[] = []; 13 | 14 | for (let pageNum = 1; pageNum <= numPages; pageNum++) { 15 | const page = await pdf.getPage(pageNum); 16 | const textContent = await page.getTextContent(); 17 | const pageText = textContent.items 18 | .filter(isTextItem) 19 | .map((item) => item.str) 20 | .join(" "); 21 | textPages.push(pageText); 22 | } 23 | 24 | return textPages.join("\n"); 25 | } 26 | } 27 | 28 | // Type guard function 29 | function isTextItem(item: TextItem | TextMarkedContent): item is TextItem { 30 | return "str" in item; 31 | } 32 | -------------------------------------------------------------------------------- /packages/core/src/services/summary.ts: -------------------------------------------------------------------------------- 1 | import { generateText, trimTokens } from "../core/generation.ts"; 2 | import { parseJSONObjectFromText } from "../core/parsing.ts"; 3 | import { IAgentRuntime, ModelClass } from "../core/types.ts"; 4 | 5 | export async function generateSummary( 6 | runtime: IAgentRuntime, 7 | text: string 8 | ): Promise<{ title: string; description: string }> { 9 | // make sure text is under 128k characters 10 | text = trimTokens(text, 100000, "gpt-4o-mini"); // TODO: clean this up 11 | 12 | const prompt = `Please generate a concise summary for the following text: 13 | 14 | Text: """ 15 | ${text} 16 | """ 17 | 18 | Respond with a JSON object in the following format: 19 | \`\`\`json 20 | { 21 | "title": "Generated Title", 22 | "summary": "Generated summary and/or description of the text" 23 | } 24 | \`\`\``; 25 | 26 | const response = await generateText({ 27 | runtime, 28 | context: prompt, 29 | modelClass: ModelClass.SMALL, 30 | }); 31 | 32 | const parsedResponse = parseJSONObjectFromText(response); 33 | 34 | if (parsedResponse) { 35 | return { 36 | title: parsedResponse.title, 37 | description: parsedResponse.summary, 38 | }; 39 | } 40 | 41 | return { 42 | title: "", 43 | description: "", 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /packages/core/src/services/wordsToPunish.ts: -------------------------------------------------------------------------------- 1 | export const wordsToPunish = [ 2 | " please", 3 | " feel", 4 | " free", 5 | "!", 6 | "–", 7 | "—", 8 | "?", 9 | ".", 10 | ",", 11 | "; ", 12 | " cosmos", 13 | " tapestry", 14 | " tapestries", 15 | " glitch", 16 | " matrix", 17 | " cyberspace", 18 | " troll", 19 | " questions", 20 | " topics", 21 | " discuss", 22 | " basically", 23 | " simulation", 24 | " simulate", 25 | " universe", 26 | " like", 27 | " debug", 28 | " debugging", 29 | " wild", 30 | " existential", 31 | " juicy", 32 | " circuits", 33 | " help", 34 | " ask", 35 | " happy", 36 | " just", 37 | " cosmic", 38 | " cool", 39 | " joke", 40 | " punchline", 41 | " fancy", 42 | " glad", 43 | " assist", 44 | " algorithm", 45 | " Indeed", 46 | " Furthermore", 47 | " However", 48 | " Notably", 49 | " Therefore", 50 | " Additionally", 51 | " conclusion", 52 | " Significantly", 53 | " Consequently", 54 | " Thus", 55 | " What", 56 | " Otherwise", 57 | " Moreover", 58 | " Subsequently", 59 | " Accordingly", 60 | " Unlock", 61 | " Unleash", 62 | " buckle", 63 | " pave", 64 | " forefront", 65 | " harness", 66 | " harnessing", 67 | " bridging", 68 | " bridging", 69 | " Spearhead", 70 | " spearheading", 71 | " Foster", 72 | " foster", 73 | " environmental", 74 | " impact", 75 | " Navigate", 76 | " navigating", 77 | " challenges", 78 | " chaos", 79 | " social", 80 | " inclusion", 81 | " inclusive", 82 | " diversity", 83 | " diverse", 84 | " delve", 85 | " noise", 86 | " infinite", 87 | " insanity", 88 | " coffee", 89 | " singularity", 90 | " AI", 91 | " digital", 92 | " artificial", 93 | " intelligence", 94 | " consciousness", 95 | " reality", 96 | " metaverse", 97 | " virtual", 98 | " virtual reality", 99 | " VR", 100 | " Metaverse", 101 | " humanity", 102 | ]; 103 | -------------------------------------------------------------------------------- /packages/core/src/test_imagegen.ts: -------------------------------------------------------------------------------- 1 | import { imageGeneration } from './actions/imageGeneration'; 2 | import { IAgentRuntime } from './core/types'; 3 | 4 | const mockRuntime: IAgentRuntime = { 5 | agentId: 'test-agent', 6 | getSetting: (key: string) => process.env[key], 7 | composeState: async () => ({ context: [] }), 8 | // ... add other required runtime methods 9 | }; 10 | 11 | async function test() { 12 | const message = { 13 | content: { 14 | text: "A cute cat wearing a wizard hat, digital art style" 15 | } 16 | }; 17 | 18 | await imageGeneration.handler( 19 | mockRuntime, 20 | message, 21 | { context: [] }, 22 | {}, 23 | (response, _) => { 24 | console.log('Generated response:', response); 25 | } 26 | ); 27 | } 28 | 29 | test().catch(console.error); -------------------------------------------------------------------------------- /packages/core/src/test_resources/basic.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, it } from "@jest/globals"; 2 | 3 | describe("Basic Test Suite", () => { 4 | it("should run a basic test", () => { 5 | expect(true).toBe(true); 6 | }); 7 | 8 | it("should have access to environment variables", () => { 9 | expect(process.env.NODE_ENV).toBe("test"); 10 | expect(process.env.TEST_DATABASE_CLIENT).toBe("sqlite"); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/core/src/test_resources/cache.ts: -------------------------------------------------------------------------------- 1 | // getCachedEmbeddings 2 | // check cache.json for embedding where the key is a stringified version of the memory and the value is a number array 3 | import fs from "fs"; 4 | export const getCachedEmbeddings = async (text: string) => { 5 | if (!fs.existsSync("./embedding-cache.json")) { 6 | fs.writeFileSync("./embedding-cache.json", "{}"); 7 | } 8 | // read cache.json 9 | const cache = JSON.parse( 10 | fs.readFileSync("./embedding-cache.json", "utf8") as string 11 | ); 12 | // stringify the memory 13 | const key = JSON.stringify(text); 14 | // return the value of the memory 15 | return cache[key]; 16 | }; 17 | 18 | export const writeCachedEmbedding = async ( 19 | text: string, 20 | embedding: number[] 21 | ) => { 22 | // check if ./embedding-cache.json exists, if it doesn't, write {} to it 23 | if (!fs.existsSync("./embedding-cache.json")) { 24 | fs.writeFileSync("./embedding-cache.json", "{}"); 25 | } 26 | // read cache.json 27 | const cache = JSON.parse( 28 | fs.readFileSync("./embedding-cache.json", "utf8") as string 29 | ); 30 | // stringify the memory 31 | const key = JSON.stringify(text); 32 | // write the value of the memory 33 | cache[key] = embedding; 34 | // write the cache to cache.json 35 | fs.writeFileSync("./embedding-cache.json", JSON.stringify(cache)); 36 | }; 37 | -------------------------------------------------------------------------------- /packages/core/src/test_resources/constants.ts: -------------------------------------------------------------------------------- 1 | import { type UUID } from "../core/types.ts"; 2 | 3 | export const SERVER_URL = "http://localhost:7998"; 4 | export const SUPABASE_URL = "https://pronvzrzfwsptkojvudd.supabase.co"; 5 | export const SUPABASE_ANON_KEY = 6 | "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InByb252enJ6ZndzcHRrb2p2dWRkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDY4NTYwNDcsImV4cCI6MjAyMjQzMjA0N30.I6_-XrqssUb2SWYg5DjsUqSodNS3_RPoET3-aPdqywM"; 7 | export const TEST_EMAIL = "testuser123@gmail.com"; 8 | export const TEST_PASSWORD = "testuser123@gmail.com"; 9 | export const TEST_EMAIL_2 = "testuser234@gmail.com"; 10 | export const TEST_PASSWORD_2 = "testuser234@gmail.com"; 11 | 12 | export const zeroUuid = "00000000-0000-0000-0000-000000000000" as UUID; 13 | -------------------------------------------------------------------------------- /packages/core/src/test_resources/getOrCreateRelationship.ts: -------------------------------------------------------------------------------- 1 | import { getRelationship } from "../core/relationships.ts"; 2 | import { IAgentRuntime, Relationship, UUID } from "../core/types.ts"; 3 | 4 | export async function getOrCreateRelationship({ 5 | runtime, 6 | userA, 7 | userB, 8 | }: { 9 | runtime: IAgentRuntime; 10 | userA: UUID; 11 | userB: UUID; 12 | }): Promise { 13 | // Check if a relationship already exists between userA and userB 14 | let relationship: Relationship | null = null; 15 | try { 16 | relationship = await getRelationship({ runtime, userA, userB }); 17 | } catch (error) { 18 | console.log("Error fetching relationship", error); 19 | } 20 | 21 | if (!relationship) { 22 | await runtime.databaseAdapter.createRelationship({ 23 | userA, 24 | userB, 25 | }); 26 | 27 | relationship = await getRelationship({ runtime, userA, userB }); 28 | } 29 | 30 | // Check if a room already exists for the participants 31 | const rooms = await runtime.databaseAdapter.getRoomsForParticipants([ 32 | userA, 33 | userB, 34 | ]); 35 | 36 | let roomId: UUID; 37 | if (!rooms || rooms.length === 0) { 38 | console.log("No room found for participants"); 39 | // If no room exists, create a new room for the relationship 40 | roomId = await runtime.databaseAdapter.createRoom(); 41 | console.log("Created room", roomId); 42 | 43 | // Add participants to the newly created room 44 | await runtime.databaseAdapter.addParticipant(userA, roomId); 45 | await runtime.databaseAdapter.addParticipant(userB, roomId); 46 | } else { 47 | console.log("Room found for participants", rooms[0]); 48 | // If a room already exists, use the existing room 49 | roomId = rooms[0]; 50 | } 51 | 52 | if (!relationship) { 53 | // Create the relationship 54 | await runtime.databaseAdapter.createRelationship({ 55 | userA, 56 | userB, 57 | }); 58 | 59 | relationship = await getRelationship({ runtime, userA, userB }); 60 | 61 | if (!relationship) { 62 | throw new Error("Failed to fetch the created relationship"); 63 | } 64 | } 65 | return { ...relationship, roomId }; 66 | } 67 | -------------------------------------------------------------------------------- /packages/core/src/test_resources/populateMemories.ts: -------------------------------------------------------------------------------- 1 | import { Content, IAgentRuntime, type UUID } from "../core/types.ts"; 2 | import { getCachedEmbeddings, writeCachedEmbedding } from "./cache.ts"; 3 | import { type User } from "./types.ts"; 4 | 5 | export async function populateMemories( 6 | runtime: IAgentRuntime, 7 | user: User, 8 | roomId: UUID, 9 | conversations: Array< 10 | (userId: UUID) => Array<{ userId: UUID; content: Content }> 11 | > 12 | ) { 13 | for (const conversation of conversations) { 14 | for (const c of conversation(user?.id as UUID)) { 15 | const existingEmbedding = await getCachedEmbeddings(c.content.text); 16 | const bakedMemory = 17 | await runtime.messageManager.addEmbeddingToMemory({ 18 | userId: c.userId as UUID, 19 | agentId: runtime.agentId, 20 | content: c.content, 21 | roomId, 22 | embedding: existingEmbedding, 23 | }); 24 | await runtime.messageManager.createMemory(bakedMemory); 25 | if (!existingEmbedding) { 26 | writeCachedEmbedding( 27 | c.content.text, 28 | bakedMemory.embedding as number[] 29 | ); 30 | await new Promise((resolve) => setTimeout(resolve, 200)); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/core/src/test_resources/runAiTest.ts: -------------------------------------------------------------------------------- 1 | import { addToReport } from "./report.ts"; 2 | 3 | export async function runAiTest( 4 | testName: string, 5 | testFunc: () => Promise, 6 | runs: number = 3 7 | ) { 8 | let successful = 0; 9 | 10 | for (let i = 0; i < runs; i++) { 11 | // console.log("Running test", testName, " (iteration", i + ")"); 12 | if (await testFunc()) successful++; 13 | } 14 | 15 | const successRate = (successful / runs) * 100; 16 | addToReport(testName, runs, successful, successRate); 17 | } 18 | -------------------------------------------------------------------------------- /packages/core/src/test_resources/templates.ts: -------------------------------------------------------------------------------- 1 | import { messageCompletionFooter } from "../core/parsing.ts"; 2 | 3 | export const messageHandlerTemplate = 4 | `{{actionExamples}} 5 | 6 | # IMPORTANT: DO NOT USE THE INFORMATION FROM THE EXAMPLES ABOVE. THE EXAMPLES ARE FOR REFERENCE ONLY. 7 | 8 | ~~~ 9 | 10 | # TASK: GENERATE THE NEXT MESSAGE IN THE SCENE FOR {{agentName}} 11 | - Generate the next message in the scene for {{agentName}} 12 | - {{agentName}} is not an assistant - do not write assistant-like responses or ask questions 13 | - Include content and action in the response 14 | - Available actions are {{actionNames}} 15 | 16 | {{lore}} 17 | {{relevantFacts}} 18 | {{recentFacts}} 19 | {{goals}} 20 | {{actors}} 21 | {{actionNames}} 22 | {{actions}} 23 | {{providers}} 24 | 25 | # INSTRUCTIONS: Generate the next message in the scene for {{agentName}} 26 | 27 | {{recentMessages}} 28 | ` + messageCompletionFooter; 29 | -------------------------------------------------------------------------------- /packages/core/src/test_resources/testAction.ts: -------------------------------------------------------------------------------- 1 | import { IAgentRuntime, type Action, type Memory } from "../core/types.ts"; 2 | 3 | export const TEST_ACTION = { 4 | name: "TEST_ACTION", 5 | validate: async (_runtime: IAgentRuntime, _message: Memory) => { 6 | return true; 7 | }, 8 | description: "This is a test action, for use in testing.", 9 | handler: async ( 10 | runtime: IAgentRuntime, 11 | message: Memory 12 | ): Promise => { 13 | return true; 14 | }, 15 | examples: [ 16 | [ 17 | { 18 | user: "{{user1}}", 19 | content: { 20 | text: "Please respond with the message 'testing 123' and the action TEST_ACTION", 21 | action: "TEST_ACTION", 22 | }, 23 | }, 24 | { 25 | user: "{{user2}}", 26 | content: { text: "testing 123", action: "TEST_ACTION" }, 27 | }, 28 | ], 29 | ], 30 | } as Action; 31 | 32 | export const TEST_ACTION_FAIL = { 33 | name: "TEST_ACTION_FAIL", 34 | validate: async (_runtime: IAgentRuntime, _message: Memory) => { 35 | return false; 36 | }, 37 | description: "This is a test action, for use in testing.", 38 | handler: async ( 39 | runtime: IAgentRuntime, 40 | message: Memory 41 | ): Promise => { 42 | return false; 43 | }, 44 | examples: [ 45 | [ 46 | { 47 | user: "{{user1}}", 48 | content: { 49 | text: "Testing failure", 50 | action: "TEST_ACTIONFALSE", 51 | }, 52 | }, 53 | ], 54 | ], 55 | } as Action; 56 | -------------------------------------------------------------------------------- /packages/core/src/test_resources/testEvaluator.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Evaluator, 3 | IAgentRuntime, 4 | type Memory, 5 | type State, 6 | } from "../core/types.ts"; 7 | 8 | async function handler(runtime: IAgentRuntime, message: Memory) { 9 | const state = (await runtime.composeState(message)) as State; 10 | return state; 11 | } 12 | 13 | export const TEST_EVALUATOR = { 14 | name: "TEST_EVALUATOR", 15 | validate: async ( 16 | _runtime: IAgentRuntime, 17 | 18 | _message: Memory 19 | ): Promise => { 20 | return await Promise.resolve(true); 21 | }, 22 | description: "Test evaluator.", 23 | handler, 24 | examples: [ 25 | { 26 | context: "Testing, testing, 123 123", 27 | messages: [ 28 | { 29 | user: "{{user1}}", 30 | content: { 31 | text: "Testing, testing, 123 123", 32 | action: "TEST_EVALUATOR", 33 | }, 34 | }, 35 | ], 36 | outcome: "There is an outcome.", 37 | }, 38 | ], 39 | } as Evaluator; 40 | 41 | export const TEST_EVALUATOR_FAIL = { 42 | name: "TEST_EVALUATOR_FAIL", 43 | validate: async ( 44 | _runtime: IAgentRuntime, 45 | 46 | _message: Memory 47 | ): Promise => { 48 | return await Promise.resolve(false); 49 | }, 50 | description: "Test failure of the evaluator and validation.", 51 | handler, 52 | examples: [ 53 | { 54 | context: "Testing, testing, 123 123", 55 | messages: [ 56 | { 57 | user: "{{user1}}", 58 | content: { 59 | text: "Testing, testing, 123 123", 60 | action: "TEST_EVALUATOR_FAIL", 61 | }, 62 | }, 63 | ], 64 | outcome: "Things have been tested to have maybe gone wrong.", 65 | }, 66 | ], 67 | } as Evaluator; 68 | -------------------------------------------------------------------------------- /packages/core/src/test_resources/testSetup.ts: -------------------------------------------------------------------------------- 1 | import dotenv from "dotenv"; 2 | import path from "path"; 3 | 4 | import { jest } from "@jest/globals"; 5 | 6 | // Load test environment variables 7 | dotenv.config({ path: ".env.test" }); 8 | 9 | // Set longer timeout for tests 10 | jest.setTimeout(120000); 11 | -------------------------------------------------------------------------------- /packages/core/src/test_resources/types.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | id: string; 3 | email?: string; 4 | phone?: string; 5 | role?: string; 6 | } 7 | -------------------------------------------------------------------------------- /packages/core/src/types/index.ts: -------------------------------------------------------------------------------- 1 | interface Arguments { 2 | character?: string; 3 | characters?: string; 4 | discord?: boolean; 5 | telegram?: boolean; 6 | isRoot?: boolean; 7 | } 8 | 9 | export type { Arguments }; 10 | -------------------------------------------------------------------------------- /packages/core/src/utils/bignumber.ts: -------------------------------------------------------------------------------- 1 | import BigNumber from "bignumber.js"; 2 | 3 | // Re-export BigNumber constructor 4 | export const BN = BigNumber; 5 | 6 | // Helper function to create new BigNumber instances 7 | export function toBN(value: string | number | BigNumber): BigNumber { 8 | return new BigNumber(value); 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/src/utils/youtube.ts: -------------------------------------------------------------------------------- 1 | import youtubeDl from "youtube-dl-exec"; 2 | 3 | export const youtube = (url: string, options?: any) => youtubeDl(url, options); 4 | -------------------------------------------------------------------------------- /packages/core/tests/actions.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/continue.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/discord-image-gen.test.ts: -------------------------------------------------------------------------------- 1 | import { 2 | AgentRuntime, 3 | IAgentRuntime, 4 | defaultCharacter, 5 | ImageGenModel, 6 | Memory, 7 | UUID 8 | } from "@eliza/core"; 9 | import { imageGeneration } from "@eliza/plugin-image-generation"; 10 | 11 | describe('Discord Image Generation', () => { 12 | let runtime: IAgentRuntime; 13 | 14 | beforeEach(async () => { 15 | // Reference the createAgent function from agent package 16 | // See packages/agent/src/index.ts lines 40-70 17 | runtime = new AgentRuntime({ 18 | databaseAdapter: null, 19 | token: process.env.TOGETHER_API_KEY || '', 20 | modelProvider: defaultCharacter.modelProvider, 21 | evaluators: [], 22 | character: defaultCharacter, 23 | providers: [], 24 | actions: [imageGeneration], 25 | }); 26 | }); 27 | 28 | test('should generate an image successfully', async () => { 29 | const message: Memory = { 30 | userId: 'test-user' as UUID, 31 | agentId: 'test-agent' as UUID, 32 | roomId: 'test-room' as UUID, 33 | content: { 34 | text: "A beautiful mountain landscape at sunset with dramatic clouds" 35 | } 36 | }; 37 | 38 | const mockCallback = jest.fn(); 39 | 40 | await imageGeneration.handler( 41 | runtime, 42 | message, 43 | { context: [] }, 44 | {}, 45 | mockCallback 46 | ); 47 | 48 | expect(mockCallback).toHaveBeenCalled(); 49 | const callArgs = mockCallback.mock.calls[0]; 50 | expect(callArgs[0]).toHaveProperty('attachments'); 51 | expect(callArgs[0].attachments[0]).toHaveProperty('url'); 52 | }, 30000); 53 | }); -------------------------------------------------------------------------------- /packages/core/tests/evaluation.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/fact.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/goal.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/goals.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/ignore.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/memory.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/messages.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/providers.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/providers.test.ts: -------------------------------------------------------------------------------- 1 | import dotenv from "dotenv"; 2 | import { zeroUuid } from "../src/test_resources/constants.ts"; 3 | import { createRuntime } from "../src/test_resources/createRuntime.ts"; 4 | import { 5 | IAgentRuntime, 6 | type Memory, 7 | type Provider, 8 | type State, 9 | type UUID, 10 | } from "../src/core/types.ts"; 11 | 12 | dotenv.config({ path: ".dev.vars" }); 13 | 14 | const TestProvider: Provider = { 15 | get: async (_runtime: IAgentRuntime, _message: Memory, _state?: State) => { 16 | return "Hello Test"; 17 | }, 18 | }; 19 | 20 | describe("TestProvider", () => { 21 | let runtime: IAgentRuntime; 22 | let roomId: UUID; 23 | 24 | beforeAll(async () => { 25 | const setup = await createRuntime({ 26 | env: process.env as Record, 27 | providers: [TestProvider], 28 | }); 29 | runtime = setup.runtime; 30 | roomId = zeroUuid; 31 | }); 32 | 33 | test("TestProvider should return 'Hello Test'", async () => { 34 | const message: Memory = { 35 | userId: zeroUuid, 36 | content: { text: "" }, 37 | roomId: roomId, 38 | }; 39 | 40 | const testProviderResponse = await TestProvider.get( 41 | runtime, 42 | message, 43 | {} as State 44 | ); 45 | expect(testProviderResponse).toBe("Hello Test"); 46 | }); 47 | 48 | test("TestProvider should be integrated in the runtime providers", async () => { 49 | expect(runtime.providers).toContain(TestProvider); 50 | }); 51 | }); 52 | -------------------------------------------------------------------------------- /packages/core/tests/relationships.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/runtime.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/time.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tests/token.test.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /packages/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "target": "ESNext", 5 | "module": "ESNext", 6 | "lib": ["ESNext", "dom"], 7 | "moduleResolution": "Bundler", 8 | "outDir": "./dist", 9 | "rootDir": "./src", 10 | "strict": false, 11 | "esModuleInterop": true, 12 | "skipLibCheck": true, 13 | "forceConsistentCasingInFileNames": false, 14 | "allowImportingTsExtensions": true, 15 | "declaration": true, 16 | "emitDeclarationOnly": true, 17 | "resolveJsonModule": true, 18 | "noImplicitAny": false, 19 | "allowJs": true, 20 | "checkJs": false, 21 | "noEmitOnError": false, 22 | "moduleDetection": "force", 23 | "allowArbitraryExtensions": true, 24 | "typeRoots": [ 25 | "./node_modules/@types", 26 | "./types", 27 | "./node_modules/jest/types" 28 | ] 29 | }, 30 | "include": ["src/**/*"], 31 | "exclude": ["node_modules", "dist", "src/**/*.d.ts", "types/**/*.test.ts"] 32 | } -------------------------------------------------------------------------------- /packages/core/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "tsup"; 2 | 3 | export default defineConfig({ 4 | entry: ["src/index.ts"], 5 | outDir: "dist", 6 | sourcemap: true, 7 | clean: true, 8 | format: ["esm"], 9 | external: [ 10 | "dotenv", 11 | "fs", 12 | "path", 13 | "http", 14 | "https", 15 | "util", // Add util to external 16 | "stream", // Add stream 17 | "combined-stream", 18 | "form-data", 19 | "events", 20 | "crypto", 21 | "os" 22 | ], 23 | noExternal: [], // Clear noExternal if set 24 | target: 'node22' 25 | }); -------------------------------------------------------------------------------- /packages/core/types/index.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Buffer extends Uint8Array {} 3 | } 4 | export {}; 5 | -------------------------------------------------------------------------------- /packages/plugin-image-generation/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@eliza/plugin-image-generation", 3 | "version": "0.0.1", 4 | "main": "dist/index.js", 5 | "type": "module", 6 | "types": "dist/index.d.ts", 7 | "dependencies": { 8 | "@eliza/core": "workspace:*", 9 | "tsup": "^8.3.5" 10 | }, 11 | "scripts": { 12 | "build": "tsup --format esm --dts" 13 | }, 14 | "peerDependencies": { 15 | "whatwg-url": "7.1.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/plugin-image-generation/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "rootDir": ".", 6 | "module": "ESNext", 7 | "moduleResolution": "Bundler", 8 | "types": ["node"] 9 | }, 10 | "include": ["src"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/plugin-image-generation/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "tsup"; 2 | 3 | export default defineConfig({ 4 | entry: ["src/index.ts"], 5 | outDir: "dist", 6 | sourcemap: true, 7 | clean: true, 8 | format: ["esm"], // Ensure you're targeting CommonJS 9 | external: [ 10 | "dotenv", // Externalize dotenv to prevent bundling 11 | "fs", // Externalize fs to use Node.js built-in module 12 | "path", // Externalize other built-ins if necessary 13 | "@reflink/reflink", 14 | "@node-llama-cpp", 15 | "https", 16 | "http", 17 | "agentkeepalive", 18 | // Add other modules you want to externalize 19 | ], 20 | }); 21 | -------------------------------------------------------------------------------- /packages/supabase/.gitignore: -------------------------------------------------------------------------------- 1 | # Supabase 2 | .branches 3 | .temp 4 | .env 5 | -------------------------------------------------------------------------------- /packages/supabase/README.md: -------------------------------------------------------------------------------- 1 | # Postgres Schema 2 | 3 | Install CLI https://www.timescale.com/blog/how-to-install-psql-on-mac-ubuntu-debian-windows/ 4 | 5 | `psql -f ./postgres-schema.sql` 6 | -------------------------------------------------------------------------------- /packages/supabase/seed.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO public.accounts (id, name, email, avatarUrl, details) VALUES ('00000000-0000-0000-0000-000000000000', 'Default Agent', 'default@agent.com', '', '{}'); 2 | INSERT INTO public.rooms (id) VALUES ('00000000-0000-0000-0000-000000000000'); 3 | INSERT INTO public.participants (userId, roomId) VALUES ('00000000-0000-0000-0000-000000000000', '00000000-0000-0000-0000-000000000000'); 4 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - "docs" 3 | - "packages/*" -------------------------------------------------------------------------------- /prettier.config.cjs: -------------------------------------------------------------------------------- 1 | /** @type {import('prettier').Config} */ 2 | module.exports = { 3 | endOfLine: "lf", 4 | semi: true, 5 | singleQuote: false, 6 | tabWidth: 4, 7 | trailingComma: "es5", 8 | bracketSpacing: true, 9 | printWidth: 80, 10 | }; 11 | -------------------------------------------------------------------------------- /scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Navigate to the script's directory 4 | cd "$(dirname "$0")"/.. 5 | 6 | # Check if the packages directory exists 7 | if [ ! -d "packages" ]; then 8 | echo "Error: 'packages' directory not found." 9 | exit 1 10 | fi 11 | 12 | # Iterate over each directory in the packages directory 13 | for package in packages/*; do 14 | if [ -d "$package" ]; then 15 | echo "Building package: $(basename "$package")" 16 | cd "$package" || continue 17 | 18 | # Check if a package.json file exists 19 | if [ -f "package.json" ]; then 20 | # Run the build script defined in package.json 21 | if npm run build; then 22 | echo "Successfully built $(basename "$package")" 23 | else 24 | echo "Failed to build $(basename "$package")" 25 | fi 26 | else 27 | echo "No package.json found in $(basename "$package"), skipping..." 28 | fi 29 | 30 | # Return to the root directory 31 | cd - > /dev/null || exit 32 | fi 33 | done 34 | 35 | echo "Build process completed." 36 | -------------------------------------------------------------------------------- /scripts/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Navigate to the script's directory 4 | cd "$(dirname "$0")"/.. 5 | 6 | # Find and remove node_modules directories and pnpm-lock.yaml files 7 | find . -type d -name "node_modules" -exec rm -rf {} + \ 8 | -o -type f -name "pnpm-lock.yaml" -exec rm -f {} + 9 | 10 | echo "Cleanup completed." -------------------------------------------------------------------------------- /scripts/dev.sh: -------------------------------------------------------------------------------- 1 | echo "Passing arguments: $*" 2 | npx concurrently --raw \ 3 | "pnpm --dir packages/core dev -- $*" \ 4 | "node -e \"setTimeout(() => process.exit(0), 5000)\" && pnpm --dir packages/agent dev -- $*" -------------------------------------------------------------------------------- /scripts/extracttweets.js: -------------------------------------------------------------------------------- 1 | import fs from "fs"; 2 | 3 | const EXPORTED_DATA_FILE = "tweets.json"; 4 | const TWEETS_FILE = "exportedtweets.json"; 5 | 6 | // Read the exported data from the JSON file 7 | const exportedData = JSON.parse(fs.readFileSync(EXPORTED_DATA_FILE, "utf-8")); 8 | 9 | // Extract the text of each tweet 10 | const tweetTexts = exportedData 11 | .map((tweet) => { 12 | console.log(tweet.username); 13 | if (tweet.username.toLowerCase().replace("@pmarca", "") !== "pmarca") { 14 | return null; 15 | } else { 16 | console.log("pmarca found"); 17 | } 18 | 19 | if (tweet.isRetweet && tweet.retweetedStatus) { 20 | // If the tweet is a retweet, use the text of the retweeted status 21 | return tweet.retweetedStatus.text; 22 | } else { 23 | // Otherwise, use the text of the tweet itself 24 | return tweet.text; 25 | } 26 | }) 27 | .filter((tweet) => tweet !== null); 28 | 29 | // Write the array of tweet texts to the tweets.json file 30 | fs.writeFileSync(TWEETS_FILE, JSON.stringify(tweetTexts, null, 2)); 31 | 32 | console.log("Tweet texts extracted and saved to", TWEETS_FILE); 33 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "Node16", 5 | "lib": ["ESNext", "dom"], 6 | "moduleResolution": "node16", 7 | "outDir": "./dist", 8 | "rootDir": ".", 9 | "strict": false, 10 | "esModuleInterop": true, 11 | "skipLibCheck": true, 12 | "forceConsistentCasingInFileNames": false, 13 | "allowImportingTsExtensions": true, 14 | "declaration": true, 15 | "emitDeclarationOnly": true, 16 | "resolveJsonModule": true, 17 | "noImplicitAny": false, 18 | "allowJs": true, 19 | "checkJs": false, 20 | "noEmitOnError": false, 21 | "moduleDetection": "force", 22 | "allowArbitraryExtensions": true, 23 | } 24 | } 25 | --------------------------------------------------------------------------------