feat: updates to quickstart-agent-motoko - #66
Open
ielashi wants to merge 5 commits into
Open
Conversation
Migrate the Motoko quickstart agent from dfx to icp-cli as a command-line-only example (no frontend): - Replace dfx.json + deps/ with an icp.yaml manifest: the `llm` canister from the v1.1.0 pre-built wasm (https / Internet Intelligence Gateway backend) and the `agent` canister via the @dfinity/motoko recipe. - Flatten src/backend/main.mo to src/main.mo (single canister) and use the string-model API ("llama3.1:8b"). - Drop the frontend; interact via `icp canister call`. - Depend on the in-repo llm library via a mops path-dep until 3.1.0 is published to the registry. - Add ic-mops to the root devDependencies so the @dfinity/motoko recipe can resolve the llm mops dependency at build time.
Switch from the local path-dep to the published llm@4.0.0 package now that it's available on the mops registry.
- Bump the llm canister to v1.2.0 and upgrade icp-cli to 1.3.0. - Move the IIG API key out of init_args into the IIG_API_KEY canister environment variable, read from the gitignored .secrets/iig-api-key file (icp-cli's file-based env vars require 1.3.0). - Simplify the llm init_args now that api_key is gone. - Take the model as the first argument to prompt/chat instead of hardcoding llama3.1:8b, and add promptWithCycles/chatWithCycles plus a documented v1_deposit flow so the example covers free and paid models.
There was a problem hiding this comment.
Pull request overview
Migrates the Motoko quickstart agent example from a dfx-based, frontend-backed project to an icp-cli-based, command-line-only example, including a flattened Motoko canister layout and updated deployment/docs.
Changes:
- Replaces
dfx.json+deps/workflow with anicp.yamlmanifest (managed local network + canister recipes). - Removes the entire frontend workspace and assets; interaction is now via
icp canister call .... - Updates the Motoko canister to expose model-parameterized
prompt/chatAPIs (plus*WithCyclesvariants) and refreshes the example README accordingly.
Reviewed changes
Copilot reviewed 20 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Bumps @icp-sdk/icp-cli and adds ic-mops as a root devDependency. |
| examples/quickstart-agent-motoko/src/main.mo | Adds the new single-canister Motoko entrypoint exposing CLI-callable methods. |
| examples/quickstart-agent-motoko/src/frontend/vite.config.js | Removes Vite config (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/tsconfig.json | Removes frontend TS config (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/src/vite-env.d.ts | Removes Vite env typing (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/src/user.svg | Removes frontend asset (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/src/main.js | Removes frontend bootstrap (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/src/index.scss | Removes frontend styling (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/src/bot.svg | Removes frontend asset (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/src/App.ts | Removes frontend app implementation (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/pnpm-lock.yaml | Removes frontend lockfile (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/package.json | Removes frontend package manifest (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/index.html | Removes frontend HTML entrypoint (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/assets/.ic-assets.json5 | Removes frontend asset config (frontend deleted). |
| examples/quickstart-agent-motoko/src/frontend/.gitignore | Removes frontend-local ignore file (frontend deleted). |
| examples/quickstart-agent-motoko/src/backend/main.mo | Removes old backend entrypoint (replaced by src/main.mo). |
| examples/quickstart-agent-motoko/README.md | Updates setup/deploy/call instructions for icp-cli and CLI-only usage. |
| examples/quickstart-agent-motoko/mops.toml | Updates Motoko dependency/toolchain settings for the example. |
| examples/quickstart-agent-motoko/icp.yaml | Adds icp-cli manifest defining canisters, networks, and environments. |
| examples/quickstart-agent-motoko/dfx.json | Removes dfx project configuration. |
| examples/quickstart-agent-motoko/deps/pulled.json | Removes dfx deps state (no longer used). |
| examples/quickstart-agent-motoko/deps/init.json | Removes dfx deps init args state (no longer used). |
| examples/quickstart-agent-motoko/deps/candid/w36hm-eqaaa-aaaal-qr76a-cai.did | Removes pulled canister candid (no longer used). |
| examples/quickstart-agent-motoko/.gitignore | Updates ignores for icp-cli state, mops artifacts, and secrets. |
Files not reviewed (1)
- examples/quickstart-agent-motoko/src/frontend/pnpm-lock.yaml: Generated file
Suppressed comments (1)
examples/quickstart-agent-motoko/README.md:112
- Same issue as above:
LLM.ChatMessageuses thesystem_variant tag, notsystem, so thischatWithCyclescommand will fail as written.
variant { system = record { content = "You are a helpful assistant for Internet Computer developers." } };
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
package.json pinned ic-mops 2.13.2 while mise.toml pins 2.19.2, and both put mops on PATH — align on the mise version so local and CI use the same mops.
ielashi
marked this pull request as ready for review
August 13, 2026 18:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates the Motoko quickstart agent from dfx to icp-cli, as a command-line-only example (no frontend).
Uses the published
mo:llm4.0.0 library and the v1.2.0 pre-builtllmcanister, which run against the Internet Intelligence Gateway (IIG) inhttpsmode.Refs: DEFI-2832