-
Notifications
You must be signed in to change notification settings - Fork 432
[FEA] Simple Calculator with Nemo-Agent-Toolkit-UI #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
4e82d4a
24c5626
37cea47
3789d93
1b2901d
2a499de
b2895f1
95601d2
921c6f7
d04d394
d1db658
6a31460
8a7b86f
b246fb0
b8c018c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Next.js Docker Configuration for Nemo-Agent-Toolkit UI | ||
| # | ||
| # Please see the README.md "Build UI Docker Image" to see full usage. This file defines Next.js build-time environment variables to | ||
| # connect the agent server with the Nemo-Agent-Toolkit UI. Next.js favors build-time environment variables for performance and security. | ||
| # | ||
| # Once the UI image is built, a docker compose is run to deploy both the UI + agent server e.g., simple_calculator | ||
| # on the same docker network. | ||
| # | ||
| # Note: Next.js automatically loads environment files in this priority order during the build process: | ||
| # .env.production.local (highest priority) | ||
| # .env.local | ||
| # .env.production ← This is what we'd use (this file gets renamed to .env.production) | ||
| # .env (lowest priority) | ||
|
|
||
| # Note: nemoagenttoolkit-server below corresponds to the service defined in the docker compose file. | ||
| NEXT_PUBLIC_HTTP_CHAT_COMPLETION_URL=http://nemoagenttoolkit-server:8000/generate | ||
| NEXT_PUBLIC_HTTP_CHAT_COMPLETION_URL_STREAMING=http://nemoagenttoolkit-server:8000/chat/stream | ||
| NEXT_PUBLIC_HTTP_FILE_UPLOAD_URL=http://nemoagenttoolkit-server:8000/files/upload | ||
| NEXT_PUBLIC_HTTP_DELETE_CONVERSATION_URL=http://nemoagenttoolkit-server:8000/conversations | ||
|
|
||
| # WebSocket URLs using Docker service name | ||
| NEXT_PUBLIC_WEBSOCKET_CHAT_COMPLETION_URL=ws://nemoagenttoolkit-server:8000/websocket | ||
| NEXT_PUBLIC_WS_CHAT_COMPLETION_URL=ws://nemoagenttoolkit-server:8000/chat/stream | ||
|
|
||
| # Default feature flags | ||
| NEXT_PUBLIC_CHAT_HISTORY_DEFAULT_ON=true | ||
| NEXT_PUBLIC_WEB_SOCKET_DEFAULT_ON=false | ||
| NEXT_PUBLIC_ENABLE_INTERMEDIATE_STEPS=true | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||
| services: | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add SPDX Apache-2.0 header to satisfy CI policy. All YAML files must start with the standard SPDX header. Please prepend the header as YAML comments. +##
+# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+##
services:📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| nemoagenttoolkit-server: | ||||||||||||||
| image: simple_calculator | ||||||||||||||
| container_name: nemoagenttoolkit-server | ||||||||||||||
| ports: | ||||||||||||||
| - "8000:8000" | ||||||||||||||
| environment: | ||||||||||||||
| - NVIDIA_API_KEY=${NVIDIA_API_KEY} | ||||||||||||||
| networks: | ||||||||||||||
| - nemoagenttoolkit-network | ||||||||||||||
| healthcheck: | ||||||||||||||
| test: ["CMD-SHELL", "python -c 'import urllib.request; urllib.request.urlopen(\"http://localhost:8000/docs\")' || exit 1"] | ||||||||||||||
| interval: 30s | ||||||||||||||
| timeout: 10s | ||||||||||||||
| retries: 3 | ||||||||||||||
| start_period: 40s | ||||||||||||||
|
|
||||||||||||||
| nemoagenttoolkit-ui: | ||||||||||||||
| image: nemoagenttoolkit-ui | ||||||||||||||
| container_name: nemoagenttoolkit-ui | ||||||||||||||
| ports: | ||||||||||||||
| - "3000:3000" | ||||||||||||||
| networks: | ||||||||||||||
| - nemoagenttoolkit-network | ||||||||||||||
| depends_on: | ||||||||||||||
| nemoagenttoolkit-server: | ||||||||||||||
| condition: service_healthy | ||||||||||||||
|
|
||||||||||||||
| networks: | ||||||||||||||
| nemoagenttoolkit-network: | ||||||||||||||
| driver: bridge | ||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix: Docker service DNS isn’t resolvable by the end-user’s browser. Use localhost for client-visible URLs.
NEXT_PUBLIC_* variables are embedded in the client bundle, so the browser will try to reach ws/http hosts directly. nemoagenttoolkit-server is only resolvable inside the Docker network, not from the host. This will cause the UI to fail to connect.
Minimal fix (host-accessible endpoints):
Alternative (more robust): keep internal server URL in a non-public var and proxy via Next.js rewrites (so the browser hits /api/* on port 3000). If you want this, I can provide a next.config.js/mjs patch.
📝 Committable suggestion
🧰 Tools
🪛 dotenv-linter (3.3.0)
[warning] 19-19: [UnorderedKey] The NEXT_PUBLIC_HTTP_DELETE_CONVERSATION_URL key should go before the NEXT_PUBLIC_HTTP_FILE_UPLOAD_URL key
(UnorderedKey)
🤖 Prompt for AI Agents