Skip to content
Open
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
29 changes: 27 additions & 2 deletions docs/docs/waveai-modes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Wave AI now supports provider-based configuration which automatically applies se
- **`openrouter`** - OpenRouter API (automatically configures endpoint and secret name) [[see example](#openrouter)]
- **`nanogpt`** - NanoGPT API (automatically configures endpoint and secret name) [[see example](#nanogpt)]
- **`groq`** - Groq API (automatically configures endpoint and secret name) [[see example](#groq)]
- **`morse`** - Morse API (automatically configures endpoint and secret name) [[see example](#morse)]
- **`google`** - Google AI (Gemini) [[see example](#google-ai-gemini)]
- **`azure`** - Azure OpenAI Service (modern API) [[see example](#azure-openai-modern-api)]
- **`azure-legacy`** - Azure OpenAI Service (legacy deployment API) [[see example](#azure-openai-legacy-deployment-api)]
Expand Down Expand Up @@ -319,6 +320,30 @@ The provider automatically sets:
For Groq, you must manually specify `ai:capabilities` based on your model's features.
:::

### Morse

[Morse](https://trymorse.ai/inference) is an OpenAI-compatible API for open-weight models, including uncensored variants such as `deepseek-ai/deepseek-v4.1-flash-uncensored` and `z-ai/glm-5.3-uncensored`. Using the `morse` provider simplifies configuration:

```json
{
"morse-deepseek-flash": {
"display:name": "Morse - DeepSeek V4.1 Flash",
"ai:provider": "morse",
"ai:model": "deepseek/deepseek-v4.1-flash",
"ai:capabilities": ["tools"]
}
}
```

The provider automatically sets:
- `ai:endpoint` to `https://inference.trymorse.ai/v1/chat/completions`

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.

Deep Code Review Agent🐛

This setup sends more than the typed prompt to the hosted ai:endpoint: Widget Context is on by default, and GenerateCurrentTabStatePrompt includes the local username and open-widget details such as file paths and browser URLs. The Morse setup doesn’t disclose that Wave sends those details with the request, even before any tool runs.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

- `ai:apitype` to `openai-chat`
- `ai:apitokensecretname` to `MORSE_KEY` (store your Morse API key with this name)

:::note
For Morse, you must manually specify `ai:capabilities` based on your model's features. The [Morse models API](https://inference.trymorse.ai/v1/models) lists each model's `input_modalities` (add `"images"` when it includes `image`) and `supported_parameters` (add `"tools"` when it includes `tools`). When a model lists several `tiers`, use the values of the tier your requests are served on, since a tier can narrow them.
:::

### Google AI (Gemini)

[Google AI](https://ai.google.dev) provides the Gemini family of models. Using the `google` provider simplifies configuration:
Expand Down Expand Up @@ -532,7 +557,7 @@ If you get "model not found" errors:
| `display:order` | No | Sort order in the selector (lower numbers first) |
| `display:icon` | No | Icon identifier for the mode (can use any [FontAwesome icon](https://fontawesome.com/search), use the name without the "fa-" prefix). Default is "sparkles" |
| `display:description` | No | Full description of the mode |
| `ai:provider` | No | Provider preset: `openai`, `openrouter`, `nanogpt`, `groq`, `google`, `azure`, `azure-legacy`, `custom` |
| `ai:provider` | No | Provider preset: `openai`, `openrouter`, `nanogpt`, `groq`, `morse`, `google`, `azure`, `azure-legacy`, `custom` |
| `ai:apitype` | No | API type: `openai-chat`, `openai-responses`, or `google-gemini` (defaults to `openai-chat` if not specified) |
| `ai:model` | No | Model identifier (required for most providers) |
| `ai:thinkinglevel` | No | Thinking level: `low`, `medium`, or `high` |
Expand All @@ -556,7 +581,7 @@ The `ai:capabilities` field specifies what features the AI mode supports:

**Provider-specific behavior:**
- **OpenAI and Google providers**: Capabilities are automatically configured based on the model. You don't need to specify them.
- **OpenRouter, NanoGPT, Groq, Azure, Azure-Legacy, and Custom providers**: You must manually specify capabilities based on your model's features.
- **OpenRouter, NanoGPT, Groq, Morse, Azure, Azure-Legacy, and Custom providers**: You must manually specify capabilities based on your model's features.

:::warning
If you don't include `"tools"` in the `ai:capabilities` array, the AI model will not be able to interact with your Wave terminal widgets, read/write files, or execute commands. Most AI modes should include `"tools"` for the best Wave experience.
Expand Down
1 change: 1 addition & 0 deletions pkg/aiusechat/uctypes/uctypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
AIProvider_Groq = "groq"
AIProvider_OpenRouter = "openrouter"
AIProvider_NanoGPT = "nanogpt"
AIProvider_Morse = "morse"
AIProvider_OpenAI = "openai"
AIProvider_Azure = "azure"
AIProvider_AzureLegacy = "azure-legacy"
Expand Down
13 changes: 13 additions & 0 deletions pkg/aiusechat/usechat-mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
OpenRouterChatEndpoint = "https://openrouter.ai/api/v1/chat/completions"
NanoGPTChatEndpoint = "https://nano-gpt.com/api/v1/chat/completions"
GroqChatEndpoint = "https://api.groq.com/openai/v1/chat/completions"
MorseChatEndpoint = "https://inference.trymorse.ai/v1/chat/completions"
AzureLegacyEndpointTemplate = "https://%s.openai.azure.com/openai/deployments/%s/chat/completions?api-version=%s"
AzureResponsesEndpointTemplate = "https://%s.openai.azure.com/openai/v1/responses"
AzureChatEndpointTemplate = "https://%s.openai.azure.com/openai/v1/chat/completions"
Expand All @@ -34,6 +35,7 @@ const (
OpenRouterAPITokenSecretName = "OPENROUTER_KEY"
NanoGPTAPITokenSecretName = "NANOGPT_KEY"
GroqAPITokenSecretName = "GROQ_KEY"
MorseAPITokenSecretName = "MORSE_KEY"
AzureOpenAIAPITokenSecretName = "AZURE_OPENAI_KEY"
GoogleAIAPITokenSecretName = "GOOGLE_AI_KEY"
)
Expand Down Expand Up @@ -125,6 +127,17 @@ func applyProviderDefaults(config *wconfig.AIModeConfigType) {
config.APITokenSecretName = GroqAPITokenSecretName
}
}
if config.Provider == uctypes.AIProvider_Morse {
if config.APIType == "" {
config.APIType = uctypes.APIType_OpenAIChat

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.

Deep Code Review Agent🐛

Morse sends an error event and closes without [DONE] when its upstream fails after streaming starts. The openai-chat backend's processChatStream skips that event because it has no choices and treats EOF as success, so Wave saves the incomplete reply without telling the user it failed.

Severity: medium


🤖 Was this useful? React with 👍 or 👎

}
if config.Endpoint == "" {
config.Endpoint = MorseChatEndpoint
}
if config.APITokenSecretName == "" {
config.APITokenSecretName = MorseAPITokenSecretName
}
}
if config.Provider == uctypes.AIProvider_AzureLegacy {
if config.AzureAPIVersion == "" {
config.AzureAPIVersion = AzureLegacyDefaultAPIVersion
Expand Down
16 changes: 16 additions & 0 deletions pkg/aiusechat/usechat_mode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ func TestApplyProviderDefaultsGroq(t *testing.T) {
}
}

func TestApplyProviderDefaultsMorse(t *testing.T) {
config := wconfig.AIModeConfigType{
Provider: uctypes.AIProvider_Morse,
}
applyProviderDefaults(&config)
if config.APIType != uctypes.APIType_OpenAIChat {
t.Fatalf("expected API type %q, got %q", uctypes.APIType_OpenAIChat, config.APIType)
}
if config.Endpoint != MorseChatEndpoint {
t.Fatalf("expected endpoint %q, got %q", MorseChatEndpoint, config.Endpoint)
}
if config.APITokenSecretName != MorseAPITokenSecretName {
t.Fatalf("expected API token secret name %q, got %q", MorseAPITokenSecretName, config.APITokenSecretName)
}
}

func TestApplyProviderDefaultsKeepsProxyURL(t *testing.T) {
config := wconfig.AIModeConfigType{
Provider: uctypes.AIProvider_OpenAI,
Expand Down
2 changes: 1 addition & 1 deletion pkg/wconfig/settingsconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ type AIModeConfigType struct {
DisplayOrder float64 `json:"display:order,omitempty"`
DisplayIcon string `json:"display:icon,omitempty"`
DisplayDescription string `json:"display:description,omitempty"`
Provider string `json:"ai:provider,omitempty" jsonschema:"enum=wave,enum=google,enum=groq,enum=openrouter,enum=nanogpt,enum=openai,enum=azure,enum=azure-legacy,enum=custom"`
Provider string `json:"ai:provider,omitempty" jsonschema:"enum=wave,enum=google,enum=groq,enum=openrouter,enum=nanogpt,enum=morse,enum=openai,enum=azure,enum=azure-legacy,enum=custom"`
APIType string `json:"ai:apitype,omitempty" jsonschema:"enum=google-gemini,enum=openai-responses,enum=openai-chat"`
Model string `json:"ai:model,omitempty"`
ThinkingLevel string `json:"ai:thinkinglevel,omitempty" jsonschema:"enum=low,enum=medium,enum=high"`
Expand Down
1 change: 1 addition & 0 deletions schema/waveai.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"groq",
"openrouter",
"nanogpt",
"morse",
"openai",
"azure",
"azure-legacy",
Expand Down