Skip to content

feat: updates to quickstart-agent-motoko - #66

Open
ielashi wants to merge 5 commits into
mainfrom
ielashi/migrate-quickstart-motoko
Open

feat: updates to quickstart-agent-motoko#66
ielashi wants to merge 5 commits into
mainfrom
ielashi/migrate-quickstart-motoko

Conversation

@ielashi

@ielashi ielashi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Migrates the Motoko quickstart agent from dfx to icp-cli, as a command-line-only example (no frontend).

Uses the published mo:llm 4.0.0 library and the v1.2.0 pre-built llm canister, which run against the Internet Intelligence Gateway (IIG) in https mode.

Refs: DEFI-2832

ielashi added 4 commits July 28, 2026 15:05
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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 an icp.yaml manifest (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/chat APIs (plus *WithCycles variants) 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.ChatMessage uses the system_ variant tag, not system, so this chatWithCycles command 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.

Comment thread examples/quickstart-agent-motoko/README.md
Comment thread package.json Outdated
Comment thread examples/quickstart-agent-motoko/icp.yaml
Comment thread examples/quickstart-agent-motoko/mops.toml
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 ielashi changed the title feat: migrate quickstart-agent-motoko to icp-cli feat: updates to quickstart-agent-motoko Aug 13, 2026
@ielashi
ielashi marked this pull request as ready for review August 13, 2026 18:08
@ielashi
ielashi requested a review from a team as a code owner August 13, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants