Skip to content

Conversation

@Davidyz
Copy link
Contributor

@Davidyz Davidyz commented Feb 17, 2025

Description

This allows the tool to be "configured" before being loaded by codecompanion. It makes it easier for plugin devs to provide integrations with codecompanion.

Related Issue(s)

Demo

Before this PR you have to put the tool in a lua/codecompanion/my_plugin/tool.lua and use it as:

agents = {
  tools = {
    my_plugin = {
      callback = "my_plugin.tool"
    },
  }
}

Now you can do

agents = {
  tools = {
    my_plugin = {
      callback = require("my_plugin").make_tool(opts)
    },
  }
}

where opts can contain parameters to set up the tool.

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I've updated the README and/or relevant docs pages
  • I've run make docs to update the vimdoc pages

@Davidyz
Copy link
Contributor Author

Davidyz commented Feb 17, 2025

I'm not quite sure where the relevant docs should go to. Could someone give me a pointer and I'll update the docs?

@olimorris
Copy link
Owner

Great stuff, thanks @Davidyz. Perhaps if we add a line about this, here.

Btw, I see you're in London. Are you part of the LLM London group? If not, if you're interested in joining I can get the admins to add you.

@Davidyz Davidyz force-pushed the davidyz/tool_resolve_table branch from 74a327d to d4c8956 Compare February 17, 2025 11:36
@Davidyz
Copy link
Contributor Author

Davidyz commented Feb 17, 2025

Hi I've added a line about the change. I included a reference to this page because it contains the schema of the callback table, but I'm not quite sure if the reference is of the right format (I suppose it needs to work with the framework you use to generate the documentation website).

I also tried running make docs but it generated changes that were not relevant to this PR, so I did not add it to my patch.

Regarding LLM London, I'm not sure whether it's appropriate because I'm no longer in London. I went to uni in London but I graduated last year. I'm also unaware of LLM London. A Google search showed a bunch of results related to laws. Could you tell me more about it? Thanks!

@olimorris olimorris merged commit 689ea6e into olimorris:main Feb 17, 2025
4 checks passed
@olimorris
Copy link
Owner

Super thanks so much!

Regarding LLM London, I'm not sure whether it's appropriate because I'm no longer in London. I went to uni in London but I graduated last year. I'm also unaware of LLM London.

Sorry should have been more specific. It's a meetup group that's run through WhatsApp. We meet every month to talk all things LLMs and what we're working on.

@Davidyz Davidyz deleted the davidyz/tool_resolve_table branch March 10, 2025 22:23
cleong14 pushed a commit to cleong14/codecompanion.nvim that referenced this pull request May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants