-
Notifications
You must be signed in to change notification settings - Fork 45
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 examples for LLM message history and system instruction features #240
base: main
Are you sure you want to change the base?
Conversation
@@ -119,14 +119,15 @@ def invoke( | |||
Returns: | |||
LLMResponse: The response from the LLM. | |||
""" | |||
system_message = ( | |||
system_instruction = ( |
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.
What about?
system_instruction = system_instruction or self.system_instruction
(Just a suggestion, not really important)
for question in questions: | ||
res: LLMResponse = llm.invoke( | ||
question, | ||
message_history=history, |
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.
Does message_history
work with the GraphRAG
class? Could be worth including an example for that if so
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.
Yes, using it with GraphRAG
search()
was the main intention.
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.
But I guess both examples are relevant.
@@ -119,14 +119,15 @@ def invoke( | |||
Returns: | |||
LLMResponse: The response from the LLM. | |||
""" | |||
system_message = ( |
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.
Don't forget to make the same changes to ainvoke()
🙂
Description
Type of Change
Complexity
Complexity: Low
How Has This Been Tested?
Checklist
The following requirements should have been met (depending on the changes in the branch):