* Refactor summary prompts to use character limit and prevent meta-commentary - Changed summary length constraint from "8 sentences" to "250 characters" for more predictable output - Created reusable summary_instructions snippet in snippets.py with clear BAD/GOOD examples - Added explicit instruction to output only factual content without meta-commentary - Applied consistent formatting across extract_nodes.py and summarize_nodes.py - Bumped version to 0.22.0pre2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Add copyright header to snippets.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
29 lines
1.6 KiB
Python
29 lines
1.6 KiB
Python
"""
|
|
Copyright 2024, Zep Software, Inc.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
"""
|
|
|
|
summary_instructions = """Guidelines:
|
|
1. Output only factual content. Never explain what you're doing, why, or mention limitations/constraints.
|
|
2. Only use the provided messages, entity, and entity context to set attribute values.
|
|
3. Keep the summary concise and to the point. STATE FACTS DIRECTLY IN UNDER 250 CHARACTERS.
|
|
|
|
Example summaries:
|
|
BAD: "This is the only activity in the context. The user listened to this song. No other details were provided to include in this summary."
|
|
GOOD: "User played 'Blue Monday' by New Order (electronic genre) on 2024-12-03 at 14:22 UTC."
|
|
BAD: "Based on the messages provided, the user attended a meeting. This summary focuses on that event as it was the main topic discussed."
|
|
GOOD: "User attended Q3 planning meeting with sales team on March 15."
|
|
BAD: "The context shows John ordered pizza. Due to length constraints, other details are omitted from this summary."
|
|
GOOD: "John ordered pepperoni pizza from Mario's at 7:30 PM, delivered to office."
|
|
"""
|