alexrudall / anthropic

Anthropic (Claude) API + Ruby! 🤖🌌
MIT License
73 stars 20 forks source link

Add system_prompt #8

Closed mybuddyandrew closed 2 months ago

mybuddyandrew commented 7 months ago

All Submissions:

I've updated the wrap_prompt method to accommodate an optional system_prompt parameter. This change allows the method to prepend a given system prompt to the user prompt, enabling more versatile usage scenarios. For instance, it can be used to set a context or provide instructions when generating prompts for AI models.

The inclusion of the system_prompt enhances the functionality of the wrap_prompt method without altering its existing behavior when no system prompt is provided. This backward-compatible enhancement makes the method more flexible and applicable in a wider range of situations, such as automated generation of prompts for various AI roles or tasks.

deikka commented 5 months ago

Hi @alexrudall did you had a look? Will this PR be merged?

alexrudall commented 5 months ago

Hey @deikka @mybuddyandrew , I'm not sure about this one. Could you share a simple scenario where it would be helpful? I can't quite see it.

deikka commented 5 months ago

They recommend using a system prompt when using Claude 2.1 (here) if using completions.

alexrudall commented 2 months ago

Thanks for this - closing as looks like the Text Completion endpoint is deprecated in favour of Messages.