-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support new LLMContext
pattern with AWSNovaSonicLLMService
#2750
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
…textAggregatorPair`
ec0baa6
to
4d9873b
Compare
) | ||
return filtered_messages | ||
|
||
def get_messages_for_persistent_storage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is new functionality on LLMContext
. There are corresponding unit tests in this PR.
The reason for the system_instruction
argument is to support usage with LLMs where you might pass the system instruction as a parameter to the LLMService
rather than via the context.
Pending: I'll update some examples to highlight this functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm...as I think about this more I'm not sure we need the complexity of the system_instruction
argument...
- If you specified your system instruction in the context in the first place, it'll still be there when you read messages for persistent storage
- If you didn't specify your system instruction in the context and instead passed it in as an LLM service parameter, you probably don't want it to be in the context when you read messages for persistent storage
- ...and if you really really do need to inject it at the start of the context, it's quite easy to do yourself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which means...we probably don't need this method at all. We can just rely on get_messages()
.
The reason for its `system_instruction` argument was to support usage with LLMs where you might pass the system instruction as a parameter to the `LLMService` rather than specifying it in the context. But as I thought about it more I became unconvinced that the `system_instruction` argument was really beneficial: - If you specified your system instruction in your context in the first place, it'll still be there when you read messages for persistent storage - If you didn't specify your system instruction in the context and instead passed it in as an `LLMService` parameter, you most likely *don't* want it to be in the context when you read messages for persistent storage - ...and if you really really do need to inject it at the start of the context, it's quite easy to do anyway And if we remove the `system_instruction` argument from `get_messages_for_persistent_storage()`, then it's essentially just `get_messages()`.
tools: Available tools/functions for the model to use. | ||
send_transcription_frames: Whether to emit transcription frames. | ||
.. deprecated:: 0.0.87 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: update this if this doesn't make the 0.0.87 release
No description provided.