Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,8 @@ Option A — .env files (recommended for local development):

```dotenv
VITE_OPENAI_API_KEY=your_openai_api_key_here
# Optional: override the chat model (defaults to gpt-4.1).
# The chat app supports GPT-4* and below; GPT-5* and later are NOT supported.
# VITE_OPENAI_MODEL=gpt-4.1
# Optional: override the chat model (defaults to gpt-5.4-nano).
# VITE_OPENAI_MODEL=gpt-5.4-nano
```

**Azure OpenAI** (using your own hosted deployment)
Expand All @@ -124,7 +123,7 @@ Option A — .env files (recommended for local development):
# Required for Azure OpenAI
VITE_OPENAI_API_VERSION=2024-12-01-preview
# On Azure, this is your DEPLOYMENT NAME (not the underlying model id).
# The chat app supports GPT-4* family deployments and below; GPT-5* and later are NOT supported.
# Ensure this deployment targets a chat-completions-compatible model.
VITE_OPENAI_MODEL=your_chat_deployment_name
```

Expand Down Expand Up @@ -152,13 +151,13 @@ Both apps read these `VITE_*` variables from their respective `.env` files.
| Variable | Description | Default |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `VITE_OPENAI_API_KEY` | **Required.** Your OpenAI API key, or your Azure OpenAI resource key when `VITE_OPENAI_BASE_URL` is set. | _(unset)_ |
| `VITE_OPENAI_MODEL` | Chat model used for completions. On Azure OpenAI this is the **deployment name**. The image-generation model is selected in the UI. | `gpt-4.1` |
| `VITE_OPENAI_MODEL` | Chat model used for completions. On Azure OpenAI this is the **deployment name**. The image-generation model is selected in the UI. | `gpt-5.4-nano` |
| `VITE_OPENAI_BASE_URL` | Custom endpoint. Set this to use Azure OpenAI (e.g. `https://your-resource.openai.azure.com`) or another OpenAI-compatible service. | _(unset)_ |
| `VITE_OPENAI_API_VERSION` | API version. **Required** when `VITE_OPENAI_BASE_URL` points at Azure OpenAI (e.g. `2024-12-01-preview`). | _(unset)_ |

When `VITE_OPENAI_BASE_URL` is set, the apps use the Azure OpenAI client; otherwise they use the standard OpenAI client.

> **Model compatibility:** The chat reference app supports **GPT-4\* family models and below** (e.g. `gpt-4`, `gpt-4.1`, `gpt-4o`). **GPT-5\* and later are not supported.** On Azure OpenAI, make sure the deployment named in `VITE_OPENAI_MODEL` targets a supported model.
> **Model compatibility:** The chat reference app uses `VITE_OPENAI_MODEL`, defaulting to `gpt-5.4-nano`. On Azure OpenAI, make sure the deployment named in `VITE_OPENAI_MODEL` targets a chat-completions-compatible model.

Start the dev servers:

Expand Down
5 changes: 2 additions & 3 deletions apps/promptions-chat/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ VITE_OPENAI_API_KEY=your_openai_api_key_here
# Required when VITE_OPENAI_BASE_URL points at Azure OpenAI.
# VITE_OPENAI_API_VERSION=2024-12-01-preview

# Optional: override the chat model (defaults to gpt-4.1).
# Note that the Promptions Chat App does not support GPT-5* or later
# VITE_OPENAI_MODEL=gpt-4.1
# Optional: override the chat model (defaults to gpt-5.4-nano).
# VITE_OPENAI_MODEL=gpt-5.4-nano
4 changes: 2 additions & 2 deletions apps/promptions-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ yarn typecheck
- **React 18** - Modern React with hooks
- **Vite** - Fast build tool and dev server
- **Fluent UI** - Microsoft's design system
- **OpenAI / Azure OpenAI API** - Streaming chat completions (defaults to `gpt-4.1`)
- **OpenAI / Azure OpenAI API** - Streaming chat completions (defaults to `gpt-5.4-nano`)
- **TypeScript** - Full type safety

## Model compatibility

The chat app supports **GPT-4\* family models and below** (e.g. `gpt-4`, `gpt-4.1`, `gpt-4o`). **GPT-5\* and later are not supported.** When using Azure OpenAI, ensure the deployment named in `VITE_OPENAI_MODEL` targets a supported model.
The chat app uses the model configured in `VITE_OPENAI_MODEL`, defaulting to `gpt-5.4-nano`. When using Azure OpenAI, ensure the deployment named in `VITE_OPENAI_MODEL` targets a chat-completions-compatible model.

## Security Notes

Expand Down
8 changes: 3 additions & 5 deletions apps/promptions-chat/src/services/ChatService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ChatService {

const baseURL = import.meta.env.VITE_OPENAI_BASE_URL;
const apiVersion = import.meta.env.VITE_OPENAI_API_VERSION;
this.model = import.meta.env.VITE_OPENAI_MODEL || "gpt-4.1";
this.model = import.meta.env.VITE_OPENAI_MODEL || "gpt-5.4-nano";

this.client = baseURL
? new AzureOpenAI({
Expand Down Expand Up @@ -50,8 +50,7 @@ export class ChatService {
model: this.model,
messages: messages as OpenAI.Chat.Completions.ChatCompletionMessageParam[],
stream: true,
temperature: 0.7,
max_tokens: 1000,
max_completion_tokens: 1000,
},
{
signal: options?.signal,
Expand All @@ -78,8 +77,7 @@ export class ChatService {
const response = await this.client.chat.completions.create({
model: this.model,
messages: messages as OpenAI.Chat.Completions.ChatCompletionMessageParam[],
temperature: 0.7,
max_tokens: 1000,
max_completion_tokens: 1000,
});

return response.choices[0]?.message?.content || "No response received";
Expand Down
4 changes: 2 additions & 2 deletions apps/promptions-image/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ VITE_OPENAI_API_KEY=your_openai_api_key_here
# Required when VITE_OPENAI_BASE_URL points at Azure OpenAI.
# VITE_OPENAI_API_VERSION=2024-12-01-preview

# Optional: override the chat model used for prompt-related completions (defaults to gpt-4.1).
# Optional: override the chat model used for prompt-related completions (defaults to gpt-5.4-nano).
# The image-generation model is selected in the UI.
# VITE_OPENAI_MODEL=gpt-4.1
# VITE_OPENAI_MODEL=gpt-5.4-nano
5 changes: 2 additions & 3 deletions apps/promptions-image/src/services/ImageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ImageService {

const baseURL = import.meta.env.VITE_OPENAI_BASE_URL;
const apiVersion = import.meta.env.VITE_OPENAI_API_VERSION;
this.chatModel = import.meta.env.VITE_OPENAI_MODEL || "gpt-4.1";
this.chatModel = import.meta.env.VITE_OPENAI_MODEL || "gpt-5.4-nano";

this.client = baseURL
? new AzureOpenAI({
Expand Down Expand Up @@ -76,8 +76,7 @@ export class ImageService {
model: this.chatModel,
messages: messages as OpenAI.Chat.Completions.ChatCompletionMessageParam[],
stream: true,
temperature: 0.7,
max_tokens: 1000,
max_completion_tokens: 1000,
},
{
signal: options?.signal,
Expand Down
Loading