Skip to content

New sample demonstrating the OpenAI integration.#1744

Open
alistairmatthews wants to merge 3 commits into
microsoft:mainfrom
alistairmatthews:aspire-with-openai-typescript
Open

New sample demonstrating the OpenAI integration.#1744
alistairmatthews wants to merge 3 commits into
microsoft:mainfrom
alistairmatthews:aspire-with-openai-typescript

Conversation

@alistairmatthews

Copy link
Copy Markdown

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.

Copilot AI review requested due to automatic review settings June 22, 2026 14:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/chat and 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.

Comment thread samples/aspire-with-openai-typescript/tsconfig.apphost.json Outdated
Comment thread samples/aspire-with-openai-typescript/apphost.mts
Comment thread samples/aspire-with-openai-typescript/app/main.py
Comment thread samples/aspire-with-openai-typescript/app/main.py
Comment thread samples/aspire-with-openai-typescript/frontend/src/App.css
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