-
Notifications
You must be signed in to change notification settings - Fork 41
Implement transcript recording functionality #8
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
Conversation
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.
Pull Request Overview
This PR implements transcript recording functionality for language model sessions, enabling automatic capture of conversation history including instructions, prompts, and responses. The implementation adds Codable conformance to key types for serialization support and updates the session management to automatically record all interactions.
Key Changes:
- Added automatic transcript recording in
LanguageModelSessionfor both streaming and non-streaming responses - Made transcript and related types
Codablefor persistence support - Enhanced test coverage with new tests verifying transcript state across multiple interaction scenarios
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/AnyLanguageModel/Transcript.swift | Added Codable conformance to all transcript-related types and internal mutation methods |
| Sources/AnyLanguageModel/LanguageModelSession.swift | Implemented automatic transcript recording for prompts and responses, added instructions entry on initialization |
| Sources/AnyLanguageModel/GenerationOptions.swift | Added Codable conformance with custom encoding/decoding for SamplingMode enum |
| Sources/AnyLanguageModel/GeneratedContent.swift | Added Codable conformance with custom encoding/decoding for Kind enum |
| Sources/AnyLanguageModel/GenerationID.swift | Added Codable conformance |
| Tests/AnyLanguageModelTests/Shared/MockLanguageModel.swift | Updated to return transcript entries in responses |
| Tests/AnyLanguageModelTests/MockLanguageModelTests.swift | Added comprehensive transcript verification tests and renamed test methods for clarity |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
Sources/AnyLanguageModel/LanguageModelSession.swift:3
- [nitpick] Multiple direct mutations of
transcript.entriesthroughout the codebase. This pattern is repeated in lines 122, 151, 260, and 273. Consider adding methods likeappendPrompt(_:)andappendResponse(_:)toTranscriptfor consistency and to centralize transcript mutation logic.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This reverts commit 65ee0af.
No description provided.