Skip to content

Conversation

@mattt
Copy link
Owner

@mattt mattt commented Oct 28, 2025

No description provided.

@mattt mattt requested a review from Copilot October 28, 2025 14:30
Copy link

Copilot AI left a 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 LanguageModelSession for both streaming and non-streaming responses
  • Made transcript and related types Codable for 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.

@mattt mattt requested a review from Copilot October 28, 2025 17:05
Copy link

Copilot AI left a 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.entries throughout the codebase. This pattern is repeated in lines 122, 151, 260, and 273. Consider adding methods like appendPrompt(_:) and appendResponse(_:) to Transcript for consistency and to centralize transcript mutation logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mattt mattt merged commit ddf81ad into main Oct 28, 2025
2 checks passed
@mattt mattt deleted the mattt/transcript branch October 28, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants