mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
fix: Ignore the Chain-of-Thought in AI response (#952)
- Improve chat response processing to handle thinking patterns using regular expressions. - Migrate server value by removing trailing '/chat/completions' path.
This commit is contained in:
parent
8cc056d2af
commit
ef2e0a8a56
2 changed files with 78 additions and 10 deletions
|
@ -19,7 +19,15 @@ namespace SourceGit.Models
|
|||
public string Server
|
||||
{
|
||||
get => _server;
|
||||
set => SetProperty(ref _server, value);
|
||||
set
|
||||
{
|
||||
// migrate old server value
|
||||
if (!string.IsNullOrEmpty(value) && value.EndsWith("/chat/completions", StringComparison.Ordinal))
|
||||
{
|
||||
value = value.Substring(0, value.Length - "/chat/completions".Length);
|
||||
}
|
||||
SetProperty(ref _server, value);
|
||||
}
|
||||
}
|
||||
|
||||
public string ApiKey
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue