-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5191339
commit 25c7d2c
Showing
14 changed files
with
193 additions
and
151 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
evals/Evals/Display.php → src/Extras/Evals/Console/Display.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
.../Evals/Contracts/CanExecuteExperiment.php → .../Evals/Contracts/CanExecuteExperiment.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?php | ||
namespace Cognesy\Evals\Evals\Contracts; | ||
namespace Cognesy\Instructor\Extras\Evals\Contracts; | ||
|
||
use Cognesy\Evals\Evals\Data\EvalInput; | ||
use Cognesy\Instructor\Extras\Evals\Data\EvalInput; | ||
use Cognesy\Instructor\Features\LLM\Data\LLMResponse; | ||
|
||
interface CanExecuteExperiment | ||
{ | ||
public static function executeFor(EvalInput $input): self; | ||
public function executeFor(EvalInput $input): self; | ||
public function getLLMResponse(): LLMResponse; | ||
public function getAnswer(): mixed; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
evals/Evals/Data/EvalOutput.php → src/Extras/Evals/Data/EvalOutput.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace Cognesy\Evals\Evals\Data; | ||
namespace Cognesy\Instructor\Extras\Evals\Data; | ||
|
||
use Exception; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace Cognesy\Instructor\Extras\Evals\Data; | ||
|
||
class EvalSchema | ||
{ | ||
public function __construct( | ||
private string $toolName, | ||
private string $toolDescription, | ||
private array $schema = [], | ||
) {} | ||
|
||
public function schema() : array { | ||
return $this->schema; | ||
} | ||
|
||
public function responseFormatJson() : array { | ||
return [ | ||
'type' => 'json_object', | ||
'schema' => $this->schema, | ||
]; | ||
} | ||
|
||
public function responseFormatJsonSchema() : array { | ||
return [ | ||
'type' => 'json_schema', | ||
'description' => $this->toolDescription, | ||
'json_schema' => [ | ||
'name' => $this->toolName, | ||
'schema' => $this->schema, | ||
'strict' => true, | ||
], | ||
]; | ||
} | ||
|
||
public function tools() : array { | ||
return [[ | ||
'type' => 'function', | ||
'function' => [ | ||
'name' => $this->toolName, | ||
'description' => $this->toolDescription, | ||
'parameters' => $this->schema, | ||
], | ||
]]; | ||
} | ||
|
||
public function toolChoice() : array { | ||
return [ | ||
'type' => 'function', | ||
'function' => [ | ||
'name' => $this->toolName, | ||
] | ||
]; | ||
} | ||
} |
Oops, something went wrong.