-
Notifications
You must be signed in to change notification settings - Fork 58
Description
Hi there @teilomillet,
Nice library! I was considering using it in one of my apps and after taking a closer look I had a question for you.
In my situation I'm handling long chat conversations sometimes, and so far I've been passing the user and assistant messages (as they accumulate) as separate JSON messages to the API. I see in the gollm implementation it is instead embedding the message history into a single user message:
https://github.com/teilomillet/gollm/blob/main/llm/memory.go#L174-L191
I'm using caching with the Anthropic API today, and this would potentially break message caching beyond the system prompt, which seems like one of the problems for me when considering using gollm.
Caching aside, have you found that there's little difference in the LLM behavior for this approach vs. passing each message as a separate JSON object?
Thanks for your feedback!