Implement tracking for when language model session is responding#7
Implement tracking for when language model session is responding#7
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements tracking for when a language model session is actively responding to requests. The implementation uses a reference-counted state mechanism to handle concurrent requests and updates the isResponding property accordingly.
Key Changes:
- Converted
SystemLanguageModelfrom astructto anactorwithnonisolatedpublic APIs - Added
isRespondingtracking inLanguageModelSessionusing a privateRespondingStateactor for thread-safe reference counting - Enhanced
Sendableconformance across types to support concurrent operations
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Sources/AnyLanguageModel/Models/SystemLanguageModel.swift | Changed from struct to actor and marked public APIs as nonisolated to maintain existing behavior |
| Sources/AnyLanguageModel/LanguageModelSession.swift | Added responding state tracking with reference counting, wrapping methods for respond/stream operations, and Sendable conformance |
| Sources/AnyLanguageModel/LanguageModel.swift | Added isResponding property to the protocol with a default implementation returning false |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.