@@ -329,42 +329,43 @@ For supported models, see:
329
329
330
330
FUNCTIONS *CopilotChat-functions*
331
331
332
- Functions provide additional information and behaviour to the chat. Tools can
333
- be organized into groups by setting the `group` property. Tools assigned to a
334
- group are not automatically made available to the LLM - they must be explicitly
335
- activated. To use grouped tools in your prompt, include ` @g roup_name` in your
336
- message. This allows the LLM to access and use all tools in that group during
337
- the current interaction. Add tools using `#tool_name[: input ]` syntax:
332
+ Functions provide additional information and behaviour to the chat. Functions
333
+ can be organized into groups by setting the `group` property. Functions can be
334
+ made available to the LLM with ` @g roup_name` or ` @f unction_name` syntax. LLM
335
+ will then be able to use them in responses as tool calls. If function has URI,
336
+ they can also be used directly in prompt with `#function_name[: input ]` syntax
337
+ for providing context as resources.
338
338
339
- --------------------------------------------------------------------------
340
- Function Input Description
341
- Support
342
- ------------- ------------ -----------------------------------------------
343
- buffer ✓ (name) Retrieves content from a specific buffer
339
+ -------------------------------------------------------------------------------
340
+ Function Input URI Description
341
+ Support
342
+ ------------- ------------ ----- ---- ------------------------------------------
343
+ buffer ✓ (name) ✓ Retrieves content from a specific buffer
344
344
345
- buffers ✓ (scope) Fetches content from multiple buffers
346
- (listed/visible)
345
+ buffers ✓ (scope) ✓ Fetches content from multiple buffers
346
+ (listed/visible)
347
347
348
- diagnostics ✓ (scope) Collects code diagnostics (errors, warnings)
348
+ diagnostics ✓ (scope) ✓ Collects code diagnostics (errors, warnings)
349
349
350
- file ✓ (path) Reads content from a specified file path
350
+ file ✓ (path) ✓ Reads content from a specified file path
351
351
352
- gitdiff ✓ (sha) Retrieves git diff information
353
- (unstaged/staged/sha)
352
+ gitdiff ✓ (sha) ✓ Retrieves git diff information
353
+ (unstaged/staged/sha)
354
354
355
- gitstatus - Retrieves git status information
355
+ gitstatus - ✓ Retrieves git status information
356
356
357
- glob ✓ (pattern) Lists filenames matching a pattern in workspace
357
+ glob ✓ (pattern) ✓ Lists filenames matching a pattern in
358
+ workspace
358
359
359
- grep ✓ (pattern) Searches for a pattern across files in
360
- workspace
360
+ grep ✓ (pattern) ✓ Searches for a pattern across files in
361
+ workspace
361
362
362
- quickfix - Includes content of files in quickfix list
363
+ quickfix - ✓ Includes content of files in quickfix list
363
364
364
- register ✓ (register) Provides access to specified Vim register
365
+ register ✓ (register) ✓ Provides access to specified Vim register
365
366
366
- url ✓ (url) Fetches content from a specified URL
367
- --------------------------------------------------------------------------
367
+ url ✓ (url) ✓ Fetches content from a specified URL
368
+ -------------------------------------------------------------------------------
368
369
Examples:
369
370
370
371
>markdown
@@ -378,6 +379,9 @@ Examples:
378
379
> #quickfix
379
380
> #register:+
380
381
> #url:https://example.com
382
+ > @glob
383
+ > @grep
384
+ > @file
381
385
<
382
386
383
387
Define your own functions in the configuration with input handling and schema:
@@ -640,7 +644,7 @@ CORE *CopilotChat-core*
640
644
chat.ask(prompt, config) -- Ask a question with optional config
641
645
chat.response() -- Get the last response text
642
646
chat.resolve_prompt() -- Resolve prompt references
643
- chat.resolve_tools () -- Resolve tools that are available for automatic use by LLM
647
+ chat.resolve_functions () -- Resolve functions that are available for automatic use by LLM (WARN: async, requires plenary.async.run)
644
648
chat.resolve_model() -- Resolve model from prompt (WARN: async, requires plenary.async.run)
645
649
646
650
-- Window Management
@@ -697,6 +701,7 @@ You can also access the chat window UI methods through the `chat.chat` object:
697
701
-- Content Management
698
702
window:append(text) -- Append text to chat window
699
703
window:clear() -- Clear chat window content
704
+ window:start() -- Start writing to chat window
700
705
window:finish() -- Finish writing to chat window
701
706
702
707
-- Navigation
0 commit comments