Skip to content

Commit

Permalink
PCH: Build without pch fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikely4r committed Nov 23, 2024
1 parent 35a7c2f commit c6f81d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions playerbot/PlayerbotLLMInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ inline std::string RecvWithTimeout(int sock, int timeout_seconds, int& bytesRead
std::string PlayerbotLLMInterface::Generate(const std::string& prompt, std::vector<std::string> & debugLines) {
bool debug = !debugLines.empty();

if (sPlayerbotLLMInterface.generationCount > sPlayerbotAIConfig.llmMaxSimultaniousGenerations)
if ((uint32)sPlayerbotLLMInterface.generationCount > sPlayerbotAIConfig.llmMaxSimultaniousGenerations)
{
if (debug)
debugLines.push_back("Maxium generations reached " + std::to_string(sPlayerbotLLMInterface.generationCount) + "/" + std::to_string(sPlayerbotAIConfig.llmMaxSimultaniousGenerations));
Expand Down Expand Up @@ -384,9 +384,9 @@ std::vector<std::string> PlayerbotLLMInterface::ParseResponse(const std::string&
return responses;
}

void PlayerbotLLMInterface::LimitContext(std::string& context, uint32 currentLength)
void PlayerbotLLMInterface::LimitContext(std::string& context, int currentLength)
{
if (sPlayerbotAIConfig.llmContextLength && currentLength > sPlayerbotAIConfig.llmContextLength)
if (sPlayerbotAIConfig.llmContextLength && (uint32)currentLength > sPlayerbotAIConfig.llmContextLength)
{
uint32 cutNeeded = currentLength - sPlayerbotAIConfig.llmContextLength;

Expand Down
8 changes: 6 additions & 2 deletions playerbot/PlayerbotLLMInterface.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <atomic>
#include <string>
#include <vector>

class PlayerbotLLMInterface
{
public:
Expand All @@ -8,9 +12,9 @@ class PlayerbotLLMInterface

static std::vector<std::string> ParseResponse(const std::string& response, const std::string& startPattern, const std::string& endPattern, const std::string& splitPattern, std::vector<std::string>& debugLines);

static void LimitContext(std::string& context, uint32 currentLength);
static void LimitContext(std::string& context, int currentLength);
private:
std::atomic<uint32> generationCount = 0;
std::atomic<int> generationCount = 0;
};

#define sPlayerbotLLMInterface MaNGOS::Singleton<PlayerbotLLMInterface>::Instance()
Expand Down

0 comments on commit c6f81d3

Please sign in to comment.