Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a682608
Merge tag '0.35.1' into develop
intitni Nov 20, 2024
3f6e4f3
Bump version
intitni Nov 20, 2024
81c4259
Enable prompt caching for 3.5 Haiku
intitni Nov 20, 2024
3863c2a
Support prompt caching in Claude through OpenRouter
intitni Nov 26, 2024
7c7a311
Update ChatModel
intitni Nov 26, 2024
9a508d7
Update prompt caching model check
intitni Nov 26, 2024
335642f
Fix the prompt truncation is not ended after cancellation
intitni Nov 26, 2024
42a4c8d
Setup a truncation limit
intitni Nov 26, 2024
ee9e7b3
Merge branch 'feature/open-router-claude-caching' into develop
intitni Nov 26, 2024
eb236aa
Revert
intitni Nov 26, 2024
a23f003
Update screenshot
intitni Nov 27, 2024
842d282
Update min length of code lines
intitni Nov 27, 2024
60f36c6
Fix color space for Xcode theme syncing
intitni Nov 27, 2024
7ccd45a
Update
intitni Nov 27, 2024
78d22b8
Update settings
intitni Nov 27, 2024
8d58436
Dsiplay status in modification
intitni Nov 27, 2024
4e92f80
Update button
intitni Nov 27, 2024
5281cdf
Add debug area
intitni Nov 27, 2024
97a866c
Bump GitHubCopilot language server
intitni Nov 27, 2024
ddb97d2
Update info
intitni Nov 27, 2024
f1d3f23
Fix GitHubCopilot chat error
intitni Nov 27, 2024
29d2cf7
Update
intitni Nov 27, 2024
bff711f
Bump Codeium language server
intitni Nov 27, 2024
173f01b
Give window a default size
intitni Nov 27, 2024
a296660
Fix typo
intitni Nov 27, 2024
0026d43
Update
intitni Nov 27, 2024
5f32cb7
Bump version to 0.35.2
intitni Nov 27, 2024
685c6e0
Remove logger
intitni Nov 28, 2024
2ab65a5
Merge branch 'release/0.35.2'
intitni Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Setup a truncation limit
  • Loading branch information
intitni committed Nov 26, 2024
commit 42a4c8d11cfb5206f08ed41d2d1b1d147d6503c8
5 changes: 5 additions & 0 deletions Tool/Sources/OpenAIService/Memory/TemplateChatGPTMemory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ public actor TemplateChatGPTMemory: ChatGPTMemory {
return tokenCount <= configuration.maxTokens - configuration.minimumReplyTokens
}

var truncationTimes = 500
while !(await checkTokenCount()) {
do {
truncationTimes -= 1
if truncationTimes <= 0 {
throw CancellationError()
}
try Task.checkCancellation()
try await memoryTemplate.truncate()
} catch {
Expand Down