{"id":25699665,"url":"https://github.com/elchemista/agent_dsl","last_synced_at":"2026-06-16T15:32:15.052Z","repository":{"id":277232640,"uuid":"931763389","full_name":"elchemista/agent_dsl","owner":"elchemista","description":"DSL for creating Ai Agents using :gen_statem with streaming response from Replicate,OpenAi,Gemini","archived":false,"fork":false,"pushed_at":"2025-02-13T23:05:31.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-25T03:16:39.395Z","etag":null,"topics":["agents","dsl","elixir"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/elchemista.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":"2025-02-12T20:17:58.000Z","updated_at":"2025-02-16T18:31:03.000Z","dependencies_parsed_at":"2025-02-12T21:40:58.183Z","dependency_job_id":null,"html_url":"https://github.com/elchemista/agent_dsl","commit_stats":null,"previous_names":["elchemista/agent_dsl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elchemista/agent_dsl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elchemista%2Fagent_dsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elchemista%2Fagent_dsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elchemista%2Fagent_dsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elchemista%2Fagent_dsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elchemista","download_url":"https://codeload.github.com/elchemista/agent_dsl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elchemista%2Fagent_dsl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34412788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["agents","dsl","elixir"],"created_at":"2025-02-25T03:16:41.143Z","updated_at":"2026-06-16T15:32:15.028Z","avatar_url":"https://github.com/elchemista.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AgentDsl\n\n# VERY EXPERIMENTAL do not use anywhere!\n### API will change, every day, maybe even two times a day. \n\n### Backend API \n\n- Replicate\n- Gemini\n- OpenAi\n\nneed keys for each API, add to .env\n\n```bash\nexport REPLICATE_API_KEY=xxxx\nexport GEMINI_API_KEY=xxxx\nexport OPENAI_API_KEY=xxxx\n```\n\n### Example DSL\n\n```elixir \ndefmodule MyAgent do\n  use Agent.DSL\n  alias Agent.API.{Replicate, Gemini, OpenAi}\n\n  agent do\n    initial_state(:ask_intro)\n    initial_data(%{name: \"Tao\"})\n\n    state :ask_intro do\n      prompt(\"\"\"\n      Ask user what job he want to create, using this information: \u003c%= data[\"name\"] %\u003e}\n      \"\"\")\n\n      backend(API.Replicate)\n\n      on_enter do\n        ask(%{}, prompt)\n      end\n\n      on_event :cast, {:user_input, user_input} do\n        run_task(extract_title(user_input))\n        run_task(extract_tags(user_input))\n\n        classify check_if_user_write_all(user_input) do\n          \":repeat\" -\u003e {:keep_state, data}\n          \":stop\" -\u003e {:stop, data}\n          _ -\u003e ask(%{}, prompt)\n        end\n      end\n\n      handle :info, {:task, :extract_tags, extracted} do\n        {:next_state, Map.put(data, :extracted, extracted)}\n      end\n    end\n\n    classification :check_if_user_write_all, user_input do\n      backend(API.Gemini)\n\n      prompt(\"\"\"\n      Classify this input: \u003c%= user_input %\u003e\n\n      answer if user want to repeat -\u003e :repeat\n      answer if user want to go next step -\u003e :next\n      answer if user want to stop -\u003e :stop\n      \"\"\")\n    end\n\n    task :extract_title, user_input do\n      prompt(\"\"\"\n      Extract title from this information: \u003c%= user_input %\u003e\n      \"\"\")\n\n      backend(API.Gemini)\n    end\n\n    task :extract_tags, user_input do\n      prompt(\"\"\"\n      Extract tags from this information: \u003c%= user_input %\u003e\n      \"\"\")\n\n      backend(API.OpenAi)\n    end\n  end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felchemista%2Fagent_dsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felchemista%2Fagent_dsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felchemista%2Fagent_dsl/lists"}