Skip to content

Commit 09c943a

Browse files
committed
doc: add minuet event and lualine section.
1 parent f634cb8 commit 09c943a

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
- [`Minuet lsp`](#minuet-lsp)
3333
- [API](#api)
3434
- [Virtual Text](#virtual-text)
35+
- [Lualine](#lualine)
36+
- [Minuet Event](#minuet-event)
3537
- [FAQ](#faq)
3638
- [Customize `cmp` ui](#customize-cmp-ui)
3739
- [Customize `blink` ui](#customize-blink-ui)
@@ -1063,6 +1065,52 @@ The Minuet LSP command provides commands for managing the in-process LSP server:
10631065
}
10641066
```
10651067

1068+
## Lualine
1069+
1070+
Minuet provides a Lualine component that displays the current status of Minuet requests. This component shows:
1071+
1072+
- The name of the active provider
1073+
- The current request count (e.g., "1/3")
1074+
- An animated spinner while processing
1075+
1076+
To use the Minuet Lualine component, add it to your Lualine configuration:
1077+
1078+
```lua
1079+
require('lualine').setup {
1080+
sections = {
1081+
lualine_x = {
1082+
require('minuet.lualine'),
1083+
'encoding',
1084+
'fileformat',
1085+
'filetype',
1086+
},
1087+
},
1088+
}
1089+
```
1090+
1091+
## Minuet Event
1092+
1093+
Minuet emits three distinct events during its request workflow:
1094+
1095+
- **MinuetRequestStartedPre**: Triggered before a completion request is
1096+
initiated. This allows for pre-request operations, such as logging or updating
1097+
the user interface.
1098+
- **MinuetRequestStarted**: Triggered immediately after the completion request
1099+
is dispatched, signaling that the request is in progress.
1100+
- **MinuetRequestFinished**: Triggered upon completion of the request.
1101+
1102+
Each event includes a `data` field containing the following properties:
1103+
1104+
- `provider`: A string indicating the provider type (e.g.,
1105+
'openai_compatible').
1106+
- `name`: A string specifying the provider's name (e.g., 'OpenAI', 'Groq',
1107+
'Ollama').
1108+
- `n_requests`: The number of requests encompassed in this completion cycle.
1109+
- `request_idx` (optional): The index of the current request, applicable when
1110+
providers make multiple requests.
1111+
- `timestamp`: A Unix timestamp representing the start of the request cycle
1112+
(corresponding to the `MinuetRequestStartedPre` event).
1113+
10661114
# FAQ
10671115

10681116
## Customize `cmp` ui

lua/minuet/lualine.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ local spinner_symbols = {
1818
'',
1919
'',
2020
}
21-
local spinner_symbols_len = 10
21+
local spinner_symbols_len = #spinner_symbols
2222

2323
-- Initializer
2424
function M:init(options)

0 commit comments

Comments
 (0)