-
Notifications
You must be signed in to change notification settings - Fork 151
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
(Anthropic) Directive not being sent #276
Comments
* gptel.el (gptel-request): let-bind `gptel--system-message` correctly in `gptel-request`. The Anthropic API requires the system message to be attached to the query differently from the others, causing the let-bindings in `gptel-request` to not work as expected. (#276)
Fixed, thank you.
Sorry for the frustration, the Anthropic API is different enough from OpenAI's that I made an error when unifying the interfaces. For future reference, it's better to run |
Why do you think they should be prepended? |
Don't be sorry, I'm happy to have helped solve a real issue 🙂 The outcome is good for everyone!
According to Anthropic documentation:
That's how I work: system prompt defines the context, while the user prompt sends the specific directive and the text to be operated on. This isn't clear-cut and is definitely up for debate, but I think we should at least have the option. |
My apologies, I misread your point entirely.
I read this as "needs to be prepended to the system prompt" (as opposed to "appended to the system prompt"). |
* gptel.el (gptel--inspect-query): `gptel--inspect-query` now takes data to display as an argument. Reduce its function to displaying a buffer with the data. * gptel-transient.el (gptel-menu, gptel--suffix-send): Fold dry-run the option into `gptel--suffix-send` and call it with a dry-run flag instead of using an alternate pathway for dry-runs. The "Inspect query" suffixes of `gptel-menu` now perform actual dry-runs, avoiding issues like #276.
* gptel.el (gptel--inspect-query): `gptel--inspect-query` now takes data to display as an argument. Reduce its function to displaying a buffer with the data. * gptel-transient.el (gptel-menu, gptel--suffix-send): Fold dry-run the option into `gptel--suffix-send` and call it with a dry-run flag instead of using an alternate pathway for dry-runs. The "Inspect query" suffixes of `gptel-menu` now perform actual dry-runs, avoiding issues like #276.
I think I found out why my directives weren't having much effect with Anthropic: it seems they are not in fact appended to the system message. I've spent an hour looking at the code and couldn't find where the directive gets appended. The "Dry run" options ("I"/"J") do not show what actually gets sent, but append the directive to the system message themselves. And the Anthropic code doesn't seem to do anything with the directive.
If I may suggest: the directive needs to be prepended to the first user message with Anthropic, or we should have an option. Appending to the system message is not a good general solution.
This is related to #249
The text was updated successfully, but these errors were encountered: