Skip to content
Merged
Show file tree
Hide file tree
Changes from 137 commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
31a87ff
start refactoring
olimorris Mar 17, 2025
4e8ab14
Merge branch 'main' into feat/move-to-function-calling
olimorris Mar 18, 2025
43f3955
Merge branch 'main' into feat/move-to-function-calling
olimorris Mar 18, 2025
c7d50ed
add back functionality and fix tests
olimorris Mar 18, 2025
ad66ebd
clean up tests
olimorris Mar 18, 2025
79e27e8
remove plugin's tool system prompt
olimorris Mar 18, 2025
bbe4415
Merge branch 'main' into feat/move-to-function-calling
olimorris Mar 19, 2025
9656b20
tool system prompt can be a function
olimorris Mar 19, 2025
afc3f51
clear lsp warnings
olimorris Mar 19, 2025
cd94e0b
split out http payload to include tools
olimorris Mar 19, 2025
be8ade0
refactor messages test
olimorris Mar 19, 2025
6b1401b
move tool methods from chat buffer to own file
olimorris Mar 19, 2025
31d97b6
Merge branch 'main' into feat/move-to-function-calling
olimorris Mar 20, 2025
8ad1137
Merge branch 'main' into feat/move-to-function-calling
olimorris Mar 20, 2025
96a0a91
Merge branch 'main' into feat/move-to-function-calling
olimorris Mar 21, 2025
4368ac0
can format tool use for openai
olimorris Mar 21, 2025
c95e877
test for adding a tool's schema
olimorris Mar 21, 2025
fb08ec1
update reference tests
olimorris Mar 22, 2025
1d2f7a1
refactor some chat elements
olimorris Mar 22, 2025
1947def
can handle streamed tools in openai
olimorris Mar 23, 2025
9ce52cf
func function calls now work
olimorris Mar 23, 2025
31f1812
add another func test
olimorris Mar 24, 2025
36ac416
fix remaining tests
olimorris Mar 24, 2025
b0423d7
openai works with streaming off and with multiple tools
olimorris Mar 26, 2025
0f0929c
clean up tests
olimorris Mar 26, 2025
a402d06
can display multiple tool calls in the chat buffer
olimorris Mar 26, 2025
cf17677
fix spelling for tests
olimorris Mar 26, 2025
7bab2dc
update message in chat buffer
olimorris Mar 26, 2025
33bebc8
add transformer for anthropic
olimorris Mar 26, 2025
c7028e1
Merge branch 'main' into feat/move-to-function-calling
olimorris Mar 27, 2025
f39b7d1
chore: update openai test
olimorris Mar 29, 2025
473cd0d
tweak openai tooling
olimorris Mar 29, 2025
1daa94c
add anthropic support
olimorris Mar 29, 2025
01a66d2
chore: remove comments
olimorris Mar 30, 2025
ad12e24
update testing tool
olimorris Mar 30, 2025
23785c4
add copilot support
olimorris Mar 30, 2025
5f878a4
tools: option to allow handlers to be called once, successively
olimorris Mar 31, 2025
b2cfc1c
update comments
olimorris Mar 31, 2025
5e37071
tools: rename from settings to opts
olimorris Mar 31, 2025
7354776
Merge branch 'main' into feat/move-to-function-calling
olimorris Mar 31, 2025
cf6d729
add support for ollama
olimorris Mar 31, 2025
a35d47a
Merge branch 'main' into feat/move-to-function-calling
olimorris Mar 31, 2025
34ae567
rename sharing to context
olimorris Mar 31, 2025
44f8c54
add DeepSeek support
olimorris Apr 2, 2025
c582a5b
fix deepseek test
olimorris Apr 2, 2025
d2e9c1e
add gemini support
olimorris Apr 2, 2025
9ce2276
remove log
olimorris Apr 2, 2025
a93bda1
fix: tool output being shown before references
olimorris Apr 4, 2025
688d34d
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 5, 2025
9b816ae
rework cmd_runner tool
olimorris Apr 5, 2025
426e0fe
remove comment
olimorris Apr 5, 2025
0c3dbcb
update tests
olimorris Apr 5, 2025
2c62503
copilot: tools work when stream is off
olimorris Apr 6, 2025
e16e3c4
rename test
olimorris Apr 7, 2025
2249534
move editor tool to new schema
olimorris Apr 7, 2025
0842ac9
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 8, 2025
e1130f8
ensure tools are processed into an array to ensure correct ordering
olimorris Apr 8, 2025
19b2786
add editor tests
olimorris Apr 8, 2025
7945faa
fix: ensure tool output from `chat_output` is unified across all adap…
olimorris Apr 11, 2025
a0f5e59
fml: sending tool calls and tool output back to OpenAI is a pain
olimorris Apr 11, 2025
6a0b7f5
fix all openai adapters and cmd_runner and editor tool
olimorris Apr 12, 2025
ab1c830
add utility to merge system prompts
olimorris Apr 12, 2025
ae8c57b
refactor adapter handlers
olimorris Apr 13, 2025
593a21f
update default system prompt
olimorris Apr 13, 2025
fb9cba0
fix spelling
olimorris Apr 13, 2025
d556005
update ollama test
olimorris Apr 13, 2025
8331ca7
fix deepseek
olimorris Apr 13, 2025
dc89334
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 13, 2025
870bb7e
tests: misc updates
olimorris Apr 15, 2025
0fb4ac8
add full test coverage for adapters and tools in chat buffer
olimorris Apr 15, 2025
5fbecfd
tests: ensure mistral has test parity
olimorris Apr 16, 2025
76c2f20
remove non-required test
olimorris Apr 16, 2025
bf9353b
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 16, 2025
879b048
update features to remove xml-tools
olimorris Apr 16, 2025
3ee51f7
chore: update tests
olimorris Apr 18, 2025
f287b00
chore: update system prompt in test weather tool
olimorris Apr 18, 2025
3cc2c4a
update adapter test
olimorris Apr 18, 2025
6a7db12
add anthropic support
olimorris Apr 18, 2025
85bb5ee
fix format
olimorris Apr 18, 2025
2657f78
enure tool output appears under LLM header
olimorris Apr 20, 2025
1a3d2c9
fix tests
olimorris Apr 20, 2025
beeb49a
fix AgentFinished command
olimorris Apr 20, 2025
57cc072
rename run_tool
olimorris Apr 20, 2025
96d48da
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 20, 2025
43a03ba
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 20, 2025
a8acac2
remove tooling in Ollama
olimorris Apr 20, 2025
3a190ca
remove ollama from tools test
olimorris Apr 20, 2025
779216a
refactor anthropic adapter
olimorris Apr 20, 2025
f1cee63
improve token utility accuracy
olimorris Apr 20, 2025
90d3e9b
fix 400 error when multiple output occurs from single tool call
olimorris Apr 21, 2025
bcdc105
chore: refactor chat/init
olimorris Apr 21, 2025
cf03348
chore: update workspace
olimorris Apr 21, 2025
a4ec9e8
feat: finish editor tool
olimorris Apr 21, 2025
5ae41af
update ui
olimorris Apr 21, 2025
efc7a67
ensure that we strip context out of the messages to allow for blank s…
olimorris Apr 21, 2025
5d8140a
add flag to cmd_runner tool
olimorris Apr 21, 2025
cac701c
chore: editor
olimorris Apr 21, 2025
c445c84
fix reference test
olimorris Apr 22, 2025
89f65f6
try and fix tests for new nightly statusline change
olimorris Apr 22, 2025
4980b54
try and fix tests for new nightly statusline change
olimorris Apr 22, 2025
ddeea35
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 22, 2025
9d914bc
chore: update chat/init
olimorris Apr 23, 2025
c8e70e7
improve cmd_runner tool outputs
olimorris Apr 23, 2025
ced541c
fix agentic workflows
olimorris Apr 23, 2025
757ee0c
fix tests
olimorris Apr 23, 2025
9bbb826
update system prompt for multiple function calls
olimorris Apr 24, 2025
742f9ab
fix anthropic adapter
olimorris Apr 24, 2025
3850406
fix deepseek assistant returning content as a list and not a string
olimorris Apr 25, 2025
1f2f13a
fix tool schema for openai errors
olimorris Apr 26, 2025
054d805
fix gemini errors
olimorris Apr 26, 2025
6265cb3
ensure tool messages have cycle and id
olimorris Apr 26, 2025
0ddda2f
clean up tool call output
olimorris Apr 26, 2025
5259d65
remove weather tool
olimorris Apr 26, 2025
5375532
add support for openai_compatible
olimorris Apr 26, 2025
f849a95
update docs
olimorris Apr 26, 2025
396b5c3
docs - move compatibility page
olimorris Apr 26, 2025
a6b7da7
make markdown tables pretty
olimorris Apr 26, 2025
ddea88d
update docs
olimorris Apr 26, 2025
08bcea1
tweak system prompts
olimorris Apr 26, 2025
bc86341
update files tool
olimorris Apr 26, 2025
632d78b
fix dead links
olimorris Apr 26, 2025
d88da20
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 27, 2025
ff26e15
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 27, 2025
032a514
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 27, 2025
c3e4021
docs: update agent
olimorris Apr 27, 2025
69d3299
update tools
olimorris Apr 27, 2025
04dd055
update types
olimorris Apr 27, 2025
6670bf4
ensure env gets a copy of the tool as a parameter
olimorris Apr 27, 2025
050f874
finish tools docs
olimorris Apr 27, 2025
a73c76b
remove xml references from tools docs
olimorris Apr 27, 2025
f99ab00
remove rag reference
olimorris Apr 27, 2025
3ac0dfc
remove xml references in workspae
olimorris Apr 27, 2025
e274778
final docs updates
olimorris Apr 27, 2025
94b7a1e
update openai_compatible adapter
olimorris Apr 28, 2025
6d14735
update docs for new video
olimorris Apr 28, 2025
f28af80
fix openai-compatible adapter
olimorris Apr 28, 2025
2f82393
update compat in docs
olimorris Apr 28, 2025
1cb0ef8
update tool docs
olimorris Apr 28, 2025
c990530
allow tools to return no visible content in the chat buffer
olimorris Apr 28, 2025
429e5fa
stop logging in tests
olimorris Apr 28, 2025
8d9b02d
handle malformed json errors
olimorris Apr 28, 2025
29761d6
change formatting of error message
olimorris Apr 28, 2025
4d633c5
update README.md
olimorris Apr 29, 2025
6bafcaf
Merge branch 'main' into feat/move-to-function-calling
olimorris Apr 29, 2025
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
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,15 @@ Thank you to the following people:

<div align="center">
<p>
<h3>The Chat Buffer</h3>
<h3>The Chat Buffer</h3> - <a href="https://github.com/user-attachments/assets/aa109f1d-0ec9-4f08-bd9a-df99da03b9a4">Link</a>
<video controls muted src="https://github.com/user-attachments/assets/aa109f1d-0ec9-4f08-bd9a-df99da03b9a4"></video>
</p>
<p>
<h3>Using Agents and Tools</h3>
<video controls muted src="https://github.com/user-attachments/assets/16bd6c17-bd70-41a1-83aa-7af45c166ae9"></video>
<h3>Tools + Agentic Workflows</h3> - <a href="https://github.com/user-attachments/assets/31bae248-ae70-4395-9df1-67fc252475ca">Link</a>
<video controls muted src="https://github.com/user-attachments/assets/362b7cfd-e794-4d9c-9a74-90d5e2a87a32"></video>
</p>
<p>
<h3>Agentic Workflows</h3>
<video controls muted src="https://github.com/user-attachments/assets/31bae248-ae70-4395-9df1-67fc252475ca"></video>
</p>
<p>
<h3>Inline Assistant</h3>
<h3>Inline Assistant</h3> - <a href="https://github.com/user-attachments/assets/dcddcb85-cba0-4017-9723-6e6b7f080fee">Link</a>
<video controls muted src="https://github.com/user-attachments/assets/dcddcb85-cba0-4017-9723-6e6b7f080fee"></video>
</p>
</div>
Expand Down Expand Up @@ -102,7 +98,7 @@ I am open to contributions but they will be implemented at my discretion. Feel f
## :clap: Acknowledgements

- [Steven Arcangeli](https://github.com/stevearc) for his genius creation of the chat buffer and his feedback early on
- [Manoel Campos](https://github.com/manoelcampos) for the [xml2lua](https://github.com/manoelcampos/xml2lua) library that's used in the tools implementation
- [Manoel Campos](https://github.com/manoelcampos) for the [xml2lua](https://github.com/manoelcampos/xml2lua) library that's used in the inline assistant implementation
- [Dante.nvim](https://github.com/S1M0N38/dante.nvim) for the beautifully simple diff implementation
- [Wtf.nvim](https://github.com/piersolenski/wtf.nvim) for the LSP assistant action
- [CopilotChat.nvim](https://github.com/CopilotC-Nvim/CopilotChat.nvim) for the rendering and usability of the chat
Expand Down
9 changes: 7 additions & 2 deletions codecompanion-workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
{
"name": "Tools",
"system_prompt": "In the CodeCompanion plugin, tools can be leveraged by an LLM to execute lua functions or shell commands on the users machine. By responding with XML, CodeCompanion will pass the response, call the corresponding tool. This feature has been implemented via the agent/init.lua file, which passes all of the tools and adds them to a queue. Then those tools are run consecutively by the executor/init.lua file.",
"system_prompt": "In the CodeCompanion plugin, tools can be leveraged by an LLM to execute lua functions or shell commands on the users machine. CodeCompanion uses an LLM's native function calling to receive a response in JSON, parse the response and call the corresponding tool. This feature has been implemented via the agent/init.lua file, which passes all of the tools and adds them to a queue. Then those tools are run consecutively by the executor/init.lua file.",
"opts": {
"remove_config_system_prompt": true
},
Expand Down Expand Up @@ -102,6 +102,11 @@
"path": "lua/codecompanion/strategies/chat/init.lua",
"description": "The `${filename}` file is the entry point for the chat strategy, which is called the `chat buffer`. All methods directly relating to the chat buffer reside here."
},
"chat-messages": {
"type": "file",
"path": "tests/stubs/messages.lua",
"description": "This is an example of what the messages table looks like. This is the table which contains all of the user and LLM messages that are sent to the LLM. It also includes output from the tools that the LLM has requested to run. The role is the person that has sent the message. Content is the message itself. Cycle is a way of grouping messages together in a turn where a turn is defined as a user message and a LLM message (sometimes a tool message too"
},
"workflow-example": {
"type": "file",
"path": "tests/stubs/workflow.lua",
Expand Down Expand Up @@ -167,7 +172,7 @@
"agents-init": {
"type": "file",
"path": "lua/codecompanion/strategies/chat/agents/init.lua",
"description": "This is the entry point for the agent. If XML is detected in an LLM's response then this file is triggered which in turns add tools to a queue before calling the executor"
"description": "This is the entry point for the agent. If an LLM's response includes a function call (or tool call) then this file is triggered which in turns add tools to a queue before calling the executor"
},
"executor-init": {
"type": "file",
Expand Down
9 changes: 9 additions & 0 deletions doc/.vitepress/theme/vaporwave.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
var(--vw-green) 25%,
var(--vw-base-bg)
);

/* even‑row stripes */
--vp-c-bg-soft: color-mix(in srgb, var(--vw-blue) 5%, var(--vp-c-bg));
}

.dark {
Expand All @@ -90,6 +93,12 @@

/* Override base background for dark mode */
--vw-base-bg-mixer: 20%;

.vp-doc table th,
.vp-doc table td {
border: 1px solid color-mix(in srgb, var(--vw-green) 40%, var(--vp-c-bg)) !important;
}
--vp-c-bg-soft: color-mix(in srgb, var(--vp-c-bg-alt) 80%, var(--vp-c-bg));
}

/* Mermaid */
Expand Down
Loading