New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Snippets #3918
base: main
Are you sure you want to change the base?
@Snippets #3918
Conversation
Hey @RXminuS , |
This reverts commit aed7aca.
The # is potentially a bit difficult to discover, so trying a simple UI element instead to tweak response style. The idea is still the same though where you pick a bunch of style-tags to apply. This can later always be expanded to ALSO allow for quick access via a #-like interface so you can simply type everything instead of having to click
aed7aca
to
d64c622
Compare
…eat/hashtag-style
Hey @RXminuS I saw that you included mermaid mixin feature. This is epic. One recommendation I can give is, that internally Cody should fetch the mermaid API for the flow chart and sequence diagram as context to correctly provide the mermaid syntax. In complex use cases it often fails. |
Yeah that's a good idea! I'll have to rework it a little so that I can mix-in at multiple points but then that's completely doable. I think that would improve responses a lot! |
@PriNova I added a bit hacky way of doing this but it seems to work, so maybe good enough for now? Mermaid is still quite tedious with whitespace so graphs do still fail at times. |
This looks awesome. Did you try fetching the API docs like I mentioned above? What most newer LLMs also understand are GraphViz dot files. |
Yeah I did but they waste a lot of tokens doing both the mermaid graph themselves and then the exact same block as code. That's why I just quickly made a gist that combines all the docs/cheatsheets and removes the duplicates. Not a long term solution but having the examples seemed to improve results by quite a bit. I think the biggest amount of mistakes comes from how there's a high likelyhood of some extra whitespace making it in (and breaking the syntax) probably due to tokens with trailing whitespace being more commonly used than ones with explicit separate whitespace. This has been an issue I've had before trying to generate structured data.
It feels a bit too verbose IMHO? I would like it to just pick the right graph based on my question. |
You are right, it takes around 5k tokens for the API of one chart-type. That's a lot.
The most common chart types are simply formatted, which can be done as a post-formatting step. The first line has no whitespaces and all following lines are prepended with whitespace. Maybe this could be a work-around. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -52,7 +54,29 @@ export class DefaultPrompter implements IPrompter { | |||
undefined | |||
) | |||
|
|||
const preambleMessages = getSimplePreamble(chat.modelID, codyApiVersion, preInstruction) | |||
sortContextItems(this.explicitContext) | |||
// We now filter out any mixins from the user contet and add those as preamble messages as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm do we want to alter the preamble instead of the last human message text for @-mention snippets ?
This seems to make it hard to debug using the exported transcript because the prompt for the snippet doesn't show up in the transcript history, and this might not work when the chat transcript gets too long?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I wasn't sure about the correct injection point so wanted to implement both. My main reasoning was to keep it similar to the normal instructions config option but just "ad hoc" which is why I started there.
But I think both of your observations are good arguments to change it. 👍
This is a PR to include experimental
@snippet
support.These snippets can be inserted just like normal context
The content of the snippets is inserted into the conversation so that they can tweak the responses by the LLM.
But also do cool things like:
TODO:
Test Plan:
Behind experimental flag, unit tests pass for existing code