Skip to content

Commit dcb38dd

Browse files
authored
release notes and more docs for v0.9.2 (#1270)
1 parent 95fd006 commit dcb38dd

7 files changed

Lines changed: 94 additions & 17 deletions

File tree

cmd/wsh/cmd/wshcmd-ai.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ var aiCmd = &cobra.Command{
2626
}
2727

2828
var aiFileFlags []string
29+
var aiNewBlockFlag bool
2930

3031
func init() {
3132
rootCmd.AddCommand(aiCmd)
33+
aiCmd.Flags().BoolVarP(&aiNewBlockFlag, "new", "n", false, "create a new AI block")
3234
aiCmd.Flags().StringArrayVarP(&aiFileFlags, "file", "f", nil, "attach file content (use '-' for stdin)")
3335
}
3436

@@ -69,9 +71,12 @@ func aiRun(cmd *cobra.Command, args []string) {
6971
if isDefaultBlock {
7072
blockArg = "view@waveai"
7173
}
72-
73-
fullORef, err := resolveSimpleId(blockArg)
74-
if err != nil && isDefaultBlock {
74+
var fullORef *waveobj.ORef
75+
var err error
76+
if !aiNewBlockFlag {
77+
fullORef, err = resolveSimpleId(blockArg)
78+
}
79+
if (err != nil && isDefaultBlock) || aiNewBlockFlag {
7580
// Create new AI block if default block doesn't exist
7681
data := &wshrpc.CommandCreateBlockData{
7782
BlockDef: &waveobj.BlockDef{

docs/docs/config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ wsh editconfig
2828
| ai:preset | string | the default AI preset to use |
2929
| ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) |
3030
| ai:apitoken | string | your AI api token |
31-
| ai:apitype | string | defaults to "open_ai", but can also set to "azure" for special Azure AI handling |
31+
| ai:apitype | string | defaults to "open_ai", but can also set to "azure" (forspecial Azure AI handling) or "anthropic" |
3232
| ai:name | string | string to display in the Wave AI block header |
3333
| ai:model | string | model name to pass to API |
3434
| ai:apiversion | string | for Azure AI only (when apitype is "azure", this will default to "2023-05-15") |

docs/docs/customization.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ Using widgets.json, you'll be able to remove any default widgets and add widgets
6464
You can also suppress the help widgets in the bottom right by setting the config key `widget:showhelp` to `false`.
6565

6666
<div style={{ clear: "both" }} />
67+
68+
## Presets
69+
70+
For more advanced customization, to set up multiple AI models, and your own tab backgrounds, check out our [Presets Documentation](./presets).

docs/docs/faq.mdx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,19 @@ Here are the ollma open AI compatibility docs: https://github.com/ollama/ollama/
2828

2929
```json
3030
{
31+
"ai:*": true,
3132
"ai:baseurl": "http://localhost:11434/v1",
3233
"ai:name": "llama3.2",
3334
"ai:model": "llama3.2",
3435
"ai:apitoken": "ollama"
3536
}
3637
```
3738

38-
### How can I connect to Azure AI
39+
Note: we set the `ai:*` key to true to clear all the existing "ai" keys so this config is a clean slate.
40+
41+
To switch between multiple models, consider [adding AI Presets](./presets) instead.
42+
43+
### How can I connect to Azure AI?
3944

4045
Open your [config file](./config) in Wave using `wsh editconfig` (the config file is normally located
4146
at `~/.config/waveterm/settings.json`).
@@ -44,6 +49,25 @@ You'll need to set your `ai:baseurl` to your Azure AI Base URL (do not include q
4449
You'll also need to set `ai:apitype` to `azure`. You can then set the `ai:model`, and `ai:apitoken` appropriately
4550
for your setup.
4651

52+
### How can I connect to Claude?
53+
54+
Open your [config file](./config) in Wave using `wsh editconfig`.
55+
56+
Set these keys:
57+
58+
```json
59+
{
60+
"ai:*": true,
61+
"ai:apitype": "anthropic",
62+
"ai:model": "claude-3-5-sonnet-latest",
63+
"ai:apitoken": "<your anthropic API key>"
64+
}
65+
```
66+
67+
Note: we set the `ai:*` key to true to clear all the existing "ai" keys so this config is a clean slate.
68+
69+
To switch between models, consider [adding AI Presets](./presets) instead.
70+
4771
### How can I see the block numbers?
4872

4973
The block numbers will appear when you hold down Ctrl-Shift (and disappear once you release the key combo).

docs/docs/presets.mdx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ Presets can be used to apply multiple setting overrides at once to either a tab
88

99
You can set presets either by placing them in `~/.config/waveterm/presets.json` or by placing them in a JSON file in the `~/.config/waveterm/presets/` directory. All presets will be aggregated regardless of which file they're placed in so you can use the `presets` directory to organize them as you see fit.
1010

11+
:::info
12+
13+
You can open up the main presets config file in Wave by running:
14+
15+
```
16+
wsh editconfig presets.json
17+
```
18+
19+
:::
20+
1121
### File format
1222

1323
Presets follow the following format:
@@ -76,18 +86,18 @@ The following configuration keys are available for use in presets:
7686

7787
#### AI configurations
7888

79-
| Key Name | Type | Function |
80-
| ------------- | ------ | -------------------------------------------------------------------------------- |
81-
| ai:preset | string | the default AI preset to use |
82-
| ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) |
83-
| ai:apitoken | string | your AI api token |
84-
| ai:apitype | string | defaults to "open_ai", but can also set to "azure" for special Azure AI handling |
85-
| ai:name | string | string to display in the Wave AI block header |
86-
| ai:model | string | model name to pass to API |
87-
| ai:apiversion | string | for Azure AI only (when apitype is "azure", this will default to "2023-05-15") |
88-
| ai:orgid | string | |
89-
| ai:maxtokens | int | max tokens to pass to API |
90-
| ai:timeoutms | int | timeout (in milliseconds) for AI calls |
89+
| Key Name | Type | Function |
90+
| ------------- | ------ | -------------------------------------------------------------------------------------------------- |
91+
| ai:preset | string | the default AI preset to use |
92+
| ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) |
93+
| ai:apitoken | string | your AI api token |
94+
| ai:apitype | string | defaults to "open_ai", but can also set to "azure" (for special Azure AI handling), or "anthropic" |
95+
| ai:name | string | string to display in the Wave AI block header |
96+
| ai:model | string | model name to pass to API |
97+
| ai:apiversion | string | for Azure AI only (when apitype is "azure", this will default to "2023-05-15") |
98+
| ai:orgid | string | |
99+
| ai:maxtokens | int | max tokens to pass to API |
100+
| ai:timeoutms | int | timeout (in milliseconds) for AI calls |
91101

92102
#### Background configurations
93103

docs/docs/releasenotes.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ sidebar_position: 200
66

77
# Release Notes
88

9+
### v0.9.2 &mdash; Nov 11, 2024
10+
11+
New minor release with bug fixes and new features! Fixed the bug around making Wave fullscreen (also affecting certain window managers like Hyprland). We've also put a lot of work into the doc site (https://docs.waveterm.dev), including documenting how [Widgets](./widgets) and [Presets](./presets) work!
12+
13+
- Updated documentation
14+
- Wave AI now supports the Anthropic API! Checkout the [FAQ](./faq) for how to use the Claude models with Wave AI.
15+
- Removed defaultwidgets.json and unified it to widgets.json. Makes it more straightforward to override the default widgets.
16+
- New resolvers for `-b` param in `wsh`. "tab:N" for accessing the nth tab, "[view]" and "[view]:N" for accessing blocks of a particlar view.
17+
- New `wsh ai` command to send AI chats (and files) directly to a new or existing AI block
18+
- wsh setmeta/getmeta improvements. Allow setmeta to take a json file (and also read from stdin), also better output formats for getmeta (compatible with setmeta).
19+
- [bugfix] Set max completion tokens in the OpenAI API so we can now work with o1 models (also fallback to non-streaming mode)
20+
- [bugfix] Fixed content resizing when entering "full screen" mode. This bug also affected certain window managers (like Hyperland)
21+
- Lots of other small bug fixes, docs updates, and dependency bumps
22+
923
### v0.9.1 &mdash; Nov 1, 2024
1024

1125
Minor bug fix release to follow-up on the v0.9.0 build. Lots of issues fixed (especially for Windows).

docs/docs/wsh.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,26 @@ wsh getmeta -b [other-tab-id] "bg:*" --clear-prefix | wsh setmeta -b tab --json
106106

107107
---
108108

109+
## ai
110+
111+
Send messages to new or existing AI blocks directly from the CLI. `-f` passes a file. note that there is a maximum size of 10k for messages and files, so use a tail/grep to cut down file sizes before passing. The `-f` option works great for small files though like shell scripts or `.zshrc` etc.
112+
113+
By default the messages get sent to the first AI block (by blocknum). If no AI block exists, then a new one will be created. Use `-n` to force creation of a new AI block. Use `-b` to target a specific AI block.
114+
115+
```
116+
wsh ai "how do i write an ls command that sorts files in reverse size order"
117+
wsh ai -f <(tail -n 20 "my.log") -- "any idea what these error messages mean"
118+
wsh ai -f README.md "help me update this readme file"
119+
120+
# creates a new AI block
121+
wsh ai -n "tell me a story"
122+
123+
# targets block number 5
124+
wsh ai -b 5 "tell me more"
125+
```
126+
127+
---
128+
109129
## editconfig
110130

111131
You can easily open up any of Wave's config files using this command.

0 commit comments

Comments
 (0)