{"id":15669202,"url":"https://github.com/kopiro/otto","last_synced_at":"2025-05-06T20:05:41.486Z","repository":{"id":38251052,"uuid":"80104660","full_name":"kopiro/otto","owner":"kopiro","description":"Otto Artificial Intelligence","archived":false,"fork":false,"pushed_at":"2025-03-24T15:08:03.000Z","size":13441,"stargazers_count":4,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T16:24:50.762Z","etag":null,"topics":["ai","bot","responder"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kopiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-26T10:19:09.000Z","updated_at":"2025-03-24T15:08:07.000Z","dependencies_parsed_at":"2024-06-14T20:53:16.040Z","dependency_job_id":"2207b9a0-b517-479c-af89-d05b0471405b","html_url":"https://github.com/kopiro/otto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopiro%2Fotto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopiro%2Fotto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopiro%2Fotto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopiro%2Fotto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kopiro","download_url":"https://codeload.github.com/kopiro/otto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252761140,"owners_count":21800124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","bot","responder"],"created_at":"2024-10-03T14:21:52.806Z","updated_at":"2025-05-06T20:05:41.141Z","avatar_url":"https://github.com/kopiro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Otto AI\n\n\u003cimg src=\"image.png\" width=\"200\" /\u003e\n\nOtto was my monkey plush, now is my personal AI assistant.\n\n## Development\n\nYou have to satisfy some dependencies that can be installed via a script based on your platform.\n\n- `./deps/macos/install.sh` if you run on macOS\n- `./deps/pi/install.sh` if you run on a Raspberry Pi\n\nThen:\n\n```sh\ncp .env.example .env\npnpm install\npnpm run start:dev\n```\n\nIf you're going to work on the client:\n\n```sh\ncd src-client\npnpm run start:dev\n```\n\n### I/O Drivers\n\nI/O drivers are the the way the AI handles inputs and output.\n\nEvery I/O driver must expose these methods:\n\n- `start` - To start receiving inputs\n- `output` - To process output\n\nYou can configure the I/O driver you want to spawn on your server via config,\nusing the `ioDrivers` keyword.\n\n```json\n{\n  \"ioDrivers\": [\"telegram\", \"messenger\"]\n}\n```\n\nYou can temporary use a driver without altering your configuration by setting an environment var:\n\n```\nexport OTTO_IO_DRIVERS=\"telegram,test\"\n```\n\nI/O drivers available at the moment:\n\n- **Voice**: handle input using microphone and speech recognizer and output using a TTS via a speaker\n- **Telegram**: handle I/O for a Telegram bot\n- **Web**: handle I/O via Rest API\n\n#### IO.Voice\n\nThis is the main I/O driver.\n\nIt uses your microphone to register your voice;\nonce it detects an hot word (example: _Hey BOT_),\nit sends the stream through an online speech recognizer and return the speeech.\n\nWhen you finish to talk, it sends the recognized speech over AI that could return\na output speech; it is sent over an online TTS to get an audio file that is played over the speaker.\n\n#### IO.Telegram\n\nIt listens via webhook (or via polling) the chat events of your Telegram bot,\nsend the text over AI that return an output.\n\nThe output is used to respond to the user request via Telegram.\n\n#### IO.Web\n\nIt provides a REST API interface to interact with the bot.\n\n## I/O Accessories\n\nI/O Accessories are similar to drivers, but don't handle input and output direclty.\nThey can be attached to I/O driver to perform additional things.\n\nYou can temporary use a accessory without altering your configuration by setting an environment var:\n\n```sh\nexport OTTO_IO_ACCESSORIES=telegram,test\n```\n\n## REST API\n\n### `/api/input`\n\nProvide an input to the API and post the output in the io_channel specified.\n\nParameters:\n\n- `io_channel`: IO Channel ID\n- `person`: Person ID\n- `params`:\n  - `text|command`: Input text or command\n  - `role?`: \"system\", \"user\" or \"assistant\"\n  - `context?`: object with context\n  - `bag?`: metadata\n\n```sh\nIO_CHANNEL_ID=\"\" \nPERSON_ID=\"\" \nTEXT=\"$1\"\ncurl https://otto.kopiro.me/api/input \\\n-X POST \\\n-H \"Content-Type: application/json\" \\\n-d \"{\\\"io_channel\\\":\\\"$IO_CHANNEL_ID\\\",\\\"person\\\":\\\"$PERSON_ID\\\",\\\"params\\\":{\\\"text\\\":\\\"$TEXT\\\"}}\"\n  ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopiro%2Fotto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkopiro%2Fotto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopiro%2Fotto/lists"}