Skip to content

Commit

Permalink
Merge pull request #398 from uezo/fix-webgl-build-fails-086
Browse files Browse the repository at this point in the history
Fix bug where WebGL build fails
  • Loading branch information
uezo authored Nov 29, 2024
2 parents 0a974f3 + 3af2f97 commit 51adfea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Scripts/LLM/ChatGPT/ChatGPTServiceWebGL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public override async UniTask StartStreamingAsync(ChatGPTSession chatGPTSession,
{
data.Add("max_tokens", MaxTokens);
}
if (useFunctions && llmTools.Count > 0)
if (useFunctions && Tools.Count > 0)
{
var tools = new List<Dictionary<string, object>>();
foreach (var tool in llmTools)
foreach (var tool in Tools)
{
tools.Add(new Dictionary<string, object>()
{
Expand Down
4 changes: 2 additions & 2 deletions Scripts/LLM/Claude/ClaudeServiceWebGL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public override async UniTask StartStreamingAsync(ClaudeSession claudeSession, D
{ "stream", true },
};

if (llmTools.Count > 0) // tools must be included when tool_result
if (Tools.Count > 0) // tools must be included when tool_result
{
var claudeTools = new List<ClaudeTool>();
foreach (var tool in llmTools)
foreach (var tool in Tools)
{
claudeTools.Add(new ClaudeTool(tool));
}
Expand Down
4 changes: 2 additions & 2 deletions Scripts/LLM/CommandR/CommandRServiceWebGL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ public override async UniTask StartStreamingAsync(string inputText, List<Command
data["tool_results"] = toolResults;
}

if (llmTools.Count > 0)
if (Tools.Count > 0)
{
var commandRTools = new List<CommandRTool>();
foreach (var tool in llmTools)
foreach (var tool in Tools)
{
commandRTools.Add(new CommandRTool(tool));
}
Expand Down
4 changes: 2 additions & 2 deletions Scripts/LLM/Gemini/GeminiServiceWebGL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ public override async UniTask StartStreamingAsync(GeminiSession geminiSession, D
}

// Set tools. Multimodal model doesn't support function calling for now (2023.12.29)
if (useFunctions && llmTools.Count > 0 && !Model.ToLower().Contains("vision"))
if (useFunctions && Tools.Count > 0 && !Model.ToLower().Contains("vision"))
{
data.Add("tools", new List<Dictionary<string, object>>(){
new Dictionary<string, object> {
{ "function_declarations", llmTools }
{ "function_declarations", Tools }
}
});
}
Expand Down

0 comments on commit 51adfea

Please sign in to comment.