Feedback: API for context sources (ContextMentionProvider, OpenCtx)

The experimental PR #3883: introduce ContextMentionProvider API for mentionable context sources will make it so that you can add new kinds of context to @-mention in Cody chat. For example, we’ll use this to make it so you can mention @npm:csv-parse to include docs from the csv-parse npm package. See OpenCtx for a related concept/prototype from Sourcegraph to make it possible to bring in more kinds of context into Cody.

Ultimately this better context makes it so Cody can answer your questions better and write better, more accurate code.

I’ve opened this thread for any discussion about:

  • any context sources that you all want to build on this API
  • any feedback on the API itself (note: it’s very experimental and will change a LOT!)
  • any requests for new context sources

Hey @sqs

This is such an amazing feature to have the ability to fetch context from custom sources.
I tried it with http fetching but it fails with an error that

The prompt string contains a reference to a file that is not allowed by the context filters.

This is because the ContextFilter is restricted to only allowing RepoURIs which of a http request isn’t the case.

As a feature request, I would like to see a programming language agnostic way to write custom ContextMentionProvider’s. One way this can be realized is to provide a http context provider, with which the user can connect through a local or remote server for fetching context (which I do at the moment)

BTW, consider using the jina reader. This is a free reader tailored to fetch web content for LLM’s. As example two different versions of a wikipedia article. The first is the legacy one and the second is the transformed one.

I’m excited to see progress.