Skip to content

Commit

Permalink
This will fix when tools show up at the wrong areas of the site like …
Browse files Browse the repository at this point in the history
…chat completion
  • Loading branch information
alnutile committed Aug 13, 2024
1 parent e95fde5 commit 9fa0023
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Modules/LlmDriver/app/BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ public function remapFunctions(array $functions): array
/**
* @DEPRECATED
* This was before all the LLMs had tools
*
*
* @param MessageInDto[] $messages
*/
protected function insertFunctionsIntoMessageArray(array $messages): array
{
$functions = $this->setToolType(ToolTypes::Source)->getFunctions();
$functions = $this->setToolType(ToolTypes::ChatCompletion)->getFunctions();

$functionsEncoded = collect($functions)->transform(
function ($item) {
Expand Down
2 changes: 1 addition & 1 deletion Modules/LlmDriver/app/Functions/GatherInfoTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class GatherInfoTool extends FunctionContract
use ToolsHelper;

public array $toolTypes = [
ToolTypes::ChatCompletion,
ToolTypes::ManualChoice,
];

protected string $name = 'gather_info_tool';
Expand Down
2 changes: 1 addition & 1 deletion Modules/LlmDriver/app/Functions/GetWebSiteFromUrlTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class GetWebSiteFromUrlTool extends FunctionContract
public bool $showInUi = false;

public array $toolTypes = [
ToolTypes::ChatCompletion,
ToolTypes::ManualChoice,
ToolTypes::Source,
ToolTypes::Output,
];
Expand Down
2 changes: 1 addition & 1 deletion Modules/LlmDriver/app/Functions/ReportingTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ReportingTool extends FunctionContract
public bool $showInUi = true;

public array $toolTypes = [
ToolTypes::ChatCompletion,
ToolTypes::ManualChoice,
];

protected string $name = 'reporting_tool';
Expand Down
2 changes: 1 addition & 1 deletion Modules/LlmDriver/app/Functions/SearchTheWeb.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SearchTheWeb extends FunctionContract
public bool $showInUi = false;

public array $toolTypes = [
ToolTypes::ChatCompletion,
ToolTypes::ManualChoice,
ToolTypes::Source,
ToolTypes::Output,
];
Expand Down
2 changes: 1 addition & 1 deletion Modules/LlmDriver/app/Functions/StandardsChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class StandardsChecker extends FunctionContract
protected array $results = [];

public array $toolTypes = [
ToolTypes::ChatCompletion,
ToolTypes::ManualChoice,
];

protected array $promptHistory = [];
Expand Down
1 change: 1 addition & 0 deletions Modules/LlmDriver/app/Functions/ToolTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ enum ToolTypes: string
case Source = 'source';
case Output = 'output';
case NoFunction = 'no_function';
case ManualChoice = 'manual_choice';
}

0 comments on commit 9fa0023

Please sign in to comment.