Skip to content

Commit 9d7a457

Browse files
authored
first definition of "first day", and minor doc mod (#2810)
1 parent d0b9d11 commit 9d7a457

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

docs/docs/waveai-modes.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@ For newer models like GPT-4.1 or GPT-5, the API type is automatically determined
199199

200200
### OpenAI Compatible
201201

202-
To use an OpenAPI compatible API provider, you need to provide the ai:endpoint, ai:apitoken, ai:model parameters,
203-
and use "openai-chat" as the ai:mode.
202+
To use an OpenAI compatible API provider, you need to provide the ai:endpoint, ai:apitokensecretname, ai:model parameters,
203+
and use "openai-chat" as the ai:apitype.
204204

205205
:::note
206206
The ai:endpoint is *NOT* a baseurl. The endpoint should contain the full endpoint, not just the baseurl.
207-
For example: https://api.x.ai/v1/chat/completions
207+
For example: https://api.x.ai/v1/chat/completions
208208

209209
If you provide only the baseurl, you are likely to get a 404 message.
210210
:::
@@ -218,11 +218,14 @@ If you provide only the baseurl, you are likely to get a 404 message.
218218
"ai:apitype": "openai-chat",
219219
"ai:model": "x-ai/grok-4-fast",
220220
"ai:endpoint": "https://api.x.ai/v1/chat/completions",
221-
"ai:apitoken": "<your-api-key>"
221+
"ai:apitokensecretname": "XAI_KEY",
222+
"ai:capabilities": ["tools", "images", "pdfs"]
222223
}
223224
}
224225
```
225226

227+
The `ai:apitokensecretname` should be the name of an environment variable that contains your API key. Set this environment variable before running Wave Terminal.
228+
226229

227230
### OpenRouter
228231

pkg/telemetry/telemetry.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,16 @@ func RecordTEvent(ctx context.Context, tevent *telemetrydata.TEvent) error {
241241
}
242242
tevent.EnsureTimestamps()
243243

244-
// Set AppFirstDay if within first day of TOS agreement
244+
// Set AppFirstDay if on same calendar day as TOS agreement
245245
tosAgreedTs := GetTosAgreedTs()
246-
if tosAgreedTs == 0 || (tosAgreedTs != 0 && time.Now().UnixMilli()-tosAgreedTs <= int64(24*60*60*1000)) {
246+
if tosAgreedTs == 0 {
247247
tevent.Props.AppFirstDay = true
248+
} else {
249+
tosYear, tosMonth, tosDay := time.UnixMilli(tosAgreedTs).Date()
250+
nowYear, nowMonth, nowDay := time.Now().Date()
251+
if tosYear == nowYear && tosMonth == nowMonth && tosDay == nowDay {
252+
tevent.Props.AppFirstDay = true
253+
}
248254
}
249255

250256
if tevent.Event == ActivityEventName {

0 commit comments

Comments
 (0)