mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-24 01:30:47 +00:00
Implement system prompt updates without clearing chat.
This commit is contained in:
@@ -709,9 +709,6 @@ void TracyLlm::ResetChat()
|
||||
|
||||
void TracyLlm::UpdateSystemPrompt()
|
||||
{
|
||||
assert( m_chat.size() <= 1 );
|
||||
m_chat.clear();
|
||||
|
||||
static constexpr std::string UserToken = "%USER%";
|
||||
static constexpr std::string TimeToken = "%TIME%";
|
||||
|
||||
@@ -723,7 +720,14 @@ void TracyLlm::UpdateSystemPrompt()
|
||||
Replace( systemPrompt, UserToken, userName );
|
||||
Replace( systemPrompt, TimeToken, m_tools->GetCurrentTime() );
|
||||
|
||||
AddMessage( std::move( systemPrompt ), "system" );
|
||||
if( m_chat.empty() )
|
||||
{
|
||||
AddMessage( std::move( systemPrompt ), "system" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_chat[0]["content"] = systemPrompt;
|
||||
}
|
||||
}
|
||||
|
||||
void TracyLlm::QueueConnect()
|
||||
|
||||
Reference in New Issue
Block a user