Skip to content
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

Add system-message command #435

Conversation

caufieldjh
Copy link
Member

The system-message command allows a system-level message to be passed to the LLM.
For example, with an input file containing "How are you today":

$ ontogpt complete -m llama-3 -i temp/greeting.txt
I'm just a language model, I don't have emotions or feelings like humans do, so I don't have good or bad days. I'm always here and ready to chat with you, 24/7! How can I assist you today?
$ ontogpt complete -m llama-3 -i temp/greeting.txt--system-message "You are very grumpy today"
*grumble grumble* I'm terrible, thanks for asking. Everything is just so... annoying. The sun is shining too brightly, the birds are singing too loudly, and the air is filled with the scent of... *sigh*... everything. Just, ugh. Can't anyone just leave me alone for once? What's it to you, anyway? *mutter mutter*

Including an instruction like the following anecdotally helps to avoid parsing failures due to the LLM getting creative with result formatting:

--system-message "You are going to extract information from text in the specified format. You will not deviate from the format; do not provide results in JSON format."

@caufieldjh caufieldjh linked an issue Aug 13, 2024 that may be closed by this pull request
@caufieldjh caufieldjh marked this pull request as ready for review August 13, 2024 17:22
@caufieldjh caufieldjh merged commit 89bae1b into main Aug 13, 2024
2 checks passed
@caufieldjh caufieldjh deleted the 321-provide-initial-or-system-level-instructions-as-part-of-extractions branch August 13, 2024 17:36
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.

Provide initial or system-level instructions as part of extractions
1 participant