Question about library usage: passing list of role/messages to prompt
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12.5k
- Forks
- 998
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 10
Description
Would you be open to this? Where we don't have to rely on llm's own conversational history, but can just supply a list of objects each representing a role/content/whatever?
It allows for some applications to use their own state of conversation, and able to change it however they see fit, before communicating the next prompt
I hacked in a method to do this, but didn't see it through. I'd want your opinions first.
--
For example, openai and anthropic's python library (well, API in general) allow you to specify an array of messages, giving you full control over the context history. It's this exact feature I want to leverage with llm, as llm has a lot of other conveniences! For now I'm just rolling w/ anthropic's library directly.. (for now).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. First review how llm currently manages conversational history and model prompts, then clarify the proposed role/content message interface with maintainers. Done would require an agreed design and tests covering caller-supplied conversation state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100