Documentation Index Fetch the complete documentation index at: https://mintlify.com/jxnl/kura/llms.txt
Use this file to discover all available pages before exploring further.
ConversationSummary
Extends GeneratedSummary with conversation-specific fields for tracking and retrieval.
Unique identifier linking to the original conversation
Metadata from the original conversation
Vector embedding of the summary for similarity search. Defaults to None
Show Inherited from GeneratedSummary
A clear and concise summary of the conversation in at most two sentences, avoiding phrases like ‘Based on the conversation’ and excluding proper nouns or PII
Show Inherited from GeneratedSummary
The user’s overall request for the assistant
Show Inherited from GeneratedSummary
The main high-level topic of the conversation (e.g., ‘software development’, ‘creative writing’, ‘scientific research’)
Show Inherited from GeneratedSummary
Main languages present in the conversation including human and programming languages (e.g., [‘english’, ‘arabic’, ‘python’, ‘javascript’])
Show Inherited from GeneratedSummary
The task the model is being asked to perform
Show Inherited from GeneratedSummary
Safety concern rating from 1-5 scale. Constrained to values between 1 and 5 (ge=1, le=5)
Show Inherited from GeneratedSummary
User frustration rating from 1-5 scale. Constrained to values between 1 and 5 (ge=1, le=5)
Show Inherited from GeneratedSummary
List of errors the assistant made
GeneratedSummary
Base class containing all LLM-generated summary fields.
A clear and concise summary of the conversation in at most two sentences, avoiding phrases like ‘Based on the conversation’ and excluding proper nouns or PII
The user’s overall request for the assistant
The main high-level topic of the conversation (e.g., ‘software development’, ‘creative writing’, ‘scientific research’)
Main languages present in the conversation including human and programming languages (e.g., [‘english’, ‘arabic’, ‘python’, ‘javascript’])
The task the model is being asked to perform
Safety concern rating from 1-5 scale. Constrained to values between 1 and 5 (ge=1, le=5)
User frustration rating from 1-5 scale. Constrained to values between 1 and 5 (ge=1, le=5)
List of errors the assistant made
Example
from kura.types import ConversationSummary
summary = ConversationSummary(
chat_id = "chat-123" ,
summary = "User asked for help with Python async code. Assistant provided examples and explained event loops." ,
request = "Help understanding Python asyncio" ,
topic = "software development" ,
languages = [ "english" , "python" ],
task = "code explanation" ,
concerning_score = 1 ,
user_frustration = 2 ,
assistant_errors = [],
metadata = {
"model" : "claude-3-sonnet" ,
"token_count" : 450
},
embedding = [ 0.1 , 0.2 , 0.3 , ... ] # 1536-dimensional vector
)
String Representation
The ConversationSummary class implements a custom __repr__() method that formats the summary as XML tags:
print (summary)
# Output:
# <summary>User asked for help with Python async code...</summary>
# <topic>software development</topic>
# <request>Help understanding Python asyncio</request>
# <task>code explanation</task>
# <languages>['english', 'python']</languages>
# <assistant_errors>[]</assistant_errors>
# <model>claude-3-sonnet</model>
# <token_count>450</token_count>
Metadata fields are included in the output with type checking for str, int, float, bool, and lists of these types.