New sample demonstrating the OpenAI integration.#1744
Open
alistairmatthews wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Aspire sample (TypeScript AppHost + Python FastAPI backend + React/Vite frontend) demonstrating use of the Aspire OpenAI integration to provide a simple chat UI alongside the standard weather endpoint.
Changes:
- Introduces a TypeScript Aspire AppHost that provisions OpenAI + a chat model, runs a FastAPI service, and wires a Vite frontend build into the API container for publish/deploy.
- Adds a React/Vite frontend with a chat UI that POSTs to
/api/chatand proxies/api/*to the backend during development. - Adds a FastAPI backend that calls OpenAI chat completions and configures OpenTelemetry exporters.
Reviewed changes
Copilot reviewed 53 out of 59 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/aspire-with-openai-typescript/tsconfig.apphost.json | TypeScript compiler config for the AppHost build. |
| samples/aspire-with-openai-typescript/package.json | Root AppHost Node/TS toolchain, scripts, and linting. |
| samples/aspire-with-openai-typescript/aspire.config.json | Aspire config declaring the TypeScript AppHost and package versions (incl. OpenAI hosting). |
| samples/aspire-with-openai-typescript/apphost.mts | AppHost wiring for OpenAI resource/model, FastAPI service, and Vite frontend publish integration. |
| samples/aspire-with-openai-typescript/eslint.config.mjs | ESLint configuration for the AppHost TS file. |
| samples/aspire-with-openai-typescript/.gitignore | Ignores for generated/build artifacts and Aspire-generated modules. |
| samples/aspire-with-openai-typescript/.vscode/mcp.json | VS Code MCP server config for the Aspire CLI agent. |
| samples/aspire-with-openai-typescript/.vscode/extensions.json | Recommends the Aspire VS Code extension. |
| samples/aspire-with-openai-typescript/frontend/package.json | Frontend dependencies/tooling (React/Vite/TS/ESLint) and Node engine constraints. |
| samples/aspire-with-openai-typescript/frontend/vite.config.ts | Vite dev server proxy configuration for /api. |
| samples/aspire-with-openai-typescript/frontend/tsconfig.json | TS project references for app/node configs. |
| samples/aspire-with-openai-typescript/frontend/tsconfig.app.json | TS config for React app source. |
| samples/aspire-with-openai-typescript/frontend/tsconfig.node.json | TS config for Vite config file. |
| samples/aspire-with-openai-typescript/frontend/eslint.config.js | Frontend ESLint configuration (React Hooks/Refresh + TS). |
| samples/aspire-with-openai-typescript/frontend/index.html | Vite HTML entrypoint. |
| samples/aspire-with-openai-typescript/frontend/src/main.tsx | React root bootstrap. |
| samples/aspire-with-openai-typescript/frontend/src/App.tsx | Main UI (weather + chat) and fetch logic. |
| samples/aspire-with-openai-typescript/frontend/src/Chat.tsx | Chat UI and /api/chat integration. |
| samples/aspire-with-openai-typescript/frontend/src/index.css | Base/reset styles and reduced-motion overrides. |
| samples/aspire-with-openai-typescript/frontend/src/App.css | App styling and layout/theme variables. |
| samples/aspire-with-openai-typescript/frontend/src/Chat.css | Chat UI styling. |
| samples/aspire-with-openai-typescript/frontend/src/vite-env.d.ts | Vite client type reference. |
| samples/aspire-with-openai-typescript/frontend/public/github.svg | GitHub icon asset. |
| samples/aspire-with-openai-typescript/frontend/.gitignore | Frontend build/editor ignores. |
| samples/aspire-with-openai-typescript/frontend/.dockerignore | Frontend Docker ignore. |
| samples/aspire-with-openai-typescript/app/pyproject.toml | Python FastAPI app project metadata and dependencies. |
| samples/aspire-with-openai-typescript/app/.python-version | Pins Python version for local tooling. |
| samples/aspire-with-openai-typescript/app/.dockerignore | Python Docker ignore. |
| samples/aspire-with-openai-typescript/app/main.py | FastAPI service endpoints for chat + weather + health and static serving. |
| samples/aspire-with-openai-typescript/app/telemetry.py | OpenTelemetry exporter/provider configuration for traces/metrics/logs. |
| samples/aspire-with-openai-typescript/.agents/skills/** | Project-local Aspire workflow/reference skills and docs (orchestration/monitoring/deployment/init). |
Files not reviewed (2)
- samples/aspire-with-openai-typescript/frontend/package-lock.json: Generated file
- samples/aspire-with-openai-typescript/package-lock.json: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
A new sample using the aspire-py-starter that demonstrates how to use the Aspire OpenAI integration to host a chat window in an Aspire solution.